Skip to content

Create device trigger​

POST
/devices/{id}/notificationTriggers

Authorizations​

ApiKeyAuth

API Key for authentication. Retrieval from either API version login routes, or other authentication token type. See Authentication for more details.

Type
API Key (header: Authorization)
Example"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

Parameters​

Path Parameters

id*

device id

Type
number
Required
Format
"integer"

Request Body​

JSON
{
  
"name": "string",
  
"type": "string",
  
"parameters": {
  
},
  
"muteFor": 0,
  
"lastTriggered": "string",
  
"delivery": {
  
},
  
"id": 0,
  
"deviceId": 0,
  
"userId": 0
}

Request example

Responses​

Body (JSON)

application/json
JSON
{
  
"name": "string",
  
"type": "string",
  
"parameters": {
  
},
  
"muteFor": 0,
  
"lastTriggered": "string",
  
"delivery": {
  
},
  
"id": 0,
  
"deviceId": 0,
  
"userId": 0
}
Try this endpoint

Playground​

Authorization
Variables
Key
Value
Body

OpenAPI definition ​

References are expanded below, except recursive definitions and references with sibling fields. Documentation overrides are included. Full original OpenAPI spec (JSON).

View endpoint OpenAPI definition
yaml
openapi: 3.1.0
info:
  version: 1.1.0
  title: TrackingAPI
  description: V1 API for retrieving tracking data and changing settings on Lightbug devices
servers:
  - url: https://api.lightbug.cloud/api
externalDocs: {}
security:
  - ApiKeyAuth: []
tags: []
paths:
  /devices/{id}/notificationTriggers:
    post:
      tags:
        - notifications
      summary: Create device trigger
      parameters:
        - name: id
          in: path
          description: device id
          required: true
          schema:
            type: number
            format: integer
requestBody:
yaml
        content:
          application/json:
            schema:
              properties:
                name:
                  type: string
                type:
                  type: string
                  enum:
                    - lowBat
                    - button
                    - expiresDaily
                    - expiresWeekly
                    - geofence
                    - newLoc
                    - newWakeLoc
                    - acc
                    - newReading
                    - speed
                    - distance
                    - alertMode
                    - temp
                    - temp_bme
                    - humidity
                    - pressure
                    - extAccel
                    - geoEntry
                    - proximity
                parameters:
                  type: object
                muteFor:
                  default: 0
                  type: number
                  format: ''
                lastTriggered:
                  type: string
                  format: date-time
                delivery:
                  default:
                    push: true
                    email: false
                  type: object
                id:
                  type: number
                  format: ''
                deviceId:
                  type: number
                  format: ''
                userId:
                  type: number
                  format: ''
              required:
                - name
                - type
                - muteFor
                - delivery
              type: object
          application/x-www-form-urlencoded:
            schema:
              properties:
                name:
                  type: string
                type:
                  type: string
                  enum:
                    - lowBat
                    - button
                    - expiresDaily
                    - expiresWeekly
                    - geofence
                    - newLoc
                    - newWakeLoc
                    - acc
                    - newReading
                    - speed
                    - distance
                    - alertMode
                    - temp
                    - temp_bme
                    - humidity
                    - pressure
                    - extAccel
                    - geoEntry
                    - proximity
                parameters:
                  type: object
                muteFor:
                  default: 0
                  type: number
                  format: ''
                lastTriggered:
                  type: string
                  format: date-time
                delivery:
                  default:
                    push: true
                    email: false
                  type: object
                id:
                  type: number
                  format: ''
                deviceId:
                  type: number
                  format: ''
                userId:
                  type: number
                  format: ''
              required:
                - name
                - type
                - muteFor
                - delivery
              type: object
          application/xml:
            schema:
              properties:
                name:
                  type: string
                type:
                  type: string
                  enum:
                    - lowBat
                    - button
                    - expiresDaily
                    - expiresWeekly
                    - geofence
                    - newLoc
                    - newWakeLoc
                    - acc
                    - newReading
                    - speed
                    - distance
                    - alertMode
                    - temp
                    - temp_bme
                    - humidity
                    - pressure
                    - extAccel
                    - geoEntry
                    - proximity
                parameters:
                  type: object
                muteFor:
                  default: 0
                  type: number
                  format: ''
                lastTriggered:
                  type: string
                  format: date-time
                delivery:
                  default:
                    push: true
                    email: false
                  type: object
                id:
                  type: number
                  format: ''
                deviceId:
                  type: number
                  format: ''
                userId:
                  type: number
                  format: ''
              required:
                - name
                - type
                - muteFor
                - delivery
              type: object
          text/xml:
            schema:
              properties:
                name:
                  type: string
                type:
                  type: string
                  enum:
                    - lowBat
                    - button
                    - expiresDaily
                    - expiresWeekly
                    - geofence
                    - newLoc
                    - newWakeLoc
                    - acc
                    - newReading
                    - speed
                    - distance
                    - alertMode
                    - temp
                    - temp_bme
                    - humidity
                    - pressure
                    - extAccel
                    - geoEntry
                    - proximity
                parameters:
                  type: object
                muteFor:
                  default: 0
                  type: number
                  format: ''
                lastTriggered:
                  type: string
                  format: date-time
                delivery:
                  default:
                    push: true
                    email: false
                  type: object
                id:
                  type: number
                  format: ''
                deviceId:
                  type: number
                  format: ''
                userId:
                  type: number
                  format: ''
              required:
                - name
                - type
                - muteFor
                - delivery
              type: object
        description: Body (JSON)
yaml
      responses:
'200':
yaml
          description: Body (JSON)
          content:
            application/json:
              schema:
                properties:
                  name:
                    type: string
                  type:
                    type: string
                    enum:
                      - lowBat
                      - button
                      - expiresDaily
                      - expiresWeekly
                      - geofence
                      - newLoc
                      - newWakeLoc
                      - acc
                      - newReading
                      - speed
                      - distance
                      - alertMode
                      - temp
                      - temp_bme
                      - humidity
                      - pressure
                      - extAccel
                      - geoEntry
                      - proximity
                  parameters:
                    type: object
                  muteFor:
                    default: 0
                    type: number
                    format: ''
                  lastTriggered:
                    type: string
                    format: date-time
                  delivery:
                    default:
                      push: true
                      email: false
                    type: object
                  id:
                    type: number
                    format: ''
                  deviceId:
                    type: number
                    format: ''
                  userId:
                    type: number
                    format: ''
                required:
                  - name
                  - type
                  - muteFor
                  - delivery
                type: object
yaml
      deprecated: false
      security:
        - ApiKeyAuth: []
      operationId: post-devices-id-notificationTriggers
components:
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: Authorization
      type: apiKey
      description: API Key for authentication. Retrieval from either API version login routes, or other authentication token type. See <a href='/apis/authentication'>Authentication</a> for more details.
      example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...