{"openapi":"3.1.0","info":{"title":"Losant Commands (BYOK) API","version":"0.1.0","description":"Losant Commands (BYOK) lets an AI assistant read your own Losant Commands data through the Losant Commands API with a key you supply (Losant API access token or application API token (with the device.sendCommand scope to send commands)). Read-only: 5 tools (list_applications, list_devices, get_device, get_device_state, get_recent_commands). The BYOK key travels with each request, is used for that...\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://byok-losant-commands.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/byok-losant-commands/docs"},"termsOfService":"https://connectorbay.com/byok-losant-commands/terms"},"servers":[{"url":"https://byok-losant-commands.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/byok-losant-commands/docs"},"security":[{"upstreamKey":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Optional. A Pro API key raises rate limits; no credentials are required."},"upstreamKey":{"type":"apiKey","in":"header","name":"X-Upstream-Key","description":"Your own key for the service this connector wraps (bring your own key). Used for that one call only; never stored, logged or cached."}},"schemas":{"Error":{"type":"object","properties":{"ok":{"const":false},"error":{"type":"object"}}}}},"paths":{"/v1/tools/list_applications":{"post":{"operationId":"list_applications","summary":"List the Losant applications the token can see with name, description, owner and last update. Use for \"Which Losant appl","description":"List the Losant applications the token can see with name, description, owner and last update. Use for \"Which Losant applications do I have\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"sort_field":{"anyOf":[{"enum":["name","id","creationDate","ownerId","lastUpdated"],"type":"string"},{"type":"null"}],"default":"name","description":"Sort by name, id, creationDate, ownerId or lastUpdated.","title":"Sort Field"},"sort_direction":{"anyOf":[{"enum":["asc","desc"],"type":"string"},{"type":"null"}],"default":null,"description":"Sort direction: asc or desc.","title":"Sort Direction"},"filter_field":{"anyOf":[{"const":"name","type":"string"},{"type":"null"}],"default":null,"description":"Field to filter on; accepted value: name.","title":"Filter Field"},"filter":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Filter text for that field; supports globbing such as 'sensor *'.","title":"Filter"},"page":{"anyOf":[{"maximum":100000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"Page number, starting at 0.","title":"Page"},"per_page":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":25,"description":"How many items per page (1 to 100).","title":"Per Page"}},"title":"list_applicationsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/list_devices":{"post":{"operationId":"list_devices","summary":"List the devices of an application with name, class, tags, attributes, connection info and last update. Filter by name o","description":"List the devices of an application with name, class, tags, attributes, connection info and last update. Filter by name or class. Use for \"Which Losant devices are connected right now\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"application_id":{"description":"Losant application id (24 hex characters) as returned by list_applications.","maxLength":200,"title":"Application Id","type":"string"},"sort_field":{"anyOf":[{"enum":["name","id","creationDate","lastUpdated","connectionStatus"],"type":"string"},{"type":"null"}],"default":"name","description":"Sort by name, id, creationDate, lastUpdated or connectionStatus.","title":"Sort Field"},"sort_direction":{"anyOf":[{"enum":["asc","desc"],"type":"string"},{"type":"null"}],"default":null,"description":"Sort direction: asc or desc.","title":"Sort Direction"},"filter_field":{"anyOf":[{"const":"name","type":"string"},{"type":"null"}],"default":null,"description":"Field to filter on; accepted value: name.","title":"Filter Field"},"filter":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"description":"Filter text for that field; supports globbing such as 'sensor *'.","title":"Filter"},"device_class":{"anyOf":[{"enum":["standalone","gateway","peripheral","floating","edgeCompute","system","embedded"],"type":"string"},{"type":"null"}],"default":null,"description":"Only this device class.","title":"Device Class"},"tags_as_object":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":false,"description":"True to return tags as an object map.","title":"Tags As Object"},"attributes_as_object":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":false,"description":"True to return attributes as an object map.","title":"Attributes As Object"},"page":{"anyOf":[{"maximum":100000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"Page number, starting at 0.","title":"Page"},"per_page":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":25,"description":"How many items per page (1 to 100).","title":"Per Page"}},"required":["application_id"],"title":"list_devicesArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_device":{"post":{"operationId":"get_device","summary":"Get one device with its attributes, tags, class, connection info and parent. Use for \"Show the details of Losant device ","description":"Get one device with its attributes, tags, class, connection info and parent. Use for \"Show the details of Losant device 575ed18f7ae143cd83dc4aa6\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"application_id":{"description":"Losant application id (24 hex characters) as returned by list_applications.","maxLength":200,"title":"Application Id","type":"string"},"device_id":{"description":"Losant device id (24 hex characters) as returned by list_devices.","maxLength":200,"title":"Device Id","type":"string"}},"required":["application_id","device_id"],"title":"get_deviceArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_device_state":{"post":{"operationId":"get_device_state","summary":"Get the most recent reported states of a device (time and attribute values), newest first. Use start, end or duration fo","description":"Get the most recent reported states of a device (time and attribute values), newest first. Use start, end or duration for a time range. Use for \"What is the latest temperature reported by Losant device 575ed18f7ae143cd83dc4aa6\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"application_id":{"description":"Losant application id (24 hex characters) as returned by list_applications.","maxLength":200,"title":"Application Id","type":"string"},"device_id":{"description":"Losant device id (24 hex characters) as returned by list_devices.","maxLength":200,"title":"Device Id","type":"string"},"limit":{"anyOf":[{"maximum":1000,"minimum":1,"type":"integer"},{"type":"null"}],"default":1,"description":"How many state entries to return (1 to 1000).","title":"Limit"},"sort_direction":{"anyOf":[{"enum":["asc","desc"],"type":"string"},{"type":"null"}],"default":null,"description":"Sort direction: asc or desc.","title":"Sort Direction"},"start":{"anyOf":[{"maximum":99999999999999,"minimum":0,"type":"integer"},{"type":"null"}],"default":null,"description":"Start of the time range in milliseconds since epoch.","title":"Start"},"end":{"anyOf":[{"maximum":99999999999999,"minimum":0,"type":"integer"},{"type":"null"}],"default":null,"description":"End of the time range in milliseconds since epoch.","title":"End"},"duration":{"anyOf":[{"maximum":99999999999999,"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"description":"Length of the time range in milliseconds, ending at end (or now).","title":"Duration"}},"required":["application_id","device_id"],"title":"get_device_stateArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}},"/v1/tools/get_recent_commands":{"post":{"operationId":"get_recent_commands","summary":"List the last commands sent to a device (time, name and payload), newest first by default. Use for \"Which commands were ","description":"List the last commands sent to a device (time, name and payload), newest first by default. Use for \"Which commands were last sent to Losant device 575ed18f7ae143cd83dc4aa6\".","tags":["tools"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"properties":{"application_id":{"description":"Losant application id (24 hex characters) as returned by list_applications.","maxLength":40,"title":"Application Id","type":"string"},"device_id":{"description":"Losant device id (24 hex characters) as returned by list_devices.","maxLength":40,"title":"Device Id","type":"string"},"limit":{"anyOf":[{"maximum":100,"minimum":1,"type":"integer"},{"type":"null"}],"default":10,"description":"How many command entries to return (default 1).","title":"Limit"},"sort_direction":{"anyOf":[{"enum":["asc","desc"],"type":"string"},{"type":"null"}],"default":"desc","description":"asc or desc by time.","title":"Sort Direction"}},"required":["application_id","device_id"],"title":"get_recent_commandsArguments","type":"object"}}}},"responses":{"200":{"description":"Tool result. `ok: true` on success; `ok: false` with a structured `error` (provider_unavailable, upstream_error, bad_input) when the tool could not answer.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"422":{"description":"Arguments failed validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit exceeded (see Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-read-only":true}}}}