openapi: 3.0.3 info: contact: email: engineering@blues.io name: Blues Engineering url: https://dev.blues.io/support/ description: 'The OpenAPI definition for the Notehub.io API. ' title: Notehub alert device API version: 1.2.0 servers: - description: Production server url: https://api.notefile.net tags: - description: Device operations name: device paths: /v1/products/{productUID}/devices/{deviceUID}/environment_variables_with_pin: parameters: - $ref: '#/components/parameters/productUIDParam' - $ref: '#/components/parameters/deviceUIDParam' - $ref: '#/components/parameters/XAuthTokenHeader' get: operationId: GetDeviceEnvironmentVariablesByPin description: Get environment variables of a device with device pin authorization responses: '200': $ref: '#/components/responses/GetDeviceEnvironmentVariablesResponse' default: $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device x-custom-attributes: permission: read put: operationId: SetDeviceEnvironmentVariablesByPin description: Set environment variables of a device with device pin authorization requestBody: description: Environment variables to be added to the device required: true content: application/json: schema: $ref: '#/components/schemas/EnvironmentVariables' responses: '200': $ref: '#/components/responses/EnvironmentVariablesResponse' default: $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device x-custom-attributes: permission: update /v1/projects/{projectOrProductUID}/devices: get: operationId: GetDevices description: Get Devices of a Project parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/pageSizeParam' - $ref: '#/components/parameters/pageNumParam' - $ref: '#/components/parameters/deviceUIDParamQuery' - $ref: '#/components/parameters/tagParam' - $ref: '#/components/parameters/serialNumberParam' - $ref: '#/components/parameters/fleetUIDsQueryParam' - $ref: '#/components/parameters/notecardFirmwareParam' - $ref: '#/components/parameters/locationParam' - $ref: '#/components/parameters/hostFirmwareParam' - $ref: '#/components/parameters/productUIDQueryParam' - $ref: '#/components/parameters/skuParam' responses: '200': $ref: '#/components/responses/DevicesResponse' default: $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device x-custom-attributes: permission: read resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/devices/{deviceUID}: parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/deviceUIDParam' delete: operationId: DeleteDevice description: Delete Device responses: '204': description: Successful operation default: $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device x-custom-attributes: permission: delete resource: blues:resources:app:APPSERIAL:devices get: operationId: GetDevice description: Get Device responses: '200': description: Successful operation content: application/json: schema: $ref: '#/components/schemas/Device' default: $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device x-custom-attributes: permission: read resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/devices/{deviceUID}/disable: post: operationId: DisableDevice description: Disable Device parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/deviceUIDParam' responses: '200': description: Successful operation default: $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device x-custom-attributes: permission: update resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/devices/{deviceUID}/enable: post: operationId: EnableDevice description: Enable Device parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/deviceUIDParam' responses: '200': description: Successful operation default: $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device x-custom-attributes: permission: update resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_hierarchy: get: operationId: GetDeviceEnvironmentHierarchy summary: Get environment variable hierarchy for a device parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/deviceUIDParam' responses: '200': description: Successfully retrieved device environment hierarchy content: application/json: schema: $ref: '#/components/schemas/EnvTreeJsonNode' '404': description: Project or device not found '500': description: Server error security: - personalAccessToken: [] tags: - device x-custom-attributes: permission: read resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_variables: parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/deviceUIDParam' get: operationId: GetDeviceEnvironmentVariables description: Get environment variables of a device responses: '200': $ref: '#/components/responses/GetDeviceEnvironmentVariablesResponse' default: $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device x-custom-attributes: permission: read resource: blues:resources:app:APPSERIAL:devices put: operationId: SetDeviceEnvironmentVariables description: Set environment variables of a device requestBody: description: Environment variables to be added to the device required: true content: application/json: schema: $ref: '#/components/schemas/EnvironmentVariables' responses: '200': $ref: '#/components/responses/EnvironmentVariablesResponse' default: $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device x-custom-attributes: permission: update resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/devices/{deviceUID}/environment_variables/{key}: delete: operationId: DeleteDeviceEnvironmentVariable description: Delete environment variable of a device parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/deviceUIDParam' - name: key in: path description: The environment variable key to delete. required: true schema: type: string responses: '200': $ref: '#/components/responses/EnvironmentVariablesResponse' default: $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device x-custom-attributes: permission: delete resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/devices/{deviceUID}/files: delete: operationId: DeleteNotefiles description: Deletes Notefiles and the Notes they contain. parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/deviceUIDParam' requestBody: required: true content: application/json: schema: type: object properties: files: description: Name of notefiles to delete type: array items: type: string responses: '200': description: An empty object means success default: $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device x-custom-attributes: permission: delete resource: blues:resources:app:APPSERIAL:notefiles get: operationId: ListNotefiles description: Lists .qi and .db files for the device parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/deviceUIDParam' - name: files in: query description: One or more files to obtain change information from. required: false schema: type: array items: type: string - name: pending in: query description: show only files that are pending sync to the Notecard required: false schema: type: boolean responses: '200': description: All notefiles and their notes content: application/json: schema: $ref: '#/components/schemas/NotefileList' default: $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device x-custom-attributes: permission: read resource: blues:resources:app:APPSERIAL:notefiles /v1/projects/{projectOrProductUID}/devices/{deviceUID}/health-log: get: operationId: GetDeviceHealthLog description: Get Device Health Log parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/deviceUIDParam' - $ref: '#/components/parameters/startDateParam' - $ref: '#/components/parameters/endDateParam' - name: log_type in: query description: Return only specified log types required: false schema: type: array items: enum: - boot - dfu_completed type: string responses: '200': description: Successful operation content: application/json: schema: type: object properties: health_log: type: array items: properties: alert: type: boolean text: type: string when: type: string format: date-time required: - when - alert - text type: object required: - health_log default: $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device x-custom-attributes: permission: read resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/devices/{deviceUID}/journeys: get: operationId: GetDeviceJourneys description: 'Get the list of journeys for a device, derived from `_track.qo` events. Returns journey metadata only (no event payloads). Capped at 100 most recent journeys; `has_more` is true when the cap is hit. ' parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/deviceUIDParam' - $ref: '#/components/parameters/startDateParam' - $ref: '#/components/parameters/endDateParam' responses: '200': description: Successful operation content: application/json: schema: type: object properties: has_more: type: boolean journeys: type: array items: properties: end_date: description: Latest event time within the journey. type: string format: date-time journey_id: description: 'Identifier of the journey, taken from the `journey` field on `_track.qo` events. This value is itself a Unix timestamp marking the start of the journey. ' type: integer format: int64 start_date: description: Earliest event time within the journey. type: string format: date-time total_events: description: The number of _track.qo events in the journey. type: integer format: int64 required: - journey_id - total_events - start_date - end_date type: object required: - journeys - has_more default: $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device x-custom-attributes: permission: read resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/devices/{deviceUID}/journeys/{journeyID}: get: operationId: GetDeviceJourney description: 'Get a single journey for a device along with its `_track.qo` events. The events array is paginated via `pageSize` / `pageNum`; use `journey.has_more` to detect additional pages. ' parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/deviceUIDParam' - name: journeyID in: path description: 'Identifier of the journey, taken from the `journey` field on `_track.qo` events (a Unix timestamp marking the start of the journey). ' required: true schema: type: integer format: int64 - $ref: '#/components/parameters/pageSizeParam' - $ref: '#/components/parameters/pageNumParam' responses: '200': description: Successful operation content: application/json: schema: type: object properties: end_date: description: Latest event time within the journey. type: string format: date-time journey: description: Paginated `_track.qo` events for the journey. type: object properties: events: type: array items: $ref: '#/components/schemas/Event' has_more: type: boolean required: - events - has_more journey_id: description: Identifier of the journey. type: integer format: int64 start_date: description: Earliest event time within the journey. type: string format: date-time required: - journey_id - start_date - end_date - journey default: $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device x-custom-attributes: permission: read resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/devices/{deviceUID}/latest: get: operationId: GetDeviceLatestEvents description: Get Device Latest Events parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/deviceUIDParam' responses: '200': $ref: '#/components/responses/LatestResponse' default: $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device x-custom-attributes: permission: read resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notefiles/{notefileID}: post: operationId: CreateNotefile description: Creates an empty Notefile on the device. parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/deviceUIDParam' - $ref: '#/components/parameters/notefileIDParam' responses: '200': description: An empty object means success default: $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device x-custom-attributes: permission: create resource: blues:resources:app:APPSERIAL:notefiles /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}: get: operationId: GetNotefile description: For .qi files, returns the queued up notes. For .db files, returns all notes in the notefile parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/deviceUIDParam' - $ref: '#/components/parameters/notefileIDParam' - name: max in: query description: The maximum number of Notes to return in the request. required: false schema: type: integer - name: deleted in: query description: true to return deleted notes. required: false schema: type: boolean - name: delete in: query description: true to delete the notes returned by the request. required: false schema: type: boolean responses: '200': description: The note changes object content: application/json: schema: type: object properties: changes: description: The number of pending changes in the Notefile. type: integer notes: description: An object with a key for each note and a value object with the body of each Note and the time the Note was added. type: object total: description: The total number of notes. type: integer default: $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device x-custom-attributes: permission: read resource: blues:resources:app:APPSERIAL:notefiles post: operationId: AddQiNote description: Adds a Note to a Notefile, creating the Notefile if it doesn't yet exist. parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/deviceUIDParam' - $ref: '#/components/parameters/notefileIDParam' requestBody: description: Body or payload of note to be added to the device required: true content: application/json: schema: $ref: '#/components/schemas/NoteInput' responses: '200': description: An empty object means success default: $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device x-custom-attributes: permission: create resource: blues:resources:app:APPSERIAL:notes /v1/projects/{projectOrProductUID}/devices/{deviceUID}/notes/{notefileID}/{noteID}: delete: operationId: DeleteNote description: Delete a note from a .db or .qi notefile parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/deviceUIDParam' - $ref: '#/components/parameters/notefileIDParam' - $ref: '#/components/parameters/noteIDParam' responses: '200': description: An empty object means success default: $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device x-custom-attributes: permission: delete resource: blues:resources:app:APPSERIAL:notes get: operationId: GetDbNote description: Get a note from a .db or .qi notefile parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/deviceUIDParam' - $ref: '#/components/parameters/notefileIDParam' - $ref: '#/components/parameters/noteIDParam' - name: delete in: query description: Whether to delete the note from the DB notefile required: false schema: type: boolean - name: deleted in: query description: Whether to return deleted notes required: false schema: type: boolean responses: '200': description: The requested note content: application/json: schema: type: object properties: body: description: The note body type: object payload: description: The note payload type: string time: description: The time the Note was added to the Notecard or Notehub type: integer default: $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device x-custom-attributes: permission: read resource: blues:resources:app:APPSERIAL:notes post: operationId: AddDbNote description: Add a Note to a .db notefile. if noteID is '-' then payload is ignored and empty notefile is created parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/deviceUIDParam' - $ref: '#/components/parameters/notefileIDParam' - $ref: '#/components/parameters/noteIDParam' requestBody: description: Body or payload of note to be added to the device required: true content: application/json: schema: $ref: '#/components/schemas/NoteInput' responses: '200': description: An empty object means success default: $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device x-custom-attributes: permission: create resource: blues:resources:app:APPSERIAL:notes put: operationId: UpdateDbNote description: Update a note in a .db or .qi notefile parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/deviceUIDParam' - $ref: '#/components/parameters/notefileIDParam' - $ref: '#/components/parameters/noteIDParam' requestBody: description: Body or payload of note to be added to the device required: true content: application/json: schema: $ref: '#/components/schemas/NoteInput' responses: '200': description: An empty object means success default: $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device x-custom-attributes: permission: update resource: blues:resources:app:APPSERIAL:notes /v1/projects/{projectOrProductUID}/devices/{deviceUID}/plans: parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/deviceUIDParam' get: operationId: GetDevicePlans description: Get Data Plans associated with the device, this include the primary sim, any external sim, as well as any satellite connections. responses: '200': $ref: '#/components/responses/DevicePlansResponse' default: $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device x-custom-attributes: permission: read resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/devices/{deviceUID}/provision: post: operationId: ProvisionDevice description: Provision Device for a Project parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/deviceUIDParam' requestBody: description: Provision a device to a specific ProductUID required: true content: application/json: schema: type: object properties: device_sn: description: The serial number to assign to the device. type: string fleet_uids: description: The fleetUIDs to provision the device to. type: array items: type: string nullable: true product_uid: description: The ProductUID that the device should use. type: string required: - product_uid responses: '200': description: Successful operation content: application/json: schema: type: object default: {} default: $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device x-custom-attributes: permission: create resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/devices/{deviceUID}/public-key: get: operationId: GetDevicePublicKey description: Get Device Public Key parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/deviceUIDParam' responses: '200': description: Successful operation content: application/json: schema: type: object properties: key: type: string uid: type: string required: - uid - key default: $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device x-custom-attributes: permission: read resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/devices/{deviceUID}/sessions: get: operationId: GetDeviceSessions description: Get Device Sessions parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/deviceUIDParam' - $ref: '#/components/parameters/pageSizeParam' - $ref: '#/components/parameters/pageNumParam' - $ref: '#/components/parameters/startDateParam' - $ref: '#/components/parameters/endDateParam' - $ref: '#/components/parameters/firstSyncParam' responses: '200': $ref: '#/components/responses/SessionResponse' default: $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device x-custom-attributes: permission: read resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/devices/{deviceUID}/signal: post: operationId: SignalDevice description: Send a signal from Notehub to a Notecard. parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/deviceUIDParam' requestBody: description: Body or payload of signal to be sent to the device required: true content: application/json: schema: $ref: '#/components/schemas/Body' responses: '200': description: A status response. content: application/json: schema: type: object properties: connected: description: true if the Notecard is connected to Notehub. type: boolean default: $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device x-custom-attributes: permission: create resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/devices/public-keys: get: operationId: GetDevicePublicKeys description: Get Device Public Keys of a Project parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/pageSizeParam' - $ref: '#/components/parameters/pageNumParam' responses: '200': description: Successful operation content: application/json: schema: type: object properties: device_public_keys: type: array items: properties: key: type: string uid: type: string type: object has_more: type: boolean required: - device_public_keys - has_more default: $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device x-custom-attributes: permission: read resource: blues:resources:app:APPSERIAL:devices /v1/projects/{projectOrProductUID}/fleets/{fleetUID}/devices: get: operationId: GetFleetDevices description: Get Devices of a Fleet within a Project parameters: - $ref: '#/components/parameters/projectOrProductUIDParam' - $ref: '#/components/parameters/fleetUIDParam' - $ref: '#/components/parameters/pageSizeParam' - $ref: '#/components/parameters/pageNumParam' - $ref: '#/components/parameters/deviceUIDParamQuery' - $ref: '#/components/parameters/tagParam' - $ref: '#/components/parameters/serialNumberParam' - $ref: '#/components/parameters/notecardFirmwareParam' - $ref: '#/components/parameters/locationParam' - $ref: '#/components/parameters/hostFirmwareParam' - $ref: '#/components/parameters/productUIDQueryParam' - $ref: '#/components/parameters/skuParam' responses: '200': $ref: '#/components/responses/DevicesResponse' default: $ref: '#/components/responses/ErrorResponse' security: - personalAccessToken: [] tags: - device x-custom-attributes: permission: read resource: blues:resources:app:APPSERIAL:devices components: schemas: Note: type: object properties: body: description: Arbitrary user-defined JSON for the note. type: object additionalProperties: true edge: description: True if originated from an edge source. type: boolean id: description: Note name/identifier (e.g., "1:435", "my_note"). type: string payload: description: Optional base64-encoded payload. type: string format: byte pending: description: True if the note is pending delivery or processing. type: boolean time: description: Unix epoch seconds. type: integer format: int64 where: description: Optional location/metadata string. type: string required: - id - body - time TowerLocation: type: object properties: c: description: Country code type: string cid: description: Cell ID type: integer l: description: Open Location Code type: string lac: description: Location Area Code type: integer lat: description: Latitude type: number format: double lon: description: Longitude type: number format: double mcc: description: Mobile Country Code type: integer mnc: description: Mobile Network Code type: integer n: description: Name of the location type: string source: description: The source of this location type: string time: description: Unix timestamp when this location was ascertained type: integer format: int64 towers: description: Number of triangulation points type: integer z: description: Timezone ID type: integer zone: description: Timezone name type: string DeviceSession: type: object properties: apn: type: string bars: type: integer format: int bearer: type: string bssid: type: string cell: description: Cell ID where the session originated and quality ("mcc,mnc,lac,cellid") type: string continuous: description: Was this a continuous connection? type: boolean device: description: Device UID type: string events: description: Number of events routed type: integer format: int64 failed_connects: description: Number of failed connection attempts in the prior session type: integer format: int64 fleets: description: Array of Fleet UIDs type: array items: type: string hp_cycles_data: type: integer format: int64 hp_cycles_gps: type: integer format: int64 hp_cycles_total: type: integer format: int64 hp_secs_data: type: integer format: int64 hp_secs_gps: type: integer format: int64 hp_secs_total: description: Total number of seconds in high power mode type: integer format: int64 iccid: type: string ip: type: string moved: type: integer format: int64 orientation: type: string penalty_secs: description: Number of seconds in penalty in the prior session type: integer format: int64 period: $ref: '#/components/schemas/DeviceUsage' power_charging: type: boolean power_mah: type: number format: double power_primary: type: boolean power_usb: type: boolean product: description: Product UID type: string rat: type: string rsrp: type: integer format: int rsrq: type: integer format: int rssi: type: integer format: int scan: type: string format: byte session: description: Session UID type: string session_began: description: UNIX timestamp of session start type: integer format: int64 session_ended: description: UNIX timestamp of session end type: integer format: int64 sinr: type: integer format: int sn: description: Device Serial Number type: string ssid: type: string temp: type: number format: double tls: description: Was TLS used? type: boolean tower: $ref: '#/components/schemas/TowerLocation' transport: description: Type of network transport type: string tri: $ref: '#/components/schemas/TowerLocation' triangulate: type: object usage_actual: type: boolean voltage: type: number format: double when: description: Last known capture time of a note routed through this session in Unix timestamp type: integer format: int64 where: description: Open Location Code from last GPS location type: string where_country: type: string where_lat: type: number format: double where_location: type: string where_lon: type: number format: double where_timezone: type: string where_when: description: Unix timestamp of last GPS location type: integer format: int64 why_session_closed: description: Reason for session closing type: string why_session_opened: description: Reason for session opening type: string work: description: Unix timestamp of the last time work was done for this session type: integer format: int64 DFUEnv: type: object properties: card: $ref: '#/components/schemas/DFUState' user: $ref: '#/components/schemas/DFUState' nullable: true Error: type: object properties: code: description: The HTTP error code associated with the error. type: integer maximum: 599 minimum: 300 debug: type: string details: type: object err: description: Human readable error message. type: string request: type: string status: description: Machine readable representation of the HTTP error code. type: string required: - err - code - status DataUsage: type: object properties: kb_remaining: description: Kilobytes remaining in the plan type: number format: double example: 372.55 kb_total: description: Total Kilobytes included in the plan type: number format: double example: 500 kb_used: description: Kilobytes used to date type: number format: double example: 127.45 required: - kb_total - kb_used - kb_remaining Location: type: object properties: country: type: string latitude: type: number format: double longitude: type: number format: double name: type: string timezone: type: string when: type: string nullable: true required: - when - name - country - timezone - latitude - longitude NoteInput: type: object properties: body: description: Arbitrary user-defined JSON for the note. type: object additionalProperties: true payload: description: Optional base64-encoded payload. type: string format: byte Notefile: type: object properties: id: description: Notefile id (e.g., "test.qi", "config.db"). type: string notes: type: array items: $ref: '#/components/schemas/Note' minItems: 0 template: type: string required: - id - notes EnvironmentVariables: type: object properties: environment_variables: type: object additionalProperties: type: string required: - environment_variables DFUState: type: object properties: began: description: The time when the DFU began type: number crc32: description: Used for image verification type: number errors: description: The number of consecutive errors the DFU process has encountered type: number file: description: Firmware filename type: string length: description: Length of firmware file type: number md5: description: Used for image verification type: string mode: description: '* "idle" - nothing downloading or downloaded * "error" - halted and in the error state * "downloading" - transferring data from cloud to module * "sideloading" - transferring data via request to module * "ready" - DFU data is ready/verified and waiting on external storage * "ready-retry" - DFU data is ready/verified and retrying * "updating" - currently updating * "completed" - DFU is done successfully ' type: string enum: - idle - error - downloading - sideloading - ready - ready-retry - updating - completed read: description: The amount the notecard has read of the image from notehub type: number retry: description: Value of _fw_retry environment var at time of DFU initialization type: number status: description: Status message type: string type: type: string enum: - card - user updated: description: Last updated timestamp type: number version: description: Last known version, which is generally a JSON object contained within the firmware image type: string nullable: true DeviceUsage: type: object properties: bytes_rcvd: type: integer format: int64 bytes_rcvd_secondary: type: integer format: int64 bytes_sent: type: integer format: int64 bytes_sent_secondary: type: integer format: int64 duration: description: Duration in seconds type: integer format: int64 notes_rcvd: type: integer format: int64 notes_sent: type: integer format: int64 sessions_tcp: type: integer format: int64 sessions_tls: type: integer format: int64 since: description: Unix timestamp type: integer format: int64 CellularPlan: type: object properties: activated: description: Unix timestamp of when the SIM was activated type: integer format: int64 example: 1656010061 data_usage: $ref: '#/components/schemas/DataUsage' expires_at: type: integer format: int64 iccid: description: The Integrated Circuit Card Identifier of the SIM card type: string example: '345678432765434567890765746354465786' imsi: description: IMSI of the SIM card type: string example: '310170830688975' last_updated: description: Time this plan information was last updated type: integer format: int64 example: 1656010061 lifetime_used: description: Total bytes used by this SIM type: integer format: int64 plan_type: description: Description of the SIM plan type including data allowance, region, and validity period type: string example: 500MB, North America, 10-year lifetime Body: type: object properties: body: type: object Event: type: object properties: app: description: App UID (globally unique) type: string bars: description: Bars. Only available on _session.qo events. type: number best_country: description: Country type: string best_id: description: The device serial number, or the DeviceUID if the serial number is not set type: string best_lat: description: Latitude type: number format: double best_location: description: Location type: string best_location_type: description: One of "gps", "triangulated", or "tower" type: string best_location_when: description: Unix timestamp type: number best_lon: description: Longitude type: number format: double best_timezone: description: Timezone type: string body: description: A JSON object containing event details type: object bssid: description: BSSID. Only available on _session.qo events. type: string device: description: Device UID (globally unique) type: string environment: description: Routed environment variables beginning with "$". Only available on _session.qo events. type: object event: description: Event UID (globally unique) type: string file: description: The notefile associated with this event type: string moved: description: The number of times the device was sensed to have moved between the last session and this session. Only available on _session.qo events. type: number note: description: The note ID in the notefile type: string ordering_code: description: Ordering code. Only available on _session.qo events. type: string orientation: description: The orientation of the device. Only available on _session.qo events. type: string payload: description: A base64-encoded binary payload type: string product: description: Product UID (globally unique) type: string rat: description: Rat. Only available on _session.qo events. type: string received: description: The unix timestamp when the event was received type: number format: double req: description: The notecard request type: string rsrp: description: RSRP. Only available on _session.qo events. type: number rsrq: description: RSRQ. Only available on _session.qo events. type: number rssi: description: Received Signal Strength Indicator (RSSI) is an estimated measurement of how well a device can receive signals. Only available on _session.qo events. type: number session: description: Session UID (globally unique) type: string sinr: description: SINR. Only available on _session.qo events. type: number sku: description: SKU. Only available on _session.qo events. type: string sn: description: The device serial number type: string ssid: description: SSID. Only available on _session.qo events. type: string temp: description: Device temperature. Only available on _session.qo events. type: number format: double tls: description: Whether TLS was used on the connection between the device and notehub. Only available on _session.qo events. type: boolean tower_country: description: Country type: string tower_id: description: Tower ID type: string tower_lat: description: Latitude type: number format: double tower_location: description: Location type: string tower_lon: description: Longitude type: number format: double tower_timezone: description: Timezone type: string tower_when: description: Unix timestamp type: number transport: description: The transport used for this event, e.g., "cellular", "wifi", ", etc. type: string tri_country: description: Country type: string tri_lat: description: Latitude type: number format: double tri_location: description: Location type: string tri_lon: description: Longitude type: number format: double tri_points: description: Triangulation points type: number tri_timezone: description: Timezone type: string tri_when: description: Unix timestamp type: number updates: type: number voltage: description: Device voltage. Only available on _session.qo events. type: number format: double when: description: When the event was captured on the device type: number where_country: description: Country type: string where_lat: description: Latitude type: number format: double where_location: description: Location type: string where_lon: description: Longitude type: number format: double where_olc: description: Open Location Code type: string where_timezone: description: Timezone type: string where_when: description: Unix timestamp type: number EnvTreeJsonNode: type: object properties: app_label: type: string app_uid: type: string children: type: array items: $ref: '#/components/schemas/EnvTreeJsonNode' device_uid: type: string fleet_label: type: string fleet_uid: type: string inherited_var_count: type: integer type: type: string url: type: string format: uri var_count: type: integer variables: type: array items: $ref: '#/components/schemas/EnvVar' required: - var_count - inherited_var_count - type - variables - children Contact: type: object properties: email: type: string name: type: string organization: type: string role: type: string nullable: true CellularUsage: type: array items: $ref: '#/components/schemas/SimUsage' properties: {} EnvVar: type: object properties: key: type: string precedence: type: integer used: type: boolean value: type: string SimUsage: type: object properties: iccid: description: ICCID of the SIM card type: string last_updated: description: Time this usage information was last updated type: integer format: int64 lifetime_used: description: Total number of bytes used by SIM type: integer format: int64 limit: description: Limit in bytes of the SIMs current data plan type: integer format: int64 used: description: Bytes used on the SIMs current data plan type: integer format: int64 NotefileList: description: Array of notefiles, each containing its notes. type: array items: $ref: '#/components/schemas/Notefile' properties: {} Device: type: object properties: best_location: $ref: '#/components/schemas/Location' cellular_usage: $ref: '#/components/schemas/CellularUsage' contact: $ref: '#/components/schemas/Contact' dfu: $ref: '#/components/schemas/DFUEnv' disabled: type: boolean firmware_host: type: string firmware_notecard: type: string fleet_uids: type: array items: type: string gps_location: $ref: '#/components/schemas/Location' last_activity: type: string format: date-time nullable: true product_uid: type: string provisioned: type: string format: date-time serial_number: type: string sku: type: string temperature: type: number format: double tower_info: type: object nullable: true properties: cell_id: type: integer lac: type: integer mcc: type: integer mnc: type: integer tower_location: $ref: '#/components/schemas/Location' triangulated_location: $ref: '#/components/schemas/Location' uid: type: string voltage: type: number format: double required: - uid - provisioned - product_uid - fleet_uids - voltage - temperature parameters: notefileIDParam: in: path name: notefileID required: true schema: type: string hostFirmwareParam: description: Host firmware filter explode: true in: query name: hostFirmware required: false schema: type: array items: type: string style: form firstSyncParam: description: When true, filters results to only show first sync sessions in: query name: firstSync required: false schema: type: boolean default: false fleetUIDsQueryParam: in: query name: fleetUID required: false schema: type: array items: type: string startDateParam: description: Start date for filtering results, specified as a Unix timestamp example: 1628631763 in: query name: startDate required: false schema: type: integer minimum: 0 serialNumberParam: description: Serial number filter explode: true in: query name: serialNumber required: false schema: type: array items: type: string style: form noteIDParam: in: path name: noteID required: true schema: type: string locationParam: description: Location filter explode: true in: query name: location required: false schema: type: array items: type: string style: form pageNumParam: in: query name: pageNum required: false schema: type: integer default: 1 minimum: 1 fleetUIDParam: in: path name: fleetUID required: true schema: type: string deviceUIDParamQuery: description: A Device UID. explode: true in: query name: deviceUID required: false schema: type: array items: type: string style: form endDateParam: description: End date for filtering results, specified as a Unix timestamp example: 1657894210 in: query name: endDate required: false schema: type: integer minimum: 0 notecardFirmwareParam: description: Firmware version filter explode: true in: query name: notecardFirmware required: false schema: type: array items: type: string style: form XAuthTokenHeader: description: For accessing endpoints by Device pin. in: header name: X-Auth-Token required: true schema: type: string pageSizeParam: in: query name: pageSize required: false schema: type: integer default: 50 maximum: 10000 minimum: 1 skuParam: description: SKU filter explode: true in: query name: sku required: false schema: type: array items: type: string style: form deviceUIDParam: example: dev:000000000000000 in: path name: deviceUID required: true schema: type: string tagParam: description: Tag filter explode: true in: query name: tag required: false schema: type: array items: type: string style: form projectOrProductUIDParam: example: app:2606f411-dea6-44a0-9743-1130f57d77d8 in: path name: projectOrProductUID required: true schema: type: string productUIDParam: example: com.blues.bridge:sensors in: path name: productUID required: true schema: type: string productUIDQueryParam: explode: true in: query name: productUID required: false schema: type: array items: type: string style: form responses: DevicesResponse: description: List of Devices content: application/json: schema: type: object properties: devices: type: array items: $ref: '#/components/schemas/Device' has_more: type: boolean required: - devices - has_more DevicePlansResponse: description: Response body for /plans content: application/json: schema: type: object properties: cellular_plans: type: array items: $ref: '#/components/schemas/CellularPlan' nullable: true SessionResponse: description: The response body for a session request. content: application/json: schema: type: object properties: has_more: type: boolean sessions: type: array items: $ref: '#/components/schemas/DeviceSession' required: - sessions - has_more example: has_more: true sessions: - apn: a-notehub.com.attz bars: 2 bearer: LTE FDD cell: 310,410,17169,77315594 continuous: true device: dev:000000000000000 events: 14 fleets: - fleet:46be9834-5te6-42c1-0000-b5ea05e248d7 hp_cycles_data: 3 hp_cycles_total: 3 hp_secs_data: 7659 hp_secs_total: 7659 iccid: '89011704278500000000' ip: 10.68.56.193 moved: 1667250807 orientation: face-up period: bytes_rcvd: 2501 bytes_sent: 4138 duration: 215 notes_sent: 12 sessions_tls: 1 since: 1667250832 product: product:com.blues.demo:project rat: lte rsrp: -91 rsrq: -13 rssi: -61 session: d76689be-37cd-423c-b695-7e0c19a2a264 sinr: 183 temp: 24.437 tls: true tower: c: US cid: 77315594 count: 7 l: 86MG3HF5+P25 lac: 17169 lat: 43.0742625 lon: -89.44239062499999 mcc: 310 mnc: 410 n: Shorewood Hills WI time: 1667250835 towers: 1 zone: America/Chicago tri: {} trigger: first sync; continuous connection mode voltage: 4.174 when: 1667251044 work: 1667251046 ErrorResponse: description: The response body in case of an API error. content: application/json: schema: type: '' properties: {} $ref: '#/components/schemas/Error' EnvironmentVariablesResponse: description: The response body from an environment variables request. content: application/json: schema: type: '' properties: {} $ref: '#/components/schemas/EnvironmentVariables' LatestResponse: description: The response body for a Latest Events request. content: application/json: schema: type: object properties: latest_events: description: The set of latest events. Will always include the current "session.begin" event. type: array items: $ref: '#/components/schemas/Event' example: latest_events: - app: app:2e49f10a-76a9-4e2d-8b18-cef0b8b46446 body: why: sensors.qo requested sync (sensors.qo) (TLS) device: dev:864475040523995 event: 81bd2bf1-0399-4978-bc46-8f779b4af350 file: _session.qo product: product:com.blues.app:myapp received: 1669667707.564694 req: session.begin session: ed18884b-f2a6-419f-b856-d28dc8f0892b tls: true tower_country: US tower_id: 310,410,20483,184692495 tower_lat: 43.769062500000004 tower_location: Waverly MI tower_lon: -83.657359375 tower_timezone: America/Detroit tower_when: 1669667691 when: 1669667707 - app: app:2e49f10a-76a9-4e2d-8b18-cef0b8b46446 body: humid: 56.23 temp: 35.5 device: dev:864475040523995 event: 916d4c81-06ae-4263-9b55-7a3a0f73cb5a file: data.qo product: product:com.blues.app:myapp received: 1669667713.221659 req: note.add session: 28cdc39f-9f62-4789-b0a3-2f35f9448ced sn: tj-1 tower_country: US tower_id: 310,410,20483,184692495 tower_lat: 43.769062500000004 tower_location: Waverly MI tower_lon: -83.657359375 tower_timezone: America/Detroit tower_when: 1669667677 when: 1669667689 - app: app:2e49f10a-76a9-4e2d-8b18-cef0b8b46446 body: humidity: 69.88647200683693 pressure: 993.6294496104914 temp: 21.273027181770885 device: dev:864475040523995 event: e98c2c3b-edbe-4fe7-af57-2196cc843eb7 file: sensors.qo product: product:com.blues.app:myapp received: 1669667711.85316 req: note.add session: 7211392c-6895-43f8-9256-790655348be5 tower_country: US tower_id: 310,410,20483,184692496 tower_lat: 43.747037500000005 tower_location: Waverly MI tower_lon: -83.665859375 tower_timezone: America/Detroit tower_when: 1669667689 when: 1669667695 GetDeviceEnvironmentVariablesResponse: description: The response body from a get device environment variables request. content: application/json: schema: type: object properties: environment_variables: description: The environment variables for this device that have been set using host firmware or the Notehub API or UI. type: object additionalProperties: type: string environment_variables_effective: description: The environment variables as they will be seen by the device, fully resolved with project/fleet/device prioritization rules. type: object additionalProperties: type: string environment_variables_env_default: description: The environment variables that have been set using the env.default request through the Notecard API. type: object additionalProperties: type: string required: - environment_variables - environment_variables_env_default securitySchemes: personalAccessToken: description: 'Use a personal access token from notehub.io/api-access ' scheme: bearer type: http externalDocs: description: Find out more about Blues url: https://blues.io