The Bulbthings API follows the JSON:API specification. The API is organized around clear resource-oriented endpoints, and uses HTTP response codes to indicate API errors. We support cross-origin resource sharing, allowing you to interact securely with our API from a client-side web application. JSON is returned by all API responses, including errors.
API key (required)
Bulbthings uses API keys to authenticate requests. You can create and manage API keys from your dashboard. Keep your keys secure and do not share them in publicly accessible areas such as GitHub, client-side code, and so forth. Keys must be provided via HTTP request headers: Authorization: Bearer your-api-key.
Workspace scope (recommended)
If you are only making requests for a single Bulbthings workspace, it is recommended you provide a companyId query parameter to all of your requests, for example GET https://api.bulbthings.com/entities?companyId=your-workspace-id. This will automatically restrict the data you read/write to the specified workspace and avoid having to manually filter results. The companyId workspace identifier can be found in the developer settings page of your dashboard.

Account objects represent the users of the platform. They can either be a human or an application bot.
Returns a list of accounts.
| include | string Enum: "companies" "memberships" "keys" "settings" "unitSettings" Comma-separated list of related resources to include in the response, for example: |
object Return only specific fields in the response on a per-resource basis. Must be a comma-separated list that refers to the name(s) of the fields to be returned. For example: | |
| filter | string Filtering expression formatted according to Bulbthings' Resource Query Language. |
| group | string Aggregating expression formatted according to Bulbthings' Resource Query Language. |
| sort | string Sorting expression formatted according to Bulbthings' Resource Query Language. |
object Page limit and offset to use when returning the list of results. |
const accounts = await bulbthings.accounts.findAll({ page: { limit: 10 } });
{- "data": [
- {
- "type": "string",
- "id": "string",
- "attributes": {
- "label": "John Doe",
- "email": "example@gmail.com",
- "currentPassword": "myCurrentSecretPassword",
- "password": "myNewSecretPassword",
- "isVerified": false,
- "isBot": false,
- "locale": "en-GB",
- "avatarFileId": "43734b19-c230-4e90-aac4-a54d936c00d3",
- "meta": {
- "timezone": "Europe/London"
}, - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}, - "relationships": { }
}
], - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Invite a user to join Bulbthings. This operation will return the existing invite if the email was already used. ⚠️ You also need to create a Membership for the user to have access to a workspace.
required | object | ||||||||||||||
| |||||||||||||||
{- "data": {
- "attributes": {
- "label": "John Doe",
- "email": "example@gmail.com",
- "locale": "en-GB",
- "avatarFileId": "43734b19-c230-4e90-aac4-a54d936c00d3",
- "meta": {
- "timezone": "Europe/London"
}
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "label": "John Doe",
- "email": "example@gmail.com",
- "currentPassword": "myCurrentSecretPassword",
- "password": "myNewSecretPassword",
- "isVerified": false,
- "isBot": false,
- "locale": "en-GB",
- "avatarFileId": "43734b19-c230-4e90-aac4-a54d936c00d3",
- "meta": {
- "timezone": "Europe/London"
}, - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Retrieve the details of an existing account using its unique identifier.
| id required | string <uuid> The identifier of the account to be retrieved. |
| include | string Enum: "companies" "memberships" "keys" "settings" "unitSettings" Comma-separated list of related resources to include in the response, for example: |
{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "label": "John Doe",
- "email": "example@gmail.com",
- "currentPassword": "myCurrentSecretPassword",
- "password": "myNewSecretPassword",
- "isVerified": false,
- "isBot": false,
- "locale": "en-GB",
- "avatarFileId": "43734b19-c230-4e90-aac4-a54d936c00d3",
- "meta": {
- "timezone": "Europe/London"
}, - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Accounts can only update themselves.
required | object | ||||||||||||||
| |||||||||||||||
{- "data": {
- "attributes": {
- "label": "John Doe",
- "email": "example@gmail.com",
- "locale": "en-GB",
- "avatarFileId": "43734b19-c230-4e90-aac4-a54d936c00d3",
- "meta": {
- "timezone": "Europe/London"
}
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "label": "John Doe",
- "email": "example@gmail.com",
- "currentPassword": "myCurrentSecretPassword",
- "password": "myNewSecretPassword",
- "isVerified": false,
- "isBot": false,
- "locale": "en-GB",
- "avatarFileId": "43734b19-c230-4e90-aac4-a54d936c00d3",
- "meta": {
- "timezone": "Europe/London"
}, - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Delete an account using its unique identifier.
| id required | string <uuid> The identifier of the account to be deleted. |
{- "errors": [
- {
- "id": "string",
- "status": "string",
- "code": "string",
- "title": "string",
- "detail": "string",
- "source": {
- "pointer": "string",
- "parameter": "string"
}, - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}, - "jsonapi": {
- "version": "string",
- "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
}Acknowledgements are objects used to record that a user has seen a notification event.
Create an acknowledgement
required | object | ||||||||||
| |||||||||||
{- "data": {
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "accountId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "eventId": "b89511a0-7770-4a06-b554-fe3eb868046b"
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "accountId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "eventId": "b89511a0-7770-4a06-b554-fe3eb868046b",
- "createdAt": "2019-08-24T14:15:22Z"
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Retrieve the details of an existing acknowledgement using its unique identifier.
| id required | string <uuid> The identifier of the acknowledgement to be retrieved. |
| include | string Enum: "company" "account" "event" Comma-separated list of related resources to include in the response, for example: |
{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "accountId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "eventId": "b89511a0-7770-4a06-b554-fe3eb868046b",
- "createdAt": "2019-08-24T14:15:22Z"
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Delete an acknowledgement using its unique identifier.
| id required | string <uuid> The identifier of the acknowledgement to be deleted. |
{- "errors": [
- {
- "id": "string",
- "status": "string",
- "code": "string",
- "title": "string",
- "detail": "string",
- "source": {
- "pointer": "string",
- "parameter": "string"
}, - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}, - "jsonapi": {
- "version": "string",
- "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
}Action types describe the possible actions that can be triggered in the system. Actions are physical or abstract operations, for example turning on/off a machine, sending an email or validating a quotation. To control the display of actions, use entity type mappings.
Returns a list of action types.
| include | string Value: "entityTypes" Comma-separated list of related resources to include in the response, for example: |
object Return only specific fields in the response on a per-resource basis. Must be a comma-separated list that refers to the name(s) of the fields to be returned. For example: | |
| filter | string Filtering expression formatted according to Bulbthings' Resource Query Language. |
| group | string Aggregating expression formatted according to Bulbthings' Resource Query Language. |
| sort | string Sorting expression formatted according to Bulbthings' Resource Query Language. |
object Page limit and offset to use when returning the list of results. |
const actionTypes = await bulbthings.actionTypes.findAll({ page: { limit: 10 } });
{- "data": [
- {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "schema": {
- "title": "Set temperature",
- "description": "Set the room temperature to the specified value (in degrees Celsius).",
- "type": "object",
- "properties": {
- "temperature": {
- "type": "number"
}
}, - "required": [
- "temperature"
]
}, - "meta": {
- "useGeoPosition": true,
- "requireScan": true,
- "redirectTo": {
- "routeId": "entityCreation",
- "routeParams": {
- "entityTypes": [
- "asset",
- "user"
], - "associationTypes": [
- "assetsAssignedToUsers"
], - "isSource": true
}
}, - "features": [
- "maintenance"
]
}
}, - "relationships": { }
}
], - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Create an action type
required | object | ||||||||||
| |||||||||||
{- "data": {
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "schema": {
- "title": "Set temperature",
- "description": "Set the room temperature to the specified value (in degrees Celsius).",
- "type": "object",
- "properties": {
- "temperature": {
- "type": "number"
}
}, - "required": [
- "temperature"
]
}, - "meta": {
- "useGeoPosition": true,
- "requireScan": true,
- "redirectTo": {
- "routeId": "entityCreation",
- "routeParams": {
- "entityTypes": [
- "asset",
- "user"
], - "associationTypes": [
- "assetsAssignedToUsers"
], - "isSource": true
}
}, - "features": [
- "maintenance"
]
}
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "schema": {
- "title": "Set temperature",
- "description": "Set the room temperature to the specified value (in degrees Celsius).",
- "type": "object",
- "properties": {
- "temperature": {
- "type": "number"
}
}, - "required": [
- "temperature"
]
}, - "meta": {
- "useGeoPosition": true,
- "requireScan": true,
- "redirectTo": {
- "routeId": "entityCreation",
- "routeParams": {
- "entityTypes": [
- "asset",
- "user"
], - "associationTypes": [
- "assetsAssignedToUsers"
], - "isSource": true
}
}, - "features": [
- "maintenance"
]
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Retrieve the details of an existing action type using its unique identifier.
| id required | string <uuid> The identifier of the action type to be retrieved. |
| include | string Value: "entityTypes" Comma-separated list of related resources to include in the response, for example: |
{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "schema": {
- "title": "Set temperature",
- "description": "Set the room temperature to the specified value (in degrees Celsius).",
- "type": "object",
- "properties": {
- "temperature": {
- "type": "number"
}
}, - "required": [
- "temperature"
]
}, - "meta": {
- "useGeoPosition": true,
- "requireScan": true,
- "redirectTo": {
- "routeId": "entityCreation",
- "routeParams": {
- "entityTypes": [
- "asset",
- "user"
], - "associationTypes": [
- "assetsAssignedToUsers"
], - "isSource": true
}
}, - "features": [
- "maintenance"
]
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Update an action type
required | object | ||||||||||
| |||||||||||
{- "data": {
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "schema": {
- "title": "Set temperature",
- "description": "Set the room temperature to the specified value (in degrees Celsius).",
- "type": "object",
- "properties": {
- "temperature": {
- "type": "number"
}
}, - "required": [
- "temperature"
]
}, - "meta": {
- "useGeoPosition": true,
- "requireScan": true,
- "redirectTo": {
- "routeId": "entityCreation",
- "routeParams": {
- "entityTypes": [
- "asset",
- "user"
], - "associationTypes": [
- "assetsAssignedToUsers"
], - "isSource": true
}
}, - "features": [
- "maintenance"
]
}
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "schema": {
- "title": "Set temperature",
- "description": "Set the room temperature to the specified value (in degrees Celsius).",
- "type": "object",
- "properties": {
- "temperature": {
- "type": "number"
}
}, - "required": [
- "temperature"
]
}, - "meta": {
- "useGeoPosition": true,
- "requireScan": true,
- "redirectTo": {
- "routeId": "entityCreation",
- "routeParams": {
- "entityTypes": [
- "asset",
- "user"
], - "associationTypes": [
- "assetsAssignedToUsers"
], - "isSource": true
}
}, - "features": [
- "maintenance"
]
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Delete an action type using its unique identifier.
| id required | string <uuid> The identifier of the action type to be deleted. |
{- "errors": [
- {
- "id": "string",
- "status": "string",
- "code": "string",
- "title": "string",
- "detail": "string",
- "source": {
- "pointer": "string",
- "parameter": "string"
}, - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}, - "jsonapi": {
- "version": "string",
- "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
}Actions represent operations being asked by a user. Think of it as issue tickets: creating an Action is like someone opening a ticket to ask for an operation to be executed. The action creation emits events that can be listened to by Bulbthings, thirdparties, or your servers in order to triggered all the necessary code and operations. During the lifeycle of the action, whatever client handling the operation will update its status until it reaches the completed or failed states.
Returns a list of actions.
| include | string Enum: "actionType" "account" "entity" "events" Comma-separated list of related resources to include in the response, for example: |
object Return only specific fields in the response on a per-resource basis. Must be a comma-separated list that refers to the name(s) of the fields to be returned. For example: | |
| filter | string Filtering expression formatted according to Bulbthings' Resource Query Language. |
| group | string Aggregating expression formatted according to Bulbthings' Resource Query Language. |
| sort | string Sorting expression formatted according to Bulbthings' Resource Query Language. |
object Page limit and offset to use when returning the list of results. |
const actions = await bulbthings.actions.findAll({ page: { limit: 10 } });
{- "data": [
- {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "entityId": "07aa8ffb-1e59-4e5b-9b01-2de99814d7b8",
- "actionTypeId": "setRoomTemperature",
- "accountId": "a4976b38-5606-4f06-ad90-00e646978e8d",
- "label": "Click me",
- "input": {
- "temperature": 20
}, - "status": "requested",
- "requestedAt": "2019-08-24T14:15:22Z",
- "completedAt": "2019-08-24T14:15:22Z",
- "meta": null
}, - "relationships": { }
}
], - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Create an action
required | object | ||||||||||||||||||||
| |||||||||||||||||||||
{- "data": {
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "entityId": "07aa8ffb-1e59-4e5b-9b01-2de99814d7b8",
- "actionTypeId": "setRoomTemperature",
- "accountId": "a4976b38-5606-4f06-ad90-00e646978e8d",
- "label": "Click me",
- "input": {
- "temperature": 20
}, - "status": "requested",
- "meta": null
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "entityId": "07aa8ffb-1e59-4e5b-9b01-2de99814d7b8",
- "actionTypeId": "setRoomTemperature",
- "accountId": "a4976b38-5606-4f06-ad90-00e646978e8d",
- "label": "Click me",
- "input": {
- "temperature": 20
}, - "status": "requested",
- "requestedAt": "2019-08-24T14:15:22Z",
- "completedAt": "2019-08-24T14:15:22Z",
- "meta": null
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Retrieve the details of an existing action using its unique identifier.
| id required | string <uuid> The identifier of the action to be retrieved. |
| include | string Enum: "actionType" "account" "entity" "events" Comma-separated list of related resources to include in the response, for example: |
{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "entityId": "07aa8ffb-1e59-4e5b-9b01-2de99814d7b8",
- "actionTypeId": "setRoomTemperature",
- "accountId": "a4976b38-5606-4f06-ad90-00e646978e8d",
- "label": "Click me",
- "input": {
- "temperature": 20
}, - "status": "requested",
- "requestedAt": "2019-08-24T14:15:22Z",
- "completedAt": "2019-08-24T14:15:22Z",
- "meta": null
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Update an action
required | object | ||||||||||||||||||||
| |||||||||||||||||||||
{- "data": {
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "entityId": "07aa8ffb-1e59-4e5b-9b01-2de99814d7b8",
- "actionTypeId": "setRoomTemperature",
- "accountId": "a4976b38-5606-4f06-ad90-00e646978e8d",
- "label": "Click me",
- "input": {
- "temperature": 20
}, - "status": "requested",
- "meta": null
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "entityId": "07aa8ffb-1e59-4e5b-9b01-2de99814d7b8",
- "actionTypeId": "setRoomTemperature",
- "accountId": "a4976b38-5606-4f06-ad90-00e646978e8d",
- "label": "Click me",
- "input": {
- "temperature": 20
}, - "status": "requested",
- "requestedAt": "2019-08-24T14:15:22Z",
- "completedAt": "2019-08-24T14:15:22Z",
- "meta": null
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Delete an action using its unique identifier.
| id required | string <uuid> The identifier of the action to be deleted. |
{- "errors": [
- {
- "id": "string",
- "status": "string",
- "code": "string",
- "title": "string",
- "detail": "string",
- "source": {
- "pointer": "string",
- "parameter": "string"
}, - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}, - "jsonapi": {
- "version": "string",
- "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
}Association types describe the different kinds of relationships that exist between entities. An association type is defined between a source and a target entity type and can be shared between multiple targets in the case of overlapping associations.
Returns a list of association types.
| include | string Enum: "sourceEntityType" "targetEntityType" Comma-separated list of related resources to include in the response, for example: |
object Return only specific fields in the response on a per-resource basis. Must be a comma-separated list that refers to the name(s) of the fields to be returned. For example: | |
| filter | string Filtering expression formatted according to Bulbthings' Resource Query Language. |
| group | string Aggregating expression formatted according to Bulbthings' Resource Query Language. |
| sort | string Sorting expression formatted according to Bulbthings' Resource Query Language. |
object Page limit and offset to use when returning the list of results. |
const associationTypes = await bulbthings.associationTypes.findAll({ page: { limit: 10 } });
{- "data": [
- {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "sourceEntityTypeId": "asset",
- "targetEntityTypeId": "user",
- "sourceIsShared": true,
- "targetIsShared": true,
- "meta": {
- "category": "Assignment",
- "sourceSectionLabel": "Assigned users",
- "sourceActionLabel": "Assign to user",
- "targetSectionLabel": "Assigned assets",
- "targetActionLabel": "Assign asset",
- "sourceShouldBeCreated": true,
- "targetShouldBeCreated": true,
- "isImportantForSource": true,
- "isImportantForTarget": true,
- "isSourcePartOfTarget": true,
- "hasPeriod": true,
- "hasQuantity": true,
- "displayInList": true,
- "displayInSourceList": true,
- "displayInTargetList": true,
- "displayInCalendar": true,
- "features": [
- "maintenance"
]
}
}, - "relationships": { }
}
], - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Create an association type
required | object | ||||||||||||||||
| |||||||||||||||||
{- "data": {
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "sourceEntityTypeId": "asset",
- "targetEntityTypeId": "user",
- "sourceIsShared": true,
- "targetIsShared": true,
- "meta": {
- "category": "Assignment",
- "sourceSectionLabel": "Assigned users",
- "sourceActionLabel": "Assign to user",
- "targetSectionLabel": "Assigned assets",
- "targetActionLabel": "Assign asset",
- "sourceShouldBeCreated": true,
- "targetShouldBeCreated": true,
- "isImportantForSource": true,
- "isImportantForTarget": true,
- "isSourcePartOfTarget": true,
- "hasPeriod": true,
- "hasQuantity": true,
- "displayInList": true,
- "displayInSourceList": true,
- "displayInTargetList": true,
- "displayInCalendar": true,
- "features": [
- "maintenance"
]
}
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "sourceEntityTypeId": "asset",
- "targetEntityTypeId": "user",
- "sourceIsShared": true,
- "targetIsShared": true,
- "meta": {
- "category": "Assignment",
- "sourceSectionLabel": "Assigned users",
- "sourceActionLabel": "Assign to user",
- "targetSectionLabel": "Assigned assets",
- "targetActionLabel": "Assign asset",
- "sourceShouldBeCreated": true,
- "targetShouldBeCreated": true,
- "isImportantForSource": true,
- "isImportantForTarget": true,
- "isSourcePartOfTarget": true,
- "hasPeriod": true,
- "hasQuantity": true,
- "displayInList": true,
- "displayInSourceList": true,
- "displayInTargetList": true,
- "displayInCalendar": true,
- "features": [
- "maintenance"
]
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Retrieve the details of an existing association type using its unique identifier.
| id required | string <uuid> The identifier of the association type to be retrieved. |
| include | string Enum: "sourceEntityType" "targetEntityType" Comma-separated list of related resources to include in the response, for example: |
{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "sourceEntityTypeId": "asset",
- "targetEntityTypeId": "user",
- "sourceIsShared": true,
- "targetIsShared": true,
- "meta": {
- "category": "Assignment",
- "sourceSectionLabel": "Assigned users",
- "sourceActionLabel": "Assign to user",
- "targetSectionLabel": "Assigned assets",
- "targetActionLabel": "Assign asset",
- "sourceShouldBeCreated": true,
- "targetShouldBeCreated": true,
- "isImportantForSource": true,
- "isImportantForTarget": true,
- "isSourcePartOfTarget": true,
- "hasPeriod": true,
- "hasQuantity": true,
- "displayInList": true,
- "displayInSourceList": true,
- "displayInTargetList": true,
- "displayInCalendar": true,
- "features": [
- "maintenance"
]
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Update an association type
required | object | ||||||||||||||||
| |||||||||||||||||
{- "data": {
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "sourceEntityTypeId": "asset",
- "targetEntityTypeId": "user",
- "sourceIsShared": true,
- "targetIsShared": true,
- "meta": {
- "category": "Assignment",
- "sourceSectionLabel": "Assigned users",
- "sourceActionLabel": "Assign to user",
- "targetSectionLabel": "Assigned assets",
- "targetActionLabel": "Assign asset",
- "sourceShouldBeCreated": true,
- "targetShouldBeCreated": true,
- "isImportantForSource": true,
- "isImportantForTarget": true,
- "isSourcePartOfTarget": true,
- "hasPeriod": true,
- "hasQuantity": true,
- "displayInList": true,
- "displayInSourceList": true,
- "displayInTargetList": true,
- "displayInCalendar": true,
- "features": [
- "maintenance"
]
}
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "sourceEntityTypeId": "asset",
- "targetEntityTypeId": "user",
- "sourceIsShared": true,
- "targetIsShared": true,
- "meta": {
- "category": "Assignment",
- "sourceSectionLabel": "Assigned users",
- "sourceActionLabel": "Assign to user",
- "targetSectionLabel": "Assigned assets",
- "targetActionLabel": "Assign asset",
- "sourceShouldBeCreated": true,
- "targetShouldBeCreated": true,
- "isImportantForSource": true,
- "isImportantForTarget": true,
- "isSourcePartOfTarget": true,
- "hasPeriod": true,
- "hasQuantity": true,
- "displayInList": true,
- "displayInSourceList": true,
- "displayInTargetList": true,
- "displayInCalendar": true,
- "features": [
- "maintenance"
]
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Delete an association type using its unique identifier.
| id required | string <uuid> The identifier of the association type to be deleted. |
{- "errors": [
- {
- "id": "string",
- "status": "string",
- "code": "string",
- "title": "string",
- "detail": "string",
- "source": {
- "pointer": "string",
- "parameter": "string"
}, - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}, - "jsonapi": {
- "version": "string",
- "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
}Entities have relationships by way of associations. An association is a relationship defined between a source and a target entity, possibly restricted to a period of time. When an association type is shareable, a ratio specifies how the relationship is split between the target entities.
Returns a list of associations.
| include | string Enum: "associationType" "sourceEntity" "targetEntity" Comma-separated list of related resources to include in the response, for example: |
object Return only specific fields in the response on a per-resource basis. Must be a comma-separated list that refers to the name(s) of the fields to be returned. For example: | |
| filter | string Filtering expression formatted according to Bulbthings' Resource Query Language. |
| group | string Aggregating expression formatted according to Bulbthings' Resource Query Language. |
| sort | string Sorting expression formatted according to Bulbthings' Resource Query Language. |
object Page limit and offset to use when returning the list of results. |
const associations = await bulbthings.associations.findAll({ page: { limit: 10 } });
{- "data": [
- {
- "type": "string",
- "id": "string",
- "attributes": {
- "accountId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "associationTypeId": "assetsAssignedToUsers",
- "sourceEntityId": "07aa8ffb-1e59-4e5b-9b01-2de99814d7b8",
- "targetEntityId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "period": {
- "from": "2019-08-24T14:15:22Z",
- "to": "2019-08-24T14:15:22Z",
- "bounds": "[]"
}, - "ratio": "1",
- "quantity": 1,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}, - "relationships": { }
}
], - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Create an association
required | object | ||||||||||||||||||||
| |||||||||||||||||||||
{- "data": {
- "attributes": {
- "accountId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "associationTypeId": "assetsAssignedToUsers",
- "sourceEntityId": "07aa8ffb-1e59-4e5b-9b01-2de99814d7b8",
- "targetEntityId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "period": {
- "from": "2019-08-24T14:15:22Z",
- "to": "2019-08-24T14:15:22Z",
- "bounds": "[]"
}, - "ratio": "1",
- "quantity": 1
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "accountId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "associationTypeId": "assetsAssignedToUsers",
- "sourceEntityId": "07aa8ffb-1e59-4e5b-9b01-2de99814d7b8",
- "targetEntityId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "period": {
- "from": "2019-08-24T14:15:22Z",
- "to": "2019-08-24T14:15:22Z",
- "bounds": "[]"
}, - "ratio": "1",
- "quantity": 1,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Retrieve the details of an existing association using its unique identifier.
| id required | string <uuid> The identifier of the association to be retrieved. |
| include | string Enum: "associationType" "sourceEntity" "targetEntity" Comma-separated list of related resources to include in the response, for example: |
{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "accountId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "associationTypeId": "assetsAssignedToUsers",
- "sourceEntityId": "07aa8ffb-1e59-4e5b-9b01-2de99814d7b8",
- "targetEntityId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "period": {
- "from": "2019-08-24T14:15:22Z",
- "to": "2019-08-24T14:15:22Z",
- "bounds": "[]"
}, - "ratio": "1",
- "quantity": 1,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Update an association
required | object | ||||||||||||||||||||
| |||||||||||||||||||||
{- "data": {
- "attributes": {
- "accountId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "associationTypeId": "assetsAssignedToUsers",
- "sourceEntityId": "07aa8ffb-1e59-4e5b-9b01-2de99814d7b8",
- "targetEntityId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "period": {
- "from": "2019-08-24T14:15:22Z",
- "to": "2019-08-24T14:15:22Z",
- "bounds": "[]"
}, - "ratio": "1",
- "quantity": 1
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "accountId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "associationTypeId": "assetsAssignedToUsers",
- "sourceEntityId": "07aa8ffb-1e59-4e5b-9b01-2de99814d7b8",
- "targetEntityId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "period": {
- "from": "2019-08-24T14:15:22Z",
- "to": "2019-08-24T14:15:22Z",
- "bounds": "[]"
}, - "ratio": "1",
- "quantity": 1,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Delete an association using its unique identifier.
| id required | string <uuid> The identifier of the association to be deleted. |
{- "errors": [
- {
- "id": "string",
- "status": "string",
- "code": "string",
- "title": "string",
- "detail": "string",
- "source": {
- "pointer": "string",
- "parameter": "string"
}, - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}, - "jsonapi": {
- "version": "string",
- "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
}Attribute types describe the different kinds of properties that can be added to entities.
Returns a list of attribute types.
| include | string Value: "unit" Comma-separated list of related resources to include in the response, for example: |
object Return only specific fields in the response on a per-resource basis. Must be a comma-separated list that refers to the name(s) of the fields to be returned. For example: | |
| filter | string Filtering expression formatted according to Bulbthings' Resource Query Language. |
| group | string Aggregating expression formatted according to Bulbthings' Resource Query Language. |
| sort | string Sorting expression formatted according to Bulbthings' Resource Query Language. |
object Page limit and offset to use when returning the list of results. |
const attributeTypes = await bulbthings.attributeTypes.findAll({ page: { limit: 10 } });
{- "data": [
- {
- "type": "string",
- "id": "string",
- "attributes": {
- "schema": {
- "type": "string",
- "title": "VIN",
- "maxLength": 17,
- "minLength": 17,
- "description": "Vehicle Identification Number"
}, - "timeSeriesOptions": {
- "type": "gauge",
- "interval": "P1M15D",
- "aligner": "last",
- "interpolation": "linear",
- "fill": "lastObservationCarriedForward"
}, - "isReadOnly": false,
- "unitId": "km",
- "meta": {
- "display": {
- "icon": {
- "fontAwesome": "lightbulb"
}, - "style": {
- "color": "#f9a400",
- "backgroundColor": "rgba(248, 165, 0, 0.2)"
}, - "ranges": [
- {
- "schema": null,
- "style": {
- "color": "#f9a400",
- "backgroundColor": "rgba(248, 165, 0, 0.2)"
}, - "displayValue": null
}
], - "numberFormat": {
- "minimumFractionDigits": 0,
- "maximumFractionDigits": 2
}
}, - "defaultUnits": {
- "britishImperial": "[mi_i]"
}, - "features": [
- "maintenance"
]
}
}, - "relationships": { }
}
], - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Create an attribute type
required | object | ||||||||||||||
| |||||||||||||||
{- "data": {
- "attributes": {
- "schema": {
- "type": "string",
- "title": "VIN",
- "maxLength": 17,
- "minLength": 17,
- "description": "Vehicle Identification Number"
}, - "timeSeriesOptions": {
- "type": "gauge",
- "interval": "P1M15D",
- "aligner": "last",
- "interpolation": "linear",
- "fill": "lastObservationCarriedForward"
}, - "isReadOnly": false,
- "unitId": "km",
- "meta": {
- "display": {
- "icon": {
- "fontAwesome": "lightbulb"
}, - "style": {
- "color": "#f9a400",
- "backgroundColor": "rgba(248, 165, 0, 0.2)"
}, - "ranges": [
- {
- "schema": null,
- "style": {
- "color": "#f9a400",
- "backgroundColor": "rgba(248, 165, 0, 0.2)"
}, - "displayValue": null
}
], - "numberFormat": {
- "minimumFractionDigits": 0,
- "maximumFractionDigits": 2
}
}, - "defaultUnits": {
- "britishImperial": "[mi_i]"
}, - "features": [
- "maintenance"
]
}
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "schema": {
- "type": "string",
- "title": "VIN",
- "maxLength": 17,
- "minLength": 17,
- "description": "Vehicle Identification Number"
}, - "timeSeriesOptions": {
- "type": "gauge",
- "interval": "P1M15D",
- "aligner": "last",
- "interpolation": "linear",
- "fill": "lastObservationCarriedForward"
}, - "isReadOnly": false,
- "unitId": "km",
- "meta": {
- "display": {
- "icon": {
- "fontAwesome": "lightbulb"
}, - "style": {
- "color": "#f9a400",
- "backgroundColor": "rgba(248, 165, 0, 0.2)"
}, - "ranges": [
- {
- "schema": null,
- "style": {
- "color": "#f9a400",
- "backgroundColor": "rgba(248, 165, 0, 0.2)"
}, - "displayValue": null
}
], - "numberFormat": {
- "minimumFractionDigits": 0,
- "maximumFractionDigits": 2
}
}, - "defaultUnits": {
- "britishImperial": "[mi_i]"
}, - "features": [
- "maintenance"
]
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Retrieve the details of an existing attribute type using its unique identifier.
| id required | string <uuid> The identifier of the attribute type to be retrieved. |
| include | string Value: "unit" Comma-separated list of related resources to include in the response, for example: |
{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "schema": {
- "type": "string",
- "title": "VIN",
- "maxLength": 17,
- "minLength": 17,
- "description": "Vehicle Identification Number"
}, - "timeSeriesOptions": {
- "type": "gauge",
- "interval": "P1M15D",
- "aligner": "last",
- "interpolation": "linear",
- "fill": "lastObservationCarriedForward"
}, - "isReadOnly": false,
- "unitId": "km",
- "meta": {
- "display": {
- "icon": {
- "fontAwesome": "lightbulb"
}, - "style": {
- "color": "#f9a400",
- "backgroundColor": "rgba(248, 165, 0, 0.2)"
}, - "ranges": [
- {
- "schema": null,
- "style": {
- "color": "#f9a400",
- "backgroundColor": "rgba(248, 165, 0, 0.2)"
}, - "displayValue": null
}
], - "numberFormat": {
- "minimumFractionDigits": 0,
- "maximumFractionDigits": 2
}
}, - "defaultUnits": {
- "britishImperial": "[mi_i]"
}, - "features": [
- "maintenance"
]
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Update an attribute type
required | object | ||||||||||||||
| |||||||||||||||
{- "data": {
- "attributes": {
- "schema": {
- "type": "string",
- "title": "VIN",
- "maxLength": 17,
- "minLength": 17,
- "description": "Vehicle Identification Number"
}, - "timeSeriesOptions": {
- "type": "gauge",
- "interval": "P1M15D",
- "aligner": "last",
- "interpolation": "linear",
- "fill": "lastObservationCarriedForward"
}, - "isReadOnly": false,
- "unitId": "km",
- "meta": {
- "display": {
- "icon": {
- "fontAwesome": "lightbulb"
}, - "style": {
- "color": "#f9a400",
- "backgroundColor": "rgba(248, 165, 0, 0.2)"
}, - "ranges": [
- {
- "schema": null,
- "style": {
- "color": "#f9a400",
- "backgroundColor": "rgba(248, 165, 0, 0.2)"
}, - "displayValue": null
}
], - "numberFormat": {
- "minimumFractionDigits": 0,
- "maximumFractionDigits": 2
}
}, - "defaultUnits": {
- "britishImperial": "[mi_i]"
}, - "features": [
- "maintenance"
]
}
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "schema": {
- "type": "string",
- "title": "VIN",
- "maxLength": 17,
- "minLength": 17,
- "description": "Vehicle Identification Number"
}, - "timeSeriesOptions": {
- "type": "gauge",
- "interval": "P1M15D",
- "aligner": "last",
- "interpolation": "linear",
- "fill": "lastObservationCarriedForward"
}, - "isReadOnly": false,
- "unitId": "km",
- "meta": {
- "display": {
- "icon": {
- "fontAwesome": "lightbulb"
}, - "style": {
- "color": "#f9a400",
- "backgroundColor": "rgba(248, 165, 0, 0.2)"
}, - "ranges": [
- {
- "schema": null,
- "style": {
- "color": "#f9a400",
- "backgroundColor": "rgba(248, 165, 0, 0.2)"
}, - "displayValue": null
}
], - "numberFormat": {
- "minimumFractionDigits": 0,
- "maximumFractionDigits": 2
}
}, - "defaultUnits": {
- "britishImperial": "[mi_i]"
}, - "features": [
- "maintenance"
]
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Delete an attribute type using its unique identifier.
| id required | string <uuid> The identifier of the attribute type to be deleted. |
{- "errors": [
- {
- "id": "string",
- "status": "string",
- "code": "string",
- "title": "string",
- "detail": "string",
- "source": {
- "pointer": "string",
- "parameter": "string"
}, - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}, - "jsonapi": {
- "version": "string",
- "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
}Catalog mappings define which entity types a catalog gives access to. Adding an entity type to a catalog automatically implies adding all of its ancestors and descendant types.
Returns a list of catalog mappings.
| include | string Enum: "catalog" "entityType" Comma-separated list of related resources to include in the response, for example: |
object Return only specific fields in the response on a per-resource basis. Must be a comma-separated list that refers to the name(s) of the fields to be returned. For example: | |
| filter | string Filtering expression formatted according to Bulbthings' Resource Query Language. |
| group | string Aggregating expression formatted according to Bulbthings' Resource Query Language. |
| sort | string Sorting expression formatted according to Bulbthings' Resource Query Language. |
object Page limit and offset to use when returning the list of results. |
const catalogMappings = await bulbthings.catalogMappings.findAll({ page: { limit: 10 } });
{- "data": [
- {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "catalogId": "4a3c7421-7ed8-48bc-8f06-0671a42a32c8",
- "entityTypeId": "vehicle",
- "meta": {
- "isReadOnly": true
}
}, - "relationships": { }
}
], - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Create a catalog mapping
required | object | ||||||||||||
| |||||||||||||
{- "data": {
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "catalogId": "4a3c7421-7ed8-48bc-8f06-0671a42a32c8",
- "entityTypeId": "vehicle",
- "meta": {
- "isReadOnly": true
}
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "catalogId": "4a3c7421-7ed8-48bc-8f06-0671a42a32c8",
- "entityTypeId": "vehicle",
- "meta": {
- "isReadOnly": true
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Retrieve the details of an existing catalog mapping using its unique identifier.
| id required | string <uuid> The identifier of the catalog mapping to be retrieved. |
| include | string Enum: "catalog" "entityType" Comma-separated list of related resources to include in the response, for example: |
{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "catalogId": "4a3c7421-7ed8-48bc-8f06-0671a42a32c8",
- "entityTypeId": "vehicle",
- "meta": {
- "isReadOnly": true
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Update a catalog mapping
required | object | ||||||||||||
| |||||||||||||
{- "data": {
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "catalogId": "4a3c7421-7ed8-48bc-8f06-0671a42a32c8",
- "entityTypeId": "vehicle",
- "meta": {
- "isReadOnly": true
}
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "catalogId": "4a3c7421-7ed8-48bc-8f06-0671a42a32c8",
- "entityTypeId": "vehicle",
- "meta": {
- "isReadOnly": true
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Delete a catalog mapping using its unique identifier.
| id required | string <uuid> The identifier of the catalog mapping to be deleted. |
{- "errors": [
- {
- "id": "string",
- "status": "string",
- "code": "string",
- "title": "string",
- "detail": "string",
- "source": {
- "pointer": "string",
- "parameter": "string"
}, - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}, - "jsonapi": {
- "version": "string",
- "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
}Catalogs are bundles of entity types that can be used to customise the application for a workspace by only showing a set of entity type categories.
Returns a list of catalogs.
| include | string Value: "entityTypes" Comma-separated list of related resources to include in the response, for example: |
object Return only specific fields in the response on a per-resource basis. Must be a comma-separated list that refers to the name(s) of the fields to be returned. For example: | |
| filter | string Filtering expression formatted according to Bulbthings' Resource Query Language. |
| group | string Aggregating expression formatted according to Bulbthings' Resource Query Language. |
| sort | string Sorting expression formatted according to Bulbthings' Resource Query Language. |
object Page limit and offset to use when returning the list of results. |
const catalogs = await bulbthings.catalogs.findAll({ page: { limit: 10 } });
{- "data": [
- {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "label": "Vehicle management catalog",
- "description": "Short text describing the catalog."
}, - "relationships": { }
}
], - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Create a catalog
required | object | ||||||||||
| |||||||||||
{- "data": {
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "label": "Vehicle management catalog",
- "description": "Short text describing the catalog."
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "label": "Vehicle management catalog",
- "description": "Short text describing the catalog."
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Retrieve the details of an existing catalog using its unique identifier.
| id required | string <uuid> The identifier of the catalog to be retrieved. |
| include | string Value: "entityTypes" Comma-separated list of related resources to include in the response, for example: |
{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "label": "Vehicle management catalog",
- "description": "Short text describing the catalog."
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Update a catalog
required | object | ||||||||||
| |||||||||||
{- "data": {
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "label": "Vehicle management catalog",
- "description": "Short text describing the catalog."
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "label": "Vehicle management catalog",
- "description": "Short text describing the catalog."
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Delete a catalog using its unique identifier.
| id required | string <uuid> The identifier of the catalog to be deleted. |
{- "errors": [
- {
- "id": "string",
- "status": "string",
- "code": "string",
- "title": "string",
- "detail": "string",
- "source": {
- "pointer": "string",
- "parameter": "string"
}, - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}, - "jsonapi": {
- "version": "string",
- "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
}Returns a list of codes.
| include | string Value: "entity" Comma-separated list of related resources to include in the response, for example: |
object Return only specific fields in the response on a per-resource basis. Must be a comma-separated list that refers to the name(s) of the fields to be returned. For example: | |
| filter | string Filtering expression formatted according to Bulbthings' Resource Query Language. |
| group | string Aggregating expression formatted according to Bulbthings' Resource Query Language. |
| sort | string Sorting expression formatted according to Bulbthings' Resource Query Language. |
object Page limit and offset to use when returning the list of results. |
const codes = await bulbthings.codes.findAll({ page: { limit: 10 } });
{- "data": [
- {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "entityId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "type": "qrcode",
- "value": "ABC1234"
}, - "relationships": { }
}
], - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Create a code
required | object | ||||||||||||
| |||||||||||||
{- "data": {
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "entityId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "type": "qrcode",
- "value": "ABC1234"
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "entityId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "type": "qrcode",
- "value": "ABC1234"
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Retrieve the details of an existing code using its unique identifier.
| id required | string <uuid> The identifier of the code to be retrieved. |
| include | string Value: "entity" Comma-separated list of related resources to include in the response, for example: |
{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "entityId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "type": "qrcode",
- "value": "ABC1234"
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Update a code
required | object | ||||||||||||
| |||||||||||||
{- "data": {
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "entityId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "type": "qrcode",
- "value": "ABC1234"
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "entityId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "type": "qrcode",
- "value": "ABC1234"
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Delete a code using its unique identifier.
| id required | string <uuid> The identifier of the code to be deleted. |
{- "errors": [
- {
- "id": "string",
- "status": "string",
- "code": "string",
- "title": "string",
- "detail": "string",
- "source": {
- "pointer": "string",
- "parameter": "string"
}, - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}, - "jsonapi": {
- "version": "string",
- "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
}Returns a list of companies.
| include | string Enum: "account" "catalog" Comma-separated list of related resources to include in the response, for example: |
object Return only specific fields in the response on a per-resource basis. Must be a comma-separated list that refers to the name(s) of the fields to be returned. For example: | |
| filter | string Filtering expression formatted according to Bulbthings' Resource Query Language. |
| group | string Aggregating expression formatted according to Bulbthings' Resource Query Language. |
| sort | string Sorting expression formatted according to Bulbthings' Resource Query Language. |
object Page limit and offset to use when returning the list of results. |
const companies = await bulbthings.companies.findAll({ page: { limit: 10 } });
{- "data": [
- {
- "type": "string",
- "id": "string",
- "attributes": {
- "label": "Company LTD",
- "accountId": "f326f347-820e-46ce-b883-3457af3d3eac",
- "catalogId": "67b60e97-0675-418c-8cc2-f8b10820ddef",
- "avatarFileId": "43734b19-c230-4e90-aac4-a54d936c00d3",
- "locale": "en-GB",
- "meta": {
- "billingId": "cus_HRkHymvJYVcAWp",
- "features": [
- "stock",
- "financials"
]
}, - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}, - "relationships": { }
}
], - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Create a company
required | object | ||||||||||||||||
| |||||||||||||||||
{- "data": {
- "attributes": {
- "label": "Company LTD",
- "accountId": "f326f347-820e-46ce-b883-3457af3d3eac",
- "catalogId": "67b60e97-0675-418c-8cc2-f8b10820ddef",
- "avatarFileId": "43734b19-c230-4e90-aac4-a54d936c00d3",
- "locale": "en-GB",
- "meta": {
- "billingId": "cus_HRkHymvJYVcAWp",
- "features": [
- "stock",
- "financials"
]
}
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "label": "Company LTD",
- "accountId": "f326f347-820e-46ce-b883-3457af3d3eac",
- "catalogId": "67b60e97-0675-418c-8cc2-f8b10820ddef",
- "avatarFileId": "43734b19-c230-4e90-aac4-a54d936c00d3",
- "locale": "en-GB",
- "meta": {
- "billingId": "cus_HRkHymvJYVcAWp",
- "features": [
- "stock",
- "financials"
]
}, - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Retrieve the details of an existing company using its unique identifier.
| id required | string <uuid> The identifier of the company to be retrieved. |
| include | string Enum: "account" "catalog" Comma-separated list of related resources to include in the response, for example: |
{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "label": "Company LTD",
- "accountId": "f326f347-820e-46ce-b883-3457af3d3eac",
- "catalogId": "67b60e97-0675-418c-8cc2-f8b10820ddef",
- "avatarFileId": "43734b19-c230-4e90-aac4-a54d936c00d3",
- "locale": "en-GB",
- "meta": {
- "billingId": "cus_HRkHymvJYVcAWp",
- "features": [
- "stock",
- "financials"
]
}, - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Update a company
required | object | ||||||||||||||||
| |||||||||||||||||
{- "data": {
- "attributes": {
- "label": "Company LTD",
- "accountId": "f326f347-820e-46ce-b883-3457af3d3eac",
- "catalogId": "67b60e97-0675-418c-8cc2-f8b10820ddef",
- "avatarFileId": "43734b19-c230-4e90-aac4-a54d936c00d3",
- "locale": "en-GB",
- "meta": {
- "billingId": "cus_HRkHymvJYVcAWp",
- "features": [
- "stock",
- "financials"
]
}
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "label": "Company LTD",
- "accountId": "f326f347-820e-46ce-b883-3457af3d3eac",
- "catalogId": "67b60e97-0675-418c-8cc2-f8b10820ddef",
- "avatarFileId": "43734b19-c230-4e90-aac4-a54d936c00d3",
- "locale": "en-GB",
- "meta": {
- "billingId": "cus_HRkHymvJYVcAWp",
- "features": [
- "stock",
- "financials"
]
}, - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Delete a company using its unique identifier.
| id required | string <uuid> The identifier of the company to be deleted. |
{- "errors": [
- {
- "id": "string",
- "status": "string",
- "code": "string",
- "title": "string",
- "detail": "string",
- "source": {
- "pointer": "string",
- "parameter": "string"
}, - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}, - "jsonapi": {
- "version": "string",
- "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
}Mappings allow you to control how attributes, actions and relationships appear on entity profiles. Mappings apply to an entity type category, which means that all entities belonging to subcategories will also inherit them. You can also restrict mappings to a certain role for more granularity in what users see.
Returns a list of entity type mappings.
| include | string Enum: "entityType" "associationType" "attributeType" "eventType" "actionType" "role" Comma-separated list of related resources to include in the response, for example: |
object Return only specific fields in the response on a per-resource basis. Must be a comma-separated list that refers to the name(s) of the fields to be returned. For example: | |
| filter | string Filtering expression formatted according to Bulbthings' Resource Query Language. |
| group | string Aggregating expression formatted according to Bulbthings' Resource Query Language. |
| sort | string Sorting expression formatted according to Bulbthings' Resource Query Language. |
object Page limit and offset to use when returning the list of results. |
const entityTypeMappings = await bulbthings.entityTypeMappings.findAll({ page: { limit: 10 } });
{- "data": [
- {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "entityTypeId": "vehicle",
- "entityId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "privateForAccountId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "roleId": "d053d12a-ead1-421d-b48c-51645efc54db",
- "type": "attributeType",
- "associationTypeId": "assetsAssignedToUsers",
- "attributeTypeId": "mileage",
- "eventTypeId": "overheatingEngine",
- "actionTypeId": "lockDoors",
- "isInherited": false,
- "meta": {
- "isReadOnly": true,
- "isHidden": true,
- "isPublic": true,
- "isRequired": false,
- "isImportant": true,
- "isSystem": true,
- "order": 1.5,
- "displayInPreview": true,
- "excludedCompanies": [
- "f74175c3-84cc-4151-aa0b-d0470de27243"
]
}
}, - "relationships": { }
}
], - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Create an entity type mapping
required | object | ||||||||||||||||||||||||||
| |||||||||||||||||||||||||||
{- "data": {
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "entityTypeId": "vehicle",
- "entityId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "privateForAccountId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "roleId": "d053d12a-ead1-421d-b48c-51645efc54db",
- "type": "attributeType",
- "associationTypeId": "assetsAssignedToUsers",
- "attributeTypeId": "mileage",
- "eventTypeId": "overheatingEngine",
- "actionTypeId": "lockDoors",
- "meta": {
- "isReadOnly": true,
- "isHidden": true,
- "isPublic": true,
- "isRequired": false,
- "isImportant": true,
- "order": 1.5,
- "displayInPreview": true,
- "excludedCompanies": [
- "f74175c3-84cc-4151-aa0b-d0470de27243"
]
}
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "entityTypeId": "vehicle",
- "entityId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "privateForAccountId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "roleId": "d053d12a-ead1-421d-b48c-51645efc54db",
- "type": "attributeType",
- "associationTypeId": "assetsAssignedToUsers",
- "attributeTypeId": "mileage",
- "eventTypeId": "overheatingEngine",
- "actionTypeId": "lockDoors",
- "isInherited": false,
- "meta": {
- "isReadOnly": true,
- "isHidden": true,
- "isPublic": true,
- "isRequired": false,
- "isImportant": true,
- "isSystem": true,
- "order": 1.5,
- "displayInPreview": true,
- "excludedCompanies": [
- "f74175c3-84cc-4151-aa0b-d0470de27243"
]
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Retrieve the details of an existing entity type mapping using its unique identifier.
| id required | string <uuid> The identifier of the entity type mapping to be retrieved. |
| include | string Enum: "entityType" "associationType" "attributeType" "eventType" "actionType" "role" Comma-separated list of related resources to include in the response, for example: |
{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "entityTypeId": "vehicle",
- "entityId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "privateForAccountId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "roleId": "d053d12a-ead1-421d-b48c-51645efc54db",
- "type": "attributeType",
- "associationTypeId": "assetsAssignedToUsers",
- "attributeTypeId": "mileage",
- "eventTypeId": "overheatingEngine",
- "actionTypeId": "lockDoors",
- "isInherited": false,
- "meta": {
- "isReadOnly": true,
- "isHidden": true,
- "isPublic": true,
- "isRequired": false,
- "isImportant": true,
- "isSystem": true,
- "order": 1.5,
- "displayInPreview": true,
- "excludedCompanies": [
- "f74175c3-84cc-4151-aa0b-d0470de27243"
]
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Update an entity type mapping
required | object | ||||||||||||||||||||||||||
| |||||||||||||||||||||||||||
{- "data": {
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "entityTypeId": "vehicle",
- "entityId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "privateForAccountId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "roleId": "d053d12a-ead1-421d-b48c-51645efc54db",
- "type": "attributeType",
- "associationTypeId": "assetsAssignedToUsers",
- "attributeTypeId": "mileage",
- "eventTypeId": "overheatingEngine",
- "actionTypeId": "lockDoors",
- "meta": {
- "isReadOnly": true,
- "isHidden": true,
- "isPublic": true,
- "isRequired": false,
- "isImportant": true,
- "order": 1.5,
- "displayInPreview": true,
- "excludedCompanies": [
- "f74175c3-84cc-4151-aa0b-d0470de27243"
]
}
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "entityTypeId": "vehicle",
- "entityId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "privateForAccountId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "roleId": "d053d12a-ead1-421d-b48c-51645efc54db",
- "type": "attributeType",
- "associationTypeId": "assetsAssignedToUsers",
- "attributeTypeId": "mileage",
- "eventTypeId": "overheatingEngine",
- "actionTypeId": "lockDoors",
- "isInherited": false,
- "meta": {
- "isReadOnly": true,
- "isHidden": true,
- "isPublic": true,
- "isRequired": false,
- "isImportant": true,
- "isSystem": true,
- "order": 1.5,
- "displayInPreview": true,
- "excludedCompanies": [
- "f74175c3-84cc-4151-aa0b-d0470de27243"
]
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Delete an entity type mapping using its unique identifier.
| id required | string <uuid> The identifier of the entity type mapping to be deleted. |
{- "errors": [
- {
- "id": "string",
- "status": "string",
- "code": "string",
- "title": "string",
- "detail": "string",
- "source": {
- "pointer": "string",
- "parameter": "string"
}, - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}, - "jsonapi": {
- "version": "string",
- "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
}Entity types are the different categories of entities. Each type can have a parent and will inherit attribute types, association types and action types from it.
Returns a list of entity types.
| include | string Comma-separated list of related resources to include in the response, for example: |
object Return only specific fields in the response on a per-resource basis. Must be a comma-separated list that refers to the name(s) of the fields to be returned. For example: | |
| filter | string Filtering expression formatted according to Bulbthings' Resource Query Language. |
| group | string Aggregating expression formatted according to Bulbthings' Resource Query Language. |
| sort | string Sorting expression formatted according to Bulbthings' Resource Query Language. |
object Page limit and offset to use when returning the list of results. |
const entityTypes = await bulbthings.entityTypes.findAll({ page: { limit: 10 } });
{- "data": [
- {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "label": "Car",
- "description": "A description of the entity type.",
- "parentId": "asset",
- "path": [
- "asset",
- "vehicle",
- "car"
], - "meta": {
- "icon": {
- "fontAwesome": "lightbulb"
}, - "isRootType": false,
- "isAbstract": true,
- "isPrivate": true,
- "features": [
- "maintenance"
]
}
}, - "relationships": { }
}
], - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Create an entity type
required | object | ||||||||||||||
| |||||||||||||||
{- "data": {
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "label": "Car",
- "description": "A description of the entity type.",
- "parentId": "asset",
- "meta": {
- "icon": {
- "fontAwesome": "lightbulb"
}, - "isRootType": false,
- "isAbstract": true,
- "isPrivate": true,
- "features": [
- "maintenance"
]
}
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "label": "Car",
- "description": "A description of the entity type.",
- "parentId": "asset",
- "path": [
- "asset",
- "vehicle",
- "car"
], - "meta": {
- "icon": {
- "fontAwesome": "lightbulb"
}, - "isRootType": false,
- "isAbstract": true,
- "isPrivate": true,
- "features": [
- "maintenance"
]
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Retrieve the details of an existing entity type using its unique identifier.
| id required | string <uuid> The identifier of the entity type to be retrieved. |
| include | string Comma-separated list of related resources to include in the response, for example: |
{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "label": "Car",
- "description": "A description of the entity type.",
- "parentId": "asset",
- "path": [
- "asset",
- "vehicle",
- "car"
], - "meta": {
- "icon": {
- "fontAwesome": "lightbulb"
}, - "isRootType": false,
- "isAbstract": true,
- "isPrivate": true,
- "features": [
- "maintenance"
]
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Update an entity type
required | object | ||||||||||||||
| |||||||||||||||
{- "data": {
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "label": "Car",
- "description": "A description of the entity type.",
- "parentId": "asset",
- "meta": {
- "icon": {
- "fontAwesome": "lightbulb"
}, - "isRootType": false,
- "isAbstract": true,
- "isPrivate": true,
- "features": [
- "maintenance"
]
}
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "label": "Car",
- "description": "A description of the entity type.",
- "parentId": "asset",
- "path": [
- "asset",
- "vehicle",
- "car"
], - "meta": {
- "icon": {
- "fontAwesome": "lightbulb"
}, - "isRootType": false,
- "isAbstract": true,
- "isPrivate": true,
- "features": [
- "maintenance"
]
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Delete an entity type using its unique identifier.
| id required | string <uuid> The identifier of the entity type to be deleted. |
{- "errors": [
- {
- "id": "string",
- "status": "string",
- "code": "string",
- "title": "string",
- "detail": "string",
- "source": {
- "pointer": "string",
- "parameter": "string"
}, - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}, - "jsonapi": {
- "version": "string",
- "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
}Entities are the main building blocks of asset management. They represent assets, users, organisations or even activities such as maintenances. The API allows you to create, delete, and update your entities. You can retrieve individual entities as well as a list of all your entities.
Returns a list of entities.
| include | string Enum: "company" "entityType" "account" "associations" "avatarFile" "files" "codes" Comma-separated list of related resources to include in the response, for example: |
object Return only specific fields in the response on a per-resource basis. Must be a comma-separated list that refers to the name(s) of the fields to be returned. For example: | |
| filter | string Filtering expression formatted according to Bulbthings' Resource Query Language. |
| group | string Aggregating expression formatted according to Bulbthings' Resource Query Language. |
| sort | string Sorting expression formatted according to Bulbthings' Resource Query Language. |
object Page limit and offset to use when returning the list of results. |
const entities = await bulbthings.entities.findAll({ page: { limit: 10 } });
{- "data": [
- {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "entityTypeId": "asset",
- "accountId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "avatarFileId": "43734b19-c230-4e90-aac4-a54d936c00d3",
- "label": "Tesla Model S",
- "attributes": {
- "vin": "5GHOU0NE5PQZ10G94",
- "license": "ZNUOFR2",
- "mileage": {
- "km": 52815.72
}, - "gpsPosition": {
- "lat": 39.759,
- "long": 132.005
}, - "fuelLevelWarning": true,
- "registrationDate": "2016-07-11T04:31:19.903Z"
}, - "quantity": 1,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "deletedAt": "2019-08-24T14:15:22Z",
- "status": "active",
- "meta": {
- "hasStock": true
}
}, - "relationships": { }
}
], - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Create an entity
required | object | ||||||||||||||||||
| |||||||||||||||||||
{- "data": {
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "entityTypeId": "asset",
- "avatarFileId": "43734b19-c230-4e90-aac4-a54d936c00d3",
- "label": "Tesla Model S",
- "quantity": 1,
- "status": "active",
- "meta": {
- "hasStock": true
}
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "entityTypeId": "asset",
- "accountId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "avatarFileId": "43734b19-c230-4e90-aac4-a54d936c00d3",
- "label": "Tesla Model S",
- "attributes": {
- "vin": "5GHOU0NE5PQZ10G94",
- "license": "ZNUOFR2",
- "mileage": {
- "km": 52815.72
}, - "gpsPosition": {
- "lat": 39.759,
- "long": 132.005
}, - "fuelLevelWarning": true,
- "registrationDate": "2016-07-11T04:31:19.903Z"
}, - "quantity": 1,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "deletedAt": "2019-08-24T14:15:22Z",
- "status": "active",
- "meta": {
- "hasStock": true
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Retrieve the details of an existing entity using its unique identifier.
| id required | string <uuid> The identifier of the entity to be retrieved. |
| include | string Enum: "company" "entityType" "account" "associations" "avatarFile" "files" "codes" Comma-separated list of related resources to include in the response, for example: |
{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "entityTypeId": "asset",
- "accountId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "avatarFileId": "43734b19-c230-4e90-aac4-a54d936c00d3",
- "label": "Tesla Model S",
- "attributes": {
- "vin": "5GHOU0NE5PQZ10G94",
- "license": "ZNUOFR2",
- "mileage": {
- "km": 52815.72
}, - "gpsPosition": {
- "lat": 39.759,
- "long": 132.005
}, - "fuelLevelWarning": true,
- "registrationDate": "2016-07-11T04:31:19.903Z"
}, - "quantity": 1,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "deletedAt": "2019-08-24T14:15:22Z",
- "status": "active",
- "meta": {
- "hasStock": true
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}⚠️ The attributes property of an Entity object is read-only. To update attributes you need to create a Measurement object.
required | object | ||||||||||||||||||
| |||||||||||||||||||
{- "data": {
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "entityTypeId": "asset",
- "avatarFileId": "43734b19-c230-4e90-aac4-a54d936c00d3",
- "label": "Tesla Model S",
- "quantity": 1,
- "status": "active",
- "meta": {
- "hasStock": true
}
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "entityTypeId": "asset",
- "accountId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "avatarFileId": "43734b19-c230-4e90-aac4-a54d936c00d3",
- "label": "Tesla Model S",
- "attributes": {
- "vin": "5GHOU0NE5PQZ10G94",
- "license": "ZNUOFR2",
- "mileage": {
- "km": 52815.72
}, - "gpsPosition": {
- "lat": 39.759,
- "long": 132.005
}, - "fuelLevelWarning": true,
- "registrationDate": "2016-07-11T04:31:19.903Z"
}, - "quantity": 1,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "deletedAt": "2019-08-24T14:15:22Z",
- "status": "active",
- "meta": {
- "hasStock": true
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Delete an entity using its unique identifier.
| id required | string <uuid> The identifier of the entity to be deleted. |
{- "errors": [
- {
- "id": "string",
- "status": "string",
- "code": "string",
- "title": "string",
- "detail": "string",
- "source": {
- "pointer": "string",
- "parameter": "string"
}, - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}, - "jsonapi": {
- "version": "string",
- "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
}Retrieve the details of an existing environment using its unique identifier.
| id required | string <uuid> The identifier of the environment to be retrieved. |
| include | string Comma-separated list of related resources to include in the response, for example: |
{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "config": {
- "title": "string",
- "webUrl": "string",
- "iosAppUrl": "string",
- "androidAppUrl": "string",
- "longTitle": "string",
- "logo": "string",
- "primaryColor": "string",
- "primaryColorVariant": "string",
- "secondaryColor": "string",
- "secondaryColorVariant": "string",
- "masterAccountLabel": "string",
- "emailTemplate": "string",
- "emailFromAddress": "string",
- "mobileBrowserDisclaimer": {
- "title": "string",
- "content": "string"
}, - "registrationInviteEmail": {
- "title": "string",
- "subtitle": "string",
- "button": "string",
- "content": "string"
}, - "features": [
- "essentials",
- "disable-onboarding"
], - "helpMenuOptions": {
- "supportEmail": "string",
- "hasChatSupport": true,
- "tutorialLink": "string"
}
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Returns a list of event types.
| include | string Comma-separated list of related resources to include in the response, for example: |
object Return only specific fields in the response on a per-resource basis. Must be a comma-separated list that refers to the name(s) of the fields to be returned. For example: | |
| filter | string Filtering expression formatted according to Bulbthings' Resource Query Language. |
| group | string Aggregating expression formatted according to Bulbthings' Resource Query Language. |
| sort | string Sorting expression formatted according to Bulbthings' Resource Query Language. |
object Page limit and offset to use when returning the list of results. |
const eventTypes = await bulbthings.eventTypes.findAll({ page: { limit: 10 } });
{- "data": [
- {
- "type": "string",
- "id": "string",
- "attributes": {
- "schema": {
- "title": "Overheating engine",
- "description": "The engine temperature is exceeding its normal operating range.",
- "type": "object",
- "properties": {
- "temperature": {
- "type": "number"
}
}, - "required": [
- "temperature"
]
}, - "meta": {
- "isProgress": false,
- "isSystem": false
}
}, - "relationships": { }
}
], - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Create an event type
required | object | ||||||||
| |||||||||
{- "data": {
- "attributes": {
- "schema": {
- "title": "Overheating engine",
- "description": "The engine temperature is exceeding its normal operating range.",
- "type": "object",
- "properties": {
- "temperature": {
- "type": "number"
}
}, - "required": [
- "temperature"
]
}, - "meta": {
- "isProgress": false,
- "isSystem": false
}
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "schema": {
- "title": "Overheating engine",
- "description": "The engine temperature is exceeding its normal operating range.",
- "type": "object",
- "properties": {
- "temperature": {
- "type": "number"
}
}, - "required": [
- "temperature"
]
}, - "meta": {
- "isProgress": false,
- "isSystem": false
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Retrieve the details of an existing event type using its unique identifier.
| id required | string <uuid> The identifier of the event type to be retrieved. |
| include | string Comma-separated list of related resources to include in the response, for example: |
{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "schema": {
- "title": "Overheating engine",
- "description": "The engine temperature is exceeding its normal operating range.",
- "type": "object",
- "properties": {
- "temperature": {
- "type": "number"
}
}, - "required": [
- "temperature"
]
}, - "meta": {
- "isProgress": false,
- "isSystem": false
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Update an event type
required | object | ||||||||
| |||||||||
{- "data": {
- "attributes": {
- "schema": {
- "title": "Overheating engine",
- "description": "The engine temperature is exceeding its normal operating range.",
- "type": "object",
- "properties": {
- "temperature": {
- "type": "number"
}
}, - "required": [
- "temperature"
]
}, - "meta": {
- "isProgress": false,
- "isSystem": false
}
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "schema": {
- "title": "Overheating engine",
- "description": "The engine temperature is exceeding its normal operating range.",
- "type": "object",
- "properties": {
- "temperature": {
- "type": "number"
}
}, - "required": [
- "temperature"
]
}, - "meta": {
- "isProgress": false,
- "isSystem": false
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Delete an event type using its unique identifier.
| id required | string <uuid> The identifier of the event type to be deleted. |
{- "errors": [
- {
- "id": "string",
- "status": "string",
- "code": "string",
- "title": "string",
- "detail": "string",
- "source": {
- "pointer": "string",
- "parameter": "string"
}, - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}, - "jsonapi": {
- "version": "string",
- "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
}Events represent a change occuring on an entity at a single point in time. Events may describe any change in the entity's lifecycle, failure, confirmation or even user comments.
Returns a list of events.
| include | string Enum: "eventType" "account" "entity" "actions" Comma-separated list of related resources to include in the response, for example: |
object Return only specific fields in the response on a per-resource basis. Must be a comma-separated list that refers to the name(s) of the fields to be returned. For example: | |
| filter | string Filtering expression formatted according to Bulbthings' Resource Query Language. |
| group | string Aggregating expression formatted according to Bulbthings' Resource Query Language. |
| sort | string Sorting expression formatted according to Bulbthings' Resource Query Language. |
object Page limit and offset to use when returning the list of results. |
const events = await bulbthings.events.findAll({ page: { limit: 10 } });
{- "data": [
- {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "eventTypeId": "overheatingEngine",
- "priority": "warning",
- "accountId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "entityId": "b89511a0-7770-4a06-b554-fe3eb868046b",
- "privateForAccountId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "time": "2019-08-24T14:15:22Z",
- "label": "Overheating engine!",
- "payload": {
- "data": {
- "temperature": 125,
- "orientation": 90
}, - "text": "John Doe: @Jane Simpson Sounds good! 👍",
- "sections": [
- {
- "type": "text",
- "value": "Hello <@65359734-d523-4066-902b-5b60377001a2>, this is a rich *text* content!"
}
]
}
}, - "relationships": { }
}
], - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Create an event
required | object | ||||||||||||||||||||||
| |||||||||||||||||||||||
{- "data": {
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "eventTypeId": "overheatingEngine",
- "priority": "warning",
- "accountId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "entityId": "b89511a0-7770-4a06-b554-fe3eb868046b",
- "privateForAccountId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "time": "2019-08-24T14:15:22Z",
- "label": "Overheating engine!",
- "payload": {
- "data": {
- "temperature": 125,
- "orientation": 90
}, - "text": "John Doe: @Jane Simpson Sounds good! 👍",
- "sections": [
- {
- "type": "text",
- "value": "Hello <@65359734-d523-4066-902b-5b60377001a2>, this is a rich *text* content!"
}
]
}
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "eventTypeId": "overheatingEngine",
- "priority": "warning",
- "accountId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "entityId": "b89511a0-7770-4a06-b554-fe3eb868046b",
- "privateForAccountId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "time": "2019-08-24T14:15:22Z",
- "label": "Overheating engine!",
- "payload": {
- "data": {
- "temperature": 125,
- "orientation": 90
}, - "text": "John Doe: @Jane Simpson Sounds good! 👍",
- "sections": [
- {
- "type": "text",
- "value": "Hello <@65359734-d523-4066-902b-5b60377001a2>, this is a rich *text* content!"
}
]
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Retrieve the details of an existing event using its unique identifier.
| id required | string <uuid> The identifier of the event to be retrieved. |
| include | string Enum: "eventType" "account" "entity" "actions" Comma-separated list of related resources to include in the response, for example: |
{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "eventTypeId": "overheatingEngine",
- "priority": "warning",
- "accountId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "entityId": "b89511a0-7770-4a06-b554-fe3eb868046b",
- "privateForAccountId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "time": "2019-08-24T14:15:22Z",
- "label": "Overheating engine!",
- "payload": {
- "data": {
- "temperature": 125,
- "orientation": 90
}, - "text": "John Doe: @Jane Simpson Sounds good! 👍",
- "sections": [
- {
- "type": "text",
- "value": "Hello <@65359734-d523-4066-902b-5b60377001a2>, this is a rich *text* content!"
}
]
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Update an event
required | object | ||||||||||||||||||||||
| |||||||||||||||||||||||
{- "data": {
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "eventTypeId": "overheatingEngine",
- "priority": "warning",
- "accountId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "entityId": "b89511a0-7770-4a06-b554-fe3eb868046b",
- "privateForAccountId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "time": "2019-08-24T14:15:22Z",
- "label": "Overheating engine!",
- "payload": {
- "data": {
- "temperature": 125,
- "orientation": 90
}, - "text": "John Doe: @Jane Simpson Sounds good! 👍",
- "sections": [
- {
- "type": "text",
- "value": "Hello <@65359734-d523-4066-902b-5b60377001a2>, this is a rich *text* content!"
}
]
}
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "eventTypeId": "overheatingEngine",
- "priority": "warning",
- "accountId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "entityId": "b89511a0-7770-4a06-b554-fe3eb868046b",
- "privateForAccountId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "time": "2019-08-24T14:15:22Z",
- "label": "Overheating engine!",
- "payload": {
- "data": {
- "temperature": 125,
- "orientation": 90
}, - "text": "John Doe: @Jane Simpson Sounds good! 👍",
- "sections": [
- {
- "type": "text",
- "value": "Hello <@65359734-d523-4066-902b-5b60377001a2>, this is a rich *text* content!"
}
]
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Delete an event using its unique identifier.
| id required | string <uuid> The identifier of the event to be deleted. |
{- "errors": [
- {
- "id": "string",
- "status": "string",
- "code": "string",
- "title": "string",
- "detail": "string",
- "source": {
- "pointer": "string",
- "parameter": "string"
}, - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}, - "jsonapi": {
- "version": "string",
- "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
}Files represent documents relevant to a given entity. Files can be of any format and can also be organised into a hierarchical folder structure.
Returns a list of files.
| include | string Enum: "parentFile" "account" "entity" Comma-separated list of related resources to include in the response, for example: |
object Return only specific fields in the response on a per-resource basis. Must be a comma-separated list that refers to the name(s) of the fields to be returned. For example: | |
| filter | string Filtering expression formatted according to Bulbthings' Resource Query Language. |
| group | string Aggregating expression formatted according to Bulbthings' Resource Query Language. |
| sort | string Sorting expression formatted according to Bulbthings' Resource Query Language. |
object Page limit and offset to use when returning the list of results. |
const files = await bulbthings.files.findAll({ page: { limit: 10 } });
{- "data": [
- {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "parentFileId": "fadb1ebd-cae4-4921-b4a9-1a757f58be7f",
- "isFolder": false,
- "name": "Cost_report_2019.pdf",
- "size": 31273,
- "type": "application/pdf",
- "encoding": "utf8",
- "accountId": "f326f347-820e-46ce-b883-3457af3d3eac",
- "entityId": "b005d3db-a75e-4160-811c-a4161c537203",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "storageId": "b64348bd-fd36-485e-b5a2-a33fe36bdc80"
}, - "relationships": { }
}
], - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Retrieve the details of an existing file using its unique identifier.
| id required | string <uuid> The identifier of the file to be retrieved. |
| include | string Enum: "parentFile" "account" "entity" Comma-separated list of related resources to include in the response, for example: |
{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "parentFileId": "fadb1ebd-cae4-4921-b4a9-1a757f58be7f",
- "isFolder": false,
- "name": "Cost_report_2019.pdf",
- "size": 31273,
- "type": "application/pdf",
- "encoding": "utf8",
- "accountId": "f326f347-820e-46ce-b883-3457af3d3eac",
- "entityId": "b005d3db-a75e-4160-811c-a4161c537203",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "storageId": "b64348bd-fd36-485e-b5a2-a33fe36bdc80"
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Update a file
required | object | ||||||||||||||||||||||||
| |||||||||||||||||||||||||
{- "data": {
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "parentFileId": "fadb1ebd-cae4-4921-b4a9-1a757f58be7f",
- "isFolder": false,
- "name": "Cost_report_2019.pdf",
- "size": 31273,
- "type": "application/pdf",
- "encoding": "utf8",
- "accountId": "f326f347-820e-46ce-b883-3457af3d3eac",
- "entityId": "b005d3db-a75e-4160-811c-a4161c537203",
- "storageId": "b64348bd-fd36-485e-b5a2-a33fe36bdc80"
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "parentFileId": "fadb1ebd-cae4-4921-b4a9-1a757f58be7f",
- "isFolder": false,
- "name": "Cost_report_2019.pdf",
- "size": 31273,
- "type": "application/pdf",
- "encoding": "utf8",
- "accountId": "f326f347-820e-46ce-b883-3457af3d3eac",
- "entityId": "b005d3db-a75e-4160-811c-a4161c537203",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "storageId": "b64348bd-fd36-485e-b5a2-a33fe36bdc80"
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Delete a file using its unique identifier.
| id required | string <uuid> The identifier of the file to be deleted. |
{- "errors": [
- {
- "id": "string",
- "status": "string",
- "code": "string",
- "title": "string",
- "detail": "string",
- "source": {
- "pointer": "string",
- "parameter": "string"
}, - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}, - "jsonapi": {
- "version": "string",
- "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
}Grants are used to assign roles to a given membership. The role can be scoped to a given Entity, which will restrict it to only entities linked to that scope entity.
Returns a list of grants.
| include | string Enum: "company" "membership" "role" "entity" Comma-separated list of related resources to include in the response, for example: |
object Return only specific fields in the response on a per-resource basis. Must be a comma-separated list that refers to the name(s) of the fields to be returned. For example: | |
| filter | string Filtering expression formatted according to Bulbthings' Resource Query Language. |
| group | string Aggregating expression formatted according to Bulbthings' Resource Query Language. |
| sort | string Sorting expression formatted according to Bulbthings' Resource Query Language. |
object Page limit and offset to use when returning the list of results. |
const grants = await bulbthings.grants.findAll({ page: { limit: 10 } });
{- "data": [
- {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "membershipId": "b89511a0-7770-4a06-b554-fe3eb868046b",
- "roleId": "33acb14f-3ff7-440a-b0ef-e3914c4b3086",
- "entityId": "ac9611a0-7270-4a06-b554-fe3eb868046b"
}, - "relationships": { }
}
], - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Create a grant
required | object | ||||||||||||
| |||||||||||||
{- "data": {
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "membershipId": "b89511a0-7770-4a06-b554-fe3eb868046b",
- "roleId": "33acb14f-3ff7-440a-b0ef-e3914c4b3086",
- "entityId": "ac9611a0-7270-4a06-b554-fe3eb868046b"
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "membershipId": "b89511a0-7770-4a06-b554-fe3eb868046b",
- "roleId": "33acb14f-3ff7-440a-b0ef-e3914c4b3086",
- "entityId": "ac9611a0-7270-4a06-b554-fe3eb868046b"
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Retrieve the details of an existing grant using its unique identifier.
| id required | string <uuid> The identifier of the grant to be retrieved. |
| include | string Enum: "company" "membership" "role" "entity" Comma-separated list of related resources to include in the response, for example: |
{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "membershipId": "b89511a0-7770-4a06-b554-fe3eb868046b",
- "roleId": "33acb14f-3ff7-440a-b0ef-e3914c4b3086",
- "entityId": "ac9611a0-7270-4a06-b554-fe3eb868046b"
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Update a grant
required | object | ||||||||||||
| |||||||||||||
{- "data": {
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "membershipId": "b89511a0-7770-4a06-b554-fe3eb868046b",
- "roleId": "33acb14f-3ff7-440a-b0ef-e3914c4b3086",
- "entityId": "ac9611a0-7270-4a06-b554-fe3eb868046b"
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "membershipId": "b89511a0-7770-4a06-b554-fe3eb868046b",
- "roleId": "33acb14f-3ff7-440a-b0ef-e3914c4b3086",
- "entityId": "ac9611a0-7270-4a06-b554-fe3eb868046b"
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Delete a grant using its unique identifier.
| id required | string <uuid> The identifier of the grant to be deleted. |
{- "errors": [
- {
- "id": "string",
- "status": "string",
- "code": "string",
- "title": "string",
- "detail": "string",
- "source": {
- "pointer": "string",
- "parameter": "string"
}, - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}, - "jsonapi": {
- "version": "string",
- "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
}Returns a list of hooks.
| include | string Comma-separated list of related resources to include in the response, for example: |
object Return only specific fields in the response on a per-resource basis. Must be a comma-separated list that refers to the name(s) of the fields to be returned. For example: | |
| filter | string Filtering expression formatted according to Bulbthings' Resource Query Language. |
| group | string Aggregating expression formatted according to Bulbthings' Resource Query Language. |
| sort | string Sorting expression formatted according to Bulbthings' Resource Query Language. |
object Page limit and offset to use when returning the list of results. |
const hooks = await bulbthings.hooks.findAll({ page: { limit: 10 } });
{- "data": [
- {
- "type": "string",
- "id": "string",
- "attributes": {
- "isActive": true,
- "name": "My HTTP hook",
- "triggeredOn": [
- "*"
]
}, - "relationships": { }
}
], - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Create a hook
required | object | ||||||||||||
| |||||||||||||
{- "data": {
- "attributes": {
- "isActive": true,
- "name": "My HTTP hook",
- "triggeredOn": [
- "*"
]
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "isActive": true,
- "name": "My HTTP hook",
- "triggeredOn": [
- "*"
]
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Retrieve the details of an existing hook using its unique identifier.
| id required | string <uuid> The identifier of the hook to be retrieved. |
| include | string Comma-separated list of related resources to include in the response, for example: |
{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "isActive": true,
- "name": "My HTTP hook",
- "triggeredOn": [
- "*"
]
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Update a hook
required | object | ||||||||||||
| |||||||||||||
{- "data": {
- "attributes": {
- "isActive": true,
- "name": "My HTTP hook",
- "triggeredOn": [
- "*"
]
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "isActive": true,
- "name": "My HTTP hook",
- "triggeredOn": [
- "*"
]
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Delete a hook using its unique identifier.
| id required | string <uuid> The identifier of the hook to be deleted. |
{- "errors": [
- {
- "id": "string",
- "status": "string",
- "code": "string",
- "title": "string",
- "detail": "string",
- "source": {
- "pointer": "string",
- "parameter": "string"
}, - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}, - "jsonapi": {
- "version": "string",
- "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
}Returns a list of keys.
| include | string Value: "account" Comma-separated list of related resources to include in the response, for example: |
object Return only specific fields in the response on a per-resource basis. Must be a comma-separated list that refers to the name(s) of the fields to be returned. For example: | |
| filter | string Filtering expression formatted according to Bulbthings' Resource Query Language. |
| group | string Aggregating expression formatted according to Bulbthings' Resource Query Language. |
| sort | string Sorting expression formatted according to Bulbthings' Resource Query Language. |
object Page limit and offset to use when returning the list of results. |
const keys = await bulbthings.keys.findAll({ page: { limit: 10 } });
{- "data": [
- {
- "type": "string",
- "id": "string",
- "attributes": {
- "accountId": "33acb14f-3ff7-440a-b0ef-e3914c4b3086",
- "label": "My custom integration A",
- "type": "api",
- "value": "string",
- "meta": {
- "ip": "216.58.211.46",
- "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:42.0) Gecko/20100101 Firefox/42.0",
- "browser": {
- "name": "Firefox",
- "version": "77.0"
}, - "os": {
- "name": "Mac OS",
- "version": "10.15"
}
}, - "expiresAt": "2019-08-24T14:15:22Z",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}, - "relationships": { }
}
], - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Create a key
required | object | ||||||||||
| |||||||||||
{- "data": {
- "attributes": {
- "accountId": "33acb14f-3ff7-440a-b0ef-e3914c4b3086",
- "label": "My custom integration A",
- "value": "string"
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "accountId": "33acb14f-3ff7-440a-b0ef-e3914c4b3086",
- "label": "My custom integration A",
- "type": "api",
- "value": "string",
- "meta": {
- "ip": "216.58.211.46",
- "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:42.0) Gecko/20100101 Firefox/42.0",
- "browser": {
- "name": "Firefox",
- "version": "77.0"
}, - "os": {
- "name": "Mac OS",
- "version": "10.15"
}
}, - "expiresAt": "2019-08-24T14:15:22Z",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Retrieve the details of an existing key using its unique identifier.
| id required | string <uuid> The identifier of the key to be retrieved. |
| include | string Value: "account" Comma-separated list of related resources to include in the response, for example: |
{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "accountId": "33acb14f-3ff7-440a-b0ef-e3914c4b3086",
- "label": "My custom integration A",
- "type": "api",
- "value": "string",
- "meta": {
- "ip": "216.58.211.46",
- "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:42.0) Gecko/20100101 Firefox/42.0",
- "browser": {
- "name": "Firefox",
- "version": "77.0"
}, - "os": {
- "name": "Mac OS",
- "version": "10.15"
}
}, - "expiresAt": "2019-08-24T14:15:22Z",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Update a key
required | object | ||||||||||
| |||||||||||
{- "data": {
- "attributes": {
- "accountId": "33acb14f-3ff7-440a-b0ef-e3914c4b3086",
- "label": "My custom integration A",
- "value": "string"
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "accountId": "33acb14f-3ff7-440a-b0ef-e3914c4b3086",
- "label": "My custom integration A",
- "type": "api",
- "value": "string",
- "meta": {
- "ip": "216.58.211.46",
- "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:42.0) Gecko/20100101 Firefox/42.0",
- "browser": {
- "name": "Firefox",
- "version": "77.0"
}, - "os": {
- "name": "Mac OS",
- "version": "10.15"
}
}, - "expiresAt": "2019-08-24T14:15:22Z",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Delete a key using its unique identifier.
| id required | string <uuid> The identifier of the key to be deleted. |
{- "errors": [
- {
- "id": "string",
- "status": "string",
- "code": "string",
- "title": "string",
- "detail": "string",
- "source": {
- "pointer": "string",
- "parameter": "string"
}, - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}, - "jsonapi": {
- "version": "string",
- "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
}All entity properties are updated through measurements. Even simple attributes such as the brand/size/color of an entity must be measured in order to be recorded. Measurements provide additional context information about the source of the value, the way and time at which it was observed, allowing to record the full history of modifications.
Returns a list of measurements.
| include | string Enum: "attributeType" "account" "entity" Comma-separated list of related resources to include in the response, for example: |
object Return only specific fields in the response on a per-resource basis. Must be a comma-separated list that refers to the name(s) of the fields to be returned. For example: | |
| filter | string Filtering expression formatted according to Bulbthings' Resource Query Language. |
| group | string Aggregating expression formatted according to Bulbthings' Resource Query Language. |
| sort | string Sorting expression formatted according to Bulbthings' Resource Query Language. |
object Page limit and offset to use when returning the list of results. |
const measurements = await bulbthings.measurements.findAll({ page: { limit: 10 } });
{- "data": [
- {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "accountId": "33acb14f-3ff7-440a-b0ef-e3914c4b3086",
- "entityId": "b89511a0-7770-4a06-b554-fe3eb868046b",
- "attributeTypeId": "mileage",
- "value": 42000,
- "normalizedValue": {
- "km": 42000,
- "[mi_i]": 26097.59
}, - "unitId": "km",
- "isAbsolute": true,
- "period": {
- "from": "2019-08-24T14:15:22Z",
- "to": "2019-08-24T14:15:22Z",
- "bounds": "[]"
}, - "createdAt": "2019-08-24T14:15:22Z"
}, - "relationships": { }
}
], - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Create a measurement
required | object | ||||||||||||||||||
| |||||||||||||||||||
{- "data": {
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "entityId": "b89511a0-7770-4a06-b554-fe3eb868046b",
- "attributeTypeId": "mileage",
- "value": 42000,
- "unitId": "km",
- "isAbsolute": true,
- "period": {
- "from": "2019-08-24T14:15:22Z",
- "to": "2019-08-24T14:15:22Z",
- "bounds": "[]"
}
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "accountId": "33acb14f-3ff7-440a-b0ef-e3914c4b3086",
- "entityId": "b89511a0-7770-4a06-b554-fe3eb868046b",
- "attributeTypeId": "mileage",
- "value": 42000,
- "normalizedValue": {
- "km": 42000,
- "[mi_i]": 26097.59
}, - "unitId": "km",
- "isAbsolute": true,
- "period": {
- "from": "2019-08-24T14:15:22Z",
- "to": "2019-08-24T14:15:22Z",
- "bounds": "[]"
}, - "createdAt": "2019-08-24T14:15:22Z"
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Retrieve the details of an existing measurement using its unique identifier.
| id required | string <uuid> The identifier of the measurement to be retrieved. |
| include | string Enum: "attributeType" "account" "entity" Comma-separated list of related resources to include in the response, for example: |
{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "accountId": "33acb14f-3ff7-440a-b0ef-e3914c4b3086",
- "entityId": "b89511a0-7770-4a06-b554-fe3eb868046b",
- "attributeTypeId": "mileage",
- "value": 42000,
- "normalizedValue": {
- "km": 42000,
- "[mi_i]": 26097.59
}, - "unitId": "km",
- "isAbsolute": true,
- "period": {
- "from": "2019-08-24T14:15:22Z",
- "to": "2019-08-24T14:15:22Z",
- "bounds": "[]"
}, - "createdAt": "2019-08-24T14:15:22Z"
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Update a measurement
required | object | ||||||||||||||||||
| |||||||||||||||||||
{- "data": {
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "entityId": "b89511a0-7770-4a06-b554-fe3eb868046b",
- "attributeTypeId": "mileage",
- "value": 42000,
- "unitId": "km",
- "isAbsolute": true,
- "period": {
- "from": "2019-08-24T14:15:22Z",
- "to": "2019-08-24T14:15:22Z",
- "bounds": "[]"
}
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "accountId": "33acb14f-3ff7-440a-b0ef-e3914c4b3086",
- "entityId": "b89511a0-7770-4a06-b554-fe3eb868046b",
- "attributeTypeId": "mileage",
- "value": 42000,
- "normalizedValue": {
- "km": 42000,
- "[mi_i]": 26097.59
}, - "unitId": "km",
- "isAbsolute": true,
- "period": {
- "from": "2019-08-24T14:15:22Z",
- "to": "2019-08-24T14:15:22Z",
- "bounds": "[]"
}, - "createdAt": "2019-08-24T14:15:22Z"
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Delete a measurement using its unique identifier.
| id required | string <uuid> The identifier of the measurement to be deleted. |
{- "errors": [
- {
- "id": "string",
- "status": "string",
- "code": "string",
- "title": "string",
- "detail": "string",
- "source": {
- "pointer": "string",
- "parameter": "string"
}, - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}, - "jsonapi": {
- "version": "string",
- "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
}Returns a list of memberships.
| include | string Enum: "company" "account" "entity" "grants" Comma-separated list of related resources to include in the response, for example: |
object Return only specific fields in the response on a per-resource basis. Must be a comma-separated list that refers to the name(s) of the fields to be returned. For example: | |
| filter | string Filtering expression formatted according to Bulbthings' Resource Query Language. |
| group | string Aggregating expression formatted according to Bulbthings' Resource Query Language. |
| sort | string Sorting expression formatted according to Bulbthings' Resource Query Language. |
object Page limit and offset to use when returning the list of results. |
const memberships = await bulbthings.memberships.findAll({ page: { limit: 10 } });
{- "data": [
- {
- "type": "string",
- "id": "string",
- "attributes": {
- "accountId": "b89511a0-7770-4a06-b554-fe3eb868046b",
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "entityId": "ac9611a0-7270-4a06-b554-fe3eb868046b",
- "isAdmin": false,
- "isActive": true,
- "period": null
}, - "relationships": { }
}
], - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Create a membership
required | object | ||||||||||||||||
| |||||||||||||||||
{- "data": {
- "attributes": {
- "accountId": "b89511a0-7770-4a06-b554-fe3eb868046b",
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "entityId": "ac9611a0-7270-4a06-b554-fe3eb868046b",
- "isAdmin": false,
- "isActive": true,
- "period": null
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "accountId": "b89511a0-7770-4a06-b554-fe3eb868046b",
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "entityId": "ac9611a0-7270-4a06-b554-fe3eb868046b",
- "isAdmin": false,
- "isActive": true,
- "period": null
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Retrieve the details of an existing membership using its unique identifier.
| id required | string <uuid> The identifier of the membership to be retrieved. |
| include | string Enum: "company" "account" "entity" "grants" Comma-separated list of related resources to include in the response, for example: |
{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "accountId": "b89511a0-7770-4a06-b554-fe3eb868046b",
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "entityId": "ac9611a0-7270-4a06-b554-fe3eb868046b",
- "isAdmin": false,
- "isActive": true,
- "period": null
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Update a membership
required | object | ||||||||||||||||
| |||||||||||||||||
{- "data": {
- "attributes": {
- "accountId": "b89511a0-7770-4a06-b554-fe3eb868046b",
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "entityId": "ac9611a0-7270-4a06-b554-fe3eb868046b",
- "isAdmin": false,
- "isActive": true,
- "period": null
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "accountId": "b89511a0-7770-4a06-b554-fe3eb868046b",
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "entityId": "ac9611a0-7270-4a06-b554-fe3eb868046b",
- "isAdmin": false,
- "isActive": true,
- "period": null
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Delete a membership using its unique identifier.
| id required | string <uuid> The identifier of the membership to be deleted. |
{- "errors": [
- {
- "id": "string",
- "status": "string",
- "code": "string",
- "title": "string",
- "detail": "string",
- "source": {
- "pointer": "string",
- "parameter": "string"
}, - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}, - "jsonapi": {
- "version": "string",
- "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
}Returns a list of paths.
| include | string Comma-separated list of related resources to include in the response, for example: |
object Return only specific fields in the response on a per-resource basis. Must be a comma-separated list that refers to the name(s) of the fields to be returned. For example: | |
| filter | string Filtering expression formatted according to Bulbthings' Resource Query Language. |
| group | string Aggregating expression formatted according to Bulbthings' Resource Query Language. |
| sort | string Sorting expression formatted according to Bulbthings' Resource Query Language. |
object Page limit and offset to use when returning the list of results. |
const paths = await bulbthings.paths.findAll({ page: { limit: 10 } });
{- "data": [
- {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "sourceEntityId": "07aa8ffb-1e59-4e5b-9b01-2de99814d7b8",
- "targetEntityId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "period": {
- "from": "2019-08-24T14:15:22Z",
- "to": "2019-08-24T14:15:22Z",
- "bounds": "[]"
}, - "ratio": 1,
- "quantity": 1,
- "nodes": [
- "07aa8ffb-1e59-4e5b-9b01-2de99814d7b8",
- "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "9dd1ac21-56bf-4342-8f63-ceaa9063c350"
], - "edges": [
- "5d8b2ebc-1049-4651-bed0-9b36732105c2",
- "60dfd4cf-f3e8-4035-9384-40c602445b2e"
], - "depth": 2
}, - "relationships": { }
}
], - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Returns a list of permissions.
| include | string Enum: "company" "role" Comma-separated list of related resources to include in the response, for example: |
object Return only specific fields in the response on a per-resource basis. Must be a comma-separated list that refers to the name(s) of the fields to be returned. For example: | |
| filter | string Filtering expression formatted according to Bulbthings' Resource Query Language. |
| group | string Aggregating expression formatted according to Bulbthings' Resource Query Language. |
| sort | string Sorting expression formatted according to Bulbthings' Resource Query Language. |
object Page limit and offset to use when returning the list of results. |
const permissions = await bulbthings.permissions.findAll({ page: { limit: 10 } });
{- "data": [
- {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "roleId": "33acb14f-3ff7-440a-b0ef-e3914c4b3086",
- "resource": "entityTypes/asset",
- "filter": "eq(entityTypeId,\"computer\")",
- "rights": [
- "read",
- "write"
], - "bypassScope": false
}, - "relationships": { }
}
], - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Create a permission
required | object | ||||||||||||||||
| |||||||||||||||||
{- "data": {
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "roleId": "33acb14f-3ff7-440a-b0ef-e3914c4b3086",
- "resource": "entityTypes/asset",
- "filter": "eq(entityTypeId,\"computer\")",
- "rights": [
- "read",
- "write"
], - "bypassScope": false
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "roleId": "33acb14f-3ff7-440a-b0ef-e3914c4b3086",
- "resource": "entityTypes/asset",
- "filter": "eq(entityTypeId,\"computer\")",
- "rights": [
- "read",
- "write"
], - "bypassScope": false
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Retrieve the details of an existing permission using its unique identifier.
| id required | string <uuid> The identifier of the permission to be retrieved. |
| include | string Enum: "company" "role" Comma-separated list of related resources to include in the response, for example: |
{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "roleId": "33acb14f-3ff7-440a-b0ef-e3914c4b3086",
- "resource": "entityTypes/asset",
- "filter": "eq(entityTypeId,\"computer\")",
- "rights": [
- "read",
- "write"
], - "bypassScope": false
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Update a permission
required | object | ||||||||||||||||
| |||||||||||||||||
{- "data": {
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "roleId": "33acb14f-3ff7-440a-b0ef-e3914c4b3086",
- "resource": "entityTypes/asset",
- "filter": "eq(entityTypeId,\"computer\")",
- "rights": [
- "read",
- "write"
], - "bypassScope": false
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "roleId": "33acb14f-3ff7-440a-b0ef-e3914c4b3086",
- "resource": "entityTypes/asset",
- "filter": "eq(entityTypeId,\"computer\")",
- "rights": [
- "read",
- "write"
], - "bypassScope": false
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Delete a permission using its unique identifier.
| id required | string <uuid> The identifier of the permission to be deleted. |
{- "errors": [
- {
- "id": "string",
- "status": "string",
- "code": "string",
- "title": "string",
- "detail": "string",
- "source": {
- "pointer": "string",
- "parameter": "string"
}, - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}, - "jsonapi": {
- "version": "string",
- "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
}Returns a list of roles.
| include | string Enum: "company" "grants" "permissions" Comma-separated list of related resources to include in the response, for example: |
object Return only specific fields in the response on a per-resource basis. Must be a comma-separated list that refers to the name(s) of the fields to be returned. For example: | |
| filter | string Filtering expression formatted according to Bulbthings' Resource Query Language. |
| group | string Aggregating expression formatted according to Bulbthings' Resource Query Language. |
| sort | string Sorting expression formatted according to Bulbthings' Resource Query Language. |
object Page limit and offset to use when returning the list of results. |
const roles = await bulbthings.roles.findAll({ page: { limit: 10 } });
{- "data": [
- {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "label": "Managers",
- "description": "Managers of the company.",
- "meta": {
- "isSystem": true,
- "isReadOnly": true
}
}, - "relationships": { }
}
], - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Create a role
required | object | ||||||||||||
| |||||||||||||
{- "data": {
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "label": "Managers",
- "description": "Managers of the company.",
- "meta": {
- "isSystem": true,
- "isReadOnly": true
}
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "label": "Managers",
- "description": "Managers of the company.",
- "meta": {
- "isSystem": true,
- "isReadOnly": true
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Retrieve the details of an existing role using its unique identifier.
| id required | string <uuid> The identifier of the role to be retrieved. |
| include | string Enum: "company" "grants" "permissions" Comma-separated list of related resources to include in the response, for example: |
{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "label": "Managers",
- "description": "Managers of the company.",
- "meta": {
- "isSystem": true,
- "isReadOnly": true
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Update a role
required | object | ||||||||||||
| |||||||||||||
{- "data": {
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "label": "Managers",
- "description": "Managers of the company.",
- "meta": {
- "isSystem": true,
- "isReadOnly": true
}
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "label": "Managers",
- "description": "Managers of the company.",
- "meta": {
- "isSystem": true,
- "isReadOnly": true
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Delete a role using its unique identifier.
| id required | string <uuid> The identifier of the role to be deleted. |
{- "errors": [
- {
- "id": "string",
- "status": "string",
- "code": "string",
- "title": "string",
- "detail": "string",
- "source": {
- "pointer": "string",
- "parameter": "string"
}, - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}, - "jsonapi": {
- "version": "string",
- "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
}Returns a list of setting types.
| include | string Comma-separated list of related resources to include in the response, for example: |
object Return only specific fields in the response on a per-resource basis. Must be a comma-separated list that refers to the name(s) of the fields to be returned. For example: | |
| filter | string Filtering expression formatted according to Bulbthings' Resource Query Language. |
| group | string Aggregating expression formatted according to Bulbthings' Resource Query Language. |
| sort | string Sorting expression formatted according to Bulbthings' Resource Query Language. |
object Page limit and offset to use when returning the list of results. |
const settingTypes = await bulbthings.settingTypes.findAll({ page: { limit: 10 } });
{- "data": [
- {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "63734b19-c230-4e90-aac4-a54d936c00d3",
- "schema": {
- "title": "Do not disturb mode",
- "description": "Disable all notifications.",
- "type": "boolean",
- "example": true
}, - "meta": {
- "isSystem": false
}
}, - "relationships": { }
}
], - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Create a setting type
required | object | ||||||||||
| |||||||||||
{- "data": {
- "attributes": {
- "companyId": "63734b19-c230-4e90-aac4-a54d936c00d3",
- "schema": {
- "title": "Do not disturb mode",
- "description": "Disable all notifications.",
- "type": "boolean",
- "example": true
}, - "meta": {
- "isSystem": false
}
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "63734b19-c230-4e90-aac4-a54d936c00d3",
- "schema": {
- "title": "Do not disturb mode",
- "description": "Disable all notifications.",
- "type": "boolean",
- "example": true
}, - "meta": {
- "isSystem": false
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Retrieve the details of an existing setting type using its unique identifier.
| id required | string <uuid> The identifier of the setting type to be retrieved. |
| include | string Comma-separated list of related resources to include in the response, for example: |
{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "63734b19-c230-4e90-aac4-a54d936c00d3",
- "schema": {
- "title": "Do not disturb mode",
- "description": "Disable all notifications.",
- "type": "boolean",
- "example": true
}, - "meta": {
- "isSystem": false
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Update a setting type
required | object | ||||||||||
| |||||||||||
{- "data": {
- "attributes": {
- "companyId": "63734b19-c230-4e90-aac4-a54d936c00d3",
- "schema": {
- "title": "Do not disturb mode",
- "description": "Disable all notifications.",
- "type": "boolean",
- "example": true
}, - "meta": {
- "isSystem": false
}
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "63734b19-c230-4e90-aac4-a54d936c00d3",
- "schema": {
- "title": "Do not disturb mode",
- "description": "Disable all notifications.",
- "type": "boolean",
- "example": true
}, - "meta": {
- "isSystem": false
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Delete a setting type using its unique identifier.
| id required | string <uuid> The identifier of the setting type to be deleted. |
{- "errors": [
- {
- "id": "string",
- "status": "string",
- "code": "string",
- "title": "string",
- "detail": "string",
- "source": {
- "pointer": "string",
- "parameter": "string"
}, - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}, - "jsonapi": {
- "version": "string",
- "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
}Returns a list of settings.
| include | string Enum: "company" "account" "settingType" Comma-separated list of related resources to include in the response, for example: |
object Return only specific fields in the response on a per-resource basis. Must be a comma-separated list that refers to the name(s) of the fields to be returned. For example: | |
| filter | string Filtering expression formatted according to Bulbthings' Resource Query Language. |
| group | string Aggregating expression formatted according to Bulbthings' Resource Query Language. |
| sort | string Sorting expression formatted according to Bulbthings' Resource Query Language. |
object Page limit and offset to use when returning the list of results. |
const settings = await bulbthings.settings.findAll({ page: { limit: 10 } });
{- "data": [
- {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "accountId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "settingTypeId": "doNotDisturb",
- "value": {
- "myProperty1": true,
- "myProperty2": "test"
}
}, - "relationships": { }
}
], - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Create a setting
required | object | ||||||||||||
| |||||||||||||
{- "data": {
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "accountId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "settingTypeId": "doNotDisturb",
- "value": {
- "myProperty1": true,
- "myProperty2": "test"
}
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "accountId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "settingTypeId": "doNotDisturb",
- "value": {
- "myProperty1": true,
- "myProperty2": "test"
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Retrieve the details of an existing setting using its unique identifier.
| id required | string <uuid> The identifier of the setting to be retrieved. |
| include | string Enum: "company" "account" "settingType" Comma-separated list of related resources to include in the response, for example: |
{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "accountId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "settingTypeId": "doNotDisturb",
- "value": {
- "myProperty1": true,
- "myProperty2": "test"
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Update a setting
required | object | ||||||||||||
| |||||||||||||
{- "data": {
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "accountId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "settingTypeId": "doNotDisturb",
- "value": {
- "myProperty1": true,
- "myProperty2": "test"
}
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "accountId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "settingTypeId": "doNotDisturb",
- "value": {
- "myProperty1": true,
- "myProperty2": "test"
}
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Delete a setting using its unique identifier.
| id required | string <uuid> The identifier of the setting to be deleted. |
{- "errors": [
- {
- "id": "string",
- "status": "string",
- "code": "string",
- "title": "string",
- "detail": "string",
- "source": {
- "pointer": "string",
- "parameter": "string"
}, - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}, - "jsonapi": {
- "version": "string",
- "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
}Returns a list of unit settings.
| include | string Enum: "company" "account" "attributeType" "unit" Comma-separated list of related resources to include in the response, for example: |
object Return only specific fields in the response on a per-resource basis. Must be a comma-separated list that refers to the name(s) of the fields to be returned. For example: | |
| filter | string Filtering expression formatted according to Bulbthings' Resource Query Language. |
| group | string Aggregating expression formatted according to Bulbthings' Resource Query Language. |
| sort | string Sorting expression formatted according to Bulbthings' Resource Query Language. |
object Page limit and offset to use when returning the list of results. |
const unitSettings = await bulbthings.unitSettings.findAll({ page: { limit: 10 } });
{- "data": [
- {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "accountId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "attributeTypeId": "mileage",
- "unitId": "km"
}, - "relationships": { }
}
], - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Create a unit setting
required | object | ||||||||||||
| |||||||||||||
{- "data": {
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "accountId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "attributeTypeId": "mileage",
- "unitId": "km"
}
}
}{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "accountId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "attributeTypeId": "mileage",
- "unitId": "km"
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Retrieve the details of an existing unit setting using its unique identifier.
| id required | string <uuid> The identifier of the unit setting to be retrieved. |
| include | string Enum: "company" "account" "attributeType" "unit" Comma-separated list of related resources to include in the response, for example: |
{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "companyId": "66734b19-c230-4e90-aac4-a54d936c00d3",
- "accountId": "5ed01c63-b82e-4361-b2d8-97e19f800071",
- "attributeTypeId": "mileage",
- "unitId": "km"
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Delete a unit setting using its unique identifier.
| id required | string <uuid> The identifier of the unit setting to be deleted. |
{- "errors": [
- {
- "id": "string",
- "status": "string",
- "code": "string",
- "title": "string",
- "detail": "string",
- "source": {
- "pointer": "string",
- "parameter": "string"
}, - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}, - "jsonapi": {
- "version": "string",
- "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}
}Returns a list of unit types.
| include | string Comma-separated list of related resources to include in the response, for example: |
object Return only specific fields in the response on a per-resource basis. Must be a comma-separated list that refers to the name(s) of the fields to be returned. For example: | |
| filter | string Filtering expression formatted according to Bulbthings' Resource Query Language. |
| group | string Aggregating expression formatted according to Bulbthings' Resource Query Language. |
| sort | string Sorting expression formatted according to Bulbthings' Resource Query Language. |
object Page limit and offset to use when returning the list of results. |
const unitTypes = await bulbthings.unitTypes.findAll({ page: { limit: 10 } });
{- "data": [
- {
- "type": "string",
- "id": "string",
- "attributes": {
- "label": "Length"
}, - "relationships": { }
}
], - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Retrieve the details of an existing unit type using its unique identifier.
| id required | string <uuid> The identifier of the unit type to be retrieved. |
| include | string Comma-separated list of related resources to include in the response, for example: |
{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "label": "Length"
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Returns a list of units.
| include | string Value: "unitType" Comma-separated list of related resources to include in the response, for example: |
object Return only specific fields in the response on a per-resource basis. Must be a comma-separated list that refers to the name(s) of the fields to be returned. For example: | |
| filter | string Filtering expression formatted according to Bulbthings' Resource Query Language. |
| group | string Aggregating expression formatted according to Bulbthings' Resource Query Language. |
| sort | string Sorting expression formatted according to Bulbthings' Resource Query Language. |
object Page limit and offset to use when returning the list of results. |
const units = await bulbthings.units.findAll({ page: { limit: 10 } });
{- "data": [
- {
- "type": "string",
- "id": "string",
- "attributes": {
- "symbol": "m²",
- "label": "Square metre",
- "unitTypeId": "length",
- "isConstant": true,
- "isBaseUnit": true
}, - "relationships": { }
}
], - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}Retrieve the details of an existing unit using its unique identifier.
| id required | string <uuid> The identifier of the unit to be retrieved. |
| include | string Value: "unitType" Comma-separated list of related resources to include in the response, for example: |
{- "data": {
- "type": "string",
- "id": "string",
- "attributes": {
- "symbol": "m²",
- "label": "Square metre",
- "unitTypeId": "length",
- "isConstant": true,
- "isBaseUnit": true
}, - "relationships": { }
}, - "included": [
- {
- "type": "string",
- "id": "string",
- "attributes": { },
- "relationships": { }
}
], - "meta": {
- "offset": 0,
- "limit": 10,
- "total": 100
}
}