{"openapi":"3.1.0","info":{"title":"Losant (BYOK) API","version":"0.1.0","description":"Losant (BYOK) lets an AI assistant read your own Losant data through the Losant API with a key you supply (Losant API access token or application API token). Read-only: 12 tools (list_applications, get_application, list_devices, get_device, get_device_state, get_device_composite_state, get_device_logs, list_events, list_flows, list_data_tables, list_data_table_rows, query_time_series). The BYOK...\n\nEvery operation is read-only or compute-only. The same tools are available over MCP (streamable HTTP) at https://byok-losant.connectorbay.com/mcp.","contact":{"name":"Unify Dynamics LLC","email":"agent@connectorbay.com","url":"https://connectorbay.com/byok-losant/docs"},"termsOfService":"https://connectorbay.com/byok-losant/terms"},"servers":[{"url":"https://byok-losant.connectorbay.com"}],"externalDocs":{"url":"https://connectorbay.com/byok-losant/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/get_application":{"post":{"operationId":"get_application","summary":"Get one Losant application with name, description, owner, endpoint slug and usage summary. Use for \"Show the details of ","description":"Get one Losant application with name, description, owner, endpoint slug and usage summary. Use for \"Show the details of my Losant application\".","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"}},"required":["application_id"],"title":"get_applicationArguments","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_device_composite_state":{"post":{"operationId":"get_device_composite_state","summary":"Get the last known value of every attribute of a device, combining the most recent reports, with the time each value was","description":"Get the last known value of every attribute of a device, combining the most recent reports, with the time each value was reported. Use for \"What are all the last known readings 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"},"attributes":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"default":null,"description":"Comma-separated attribute names to include; all when left out.","title":"Attributes"},"start":{"anyOf":[{"maximum":99999999999999,"minimum":0,"type":"integer"},{"type":"null"}],"default":null,"description":"Start of the range in milliseconds since epoch.","title":"Start"},"end":{"anyOf":[{"maximum":99999999999999,"minimum":0,"type":"integer"},{"type":"null"}],"default":null,"description":"End of the range in milliseconds since epoch.","title":"End"}},"required":["application_id","device_id"],"title":"get_device_composite_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_device_logs":{"post":{"operationId":"get_device_logs","summary":"Get recent connection log entries of a device: connect and disconnect times, method, reason, IP address and message coun","description":"Get recent connection log entries of a device: connect and disconnect times, method, reason, IP address and message counts. Use for \"When did Losant device 575ed18f7ae143cd83dc4aa6 last disconnect and why\".","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":20,"description":"How many log 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_logsArguments","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_events":{"post":{"operationId":"list_events","summary":"List application events (alerts raised by workflows) with level, state, subject, message and device. Use for \"Which Losa","description":"List application events (alerts raised by workflows) with level, state, subject, message and device. Use for \"Which Losant events are still new\".","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"},"state":{"anyOf":[{"enum":["new","acknowledged","resolved"],"type":"string"},{"type":"null"}],"default":null,"description":"Only events in this state: new, acknowledged or resolved.","title":"State"},"sort_field":{"anyOf":[{"enum":["subject","id","creationDate","lastUpdated","level","state","deviceId"],"type":"string"},{"type":"null"}],"default":"creationDate","description":"Sort by subject, id, creationDate, lastUpdated, level, state or deviceId.","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":"subject","type":"string"},{"type":"null"}],"default":null,"description":"Field to filter on; accepted value: subject.","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"}},"required":["application_id"],"title":"list_eventsArguments","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_flows":{"post":{"operationId":"list_flows","summary":"List the workflows of an application with name, class, enabled flag and last update. Use for \"Which Losant workflows are","description":"List the workflows of an application with name, class, enabled flag and last update. Use for \"Which Losant workflows are enabled\".","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"},"flow_class":{"anyOf":[{"enum":["edge","embedded","cloud","customNode","experience"],"type":"string"},{"type":"null"}],"default":null,"description":"Only this workflow class: edge, embedded, cloud, customNode or experience.","title":"Flow Class"},"sort_field":{"anyOf":[{"enum":["name","id","creationDate","lastUpdated"],"type":"string"},{"type":"null"}],"default":"name","description":"Sort by name, id, creationDate 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"}},"required":["application_id"],"title":"list_flowsArguments","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_data_tables":{"post":{"operationId":"list_data_tables","summary":"List the data tables of an application with name, description, columns and a size summary. Use for \"Which Losant data ta","description":"List the data tables of an application with name, description, columns and a size summary. Use for \"Which Losant data tables exist in my application\".","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"],"type":"string"},{"type":"null"}],"default":"name","description":"Sort by name, id, creationDate 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"}},"required":["application_id"],"title":"list_data_tablesArguments","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_data_table_rows":{"post":{"operationId":"list_data_table_rows","summary":"List rows of a data table, optionally sorted by a column and limited to some columns. Use for \"Show the first rows of my","description":"List rows of a data table, optionally sorted by a column and limited to some columns. Use for \"Show the first rows of my Losant data table\".","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"},"data_table_id":{"description":"Data table id as returned by list_data_tables.","maxLength":200,"title":"Data Table Id","type":"string"},"sort_column":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}],"default":null,"description":"Column to sort the rows by.","title":"Sort Column"},"sort_direction":{"anyOf":[{"enum":["asc","desc"],"type":"string"},{"type":"null"}],"default":null,"description":"Sort direction: asc or desc.","title":"Sort Direction"},"limit":{"anyOf":[{"maximum":1000,"minimum":1,"type":"integer"},{"type":"null"}],"default":50,"description":"How many rows to return (1 to 1000).","title":"Limit"},"offset":{"anyOf":[{"maximum":1000000,"minimum":0,"type":"integer"},{"type":"null"}],"default":0,"description":"How many rows to skip.","title":"Offset"},"include_fields":{"anyOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"default":null,"description":"Comma-separated columns to include, for example id,createdAt,temperature.","title":"Include Fields"}},"required":["application_id","data_table_id"],"title":"list_data_table_rowsArguments","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/query_time_series":{"post":{"operationId":"query_time_series","summary":"Query stored device data over time for one attribute of one device, optionally aggregated (mean, min, max, sum, count, f","description":"Query stored device data over time for one attribute of one device, optionally aggregated (mean, min, max, sum, count, first, last, median) into buckets of a resolution in milliseconds. Use for \"What was the average temperature of Losant device 575ed18f7ae143cd83dc4aa6 per hour yesterday\".","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":"Device id (24 hex characters) as returned by list_devices.","maxLength":24,"title":"Device Id","type":"string"},"attribute":{"description":"Attribute name to read, for example temperature.","maxLength":255,"title":"Attribute","type":"string"},"start":{"description":"Start of the range in milliseconds since epoch.","maximum":99999999999999,"minimum":0,"title":"Start","type":"integer"},"end":{"description":"End of the range in milliseconds since epoch.","maximum":99999999999999,"minimum":0,"title":"End","type":"integer"},"resolution":{"anyOf":[{"maximum":99999999999999,"minimum":1,"type":"integer"},{"type":"null"}],"default":null,"description":"Bucket size in milliseconds, for example 3600000 for one hour.","title":"Resolution"},"aggregation":{"anyOf":[{"enum":["NONE","FIRST","LAST","COUNT","MAX","MIN","MEDIAN","MEAN","SUM","STD_DEV"],"type":"string"},{"type":"null"}],"default":null,"description":"How to combine values per bucket.","title":"Aggregation"}},"required":["application_id","device_id","attribute","start","end"],"title":"query_time_seriesArguments","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}}}}