Losant Device Attributes API
The Device Attributes API from Losant — 2 operation(s) for device attributes.
The Device Attributes API from Losant — 2 operation(s) for device attributes.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/losant:losant-device-attributes-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Platform Device Attributes API
version: 1.31.0
description: User API for accessing platform data
servers:
- url: https://api.losant.com
security:
- bearerAuth: []
tags:
- name: Device Attributes
paths:
/applications/{applicationId}/devices/{deviceId}/attributes:
get:
operationId: deviceAttributes.get
summary: Returns the attributes for a device
tags:
- Device Attributes
parameters:
- name: applicationId
in: path
required: true
description: ID associated with the application
schema:
type: string
pattern: ^[A-Fa-f\d]{24}$
example: 575ec8687ae143cd83dc4a97
- name: deviceId
in: path
required: true
description: ID associated with the device
schema:
type: string
pattern: ^[A-Fa-f\d]{24}$
example: 575ecf887ae143cd83dc4aa2
- name: sortField
in: query
required: false
description: Field to sort the results by
schema:
type: string
enum:
- name
- dataType
default: name
example: status
- name: sortDirection
in: query
required: false
description: Direction to sort the results by
schema:
type: string
enum:
- asc
- desc
default: asc
example: asc
- name: filterField
in: query
required: false
description: Field to filter the results by. Blank or not provided means no filtering.
schema:
type: string
enum:
- name
- dataType
example: status
- name: filter
in: query
required: false
description: Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering.
schema:
type: string
example: number
responses:
'200':
description: Collection of device attributes
content:
application/json:
schema:
$ref: '#/components/schemas/deviceAttributes'
'400':
description: Error if malformed request
content:
application/json:
schema:
$ref: '#/components/schemas/error'
'404':
description: Error if device was not found
content:
application/json:
schema:
$ref: '#/components/schemas/error'
x-losant-auth-scopes:
- deviceAttributes.get
post:
operationId: deviceAttributes.post
summary: Adds a new attribute to a device
tags:
- Device Attributes
parameters:
- name: applicationId
in: path
required: true
description: ID associated with the application
schema:
type: string
pattern: ^[A-Fa-f\d]{24}$
example: 575ec8687ae143cd83dc4a97
- name: deviceId
in: path
required: true
description: ID associated with the device
schema:
type: string
pattern: ^[A-Fa-f\d]{24}$
example: 575ecf887ae143cd83dc4aa2
responses:
'201':
description: Successfully created device attribute
content:
application/json:
schema:
$ref: '#/components/schemas/deviceAttribute'
'400':
description: Error if malformed request
content:
application/json:
schema:
$ref: '#/components/schemas/error'
'404':
description: Error if device was not found
content:
application/json:
schema:
$ref: '#/components/schemas/error'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/deviceAttributePost'
description: Device attribute information
x-losant-auth-scopes:
- deviceAttributes.post
/applications/{applicationId}/devices/{deviceId}/attributes/{name}:
get:
operationId: deviceAttribute.get
summary: Retrieves information on a device attribute
tags:
- Device Attributes
parameters:
- name: applicationId
in: path
required: true
description: ID associated with the application
schema:
type: string
pattern: ^[A-Fa-f\d]{24}$
example: 575ec8687ae143cd83dc4a97
- name: deviceId
in: path
required: true
description: ID associated with the device
schema:
type: string
pattern: ^[A-Fa-f\d]{24}$
example: 575ecf887ae143cd83dc4aa2
- name: name
in: path
required: true
description: Name of the attribute
schema:
type: string
pattern: ^[0-9a-zA-Z_-]{1,255}$
example: voltage
responses:
'200':
description: Device attribute information
content:
application/json:
schema:
$ref: '#/components/schemas/deviceAttribute'
'400':
description: Error if malformed request
content:
application/json:
schema:
$ref: '#/components/schemas/error'
'404':
description: Error if device attribute was not found
content:
application/json:
schema:
$ref: '#/components/schemas/error'
x-losant-auth-scopes:
- deviceAttribute.get
patch:
operationId: deviceAttribute.patch
summary: Updates an attribute on a device
tags:
- Device Attributes
parameters:
- name: applicationId
in: path
required: true
description: ID associated with the application
schema:
type: string
pattern: ^[A-Fa-f\d]{24}$
example: 575ec8687ae143cd83dc4a97
- name: deviceId
in: path
required: true
description: ID associated with the device
schema:
type: string
pattern: ^[A-Fa-f\d]{24}$
example: 575ecf887ae143cd83dc4aa2
- name: name
in: path
required: true
description: Name of the attribute
schema:
type: string
pattern: ^[0-9a-zA-Z_-]{1,255}$
example: voltage
responses:
'200':
description: Updated device attribute information
content:
application/json:
schema:
$ref: '#/components/schemas/deviceAttribute'
'400':
description: Error if malformed request
content:
application/json:
schema:
$ref: '#/components/schemas/error'
'404':
description: Error if device attribute was not found
content:
application/json:
schema:
$ref: '#/components/schemas/error'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/deviceAttributePatch'
description: Object containing new properties of the device attribute
x-losant-auth-scopes:
- deviceAttribute.patch
delete:
operationId: deviceAttribute.delete
summary: Removes an attribute from a device
tags:
- Device Attributes
parameters:
- name: applicationId
in: path
required: true
description: ID associated with the application
schema:
type: string
pattern: ^[A-Fa-f\d]{24}$
example: 575ec8687ae143cd83dc4a97
- name: deviceId
in: path
required: true
description: ID associated with the device
schema:
type: string
pattern: ^[A-Fa-f\d]{24}$
example: 575ecf887ae143cd83dc4aa2
- name: name
in: path
required: true
description: Name of the attribute
schema:
type: string
pattern: ^[0-9a-zA-Z_-]{1,255}$
example: voltage
responses:
'200':
description: If device attribute was successfully deleted
content:
application/json:
schema:
$ref: '#/components/schemas/success'
'400':
description: Error if malformed request
content:
application/json:
schema:
$ref: '#/components/schemas/error'
'404':
description: Error if device attribute was not found
content:
application/json:
schema:
$ref: '#/components/schemas/error'
x-losant-auth-scopes:
- deviceAttribute.delete
components:
schemas:
deviceAttributes:
title: Device Attributes
description: Schema for a collection of Device Attributes
type: object
properties:
items:
type: array
items:
$ref: '#/components/schemas/deviceAttribute'
count:
type: integer
totalCount:
type: integer
filter:
type: string
filterField:
type: string
sortField:
type: string
sortDirection:
type: string
enum:
- asc
- desc
- ASC
- DESC
- ''
applicationId:
type: string
pattern: ^[A-Fa-f\d]{24}$
deviceId:
type: string
pattern: ^[A-Fa-f\d]{24}$
error:
title: Error
description: Schema for errors returned by the API
type: object
properties:
type:
type: string
message:
type: string
validationErrors:
type: array
items:
type: object
properties:
field:
type: string
validationMessage:
type: string
success:
title: Success
description: Schema for reporting a successful operation
type: object
properties:
success:
type: boolean
enum:
- true
deviceAttributePatch:
title: Device Attribute Patch
description: Schema for the body of a Device Attribute modification request
type: object
properties:
name:
type: string
pattern: ^[0-9a-zA-Z_-]{1,255}$
contentType:
type: string
maxLength: 64
description:
type: string
maxLength: 32767
attributeTags:
type: object
patternProperties:
^[0-9a-zA-Z_-]{1,255}$:
type: string
minLength: 1
maxLength: 255
additionalProperties: false
system:
type: object
properties:
aggregation:
type: string
enum:
- FIRST
- LAST
- COUNT
- MAX
- MIN
- MEDIAN
- MEAN
- SUM
- STD_DEV
aggregationOptions:
type: array
items:
type: object
additionalProperties: false
maxItems: 0
childAttributes:
type: array
items:
type: object
properties:
name:
type: string
pattern: ^[0-9a-zA-Z_-]{1,255}$
mode:
type: string
enum:
- all
- whitelist
- blacklist
deviceIds:
type: array
items:
type: string
pattern: ^[A-Fa-f\d]{24}$
maxItems: 1000
deviceTags:
type: array
items:
type: object
properties:
key:
type: string
pattern: ^[0-9a-zA-Z_-]{1,255}$
value:
type: string
minLength: 1
maxLength: 255
additionalProperties: false
maxItems: 100
required:
- name
- mode
additionalProperties: false
maxItems: 256
additionalProperties: false
additionalProperties: false
deviceAttributePost:
title: Device Attribute Post
description: Schema for the body of a Device Attribute creation request
type: object
properties:
name:
type: string
pattern: ^[0-9a-zA-Z_-]{1,255}$
dataType:
type: string
enum:
- string
- number
- gps
- boolean
- blob
contentType:
type: string
maxLength: 64
description:
type: string
maxLength: 32767
attributeTags:
type: object
patternProperties:
^[0-9a-zA-Z_-]{1,255}$:
type: string
minLength: 1
maxLength: 255
additionalProperties: false
system:
type: object
properties:
aggregation:
type: string
enum:
- FIRST
- LAST
- COUNT
- MAX
- MIN
- MEDIAN
- MEAN
- SUM
- STD_DEV
aggregationOptions:
type: array
items:
type: object
additionalProperties: false
maxItems: 0
childAttributes:
type: array
items:
type: object
properties:
name:
type: string
pattern: ^[0-9a-zA-Z_-]{1,255}$
mode:
type: string
enum:
- all
- whitelist
- blacklist
deviceIds:
type: array
items:
type: string
pattern: ^[A-Fa-f\d]{24}$
maxItems: 1000
deviceTags:
type: array
items:
type: object
properties:
key:
type: string
pattern: ^[0-9a-zA-Z_-]{1,255}$
value:
type: string
minLength: 1
maxLength: 255
additionalProperties: false
maxItems: 100
required:
- name
- mode
additionalProperties: false
maxItems: 256
additionalProperties: false
required:
- name
- dataType
additionalProperties: false
deviceAttribute:
title: Device Attribute
description: Schema for a single Device Attribute
type: object
properties:
name:
type: string
pattern: ^[0-9a-zA-Z_-]{1,255}$
dataType:
type: string
enum:
- string
- number
- gps
- boolean
- blob
contentType:
type: string
maxLength: 64
description:
type: string
maxLength: 32767
attributeTags:
type: object
patternProperties:
^[0-9a-zA-Z_-]{1,255}$:
type: string
minLength: 1
maxLength: 255
additionalProperties: false
system:
type: object
properties:
aggregation:
type: string
enum:
- FIRST
- LAST
- COUNT
- MAX
- MIN
- MEDIAN
- MEAN
- SUM
- STD_DEV
aggregationOptions:
type: array
items:
type: object
additionalProperties: false
maxItems: 0
childAttributes:
type: array
items:
type: object
properties:
name:
type: string
pattern: ^[0-9a-zA-Z_-]{1,255}$
mode:
type: string
enum:
- all
- whitelist
- blacklist
deviceIds:
type: array
items:
type: string
pattern: ^[A-Fa-f\d]{24}$
maxItems: 1000
deviceTags:
type: array
items:
type: object
properties:
key:
type: string
pattern: ^[0-9a-zA-Z_-]{1,255}$
value:
type: string
minLength: 1
maxLength: 255
additionalProperties: false
maxItems: 100
required:
- name
- mode
additionalProperties: false
maxItems: 256
additionalProperties: false
applicationId:
type: string
pattern: ^[A-Fa-f\d]{24}$
deviceId:
type: string
pattern: ^[A-Fa-f\d]{24}$
securitySchemes:
bearerAuth:
type: http
scheme: bearer
x-derived-from:
format: bravado 1.0
by: all/0-working/bravado-to-openapi.py (roadmap#799)
note: 'every action keeps its own path: resource.path + action.path'