openapi: 3.1.0
info:
  title: TagoIO API
  description: >-
    #### **How to use this documentation**

    The documentation is split by which token you're required to use in the
    request.  

    TagoIO provides 4 different tokens:

    - **Device-Token**: The token from your device, which you can get from the
    device's page.
        
    - **Profile-Token**: Also know as Account-Token. You get from your profile
    settings page.
        
    - **Network-Token**: Is the token from your Network. Only available if
    you're owner of the network in your integrations page.
        
    - **Analysis-Token:** The token from your analysis, available in the
    analysis page.

    ---

    #### Setting the API Endpoint Region

    When making a request to the TagoIO API, you must also specify the
    appropriate regional endpoint. Choose one of the following endpoints based
    on your geographical region:


    - **United States East 1:**  
        Use this endpoint when your application is based in the eastern United States.  
        **URL:** `https://api.us-e1.tago.io/`
        
    - **Europe West 1:**  
        Use this endpoint when your application is based in Western Europe.  
        **URL:** `https://api.eu-w1.tago.io/`

    - **Tago Deploy:**  
      You should use your own API URL that is available in your Domains section of the TagoDeploy.
  version: 1.0.0
  contact: {}

components:
  securitySchemes:
    Device-Token:
      type: apiKey
      description: >-
        A Device-Token that is unique to your device. Generate a token by
        accessing your Device's page.
      name: Device-Token
      in: header
      x-example: 5e12345a-d70a-4e2d-b83d-5c0123456789
    Network-Token:
      type: apiKey
      description: >-
        A Network Token that is unique to your Network. Access Integrations >
        Network > Tokens to generate a token for your Network.
      name: Token
      in: header
      x-DisplayName: Network-Token
      x-example: fd549ad2-813c-4d66-bf72-508e5b98afe3
    Profile-Token:
      type: apiKey
      description: >-
        A Profile token that is unique to your entire profile. Generate in your
        account settings.
      name: Profile-Token
      in: header
      x-example: a15ea5ea-dd2d-4c63-8945-92b54da4772a

  schemas:
    DeviceDataItem:
      type: object
      required: [variable]
      properties:
        variable:
          type: string
          example: location
        location:
          type: object
          properties:
            lat:
              type: number
              example: 35.770723
            lng:
              type: number
              example: -78.677328
        value:
          type: string
          example: TagoIO Headquarters
        time:
          type: string
          description: ISO 8601 string or Unix timestamp
          example: "2023-12-01T12:34:56.000Z"
        group:
          type: string
          description: Unique grouping ID for your data. Widgets often group by this.
        unit:
          type: string
          example: "%"
          description: Provide a unit of measurement to the data. Most widgets will display the unit.
        metadata:
          type: object
          description: Can be attached to the data to influence widget behavior and store additional information.
          additionalProperties: true
          example:
            color: red
            icon: car

    DeviceData:
      description: |
        Accepts a single item or an array of items when sent as application/json.
        For text/plain content, use the [Payload Parser](/docs/tagoio/devices/payload-parser/) to normalize the data into TagoIO JSON format.
      oneOf:
        - $ref: "#/components/schemas/DeviceDataItem"
        - $ref: "#/components/schemas/DeviceDataArray"
    DeviceDataArray:
      type: array
      items:
        $ref: "#/components/schemas/DeviceDataItem"
      description: Accepts a single item or an array of items.
    NetworkDeviceData:
      type: object
      required: [variable]
      properties:
        variable:
          type: string
          example: payload
        value:
          type: string
          description: Hexadecimal string payload
          example: "41BC7E1F2A"
        metadata:
          type: object
          properties:
            serial:
              type: string
              description: Device serial number
              example: "SN123456789"
          additionalProperties: false
      description: Network device data format with payload and serial metadata.
  requestBodies:
    DeviceDataBody:
      required: true
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/DeviceData"
          examples:
            Send data (object):
              value:
                variable: location
                value: TagoIO Headquarters
                location:
                  lat: 35.770723
                  lng: -78.677328
            Send data (array):
              value:
                - variable: location
                  value: TagoIO Headquarters
                  location:
                    lat: 35.770723
                    lng: -78.677328
                - variable: location
                  value: New York Office
                  location:
                    lat: 40.712776
                    lng: -74.005974
        text/plain:
          schema:
            type: string
            description: Raw text data that will be processed by the device's Payload Parser to normalize into TagoIO JSON format.
          examples:
            Raw sensor data:
              value: "temperature:23.5,humidity:45.2,battery:87"
            HEX payload:
              value: "41BC7E1F2A"
            Custom format:
              value: "sensor_id=123&temp=25.6&status=ok"

  parameters:
    DeleteFilterQty:
      name: qty
      in: query
      description: Quantity of data records to delete. Default is 15.
      schema:
        type: integer
        minimum: 1
        default: 15
        example: 20
    DeleteFilterOrdination:
      name: ordination
      in: query
      description: Sort direction. Default is descending.
      schema:
        type: string
        enum: [ascending, descending]
        default: descending
        example: descending
    DeleteFilterSkip:
      name: skip
      in: query
      description: Number of items to skip (pagination).
      schema:
        type: integer
        minimum: 0
        example: 15
    DeleteFilterVariables:
      name: variables
      in: query
      description: Filter data by variable.
      schema:
        type: string
        example: temperature
    DeleteFilterValues:
      name: values
      in: query
      description: Filter data by value. Accepts single or multiple values.
      schema:
        type: string
        items:
          type: string
        example: "12"
    DeleteFilterIds:
      name: ids
      in: query
      description: Filter data by id. Accepts single or multiple values.
      schema:
        type: string
        items:
          type: string
        example: "6144a25e280ad80019688e689"
    DeleteFilterGroups:
      name: groups
      in: query
      description: |
        Filter data by group. Accepts single or multiple values.
        For multiple, send `groups[0]=foo&groups[1]=bar`.
      schema:
        type: string
        items:
          type: string
        example: "16731887966346"
    authorization_token:
      name: authorization_token
      in: query
      required: true
      description: |
        Authorization_Token
      schema:
        type: string
        example: "at72fb69a8dc714059b6cebee41693eb0"

servers:
  - url: "https://api.us-e1.tago.io"
  - url: "https://api.eu-w1.tago.io"

security:
  - ProfileToken: []

tags:
  - name: Device Data
    description: Endpoints that act as a device using a Device Token (device-level permissions).
  - name: Network Ingest
    description: Endpoints that act as a network using a Network Token (network-level permissions).
  - name: Devices
    description: Manage devices using a Profile Token (admin-level).
  - name: Device Tokens
    description: Manage device tokens (Profile Token).
  - name: Configuration Params
    description: Manage device configuration parameters (Profile Token).
  - name: Import/Export
    description: Import/Export Operations for devices  (Profile Token).
  - name: Immutable Device
    description: Operations specific to immutable device type (Profile Token).
  - name: TagoRUN
    description: Operations for TagoRUN (Profile Token).
  - name: Users
    description: Manage TagoRUN users (Profile Token).
  - name: Notifications
    description: Manage notifications (Profile Token).
  - name: Entity
    description: Manage entities (Profile Token).
  - name: Entity Data
    description: Operations specific to managing entitie stored data (Profile Token)
  - name: Dashboards
    description: Manage dashboards (Profile Token).
  - name: Widgets
    description: Manage widgets (Profile Token).
  - name: Files
    description: File storage operations (Profile Token).
  - name: Uploads
    description: File upload operations (Profile Token).
  - name: Statistics / Billing
    description: Usage statistics and billing (Profile Token).
  - name: Account
    description: Account-level operations (Profile Token).
  - name: Access Management
    description: Roles, permissions, and sharing (Profile Token).
  - name: Profile
    description: Manage your own profile settings (Profile Token).
  - name: Dictionary
    description: Manage Dictionary Slugs and Keys for TagoRUN (Profile Token).

x-tagGroups:
  - name: Device Token (Device-level)
    tags:
      - Device Data
  - name: Network Token (Network-level)
    tags:
      - Network Ingest
  - name: Device Management
    tags:
      - Devices
      - Device Tokens
      - Configuration Param
      - Import/Export
      - Immutable Device
  - name: Tago RUN
    tags:
      - Tago RUN
      - Users
      - Dictionary
      - Notifications
  - name: Dashboards
    tags:
      - Dashboards
      - Widgets
  - name: File(s) Management
    tags:
      - Files
      - Upload
  - name: Profile
    tags:
      - Account
      - Profile
      - Statistics / Billing
  - name: Entities
    tags:
      - Entity
      - Entity Data

  - name: Resources
    tags:
      - Access Management
paths:
  /info:
    get:
      tags:
        - Device Data
      summary: Device Information
      description: >
        Get information about the current device
      operationId: currentDeviceInformation
      security:
        - Device-Token: []
      responses:
        "200":
          description: >-
            Get information about current device successfuly
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      active:
                        type: boolean
                        example: true
                      connector:
                        type: string
                        example: 62333bd36977fc001a2990c8
                      created_at:
                        type: string
                        example: "2022-06-02T18:09:07.135Z"
                      id:
                        type: string
                        example: 6298fcc3e0b6840012b6abfa
                      last_input:
                        type: string
                        example: "2022-06-02T19:40:54.517Z"
                      name:
                        type: string
                        example: TagoIO Device
                      network:
                        type: string
                        example: 62336c32ab6e0d0012e06c04
                      payload_decoder:
                        type: string
                        example: >-
                          LyogVGhpcyBpcyBhIGRlZmF1bHQgZXhhbXBsZSBmb3IgcGF5bG9hZCBwYXJzZXIuCioqIFRoZSBpZ25vcmVfdmFycyB2YXJpYWJsZSBpbiB0aGlzIGNvZGUgc2hvdWxkIGJlIHVzZWQgdG8gaWdub3JlIHZhcmlhYmxlcwoqKiBmcm9tIHRoZSBkZXZpY2UgdGhhdCB5b3UgZG9uJ3Qgd2FudC4KKioKKiogVGVzdGluZzoKKiogWW91IGNhbiBkbyBtYW51YWwgdGVzdHMgdG8gdGhpcyBwYXJzZSBieSB1c2luZyB0aGUgRGV2aWNlIEVtdWxhdG9yLiBDb3B5IGFuZCBQYXN0ZSB0aGUgZm9sbG93aW5nIGNvZGU6CioqIFt7ICJ2YXJpYWJsZSI6ICJwYXlsb2FkIiwgInZhbHVlIjogIjAxMDk2MTEzOTUiIH1dCioqCiovCi8vIEFkZCBpZ25vcmFibGUgdmFyaWFibGVzIGluIHRoaXMgYXJyYXkuCmNvbnN0IGlnbm9yZV92YXJzID0gWydyZl9jaGFpbicsICdjaGFubmVsJywgJ21vZHVsYXRpb24nLCAnYXBwX2lkJywgJ2Rldl9pZCcsICd0aW1lJywgJ2d0d190cnVzdGVkJywgJ3BvcnQnXTsKCi8vIFJlbW92ZSB1bndhbnRlZCB2YXJpYWJsZXMuCnBheWxvYWQgPSBwYXlsb2FkLmZpbHRlcih4ID0+ICFpZ25vcmVfdmFycy5pbmNsdWRlcyh4LnZhcmlhYmxlKSk7CgovLyBZb3UgY2FuIGVkaXQgYW55IHZhcmlhYmxlIHRoYXQncyBiZWluZyBhZGRlZCB0byB5b3VyIGRldmljZS4KLy8gRm9yIGV4YW1wbGUsIGlmIHlvdSBuZWVkIHRvIGNvbnZlcnQgYSB2YXJpYWJsZSBmcm9tIEZhaHJlaW50aCB0byBDZWxzaXVzLCB1bmNvbW1lbnQgdGhlIGZvbGxvd2luZyBjb2RlOgovLyBjb25zdCB0ZW1wZXJhdHVyZSA9IHBheWxvYWQuZmluZCh4ID0+IHgudmFyaWFibGUgPT09ICJ0ZW1wZXJhdHVyZSIpOwovLyBpZiAodGVtcGVyYXR1cmUpIHsKLy8gICB0ZW1wZXJhdHVyZS52YWx1ZSA9ICg1IC8gOSkgKiAodGVtcGVyYXR1cmUudmFsdWUgLSAzMik7Ci8vICAgdGVtcGVyYXR1cmUudW5pdCA9ICJDIjsKLy8gfQ==
                      profile:
                        type: string
                        example: 5e1e192a06fbee00265ccfb0
                      tags:
                        type: array
                        items: {}
                        example: []
                      type:
                        type: string
                        example: mutable
                      updated_at:
                        type: string
                        example: "2022-06-10T20:22:59.405Z"
                      visible:
                        type: boolean
                        example: true
                  status:
                    type: boolean
                    example: true
  /data:
    get:
      tags:
        - Device Data
      summary: Get Data
      description: Get data from the device.
      operationId: getData
      parameters:
        - name: query
          in: query
          schema:
            type: string
            enum: [count, min, max, avg, sum, last_item, last_location, aggregate, conditional]
          description: Select the query mode.
        - name: qty
          in: query
          schema:
            type: integer
            minimum: 1
            example: 20
          description: Total quantity of data to retrieve.
        - name: details
          in: query
          schema:
            type: boolean
            example: true
          description: Include additional fields (e.g., created_at).
        - name: ordination
          in: query
          schema:
            type: string
            enum: [ascending, descending]
            example: descending
          description: Sort order.
        - name: skip
          in: query
          schema:
            type: integer
            minimum: 0
            example: 15
          description: Number of items to skip.
        - name: variables
          in: query
          schema:
            type: string
            example: temperature
          description: Filter data by variable.
        - name: values
          in: query
          schema:
            type: string
            example: "25"
          description: Filter data by value.
        - name: groups
          in: query
          schema:
            type: string
            example: "0923092039"
          description: Filter by group identifier.
        - name: start_date
          in: query
          schema:
            type: string
            format: date-time
            example: "2022-09-09T10:28:44Z"
          description: Start timestamp or relative date.
        - name: end_date
          in: query
          schema:
            type: string
            format: date-time
            example: "2022-09-10T10:28:44Z"
          description: End timestamp or relative date.
        - name: function
          in: query
          schema:
            type: string
            enum: [avg, sum, min, max, gt, gte, lt, lte, eq, ne]
            example: avg
          description: >-
            Allowed values depend on query mode: aggregate → avg,sum,min,max; conditional → gt,gte,lt,lte,eq,ne.
      security:
        - Device-Token: []
      responses:
        "200":
          description: >-
            Success Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    items:
                      type: object
                      properties:
                        created_at:
                          type: string
                          example: "2021-09-16T17:51:43.672Z"
                        device:
                          type: string
                          example: 612ea1694035dd0012f6d238
                        group:
                          type: string
                          example: "1631814703672"
                        id:
                          type: string
                          example: 6143842f561c4e00199f517b
                        location:
                          type: object
                          properties:
                            coordinates:
                              type: array
                              items:
                                type: number
                                example: -78.677328
                              example:
                                - -78.677328
                                - 35.770723
                            type:
                              type: string
                              example: point
                        time:
                          type: string
                          example: "2021-09-16T17:51:43.672Z"
                        unit:
                          type: string
                          example: °C
                        value:
                          type: number
                          example: -12.67
                        variable:
                          type: string
                          example: temperature
                    example:
                      - created_at: "2021-09-16T17:51:43.672Z"
                        device: 612ea1694035dd0012f6d238
                        group: "1631814703672"
                        id: 6143842f561c4e00199f517b
                        location:
                          coordinates:
                            - -78.677328
                            - 35.770723
                          type: point
                        time: "2021-09-16T17:51:43.672Z"
                        unit: °C
                        value: -12.67
                        variable: temperature
                  status:
                    type: boolean
                    example: true

    put:
      tags:
        - Device Data
      summary: Edit Data
      description: >-
        Edit specific data stored in the device. Same properties as the Create Data is accepted, edit requires the ID field of the data to be edited.

        :::info  

        This request is only available when using Mutable Storage on Devices  

        :::
      operationId: editData
      security:
        - Device-Token: []
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                type: object
                required:
                  - id
                properties:
                  id:
                    type: string
                    example: 6298fcc3e0b6840012bb6abfa
                  metadata:
                    type: object
                    properties:
                      color:
                        type: string
                        example: blue
                  value:
                    type: string
                    example: "27"
              example:
                - id: 6298fcc3e0b6840012bb6abfa
                  metadata:
                    color: blue
                  value: "27"
          text/plain:
            examples:
              Edit data:
                value: |-
                  [
                      {
                          "id": "6298fcc3e0b6840012bb6abfa",
                          "value": "27", // edit the value field
                          "metadata": { // edit the metadata field
                              "color": "blue"
                          }
                      }
                  ]
      responses:
        "200":
          description: Editing data register by ID
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: 1 item(s) updated
                  status:
                    type: boolean
                    example: true
    post:
      tags:
        - Device Data
      summary: Send Data
      description: |
        Send Device Data
      operationId: sendData
      security:
        - Device-Token: []
      requestBody:
        $ref: "#/components/requestBodies/DeviceDataBody"
      responses:
        "200":
          description: Sending data
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: 2 Data Added
                  status:
                    type: boolean
                    example: true
    delete:
      tags:
        - Device Data
      summary: Delete Data
      description: >
        Delete data from the device.

        :::info  

        This request is only available when using Mutable Storage on Devices.  

        :::

      operationId: deleteData
      parameters:
        - $ref: "#/components/parameters/DeleteFilterQty"
        - $ref: "#/components/parameters/DeleteFilterOrdination"
        - $ref: "#/components/parameters/DeleteFilterSkip"
        - $ref: "#/components/parameters/DeleteFilterVariables"
        - $ref: "#/components/parameters/DeleteFilterValues"
        - $ref: "#/components/parameters/DeleteFilterIds"
        - $ref: "#/components/parameters/DeleteFilterGroups"
      security:
        - Device-Token: []
      responses:
        "200":
          description: Deleting data using params
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: 1 Data Removed
                  status:
                    type: boolean
                    example: true
  /device/params:
    get:
      tags:
        - Device Data
      summary: List Config. parameters
      description: |
        Retrieve configuration parameters for the current device. This is useful for delivering settings or instructions that your device can periodically check for updates.

        [Configuration Parameters](/docs/tagoio/devices/configuration-parameters-for-devices) can be used to provide URLs (such as for firmware updates) or any other settings needed to control device behavior.
      operationId: getConfigurationParameters
      parameters:
        - name: sent_status
          in: query
          schema:
            type: string
            example: "true"
          description: Filter by `sent` status.
      security:
        - Device-Token: []
      responses:
        "200":
          description: List of configuration parameters returned
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          example: 6244401fe689b90014f9b299
                        key:
                          type: string
                          example: param_key
                        sent:
                          type: boolean
                          example: false
                        value:
                          type: string
                          example: param_value
                  status:
                    type: boolean
                    example: true
  /device/params/{paramID}:
    put:
      tags:
        - Device Data
      summary: Mark Config. Parameter as Read
      description: |
        Marks a configuration parameter as read on the current device.  

        This is useful when collecting settings from Configuration Parameters and you need to track whether you have already processed the current value. Use this endpoint to set the `sent` field to `true`.
      operationId: markAConfigurationParameterAsRead
      security:
        - Device-Token: []
      responses:
        "200":
          description: Success Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: Params Successfully Updated
                  status:
                    type: boolean
                    example: true
    parameters:
      - name: paramID
        in: path
        required: true
        schema:
          type: string
          example: (Type your param ID)
  /device/token/{deviceID}:
    get:
      tags:
        - Device Tokens
      summary: List Tokens
      description: |
        Retrieves list of all tokens from device
      operationId: listOfTokens
      responses:
        "200":
          description: ""
    parameters:
      - name: deviceID
        in: path
        required: true
        schema:
          type: string
  /device/token:
    post:
      tags:
        - Device Tokens
      summary: Create Token
      description: |
        Generate and retrieve a new token
      operationId: createToken
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                device:
                  type: string
                  example: 6243321z80d789a05800143075a4
                expire_time:
                  type: string
                  example: 3 hours
                name:
                  type: string
                  example: TestToken
                serie_number:
                  type: string
                  example: 359881234567890
                  description: If applicable for the selected Network. Can be an IMEI, EUI, or unique serial number.
            examples:
              Create token:
                value:
                  device: 6243321z80d789a05800143075a4
                  expire_time: 3 hours
                  name: TestToken
          text/plain:
            examples:
              Create token:
                value: "{\r\n    \"expire_time\": \"never\", // ISO-8601 or relative date, e.g 1 day\r\n    \"name\": \"Token #2\",\r\n    \"permission\": \"full\", // full, read or write\r\n    \"serie_number\": \"\", //Optional\r\n    \"device\": \"6298fcc3e0b6840012b6abfa\"\r\n}"
      responses:
        "201":
          description: Token created
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      expire_time:
                        type: string
                        example: "2022-03-30T01:15:14.914Z"
                      permission:
                        type: string
                        example: full
                      token:
                        type: string
                        example: f2ba4b46-3c57-44ce-810f-98e1271ea602
                  status:
                    type: boolean
                    example: true
  /device/token/{tokenID}:
    delete:
      tags:
        - Device Tokens
      summary: Delete Token
      description: |
        Delete a token
      operationId: deleteToken
      responses:
        "200":
          description: Delete Token
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: Token Successfully Removed
                  status:
                    type: boolean
                    example: true
    parameters:
      - name: tokenID
        in: path
        required: true
        schema:
          type: string
          example: (Type a token ID to be deleted)
  /device/{deviceID}/params:
    get:
      tags:
        - Configuration Param
      summary: List Device Params
      description: |
        List params for the device
      operationId: listDeviceParams
      parameters:
        - name: sent_status
          in: query
          schema:
            type: string
            example: "false"
          description: "Filter by Boolean."
      responses:
        "200":
          description: List Device Params
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          example: 62ab8294c1ac39001361e11b
                        key:
                          type: string
                          example: param1
                        sent:
                          type: boolean
                          example: false
                        value:
                          type: string
                          example: value1
                    example:
                      - id: 62ab8294c1ac39001361e11b
                        key: param1
                        sent: false
                        value: value1
                      - id: 62ab8294c1ac39001361e11c
                        key: param2
                        sent: false
                        value: value2
                  status:
                    type: boolean
                    example: true
    post:
      tags:
        - Configuration Param
      summary: Create and Edit Device Params
      description: |
        Create and edit params for the device
      operationId: createAndEditDeviceParams
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  example: 62aba74d84acd30011ac593f
                key:
                  type: string
                  example: updatedKey
                sent:
                  type: boolean
                  example: false
                value:
                  type: string
                  example: updatedValue
            examples:
              Create and Edit Device Params:
                value:
                  id: 62aba74d84acd30011ac593f
                  key: updatedKey
                  sent: false
                  value: updatedValue
      responses:
        "201":
          description: Creating or editing device parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: Params Successfully Updated
                  status:
                    type: boolean
                    example: true
    parameters:
      - name: deviceID
        in: path
        required: true
        schema:
          type: string
          example: (Type your device ID)
  /device/{deviceID}/params/{paramID}:
    delete:
      tags:
        - Configuration Param
      summary: Delete Device Param
      description: |
        Delete param from the device
      operationId: deleteDeviceParam
      responses:
        "200":
          description: Deleting a Device Param by ID
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: Successfully Removed
                  status:
                    type: boolean
                    example: true
    parameters:
      - name: deviceID
        in: path
        required: true
        schema:
          type: string
          example: (Type your device ID)
      - name: paramID
        in: path
        required: true
        schema:
          type: string
          example: (Type your param ID)
  /device:
    get:
      tags:
        - Devices
      summary: List of Devices
      description: |
        Retrieves a list with all devices from the profile
      operationId: listOfDevices
      parameters:
        - name: page
          in: query
          schema:
            type: string
            example: "1"
          description: Page number.
        - name: amount
          in: query
          schema:
            type: string
            example: "10"
          description: Amount of devices by page.
        - name: filter[id]
          in: query
          schema:
            type: string
            example: ""
          description: Filter the device by ID.
        - name: filter[name]
          in: query
          schema:
            type: string
            example: ""
          description: Filter the device name.
        - name: filter[visible]
          in: query
          schema:
            type: string
            example: true / false
          description: Filter the device visible status.
        - name: filter[active]
          in: query
          schema:
            type: string
            example: true / false
          description: Filter the device active status.
        - name: filter[connector]
          in: query
          schema:
            type: string
            example: ""
          description: Filter the devices by the Connector ID.
        - name: filter[network]
          in: query
          schema:
            type: string
            example: ""
          description: Filter the devices by the Network ID.
        - name: filter[tags]
          in: query
          schema:
            type: string
            example: ""
          description: Filter device by it's tag. Check the example.
        - name: filter[updated_at]
          in: query
          schema:
            type: string
            example: 1 day
          description: >-
            Filter by time the device was received data. Can be an ISO-8601 or a
            relative date
        - name: filter[created_at]
          in: query
          schema:
            type: string
            example: 1 day
          description: >-
            Filter by time the device was created. Can be an ISO-8601 or a
            relative date
        - name: orderBy
          in: query
          schema:
            type: string
            example: created_at
      responses:
        "200":
          description: List of devices retrieved using query params
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    items:
                      type: object
                      properties:
                        connector:
                          type: string
                          example: 5f5a8f3351d4db99c40ded2d
                        id:
                          type: string
                          example: 5dcad1c216174c001ca23ab9
                        name:
                          type: string
                          example: "Device #1"
                        network:
                          type: string
                          example: 5bbd120d4051a50034cd1a05
                        tags:
                          type: array
                          items:
                            type: object
                            properties:
                              key:
                                type: string
                                example: type
                              value:
                                type: string
                                example: Smoke Detector
                          example:
                            - key: type
                              value: Smoke Detector
                    example:
                      - connector: 5f5a8f3351d4db99c40ded2d
                        id: 5dcad1c216174c001ca23ab9
                        name: "Device #1"
                        network: 5bbd120d4051a50034cd1a05
                        tags:
                          - key: type
                            value: Smoke Detector
                      - connector: 5f5a8f3351d4db99c40ded2d
                        id: 5dcad25016174c001ca24a09
                        name: "Device #2"
                        network: 5bbd120d4051a50034cd1a05
                        tags:
                          - key: type
                            value: Smoke Detector
                  status:
                    type: boolean
                    example: true
              examples:
                List of devices retrieved using query params:
                  value:
                    result:
                      - connector: 5f5a8f3351d4db99c40ded2d
                        id: 5dcad1c216174c001ca23ab9
                        name: "Device #1"
                        network: 5bbd120d4051a50034cd1a05
                        tags:
                          - key: type
                            value: Smoke Detector
                      - connector: 5f5a8f3351d4db99c40ded2d
                        id: 5dcad25016174c001ca24a09
                        name: "Device #2"
                        network: 5bbd120d4051a50034cd1a05
                        tags:
                          - key: type
                            value: Smoke Detector
                    status: true
    post:
      tags:
        - Devices
      summary: Create Device
      description: Create either an immutable or a mutable device. Immutable devices require chunking parameters and are optimized for long-term, append-only storage. Mutable devices behave like classic devices and do not require chunk settings.
      operationId: createNewDevice
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - title: "Immutable Device Creation"
                  type: object
                  required: ["name", "type", "network", "connector", "chunk_period", "chunk_retention"]
                  properties:
                    name:
                      type: string
                      description: "Device name"
                      example: "My first immutable device"
                    type:
                      type: string
                      enum: ["immutable"]
                      description: "Device type - must be 'immutable' for immutable devices"
                      example: "immutable"
                    network:
                      type: string
                      description: "Network ID where the device will be created"
                      example: "5bbd0d144051a50034cd19fb"
                    connector:
                      type: string
                      description: "Connector ID for the device"
                      example: "5f5a8f3351d4db99c40dece5"
                    chunk_period:
                      type: string
                      enum: ["day", "week", "month", "quarter"]
                      description: "Chunk period for data storage - one of day, week, month, quarter"
                      example: "quarter"
                    chunk_retention:
                      type: number
                      minimum: 0
                      maximum: 36
                      description: "Number of chunks to retain (0-36)"
                      example: 36
                    serie_number:
                      type: string
                      description: "Serial number - only required if specified by the network"
                      example: "AB87392C17CA"
                    tags:
                      type: array
                      description: "Device tags as key-value string pairs"
                      items:
                        type: object
                        properties:
                          key:
                            type: string
                            description: "Tag key"
                            example: "tagKey1"
                          value:
                            type: string
                            description: "Tag value"
                            example: "value1"
                      example:
                        - key: "tagKey1"
                          value: "value1"
                        - key: "tagKey2"
                          value: "value2"
                - title: "Mutable Device Creation"
                  type: object
                  required: ["name", "type", "network", "connector"]
                  properties:
                    name:
                      type: string
                      description: "Device name"
                      example: "My first device"
                    type:
                      type: string
                      enum: ["mutable"]
                      description: "Device type - must be 'mutable' for mutable devices"
                      example: "mutable"
                    network:
                      type: string
                      description: "Network ID where the device will be created"
                      example: "5bbd0d144051a50034cd19fb"
                    connector:
                      type: string
                      description: "Connector ID for the device"
                      example: "5f5a8f3351d4db99c40dece5"
                    serie_number:
                      type: string
                      description: "Serial number - only required if specified by the network"
                      example: "AB87392C12CA"
                    active:
                      type: boolean
                      description: "Device active status"
                      example: true
                    payload_decoder:
                      type: string
                      description: "Base64 encoded payload decoder function"
                    tags:
                      type: array
                      description: "Device tags"
                      items:
                        type: object
                        properties:
                          key:
                            type: string
                            example: "tagKey1"
                          value:
                            type: string
                            example: "value1"
                      example:
                        - key: "tagKey1"
                          value: "value1"
                        - key: "tagKey2"
                          value: "value2"
                    visible:
                      type: boolean
                      description: "Device visibility status"
                      example: true

            examples:
              Create Immutable Device:
                value:
                  name: "My first immutable device"
                  type: "immutable"
                  network: "5bbd0d144051a50034cd19fb"
                  connector: "5f5a8f3351d4db99c40dece5"
                  chunk_period: "quarter"
                  chunk_retention: 36
                  serie_number: "AB87392C17CA"
              Create Mutable Device:
                value:
                  name: "My first device"
                  type: "mutable"
                  network: "5bbd0d144051a50034cd19fb"
                  connector: "5f5a8f3351d4db99c40dece5"
                  serie_number: "AB87392C12CA"
              Create Mutable Device with Parse Function:
                value:
                  name: "Mutable device"
                  type: "mutable"
                  network: "5bbd0d144051a50034cd19fb"
                  connector: "5f5a8f3351d4db99c40dece5"
                  action: true
                  active: true
                  visible: true
                  tags:
                    - key: "tagKey1"
                      value: "value1"
                    - key: "tagKey2"
                      value: "value2"
          text/plain:
            examples:
              Create Immutable Device:
                value: "{\r\n  \"name\": \"My first immutable device\",\r\n  \"type\": \"immutable\",\r\n  \"network\": \"5bbd0d144051a50034cd19fb\",\r\n  \"connector\": \"5f5a8f3351d4db99c40dece5\",\r\n  \"chunk_period\": \"quarter\", //define a chunk period by \"day\",\"week\", \"month\", \"quarter\"\r\n  \"chunk_retention\": 36, //acceptable range between 0-36\r\n  \"serie_number\": \"AB87392C17CA\" //only if required by network (optional)\r\n }"
              Create Mutable Device:
                value: "{\r\n  \"name\": \"My first device\",\r\n  \"type\": \"mutable\",\r\n  \"network\": \"5bbd0d144051a50034cd19fb\",\r\n  \"connector\": \"5f5a8f3351d4db99c40dece5\",\r\n  \"serie_number\": \"AB87392C12CA\" //only if required by network (optional)\r\n }"
      responses:
        "201":
          description: >-
            Mutable device created / Mutable device created with parse function
            / Immutable device created
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      deviceID:
                        type: string
                        example: 5dcad1c216174c001ca23ab9
                      token:
                        type: string
                        example: 5a16405f-b32c-4c91-ae39-cbb2caba18d8
                  status:
                    type: boolean
                    example: true
  /device/{deviceID}/data/backup:
    post:
      tags:
        - Import/Export
      summary: Export data to CSV in Files
      description: Export data to CSV in Files
      operationId: exportDataToCsvInFiles
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                file_address:
                  type: string
                  example: /device/$DEVICE$/$TIMESTAMP$
                headers:
                  type: boolean
                  example: true
            examples:
              Export data to CSV in Files:
                value:
                  file_address: /device/$DEVICE$/$TIMESTAMP$
                  headers: true
      responses:
        "200":
          description: Exporting data to Files
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      file_address:
                        type: string
                        example: device/66db45b6552d1d00097956de/1732039901282.csv
                  status:
                    type: boolean
                    example: true
    parameters:
      - name: deviceID
        in: path
        required: true
        schema:
          type: string
          example: "67aa1f9135b1a7000a9db33c"
        description: Device ID
  /device/{deviceID}/chunk:
    get:
      tags:
        - Immutable Device
      summary: List Chunks
      description: List of chunks
      operationId: listOfChunks
      responses:
        "200":
          description: Getting a list of chunks by device
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    items:
                      type: object
                      properties:
                        amount:
                          type: number
                          example: 1584
                        from:
                          type: string
                          example: "2022-07-18T00:00:00.000+00:00"
                        id:
                          type: string
                          example: "1658102400_1658707199"
                        to:
                          type: string
                          example: "2022-07-24T23:59:59.999+00:00"
                    example:
                      - amount: 1584
                        from: "2022-07-18T00:00:00.000+00:00"
                        id: "1658102400_1658707199"
                        to: "2022-07-24T23:59:59.999+00:00"
                      - amount: 13383
                        from: "2022-07-11T00:00:00.000+00:00"
                        id: "1657497600_1658102399"
                        to: "2022-07-17T23:59:59.999+00:00"
                      - amount: 12788
                        from: "2022-07-04T00:00:00.000+00:00"
                        id: "1656892800_1657497599"
                        to: "2022-07-10T23:59:59.999+00:00"
                      - amount: 12784
                        from: "2022-06-27T00:00:00.000+00:00"
                        id: "1656288000_1656892799"
                        to: "2022-07-03T23:59:59.999+00:00"
                      - amount: 4179
                        from: "2022-03-07T00:00:00.000+00:00"
                        id: "1646611200_1647215999"
                        to: "2022-03-13T23:59:59.999+00:00"
                  status:
                    type: boolean
                    example: true
    parameters:
      - name: deviceID
        in: path
        required: true
        schema:
          type: string
          example: "67aa1f9135b1a7000a9db33c"
  /device/{deviceID}:
    get:
      tags:
        - Devices
      summary: Device Information
      description: Device information
      operationId: deviceInformation
      responses:
        "200":
          description: Getting a device information
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      active:
                        type: boolean
                        example: true
                      connector:
                        type: string
                        example: 60f19bda2889a60012d34167
                      created_at:
                        type: string
                        example: "2022-06-09T21:21:51.877Z"
                      data_retention:
                        type: string
                        example: forever
                      description:
                        type: string
                        example: >-
                          Simulates a Extrusion machine with temperature, speed
                          and pressure
                      id:
                        type: string
                        example: 62a2646ffdea2f0013b1bfe7
                      last_input:
                        type: string
                        example: "2022-06-23T11:19:54.369Z"
                      name:
                        type: string
                        example: Test Chunk Monthly
                      network:
                        type: string
                        example: 6073cdfec79ed00011228e47
                      payload_decoder:
                        example: null
                      profile:
                        type: string
                        example: 612ea05e3cc0780012715111
                      tags:
                        type: array
                        items:
                          type: object
                          properties:
                            key:
                              type: string
                              example: maxTemp
                            value:
                              type: string
                              example: "20"
                        example:
                          - key: maxTemp
                            value: "20"
                          - key: minTemp
                            value: "0"
                      type:
                        type: string
                        example: mutable
                      updated_at:
                        type: string
                        example: "2022-06-09T21:53:22.752Z"
                      visible:
                        type: boolean
                        example: true
                  status:
                    type: boolean
                    example: true
    put:
      tags:
        - Devices
      summary: Edit Device
      description: |
        Modify any property of the device.

        You're only required to send the parameters you want to edit.

        If changing network/connector, make sure you've deleted all tokens in the device first. Is also required to send both network and connector to edit any of both fields.
      operationId: editDevice
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                active:
                  type: boolean
                  example: false
                connector:
                  type: string
                  example: 6148de43683cae0018940d0c
                name:
                  type: string
                  example: "Device #2"
                network:
                  type: string
                  example: 5bbd120d4051a50034cd1a05
                payload_decoder:
                  type: string
                  description: Base64 formatted javascript code
                tags:
                  type: array
                  items:
                    type: object
                    properties:
                      key:
                        type: string
                        example: my_tag_key
                      value:
                        type: string
                        example: my_tag_value
                  example:
                    - key: my_tag_key
                      value: my_tag_value
                visible:
                  type: boolean
                  example: false
            examples:
              Edit device:
                value:
                  active: false
                  connector: 6148de43683cae0018940d0c
                  name: "Device #2"
                  network: 5bbd120d4051a50034cd1a05
                  payload_decoder: >-
                    LyogVGhpcyBpcyBhIGRlZmF1bHQgZXhhbXBsZSBmb3IgcGF5bG9hZCBwYXJzZXIuCioqIFRoZSBpZ25vcmVfdmFycyB2YXJpYWJsZSBpbiB0aGlzIGNvZGUgc2hvdWxkIGJlIHVzZWQgdG8gaWdub3JlIHZhcmlhYmxlcwoqKiBmcm9tIHRoZSBkZXZpY2UgdGhhdCB5b3UgZG9uJ3Qgd2FudC4KKioKKiogVGVzdGluZzoKKiogWW91IGNhbiBkbyBtYW51YWwgdGVzdHMgdG8gdGhpcyBwYXJzZSBieSB1c2luZyB0aGUgRGV2aWNlIEVtdWxhdG9yLiBDb3B5IGFuZCBQYXN0ZSB0aGUgZm9sbG93aW5nIGNvZGU6CioqIFt7ICJ2YXJpYWJsZSI6ICJwYXlsb2FkIiwgInZhbHVlIjogIjAxMDk2MTEzOTUiIH1dCioqCiovCi8vIEFkZCBpZ25vcmFibGUgdmFyaWFibGVzIGluIHRoaXMgYXJyYXkuCmNvbnN0IGlnbm9yZV92YXJzID0gWydyZl9jaGFpbicsICdjaGFubmVsJywgJ21vZHVsYXRpb24nLCAnYXBwX2lkJywgJ2Rldl9pZCcsICd0aW1lJywgJ2d0d190cnVzdGVkJywgJ3BvcnQnXTsKCi8vIFJlbW92ZSB1bndhbnRlZCB2YXJpYWJsZXMuCnBheWxvYWQgPSBwYXlsb2FkLmZpbHRlcih4ID0+ICFpZ25vcmVfdmFycy5pbmNsdWRlcyh4LnZhcmlhYmxlKSk7CgovLyBZb3UgY2FuIGVkaXQgYW55IHZhcmlhYmxlIHRoYXQncyBiZWluZyBhZGRlZCB0byB5b3VyIGRldmljZS4KLy8gRm9yIGV4YW1wbGUsIGlmIHlvdSBuZWVkIHRvIGNvbnZlcnQgYSB2YXJpYWJsZSBmcm9tIEZhaHJlaW50aCB0byBDZWxzaXVzLCB1bmNvbW1lbnQgdGhlIGZvbGxvd2luZyBjb2RlOgovLyBjb25zdCB0ZW1wZXJhdHVyZSA9IHBheWxvYWQuZmluZCh4ID0+IHgudmFyaWFibGUgPT09ICJ0ZW1wZXJhdHVyZSIpOwovLyBpZiAodGVtcGVyYXR1cmUpIHsKLy8gICB0ZW1wZXJhdHVyZS52YWx1ZSA9ICg1IC8gOSkgKiAodGVtcGVyYXR1cmUudmFsdWUgLSAzMik7Ci8vICAgdGVtcGVyYXR1cmUudW5pdCA9ICJDIjsKLy8gfQ==
                  tags:
                    - key: my_tag_key
                      value: my_tag_value
                  visible: false
                  chunk_retention: 20
              Immutable Chunk retention:
                value: "{\r\n    \"chunk_retention\": 20 // acceptable range by period: day(0-31), week(0-26), month(0-36), quarter(0-36)\r\n}"
      responses:
        "200":
          description: Updating device settings
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: Successfully Updated
                  status:
                    type: boolean
                    example: true
    delete:
      tags:
        - Devices
      summary: Delete Device
      description: |
        Deletes a device from the profile
      operationId: deleteDevice
      responses:
        "200":
          description: Deleting a device by ID
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: Successfully Removed
                  status:
                    type: boolean
                    example: true
    parameters:
      - name: deviceID
        in: path
        required: true
        schema:
          type: string
          example: "67aa1f9135b1a7000a9db33c"
  /device/{deviceID}/chunk/backup:
    post:
      tags:
        - Immutable Device
      summary: Export Chunk
      description: Export a chunk as CSV to your TagoIO Files
      operationId: exportAChunkAsCsvToFiles
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                chunk_id:
                  type: string
                  example: "1657497600_1658102399"
                file_address:
                  type: string
                  example: /device/$DEVICE$/$FROM$_$TO$
                headers:
                  type: boolean
                  example: true
            examples:
              Export a chunk as CSV to Files:
                value:
                  chunk_id: "1657497600_1658102399"
                  file_address: /device/$DEVICE$/$FROM$_$TO$
                  headers: true
      responses:
        "200":
          description: Chunk exported to Files
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      chunk_id:
                        type: string
                        example: "1657497600_1658102399"
                      file_address:
                        type: string
                        example: >-
                          device/62a2643dcc8dd60012eb4838/2022-07-11_2022-07-17.csv
                  status:
                    type: boolean
                    example: true
    parameters:
      - name: deviceID
        in: path
        required: false
        schema:
          type: string
          example: "67aa1f9135b1a7000a9db33c"
    description: Device ID
  /device/{deviceID}/chunk/{chunkID}:
    delete:
      tags:
        - Immutable Device
      summary: Delete Chunk
      description: Delete chunk
      operationId: deleteChunk
      responses:
        "200":
          description: Chunk deleted from device
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: Chunk 1657497600_1658102399 deleted
                  status:
                    type: boolean
                    example: true
    parameters:
      - name: deviceID
        in: path
        required: true
        schema:
          type: string
          example: "67aa1f9135b1a7000a9db33c"
        description: Device ID
      - name: chunkID
        in: path
        required: true
        schema:
          type: string
          example: (Type a chunk ID)
        description: Chunk ID
  /device/{deviceID}/convert:
    post:
      tags:
        - Devices
      summary: Convert Device Type
      description: >-
        Convert the device immutable or mutable.


        The device must be empty before being converted. You can empty your
        device through your device's page. The Device-Token is preserved when
        converting using this route.

        The device must be disabled before being converted. You can disable the
        device by going to the device's page and turn off the active switch.
      operationId: convertDeviceType
      requestBody:
        content:
          application/json:
            schema:
              type: object
              title: ConvertDeviceTypeRequest
              properties:
                type:
                  type: string
                  example: immutable
                chunk_period:
                  type: string
                  example: quarter
                  description: Only required when converting to immutable. Defines the period for data chunking (e.g., quarter, month, year).
                chunk_retention:
                  type: number
                  example: 4
                  description: Only required when converting to immutable. Number of chunk periods to retain.
            examples:
              Convert to Immutable:
                value:
                  type: immutable
                  chunk_period: quarter
                  chunk_retention: 4
              Convert to Mutable:
                value:
                  type: mutable
      responses:
        "200":
          description: >-
            Converting a device type
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: Device type/chunk was converted
                  status:
                    type: boolean
                    example: true
    parameters:
      - name: deviceID
        in: path
        required: true
        schema:
          type: string
          example: "67aa1f9135b1a7000a9db33c"
  /device/{deviceID}/data_amount:
    get:
      tags:
        - Devices
      summary: Data Amount
      description: Get the total number of data items stored within the device.
      operationId: deviceDataAmount
      responses:
        "200":
          description: Getting a device data amount
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: number
                    example: 529
                  status:
                    type: boolean
                    example: true
    parameters:
      - name: deviceID
        in: path
        required: true
        schema:
          type: string
          example: "67aa1f9135b1a7000a9db33c"
  /device/{deviceID}/data/restore:
    post:
      tags:
        - Import/Export
      summary: Import Data from a CSV in Files
      description: Import Data from a CSV in Files
      operationId: importDataFromACsvInFiles
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                file_address:
                  type: string
                  example: /July_data/31072024_data.csv
            examples:
              Import Data from a CSV in Files:
                value:
                  file_address: /July_data/31072024_data.csv
      responses:
        "200":
          description: Importing data from Files
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: Data import added to the queue successfully!
                  status:
                    type: boolean
                    example: true
    parameters:
      - name: deviceID
        in: path
        required: true
        schema:
          type: string
          example: "67aa1f9135b1a7000a9db33c"
    description: Device ID
  /device/{deviceID}/empty:
    post:
      tags:
        - Devices
      summary: Empty Device Storage
      description: Empty a Device's Data
      operationId: emptyADeviceSData
      responses:
        "200":
          description: Device's Data empty
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: Data Successfully Removed
                  status:
                    type: boolean
                    example: true
    parameters:
      - name: deviceID
        in: path
        required: true
        schema:
          type: string
          example: "67aa1f9135b1a7000a9db33c"

  /device/{deviceID}/data:
    get:
      tags:
        - Devices
      summary: Get Device Data
      description: Get Device Data for a specific Device within your profile
      operationId: getDeviceData
      parameters:
        - name: qty
          in: query
          schema:
            type: string
            example: "10"
          description: Numeric quantity of data to be returned
        - name: end_date
          in: query
          schema:
            type: string
            example: "2023-10-10T13:17:16.290Z"
          description: >-
            Final date to get the data returned in ISO timestamp format (Not
            Required)
      responses:
        "200":
          description: Get Device Data
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    items:
                      type: object
                      properties:
                        created_at:
                          type: string
                          example: "2023-09-20T14:26:44.918Z"
                        device:
                          type: string
                          example: 6307b0b1b41f1b001a45c7e3
                        group:
                          type: string
                          example: 63956cf0000a19e44210b056
                        id:
                          type: string
                          example: 650b01244e91a0000fc65937
                        location:
                          type: object
                          properties:
                            coordinates:
                              type: array
                              items:
                                type: number
                                example: -77.757328
                              example:
                                - -77.757328
                                - 36.68072299999999
                            type:
                              type: string
                              example: Point
                        time:
                          type: string
                          example: "2023-09-20T14:26:44.918Z"
                        unit:
                          type: string
                          example: C
                        value:
                          type: string
                          example: "16"
                        variable:
                          type: string
                          example: temperature
                    example:
                      - created_at: "2023-09-20T14:26:44.918Z"
                        device: 6307b0b1b41f1b001a45c7e3
                        group: 63956cf0000a19e44210b056
                        id: 650b01244e91a0000fc65937
                        location:
                          coordinates:
                            - -77.757328
                            - 36.68072299999999
                          type: Point
                        time: "2023-09-20T14:26:44.918Z"
                        unit: C
                        value: "16"
                        variable: temperature
                      - created_at: "2023-09-20T14:26:38.015Z"
                        device: 6307b0b1b41f1b001a45c7e3
                        group: f863379000439d95e110b056
                        id: 650b011e59d9340009733690
                        location:
                          coordinates:
                            - -77.757328
                            - 36.68072299999999
                          type: Point
                        time: "2023-09-20T14:26:38.015Z"
                        unit: C
                        value: "86"
                        variable: temperature
                      - created_at: "2023-09-20T14:26:25.477Z"
                        device: 6307b0b1b41f1b001a45c7e3
                        group: aa756cf0000a19e41110b056
                        id: 650b01114e91a0000fc657ab
                        location:
                          coordinates:
                            - -77.757328
                            - 36.68072299999999
                          type: Point
                        time: "2023-09-20T14:26:25.477Z"
                        unit: C
                        value: "16"
                        variable: temperature
                      - created_at: "2023-09-20T14:26:14.180Z"
                        device: 6307b0b1b41f1b001a45c7e3
                        group: b0ee2101006e7e786010b056
                        id: 650b010687e7e6001012ee0c
                        location:
                          coordinates:
                            - -77.757328
                            - 36.68072299999999
                          type: Point
                        time: "2023-09-20T14:26:14.180Z"
                        unit: C
                        value: "58"
                        variable: temperature
                      - created_at: "2023-09-20T14:26:03.199Z"
                        device: 6307b0b1b41f1b001a45c7e3
                        group: 5b33379000439d95bf00b056
                        id: 650b00fb59d93400097333b6
                        location:
                          coordinates:
                            - -77.757328
                            - 36.68072299999999
                          type: Point
                        time: "2023-09-20T14:26:03.199Z"
                        unit: C
                        value: "11"
                        variable: temperature
                      - created_at: "2023-09-20T14:25:53.034Z"
                        device: 6307b0b1b41f1b001a45c7e3
                        group: e2456cf0000a19e41f00b056
                        id: 650b00f14e91a0000fc6542f
                        location:
                          coordinates:
                            - -77.757328
                            - 36.68072299999999
                          type: Point
                        time: "2023-09-20T14:25:53.034Z"
                        unit: C
                        value: "3"
                        variable: temperature
                      - created_at: "2023-09-20T14:25:43.099Z"
                        device: 6307b0b1b41f1b001a45c7e3
                        group: 6f40e7f0001ad1107e00b056
                        id: 650b00e7011da1000f7e04f7
                        location:
                          coordinates:
                            - -77.757328
                            - 36.68072299999999
                          type: Point
                        time: "2023-09-20T14:25:43.099Z"
                        unit: C
                        value: "10"
                        variable: test
                      - created_at: "2023-09-20T14:25:33.027Z"
                        device: 6307b0b1b41f1b001a45c7e3
                        group: b77fbff000c901bddd00b056
                        id: 650b00dddb109c000ffbf77c
                        location:
                          coordinates:
                            - -77.757328
                            - 36.68072299999999
                          type: Point
                        time: "2023-09-20T14:25:33.027Z"
                        unit: C
                        value: "7"
                        variable: temperature
                      - created_at: "2023-09-20T14:25:23.020Z"
                        device: 6307b0b1b41f1b001a45c7e3
                        group: b7e298900029919a3d00b056
                        id: 650b00d3a919920009892e7c
                        location:
                          coordinates:
                            - -77.757328
                            - 36.68072299999999
                          type: Point
                        time: "2023-09-20T14:25:23.020Z"
                        unit: C
                        value: "1"
                        variable: temperature
                      - created_at: "2023-09-20T14:25:13.079Z"
                        device: 6307b0b1b41f1b001a45c7e3
                        group: 7320e7f0001ad1109c00b056
                        id: 650b00c9011da1000f7e0238
                        location:
                          coordinates:
                            - -77.757328
                            - 36.68072299999999
                          type: Point
                        time: "2023-09-20T14:25:13.079Z"
                        unit: C
                        value: "12"
                        variable: temperature
                      - created_at: "2023-09-20T14:25:03.133Z"
                        device: 6307b0b1b41f1b001a45c7e3
                        group: c14fbff000c901bdfb00b056
                        id: 650b00bfdb109c000ffbf41d
                        location:
                          coordinates:
                            - -77.757328
                            - 36.68072299999999
                          type: Point
                        time: "2023-09-20T14:25:03.133Z"
                        unit: C
                        value: "66"
                        variable: temperature
                      - created_at: "2023-09-20T14:24:53.135Z"
                        device: 6307b0b1b41f1b001a45c7e3
                        group: 64a2379000439d955b00b056
                        id: 650b00b559d9340009732a47
                        location:
                          coordinates:
                            - -77.757328
                            - 36.68072299999999
                          type: Point
                        time: "2023-09-20T14:24:53.134Z"
                        unit: C
                        value: "19"
                        variable: temperature
                  status:
                    type: boolean
                    example: true
              examples:
                Get Device Data:
                  value:
                    result:
                      - created_at: "2023-09-20T14:26:44.918Z"
                        device: 6307b0b1b41f1b001a45c7e3
                        group: 63956cf0000a19e44210b056
                        id: 650b01244e91a0000fc65937
                        location:
                          coordinates:
                            - -77.757328
                            - 36.68072299999999
                          type: Point
                        time: "2023-09-20T14:26:44.918Z"
                        unit: C
                        value: "16"
                        variable: temperature
                      - created_at: "2023-09-20T14:26:38.015Z"
                        device: 6307b0b1b41f1b001a45c7e3
                        group: f863379000439d95e110b056
                        id: 650b011e59d9340009733690
                        location:
                          coordinates:
                            - -77.757328
                            - 36.68072299999999
                          type: Point
                        time: "2023-09-20T14:26:38.015Z"
                        unit: C
                        value: "86"
                        variable: temperature
                      - created_at: "2023-09-20T14:26:25.477Z"
                        device: 6307b0b1b41f1b001a45c7e3
                        group: aa756cf0000a19e41110b056
                        id: 650b01114e91a0000fc657ab
                        location:
                          coordinates:
                            - -77.757328
                            - 36.68072299999999
                          type: Point
                        time: "2023-09-20T14:26:25.477Z"
                        unit: C
                        value: "16"
                        variable: temperature
                      - created_at: "2023-09-20T14:26:14.180Z"
                        device: 6307b0b1b41f1b001a45c7e3
                        group: b0ee2101006e7e786010b056
                        id: 650b010687e7e6001012ee0c
                        location:
                          coordinates:
                            - -77.757328
                            - 36.68072299999999
                          type: Point
                        time: "2023-09-20T14:26:14.180Z"
                        unit: C
                        value: "58"
                        variable: temperature
                      - created_at: "2023-09-20T14:26:03.199Z"
                        device: 6307b0b1b41f1b001a45c7e3
                        group: 5b33379000439d95bf00b056
                        id: 650b00fb59d93400097333b6
                        location:
                          coordinates:
                            - -77.757328
                            - 36.68072299999999
                          type: Point
                        time: "2023-09-20T14:26:03.199Z"
                        unit: C
                        value: "11"
                        variable: temperature
                      - created_at: "2023-09-20T14:25:53.034Z"
                        device: 6307b0b1b41f1b001a45c7e3
                        group: e2456cf0000a19e41f00b056
                        id: 650b00f14e91a0000fc6542f
                        location:
                          coordinates:
                            - -77.757328
                            - 36.68072299999999
                          type: Point
                        time: "2023-09-20T14:25:53.034Z"
                        unit: C
                        value: "3"
                        variable: temperature
                      - created_at: "2023-09-20T14:25:43.099Z"
                        device: 6307b0b1b41f1b001a45c7e3
                        group: 6f40e7f0001ad1107e00b056
                        id: 650b00e7011da1000f7e04f7
                        location:
                          coordinates:
                            - -77.757328
                            - 36.68072299999999
                          type: Point
                        time: "2023-09-20T14:25:43.099Z"
                        unit: C
                        value: "10"
                        variable: test
                      - created_at: "2023-09-20T14:25:33.027Z"
                        device: 6307b0b1b41f1b001a45c7e3
                        group: b77fbff000c901bddd00b056
                        id: 650b00dddb109c000ffbf77c
                        location:
                          coordinates:
                            - -77.757328
                            - 36.68072299999999
                          type: Point
                        time: "2023-09-20T14:25:33.027Z"
                        unit: C
                        value: "7"
                        variable: temperature
                      - created_at: "2023-09-20T14:25:23.020Z"
                        device: 6307b0b1b41f1b001a45c7e3
                        group: b7e298900029919a3d00b056
                        id: 650b00d3a919920009892e7c
                        location:
                          coordinates:
                            - -77.757328
                            - 36.68072299999999
                          type: Point
                        time: "2023-09-20T14:25:23.020Z"
                        unit: C
                        value: "1"
                        variable: temperature
                      - created_at: "2023-09-20T14:25:13.079Z"
                        device: 6307b0b1b41f1b001a45c7e3
                        group: 7320e7f0001ad1109c00b056
                        id: 650b00c9011da1000f7e0238
                        location:
                          coordinates:
                            - -77.757328
                            - 36.68072299999999
                          type: Point
                        time: "2023-09-20T14:25:13.079Z"
                        unit: C
                        value: "12"
                        variable: temperature
                      - created_at: "2023-09-20T14:25:03.133Z"
                        device: 6307b0b1b41f1b001a45c7e3
                        group: c14fbff000c901bdfb00b056
                        id: 650b00bfdb109c000ffbf41d
                        location:
                          coordinates:
                            - -77.757328
                            - 36.68072299999999
                          type: Point
                        time: "2023-09-20T14:25:03.133Z"
                        unit: C
                        value: "66"
                        variable: temperature
                      - created_at: "2023-09-20T14:24:53.135Z"
                        device: 6307b0b1b41f1b001a45c7e3
                        group: 64a2379000439d955b00b056
                        id: 650b00b559d9340009732a47
                        location:
                          coordinates:
                            - -77.757328
                            - 36.68072299999999
                          type: Point
                        time: "2023-09-20T14:24:53.134Z"
                        unit: C
                        value: "19"
                        variable: temperature
                    status: true
    post:
      tags:
        - Devices
      summary: Send Device Data
      description: |
        Send data to a specific Device within your profile
      operationId: sendDataToDevice
      security:
        - Device-Token: []
      requestBody:
        $ref: "#/components/requestBodies/DeviceDataBody"
      responses:
        "200":
          description: Sending data
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: 2 Data Added
                  status:
                    type: boolean
                    example: true
    put:
      tags:
        - Devices
      summary: Edit Device Data
      description: >-
        Edit specific data stored in the device.

        :::info  

        This request is only available when using Mutable Storage on Devices  

        :::
      operationId: editDeviceData
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  example: 653aa3ab617c10000990718f
                value:
                  type: number
                  example: 20
            examples:
              Edit Device Data:
                value:
                  id: 653aa3ab617c10000990718f
                  value: 20
      responses:
        "200":
          description: Editing a device data
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: 1 item(s) updated
                  status:
                    type: boolean
                    example: true
              examples:
                Editing a device data:
                  value:
                    result: 1 item(s) updated
                    status: true
    delete:
      tags:
        - Devices
      summary: Delete Device Data
      description: >-
        Delete specific data stored in the device.

        :::info  

        This request is only available when using Mutable Storage on Devices  

        :::
      operationId: deleteDeviceData
      parameters:
        - $ref: "#/components/parameters/DeleteFilterQty"
        - $ref: "#/components/parameters/DeleteFilterOrdination"
        - $ref: "#/components/parameters/DeleteFilterSkip"
        - $ref: "#/components/parameters/DeleteFilterVariables"
        - $ref: "#/components/parameters/DeleteFilterValues"
        - $ref: "#/components/parameters/DeleteFilterIds"
        - $ref: "#/components/parameters/DeleteFilterGroups"
      responses:
        "200":
          description: Delete Device Data
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: 1 Data Removed
                  status:
                    type: boolean
                    example: true
    parameters:
      - name: deviceID
        in: path
        required: true
        schema:
          type: string
          example: "67aa1f9135b1a7000a9db33c"
        description: Device ID

  /run/notification:
    post:
      tags:
        - Notifications
      summary: Create Notification
      description: |
        Create Notification for an user
      operationId: createNotification
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                buttons:
                  type: array
                  items:
                    type: object
                    properties:
                      analysis:
                        type: string
                        example: 5515de2676ab4e3211109e41c
                      color:
                        type: string
                        example: green
                      id:
                        type: string
                        example: btn_1249384
                      label:
                        type: string
                        example: Acknowledge
                  example:
                    - analysis: 5515de2676ab4e3211109e41c
                      color: green
                      id: btn_1249384
                      label: Acknowledge
                buttons_autodisable:
                  type: boolean
                  example: true
                buttons_enabled:
                  type: boolean
                  example: true
                message:
                  type: string
                  example: The temperature is lower than 18ºC.
                run_user:
                  type: string
                  example: 614edef8749df6a30280012a3caef
                title:
                  type: string
                  example: Low Temperature
            examples:
              Create Notification:
                value:
                  buttons:
                    - analysis: 5515de2676ab4e3211109e41c
                      color: green
                      id: btn_1249384
                      label: Acknowledge
                  buttons_autodisable: true
                  buttons_enabled: true
                  message: The temperature is lower than 18ºC.
                  run_user: 614edef8749df6a30280012a3caef
                  title: Low Temperature
          text/plain:
            examples:
              Create Notification:
                value: "{\r\n    \"run_user\": \"<Run User ID>\",\r\n    \"title\": \"notification title\",\r\n    \"message\": \"message to be read\",\r\n    \"buttons\": [ // optional\r\n        {\r\n            \"label\": \"label of the button\",\r\n            \"id\": \"id_of_the_button\", // no space allowed\r\n            \"color\": \"color of the button\", //hexadecimal allowed\r\n            \"url\": \"url to redirect the user\", //optional\r\n            \"analysis\": \"analysis to run when clicked\" //optional\r\n        }\r\n    ],\r\n    \"buttons_enabled\": true, // optional\r\n    \"buttons_autodisable\": true // optional\r\n}"
      responses:
        "200":
          description: Creating a RUN notification
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      id:
                        type: string
                        example: 3415de2676ff4e2001109e63b
                  status:
                    type: boolean
                    example: true
              examples:
                Creating a RUN notification:
                  value:
                    result:
                      id: 3415de2676ff4e2001109e63b
                    status: true
  /run/notification/{userID}:
    get:
      tags:
        - Notifications
      summary: List Notifications
      description: |
        List of notifications for an user
      operationId: listOfNotifications
      responses:
        "200":
          description: List of the Run user notifications
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    items:
                      type: object
                      properties:
                        buttons:
                          type: array
                          items: {}
                          example: []
                        buttons_autodisable:
                          type: boolean
                          example: true
                        buttons_enabled:
                          type: boolean
                          example: true
                        created_at:
                          type: string
                          example: "2022-06-20T17:35:26.753Z"
                        id:
                          type: string
                          example: 62b0afde27ce4d0012c62256
                        message:
                          type: string
                          example: Your device has retuned to the regular temperature
                        read:
                          type: boolean
                          example: false
                        title:
                          type: string
                          example: Temperature back to normal
                    example:
                      - buttons: []
                        buttons_autodisable: true
                        buttons_enabled: true
                        created_at: "2022-06-20T17:35:26.753Z"
                        id: 62b0afde27ce4d0012c62256
                        message: Your device has retuned to the regular temperature
                        read: false
                        title: Temperature back to normal
                      - buttons: []
                        buttons_autodisable: true
                        buttons_enabled: true
                        created_at: "2022-05-26T13:12:06.753Z"
                        id: 62b0afde27ce4d0012c62286
                        message: The temperature is lower than 18ºC.
                        read: true
                        title: Low Temperature
                  status:
                    type: boolean
                    example: true
    parameters:
      - name: userID
        in: path
        required: true
        schema:
          type: string
          example: (Type a RUN user ID)
  /run/notification/{notificationID}:
    put:
      tags:
        - Notifications
      summary: Edit Notification
      description: |
        Edit notification on Run
      operationId: editNotification
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                buttons_enabled:
                  type: boolean
                  example: true
                message:
                  type: string
                  example: new notification message
                read:
                  type: boolean
                  example: true
                title:
                  type: string
                  example: new notification title
      responses:
        "200":
          description: Editing a RUN user notification
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: TagoIO Notification User Successfully Updated
                  status:
                    type: boolean
                    example: true
    delete:
      tags:
        - Notifications
      summary: Delete Notification
      description: |
        Delete notification on Run
      operationId: deleteNotification
      responses:
        "200":
          description: Deleting a RUN user notification
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: Successfully Removed
                  status:
                    type: boolean
                    example: true
    parameters:
      - name: notificationID
        in: path
        required: true
        schema:
          type: string
          example: (Type your RUN notification ID)
  /run/users/{userID}:
    get:
      tags:
        - Users
      summary: User Information
      description: |
        Get information about an user using userID
      operationId: userInformation
      responses:
        "200":
          description: Getting RUN user information by ID
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    items:
                      type: object
                      properties:
                        active:
                          type: boolean
                          example: true
                        company:
                          type: string
                          example: Companyname
                        created_at:
                          type: string
                          example: "2022-01-21T21:29:08.957Z"
                        email:
                          type: string
                          example: runuser@email
                        id:
                          type: string
                          example: 614889df6a302639012a7caef
                        language:
                          type: string
                          example: en
                        last_login:
                          type: string
                          example: "2022-06-10T17:59:26.879Z"
                        name:
                          type: string
                          example: runusername
                        newsletter:
                          example: null
                        options:
                          type: object
                          properties:
                            date_format:
                              type: string
                              example: MM/DD/YYYY
                            time_format:
                              type: string
                              example: "12"
                        otp:
                          type: object
                          properties: {}
                        phone:
                          type: string
                          example: "+010001010011"
                        profile:
                          type: string
                          example: 612ea05e3cc07803480127151133
                        tags:
                          type: array
                          items:
                            type: object
                            properties:
                              key:
                                type: string
                                example: user_type
                              value:
                                type: string
                                example: enduser
                          example:
                            - key: user_type
                              value: enduser
                            - key: limit_login
                              value: "10"
                        timezone:
                          type: string
                          example: America/New_York
                        updated_at:
                          type: string
                          example: "2022-06-14T14:16:52.377Z"
                    example:
                      - active: true
                        company: Companyname
                        created_at: "2022-01-21T21:29:08.957Z"
                        email: runuser@email
                        id: 614889df6a302639012a7caef
                        language: en
                        last_login: "2022-06-10T17:59:26.879Z"
                        name: runusername
                        newsletter: null
                        options:
                          date_format: MM/DD/YYYY
                          time_format: "12"
                        otp: {}
                        phone: "+010001010011"
                        profile: 612ea05e3cc07803480127151133
                        tags:
                          - key: user_type
                            value: enduser
                          - key: limit_login
                            value: "10"
                        timezone: America/New_York
                        updated_at: "2022-06-14T14:16:52.377Z"
                  status:
                    type: boolean
                    example: true
    put:
      tags:
        - Users
      summary: Edit User
      description: |
        Edit information about an user using userID
      operationId: editUser
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                active:
                  type: boolean
                  example: true
                company:
                  type: string
                  example: Companyname
                language:
                  type: string
                  example: en
                name:
                  type: string
                  example: runusername
                options:
                  type: object
                  properties:
                    date_format:
                      type: string
                      example: MM/DD/YYYY
                    time_format:
                      type: string
                      example: "12"
                phone:
                  type: string
                  example: "+010001010011"
                tags:
                  type: array
                  items:
                    type: object
                    properties:
                      key:
                        type: string
                        example: user_type
                      value:
                        type: string
                        example: enduser
                  example:
                    - key: user_type
                      value: enduser
                    - key: limit_login
                      value: "10"
                timezone:
                  type: string
                  example: America/New_York
      responses:
        "200":
          description: Editing a RUN user information by ID
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: TagoIO Run User Successfully Updated
                  status:
                    type: boolean
                    example: true
    delete:
      tags:
        - Users
      summary: Delete User
      description: |
        Delete user from Run using userID
      operationId: deleteUser
      responses:
        "200":
          description: Deleting a RUN user by ID
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: Successfully Removed
                  status:
                    type: boolean
                    example: true
    parameters:
      - name: userID
        in: path
        required: true
        schema:
          type: string
          example: (Type a RUN user ID)
  /run/users:
    get:
      tags:
        - Users
      summary: List Users
      description: |
        List users from Run
      operationId: listUsers
      parameters:
        - name: page
          in: query
          schema:
            type: string
            example: "1"
          description: Page number.
        - name: name
          in: query
          schema:
            type: string
            example: John Doe
          description: Filter by the RUN user's name.
        - name: email
          in: query
          schema:
            type: string
            example: runuser@email.com
          description: Filter by the RUN user's email.
        - name: timezone
          in: query
          schema:
            type: string
            example: America/New_York
          description: Filter by the RUN user's timezone.
        - name: company
          in: query
          schema:
            type: string
            example: Companyname
          description: Filter by the RUN user's company.
        - name: phone
          in: query
          schema:
            type: string
            example: "+010001010011"
          description: Filter by the RUN user's phone number.
        - name: language
          in: query
          schema:
            type: string
            example: En
          description: Filter by the RUN user's language.
        - name: tags
          in: query
          schema:
            type: string
            example: '[{"key":"tag_key","value":"tag value"}]'
          description: Filter by the RUN user's tags and keys.
        - name: active
          in: query
          schema:
            type: string
            example: "true"
          description: Filter by the RUN user's activation status.
        - name: id
          in: query
          schema:
            type: string
            example: 614889df6a302639012a7caef
          description: Filter by the RUN user's id.
        - name: last_login
          in: query
          schema:
            type: string
            example: "2021-04-15T15:52:01.102Z"
          description: Filter by the RUN user's last login.
        - name: created_at
          in: query
          schema:
            type: string
            example: "2021-07-26T13:10:39.314Z"
          description: Filter by the RUN user's creation timestamp.
        - name: amount
          in: query
          schema:
            type: string
            example: "5"
          description: Amount of RUN users by page.
        - name: orderBy
          in: query
          schema:
            type: string
            example: name,asc
          description: Order by the RUN users name/ascending/descending.
      responses:
        "200":
          description: Getting a list of RUN users
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    items:
                      type: object
                      properties:
                        active:
                          type: boolean
                          example: true
                        company:
                          type: string
                          example: Companyname
                        created_at:
                          type: string
                          example: "2022-01-21T21:29:08.957Z"
                        email:
                          type: string
                          example: runuser@email
                        id:
                          type: string
                          example: 614889df6a302639012a7caef
                        language:
                          type: string
                          example: en
                        last_login:
                          type: string
                          example: "2022-06-10T17:59:26.879Z"
                        name:
                          type: string
                          example: runusername
                        newsletter:
                          example: null
                        options:
                          type: object
                          properties:
                            date_format:
                              type: string
                              example: MM/DD/YYYY
                            time_format:
                              type: string
                              example: "12"
                        otp:
                          type: object
                          properties: {}
                        phone:
                          type: string
                          example: "+010001010011"
                        profile:
                          type: string
                          example: 612ea05e3cc07803480127151133
                        tags:
                          type: array
                          items:
                            type: object
                            properties:
                              key:
                                type: string
                                example: user_type
                              value:
                                type: string
                                example: enduser
                          example:
                            - key: user_type
                              value: enduser
                            - key: limit_login
                              value: "10"
                        timezone:
                          type: string
                          example: America/New_York
                        updated_at:
                          type: string
                          example: "2022-06-14T14:16:52.377Z"
                    example:
                      - active: true
                        company: Companyname
                        created_at: "2022-01-21T21:29:08.957Z"
                        email: runuser@email
                        id: 614889df6a302639012a7caef
                        language: en
                        last_login: "2022-06-10T17:59:26.879Z"
                        name: runusername
                        newsletter: null
                        options:
                          date_format: MM/DD/YYYY
                          time_format: "12"
                        otp: {}
                        phone: "+010001010011"
                        profile: 612ea05e3cc07803480127151133
                        tags:
                          - key: user_type
                            value: enduser
                          - key: limit_login
                            value: "10"
                        timezone: America/New_York
                        updated_at: "2022-06-14T14:16:52.377Z"
                  status:
                    type: boolean
                    example: true
    post:
      tags:
        - Users
      summary: Create User
      description: |
        Create user on Run
      operationId: createUser
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - email
                - password
              properties:
                active:
                  type: boolean
                  example: true
                email:
                  type: string
                  example: janedoe@mail.com
                name:
                  type: string
                  example: Jane Doe
                password:
                  type: string
                  example: Testing_01
                timezone:
                  type: string
                  example: New_York/America
      responses:
        "200":
          description: Creating a RUN user
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      user:
                        type: string
                        example: 62b086df27ce4d0012be6bac
                  status:
                    type: boolean
                    example: true
  /run:
    get:
      tags:
        - Tago RUN
      summary: Get RUN settings
      description: |
        Retrieve information about TagoRUN
      operationId: getRunSettings
      responses:
        "200":
          description: RUN settings retrieved
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      active:
                        type: boolean
                        example: true
                      auth_token_ttl:
                        type: string
                        example: 3 months
                      created_at:
                        type: string
                        example: "2022-06-17T00:02:20.531Z"
                      dictionary:
                        example: null
                      email_domain:
                        example: null
                      email_templates:
                        type: object
                        properties:
                          password_recover:
                            type: object
                            properties:
                              subject:
                                type: string
                                example: Password Recovery
                              value:
                                type: string
                                example: >-
                                  ### Hi $name$.


                                  You have requested to reset your password on
                                  $application.name$.


                                  Click [here]($recover_link$) and you'll be
                                  redirected to a secure site where you can set
                                  a new password.
                          welcome_actived:
                            type: object
                            properties:
                              subject:
                                type: string
                                example: Your account was activated!
                              value:
                                type: string
                                example: >-
                                  ### Hi $name$.


                                  Your account was successfully confirmed. You
                                  are now able to log in!
                          welcome_adminconfirm:
                            type: object
                            properties:
                              subject:
                                type: string
                                example: Your account is being analysed
                              value:
                                type: string
                                example: >-
                                  ### Hi $name$.


                                  Welcome!


                                  Your account creation has been submitted, but
                                  is currently being analysed. We'll keep you
                                  posted.
                          welcome_autoconfirm:
                            type: object
                            properties:
                              subject:
                                type: string
                                example: Welcome $name$!
                              value:
                                type: string
                                example: >-
                                  ### Hi $name$.


                                  Welcome!


                                  Before you start to enjoy all the features,
                                  click [here]($confirmation_link$) to confirm
                                  your email.
                      favicon:
                        example: null
                      feature_devicewifisetup:
                        type: object
                        properties:
                          background_color:
                            type: string
                            example: white
                          button_cancel_background_color:
                            type: string
                            example: white
                          button_cancel_text_color:
                            type: string
                            example: black
                          button_confirm_background_color:
                            type: string
                            example: hsl(229, 100%, 23%)
                          button_confirm_text_color:
                            type: string
                            example: white
                          enabled:
                            type: boolean
                            example: false
                          ip:
                            type: string
                            example: ""
                          language:
                            type: string
                            example: EN
                          name:
                            type: string
                            example: ""
                          port:
                            type: string
                            example: ""
                          protocol:
                            type: string
                            example: http
                          text_color:
                            type: string
                            example: rgb(60, 60, 60)
                          translations:
                            type: object
                            properties:
                              EN:
                                type: object
                                properties:
                                  done_desc:
                                    type: string
                                    example: ""
                                  done_title:
                                    type: string
                                    example: Device configured!
                                  intro_desc:
                                    type: string
                                    example: >-
                                      Let's connect your device to Wi-Fi for you
                                      to start using it.
                                  intro_img:
                                    type: string
                                    example: ""
                                  intro_title:
                                    type: string
                                    example: Begin device setup
                                  param_title:
                                    type: string
                                    example: Device found!
                                  wait_desc:
                                    type: string
                                    example: ""
                                  wait_title:
                                    type: string
                                    example: Waiting for device...
                                  wifi_config_desc:
                                    type: string
                                    example: >-
                                      Go to the Wi-Fi settings on your phone and
                                      select the AcmeTracking-XXX network. It
                                      may take up to a minute to appear on the
                                      list. After connecting your phone to the
                                      AcmeTracking-XXX network via Wi-Fi, return
                                      to the TagoRun app to continue the setup.
                                  wifi_config_title:
                                    type: string
                                    example: Manually connect to the Device Network
                      feature_geolocation:
                        example: null
                      integration:
                        type: object
                        properties:
                          google_analytics:
                            type: string
                            example: ""
                          zoho_salesiq:
                            type: string
                            example: ""
                      logo:
                        example: null
                      logo_options:
                        type: object
                        properties:
                          tooltip:
                            type: string
                            example: ""
                          type:
                            type: string
                            example: ""
                          value:
                            type: string
                            example: ""
                      name:
                        type: string
                        example: John Doe Run
                      profile:
                        type: string
                        example: 62ab4302ee089b00134f33ff
                      security:
                        type: object
                        properties: {}
                      sidebar_buttons:
                        type: array
                        items:
                          type: object
                          properties:
                            color:
                              type: string
                              example: grey
                            href:
                              type: string
                              example: /
                            iconUrl:
                              type: string
                              example: https://svg.internal.tago.io/home.svg
                            isInNewLine:
                              type: boolean
                              example: true
                            text:
                              type: string
                              example: Home
                            type:
                              type: string
                              example: ""
                        example:
                          - color: grey
                            href: /
                            iconUrl: https://svg.internal.tago.io/home.svg
                            text: Home
                            type: ""
                          - color: red
                            href: users
                            iconUrl: >-
                              https://svg.internal.tago.io/group-profile-users.svg
                            text: Users
                            type: ""
                          - color: hsl(208, 56%, 46%)
                            href: connections
                            iconUrl: https://svg.internal.tago.io/wifi.svg
                            isInNewLine: true
                            text: Connections
                            type: ""
                      signup_fields:
                        type: array
                        items: {}
                        example: []
                      signup_logo:
                        example: null
                      signup_logo_options:
                        type: object
                        properties: {}
                      signup_method:
                        type: string
                        example: default
                      sso_saml_active:
                        type: boolean
                        example: false
                      sub_title:
                        type: string
                        example: Machine Management
                      theme:
                        type: object
                        properties:
                          actionSchedule:
                            type: string
                            example: "#e6431e"
                          actionTriggerByData:
                            type: string
                            example: rgb(85, 107, 47)
                          actionTriggerByMQTT:
                            type: string
                            example: hsl(296, 32%, 43%)
                          actionTriggerByResource:
                            type: string
                            example: hsl(208, 56%, 45%)
                          alertActionDangerBackground:
                            type: string
                            example: hsl(0, 49%, 54%)
                          alertActionInfoBackground:
                            type: string
                            example: hsl(200, 74%, 88%)
                          alertActionWarningBackground:
                            type: string
                            example: hsl(50, 100%, 86%)
                          alertDangerBackground:
                            type: string
                            example: hsl(0, 60%, 92%)
                          alertInfoBackground:
                            type: string
                            example: hsl(200, 65%, 91%)
                          alertWarningBackground:
                            type: string
                            example: hsl(50, 100%, 94%)
                          analysisExternal:
                            type: string
                            example: hsl(27, 80%, 49%)
                          analysisInternal:
                            type: string
                            example: hsl(208, 56%, 46%)
                          auth_bg_opacity:
                            type: number
                            example: 100
                          auth_bg_src:
                            type: string
                            example: ""
                          auth_bg_type:
                            type: string
                            example: default
                          auth_form_opacity:
                            example: null
                          blueprint:
                            type: string
                            example: hsl(230, 100%, 32%)
                          buttonDanger:
                            type: string
                            example: "#e40000"
                          buttonDangerText:
                            type: string
                            example: hsl(0, 100%, 100%)
                          buttonDefault:
                            type: string
                            example: hsl(0, 0%, 100%)
                          buttonDefaultText:
                            type: string
                            example: hsl(0, 0%, 0%)
                          buttonDisabled:
                            type: string
                            example: hsl(0, 0%, 90%)
                          buttonDisabledText:
                            type: string
                            example: hsl(0, 0%, 0%)
                          buttonIconLabel:
                            type: string
                            example: hsl(0, 4%, 29%)
                          buttonPrimary:
                            type: string
                            example: hsl(229, 100%, 23%)
                          buttonPrimaryText:
                            type: string
                            example: hsl(0, 0%, 100%)
                          buttonSuccess:
                            type: string
                            example: "#007d05"
                          buttonSuccessText:
                            type: string
                            example: hsl(0, 0%, 100%)
                          buttonUpgrade:
                            type: string
                            example: hsl(31, 92%, 66%)
                          buttonUpgradeText:
                            type: string
                            example: hsl(0, 0%, 0%)
                          buttonWarning:
                            type: string
                            example: hsl(31, 92%, 66%)
                          buttonWarningText:
                            type: string
                            example: hsl(0, 0%, 100%)
                          contentBackground:
                            type: string
                            example: hsl(0, 0%, 100%)
                          contentHeader:
                            type: string
                            example: hsl(0, 0%, 100%)
                          contentHeaderGradient:
                            type: string
                            example: rgb(218, 218, 220)
                          contentHeaderSeparator:
                            type: string
                            example: hsl(0, 4%, 29%)
                          contentHeaderText:
                            type: string
                            example: hsl(0, 4%, 29%)
                          dataStorageImmutable:
                            type: string
                            example: hsl(82, 39%, 30%)
                          dataStorageMutable:
                            type: string
                            example: hsl(180, 100%, 27%)
                          deviceInputOutput1Day:
                            type: string
                            example: hsl(298, 74%, 37%)
                          deviceInputOutput3Days:
                            type: string
                            example: hsl(341, 74%, 36%)
                          deviceInputOutput3Hours:
                            type: string
                            example: hsl(121, 84%, 40%)
                          deviceInputOutput6Hours:
                            type: string
                            example: hsl(29, 98%, 48%)
                          deviceInputOutputRest:
                            type: string
                            example: hsl(0, 0%, 50%)
                          deviceListAlternateRow:
                            type: string
                            example: hsla(0, 0%, 0%, .05)
                          deviceListColumn:
                            type: string
                            example: hsla(0, 0%, 0%, .05)
                          dictionaryAlertIcon:
                            type: string
                            example: hsl(0, 95%, 70%)
                          dictionaryPrimary:
                            type: string
                            example: hsl(208, 56%, 46%)
                          dottedBorder:
                            type: string
                            example: hsl(0, 4%, 29%)
                          dropdownAccent:
                            type: string
                            example: hsl(229, 100%, 23%)
                          dropdownBackground:
                            type: string
                            example: hsl(0, 0%, 100%)
                          dynamicTableAlternateRow:
                            type: string
                            example: hsla(0, 0%, 0%, .05)
                          dynamicTableColumn:
                            type: string
                            example: hsla(0, 0%, 0%, .05)
                          filesSelection:
                            type: string
                            example: hsl(207, 56%, 93%)
                          floatingSidebarTitle:
                            type: string
                            example: hsl(229, 100%, 23%)
                          footerBackground:
                            type: string
                            example: hsl(0, 0%, 100%)
                          formControlBorder:
                            type: string
                            example: hsla(0, 0%, 0%, 0.07)
                          formControlFocus:
                            type: string
                            example: hsl(208, 56%, 46%)
                          gaugeDanger:
                            type: string
                            example: "#C02416"
                          gaugeEmpty:
                            type: string
                            example: hsl(0, 0%, 80%)
                          gaugeFill:
                            type: string
                            example: hsl(208, 56%, 46%)
                          gaugePrimaryText:
                            type: string
                            example: hsl(0, 0%, 0%)
                          gaugeSecondaryText:
                            type: string
                            example: hsl(0, 0%, 45%)
                          gaugeTick:
                            type: string
                            example: hsl(0, 0%, 57%)
                          html5:
                            type: string
                            example: hsl(14, 93%, 54%)
                          iconRadioSelected:
                            type: string
                            example: hsl(0, 0%, 33%)
                          iconRadioSubTitle:
                            type: string
                            example: hsl(0, 0%, 45%)
                          informationIcon:
                            type: string
                            example: hsl(229, 100%, 23%)
                          inputBackground:
                            type: string
                            example: hsl(0, 0%, 99%)
                          inputBackgroundReadOnly:
                            type: string
                            example: hsl(0, 0%, 95%)
                          inputError:
                            type: string
                            example: "#e40000"
                          inputForeground:
                            type: string
                            example: hsl(225, 6%, 13%)
                          inputForegroundReadOnly:
                            type: string
                            example: hsl(0, 0%, 45%)
                          lightBorder:
                            type: string
                            example: hsla(0, 0%, 0%, 0.1)
                          limitAlert:
                            type: string
                            example: hsl(0, 49%, 54%)
                          link:
                            type: string
                            example: hsl(208, 56%, 46%)
                          listNavColor:
                            type: string
                            example: hsl(0, 0%, 100%)
                          listTitleLabel:
                            type: string
                            example: hsl(0, 0%, 33%)
                          loading:
                            type: string
                            example: hsl(0, 0%, 20%)
                          loginButton:
                            type: string
                            example: hsl(229, 81%, 54%)
                          loginButtonText:
                            type: string
                            example: hsl(0, 100%, 100%)
                          loginForeground:
                            type: string
                            example: hsl(0, 4%, 29%)
                          loginForm:
                            type: string
                            example: hsla(0, 100%, 100%, 1)
                          modalContainer:
                            type: string
                            example: hsl(0, 0%, 100%)
                          modalOverlay:
                            type: string
                            example: hsla(0, 0%, 0%, 0.5)
                          navDescription:
                            type: string
                            example: hsl(0, 0%, 55%)
                          navbar:
                            type: string
                            example: hsl(229, 100%, 23%)
                          navbarBetaDeveloperBorder:
                            type: string
                            example: rgb(0, 255, 126)
                          navbarButton:
                            type: string
                            example: hsl(229, 100%, 23%)
                          navbarDropdownBackground:
                            type: string
                            example: hsl(0, 0%, 100%)
                          navbarDropdownBorder:
                            type: string
                            example: hsl(0, 0%, 80%)
                          navbarDropdownOption:
                            type: string
                            example: hsl(0, 0%, 30%)
                          navbarDropdownOptionBackground:
                            type: string
                            example: hsl(0, 0%, 98%)
                          navbarDropdownOptionBorder:
                            type: string
                            example: rgb(225, 225, 225)
                          navbarDropdownOptionHover:
                            type: string
                            example: hsl(0, 0%, 94%)
                          navbarDropdownSecondaryText:
                            type: string
                            example: rgb(150, 150, 150)
                          navbarDropdownSignoutButton:
                            type: string
                            example: hsl(0, 0%, 100%)
                          navbarSettings:
                            type: string
                            example: hsl(0, 0%, 55%)
                          navbarText:
                            type: string
                            example: hsl(0, 100%, 100%)
                          notificationButtonAmount:
                            type: string
                            example: hsl(354, 81%, 60%)
                          notificationButtonAmountText:
                            type: string
                            example: hsl(0, 100%, 100%)
                          notificationEmptyIcon:
                            type: string
                            example: hsl(0, 0%, 78%)
                          notificationEmptyTitle:
                            type: string
                            example: hsl(0, 0%, 62%)
                          notificationFilterBackground:
                            type: string
                            example: hsl(240,4%,95%)
                          notificationFilterMessageIcon:
                            type: string
                            example: rgba(0, 0, 0, 0.2)
                          notificationFooter:
                            type: string
                            example: hsl(0, 0%, 98%)
                          notificationIconContainer:
                            type: string
                            example: rgba(0, 0, 0, 0.04)
                          notificationItem:
                            type: string
                            example: hsl(0, 0%, 100%)
                          notificationItemBorder:
                            type: string
                            example: hsl(0, 0%, 90%)
                          notificationItemDate:
                            type: string
                            example: rgba(0, 0, 0, 0.4)
                          notificationItemTextAccepted:
                            type: string
                            example: hsl(0, 0%, 62%)
                          notificationItemUnread:
                            type: string
                            example: hsla(0, 0%, 97%, 1)
                          notificationText:
                            type: string
                            example: hsl(0, 4%, 29%)
                          pdf:
                            type: string
                            example: hsl(3, 97%, 48%)
                          primary:
                            type: string
                            example: hsl(229, 100%, 23%)
                          publicPageNavigationBar:
                            type: string
                            example: "#007d05"
                          quickstart:
                            type: string
                            example: hsl(233, 45%, 50%)
                          quickstartSidebarBackground:
                            type: string
                            example: hsl(220, 16%, 96%)
                          quickstartTask:
                            type: string
                            example: hsl(223, 12%, 89%)
                          quickstartTaskFinished:
                            type: string
                            example: hsl(155, 54%, 46%)
                          quickstartText:
                            type: string
                            example: hsl(0, 100%, 100%)
                          regularText:
                            type: string
                            example: hsl(0, 4%, 29%)
                          sidebarAccessSelected:
                            type: string
                            example: hsl(300, 100%, 25%)
                          sidebarAccountSelected:
                            type: string
                            example: hsl(43, 94%, 37%)
                          sidebarActionSelected:
                            type: string
                            example: "#e6431e"
                          sidebarAnalysisSelected:
                            type: string
                            example: "#294E80"
                          sidebarBackground:
                            type: string
                            example: hsl(0, 0%, 100%)
                          sidebarBillingSelected:
                            type: string
                            example: rgb(28, 117, 8)
                          sidebarConnector:
                            type: string
                            example: hsl(208, 56%, 46%)
                          sidebarDashboardSelected:
                            type: string
                            example: hsl(321, 84%, 38%)
                          sidebarDeviceSelected:
                            type: string
                            example: "#118c8c"
                          sidebarExploreSelected:
                            type: string
                            example: hsl(206, 74%, 52%)
                          sidebarFileSelected:
                            type: string
                            example: "#ea8d13"
                          sidebarForegroundIcon:
                            type: string
                            example: hsl(0, 4%, 29%)
                          sidebarHomeSelected:
                            type: string
                            example: hsl(208, 56%, 46%)
                          sidebarIntegration:
                            type: string
                            example: hsl(0, 0%, 25%)
                          sidebarItem:
                            type: string
                            example: hsl(240, 4%, 100%)
                          sidebarItemHover:
                            type: string
                            example: hsl(240, 4%, 95%)
                          sidebarItemOdd:
                            type: string
                            example: rgba(0, 0, 0, .015)
                          sidebarItemSelected:
                            type: string
                            example: hsl(240, 4%, 97%)
                          sidebarNetwork:
                            type: string
                            example: hsl(156, 74%, 25%)
                          sidebarRibbon:
                            type: string
                            example: hsl(0, 0%, 97%)
                          sidebarRunSelected:
                            type: string
                            example: rgb(120, 90, 255)
                          sidebarSecondBackground:
                            type: string
                            example: hsl(240, 4%, 95%)
                          sidebarSeparator:
                            type: string
                            example: hsl(0, 0%, 100%)
                          sidebarSeparatorForeground:
                            type: string
                            example: hsla(0, 0%, 0%, .5)
                          sidebarTagoCoreSelected:
                            type: string
                            example: hsl(0, 0%, 0%)
                          sidebarText:
                            type: string
                            example: hsl(0, 4%, 29%)
                          sidebarUserSelected:
                            type: string
                            example: rgb(113, 20, 20)
                          snakeButtonOutline:
                            type: string
                            example: hsl(0, 0%, 60%)
                          svgTagoFont:
                            type: string
                            example: hsl(208, 56%, 46%)
                          svgTagoIOHole:
                            type: string
                            example: hsl(0, 0%, 100%)
                          switchDisabledBackground:
                            type: string
                            example: hsl(0, 0%, 77%)
                          switchLabelDark:
                            type: string
                            example: hsl(0, 0%, 97%)
                          switchLabelWhite:
                            type: string
                            example: hsla(0, 0%, 0%, .5)
                          switchSlider:
                            type: string
                            example: hsl(0, 0%, 100%)
                          tabLabelActive:
                            type: string
                            example: hsl(208, 56%, 46%)
                          tabLabelBackground:
                            type: string
                            example: hsl(240, 4%, 95%)
                          tabLabelBorder:
                            type: string
                            example: hsl(204, 12%, 92%)
                          tabLabelHover:
                            type: string
                            example: hsl(0, 0%, 100%)
                          tabText:
                            type: string
                            example: hsl(0, 4%, 29%)
                          tableBackground:
                            type: string
                            example: hsl(0, 100%, 100%)
                          tableBorder:
                            type: string
                            example: hsla(0, 0%, 0%, 0.1)
                          tableEvenRowBackground:
                            type: string
                            example: hsla(0, 0%, 0%, 0.03)
                          tableFooterBackground:
                            type: string
                            example: hsl(240, 4%, 95%)
                          tableOddRowBackground:
                            type: string
                            example: hsl(0, 100%, 100%)
                          toast:
                            type: string
                            example: hsl(0,0%,100%)
                          toastText:
                            type: string
                            example: hsl(0, 4%, 29%)
                          tooltipContainer:
                            type: string
                            example: hsl(229, 100%, 23%)
                          tooltipText:
                            type: string
                            example: hsl(0, 0%, 100%)
                          verticalTabItem:
                            type: string
                            example: hsl(240, 20%, 98%)
                          verticalTabItemBorder:
                            type: string
                            example: hsl(204, 12%, 92%)
                          widgetCardBackground:
                            type: string
                            example: hsl(0, 0%, 100%)
                          widgetColors:
                            type: string
                            example: hsl(208, 56%, 46%)
                          widgetIconsAccent:
                            type: string
                            example: hsl(229, 100%, 23%)
                          widgetIconsBackground:
                            type: string
                            example: hsl(0, 0%, 100%)
                          widgetIconsColor:
                            type: string
                            example: hsl(0, 4%, 29%)
                          widgetIconsFooterBasic:
                            type: string
                            example: hsl(0, 0%, 97%)
                          widgetIconsFooterPremium:
                            type: string
                            example: hsl(53, 100%, 55%)
                      updated_at:
                        type: string
                        example: "2022-06-17T00:02:20.531Z"
                      url:
                        type: string
                        example: 62ab4302ee089b00134f33ff.run.tago.io
                  status:
                    type: boolean
                    example: true
    put:
      tags:
        - Tago RUN
      summary: Edit RUN settings
      description: |
        Edit information about TagoRUN
      operationId: editSettings
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                active:
                  type: boolean
                  example: true
                name:
                  type: string
                  example: My new RUN name
                profile:
                  type: string
                  example: 612ea05e3cc07803480127151133
                url:
                  type: string
                  example: 612ea05e3cc07803480127151133.run.tago.io
      responses:
        "200":
          description: Editing RUN information
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: TagoIO Run Successfully Updated
                  status:
                    type: boolean
                    example: true

  /run/users/{userID}/login:
    get:
      tags:
        - Tago RUN
      summary: Get User Token
      description: |
        Get TagoRUN User Token and allow to perform request to TagoRUN specific endpoints (not available).
      operationId: loginAsUser
      parameters:
        - name: expire_time
          in: query
          schema:
            type: string
            example: 3 months
          description: hours,days,months.
      responses:
        "200":
          description: Login as a RUN User
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      expire_time:
                        type: string
                        example: "2022-06-21T03:01:10.908Z"
                      name:
                        type: string
                        example: Login by Run Administrator(runadmin@mail.com)
                      run_user:
                        type: string
                        example: 61eb25a4d6a4a20011d4cd3c
                      token:
                        type: string
                        example: fe82f846-d19c-42b3-863a-7e7dgcd519e6
                  status:
                    type: boolean
                    example: true

    parameters:
      - name: userID
        in: path
        required: true
        schema:
          type: string
          example: (Type a RUN user ID)
  /entity:
    get:
      tags:
        - Entity
      summary: List Entities
      description: List Entities
      operationId: listEntities
      parameters:
        - name: page
          in: query
          schema:
            type: string
            example: number
          description: (default 1)
        - name: amount
          in: query
          schema:
            type: string
            example: number
          description: "(default: 20, max: 100)"
        - name: filter
          in: query
          schema:
            type: string
            example: "[name]"
          description: string
        - name: orderBy
          in: query
          schema:
            type: string
            example: created_at | updated_at
        - name: fields
          in: query
          schema:
            type: string
          description: comma-separated list of fields to return
      responses:
        "200":
          description: Listing entity by field / Listing entity by tags
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    items:
                      type: object
                      properties:
                        created_at:
                          type: string
                          example: "2024-11-05T18:32:25.522Z"
                        id:
                          type: string
                          example: 672a64b91807cd0008baa4d5
                        name:
                          type: string
                          example: Control Entity
                        profile:
                          type: string
                          example: 63c82c9e6a7fb4000a1f95a0
                        tags:
                          type: array
                          items:
                            type: object
                            properties:
                              key:
                                type: string
                                example: active
                              value:
                                type: string
                                example: "yes"
                          example:
                            - key: active
                              value: "yes"
                        updated_at:
                          type: string
                          example: "2024-11-05T18:32:25.522Z"
                    example:
                      - created_at: "2024-11-05T18:32:25.522Z"
                        id: 672a64b91807cd0008baa4d5
                        name: Control Entity
                        profile: 63c82c9e6a7fb4000a1f95a0
                        tags:
                          - key: active
                            value: "yes"
                        updated_at: "2024-11-05T18:32:25.522Z"
                      - created_at: "2024-11-05T18:49:16.438Z"
                        id: 672a68ac640f330009872ca3
                        name: Test Entity
                        profile: 63c82c9e6a7fb4000a1f95a0
                        tags: []
                        updated_at: "2024-11-05T18:49:16.438Z"
                  status:
                    type: boolean
                    example: true
    post:
      tags:
        - Entity
      summary: Create Entity
      description: Create Entity
      operationId: createEntity
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  example: "2938924293"
                index:
                  type: object
                  properties:
                    index_charge_amount:
                      type: object
                      properties:
                        fields:
                          type: array
                          items:
                            type: string
                            example: charge_amount
                          example:
                            - charge_amount
                name:
                  type: string
                  example: Control Entity
                schema:
                  type: object
                  properties:
                    charge_amount:
                      type: object
                      properties:
                        required:
                          type: boolean
                          example: false
                        type:
                          type: string
                          example: int
                    update_date:
                      type: object
                      properties:
                        required:
                          type: boolean
                          example: true
                        type:
                          type: string
                          example: timestamp
                tags:
                  type: array
                  items:
                    type: object
                    properties:
                      key:
                        type: string
                        example: active
                      value:
                        type: string
                        example: "yes"
                  example:
                    - key: active
                      value: "yes"
            examples:
              Create Entity:
                value:
                  id: "2938924293"
                  index:
                    index_charge_amount:
                      fields:
                        - charge_amount
                  name: Control Entity
                  schema:
                    charge_amount:
                      required: false
                      type: int
                    update_date:
                      required: true
                      type: timestamp
                  tags:
                    - key: active
                      value: "yes"
      responses:
        "200":
          description: Creating an entity
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      id:
                        type: string
                        example: 672a64b91807cd7008bae4d5
                  status:
                    type: boolean
                    example: true
  /entity/{entity_id}:
    get:
      tags:
        - Entity
      summary: Entity Information
      description: Get Entity Details
      operationId: getEntityInfo
      responses:
        "200":
          description: Getting an entity information
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      created_at:
                        type: string
                        example: "2024-11-05T18:32:25.522Z"
                      database:
                        type: string
                        example: 6229032d0620c89169acbdc0
                      id:
                        type: string
                        example: 672a64b91807cd0008baa4d5
                      index:
                        type: object
                        properties:
                          id_created_at_idx:
                            type: object
                            properties:
                              fields:
                                type: array
                                items:
                                  type: string
                                  example: id
                                example:
                                  - id
                                  - created_at
                          id_idx:
                            type: object
                            properties:
                              fields:
                                type: array
                                items:
                                  type: string
                                  example: id
                                example:
                                  - id
                          id_updated_at_idx:
                            type: object
                            properties:
                              fields:
                                type: array
                                items:
                                  type: string
                                  example: id
                                example:
                                  - id
                                  - updated_at
                          index_charge_amount:
                            type: object
                            properties:
                              fields:
                                type: array
                                items:
                                  type: string
                                  example: charge_amount
                                example:
                                  - charge_amount
                      name:
                        type: string
                        example: Control Entity
                      payload_decoder:
                        example: null
                      profile:
                        type: string
                        example: 63c82c9e6a7fb4000a1f95a0
                      schema:
                        type: object
                        properties:
                          charge_amount:
                            type: object
                            properties:
                              required:
                                type: boolean
                                example: false
                              type:
                                type: string
                                example: int
                          created_at:
                            type: object
                            properties:
                              required:
                                type: boolean
                                example: false
                              type:
                                type: string
                                example: timestamp
                          id:
                            type: object
                            properties:
                              required:
                                type: boolean
                                example: true
                              type:
                                type: string
                                example: uuid
                          int_field:
                            type: object
                            properties:
                              required:
                                type: boolean
                                example: false
                              type:
                                type: string
                                example: int
                          update_date:
                            type: object
                            properties:
                              required:
                                type: boolean
                                example: true
                              type:
                                type: string
                                example: timestamp
                          updated_at:
                            type: object
                            properties:
                              required:
                                type: boolean
                                example: false
                              type:
                                type: string
                                example: timestamp
                      tags:
                        type: array
                        items:
                          type: object
                          properties:
                            key:
                              type: string
                              example: active
                            value:
                              type: string
                              example: "yes"
                        example:
                          - key: active
                            value: "yes"
                      updated_at:
                        type: string
                        example: "2024-11-05T20:21:40.797Z"
                  status:
                    type: boolean
                    example: true
              examples:
                Getting an entity information:
                  value:
                    result:
                      created_at: "2024-11-05T18:32:25.522Z"
                      database: 6229032d0620c89169acbdc0
                      id: 672a64b91807cd0008baa4d5
                      index:
                        id_created_at_idx:
                          fields:
                            - id
                            - created_at
                        id_idx:
                          fields:
                            - id
                        id_updated_at_idx:
                          fields:
                            - id
                            - updated_at
                        index_charge_amount:
                          fields:
                            - charge_amount
                      name: Control Entity
                      payload_decoder: null
                      profile: 63c82c9e6a7fb4000a1f95a0
                      schema:
                        charge_amount:
                          required: false
                          type: int
                        created_at:
                          required: false
                          type: timestamp
                        id:
                          required: true
                          type: uuid
                        int_field:
                          required: false
                          type: int
                        update_date:
                          required: true
                          type: timestamp
                        updated_at:
                          required: false
                          type: timestamp
                      tags:
                        - key: active
                          value: "yes"
                      updated_at: "2024-11-05T20:21:40.797Z"
                    status: true
    put:
      tags:
        - Entity
      summary: Update Entity
      description: Update Entity
      operationId: updateEntity
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  example: Updated Entity
                tags:
                  type: array
                  items:
                    type: object
                    properties:
                      key:
                        type: string
                        example: active
                      value:
                        type: string
                        example: "no"
                  example:
                    - key: active
                      value: "no"
            examples:
              Update Entity:
                value:
                  name: Updated Entity
                  tags:
                    - key: active
                      value: "no"
      responses:
        "200":
          description: Updating entity name and tag
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      message:
                        type: string
                        example: Entity Successfully Updated
                  status:
                    type: boolean
                    example: true
              examples:
                Updating entity name and tag:
                  value:
                    result:
                      message: Entity Successfully Updated
                    status: true
    delete:
      tags:
        - Entity
      summary: Delete Entity
      description: Delete Entity
      operationId: deleteEntity
      responses:
        "200":
          description: Deleting an entity
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: Entity Successfully Removed
                  status:
                    type: boolean
                    example: true
              examples:
                Deleting an entity:
                  value:
                    result: Entity Successfully Removed
                    status: true
    parameters:
      - name: entity_id
        in: path
        required: true
        schema:
          type: string
          example: (Type an entity ID)
    description: Entity ID
  /entity/{entity_id}/data_amount:
    get:
      tags:
        - Entity Data
      summary: Entity Data Amount
      description: Get Entity Data Amount
      operationId: getEntityDataAmount
      responses:
        "200":
          description: Getting entity data amount
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: number
                    example: 100
                  status:
                    type: boolean
                    example: true
              examples:
                Getting entity data amount:
                  value:
                    result: 100
                    status: true
    parameters:
      - name: entity_id
        in: path
        required: true
        schema:
          type: string
          example: (Type an entity ID)
  /entity/{entity_id}/schema:
    put:
      tags:
        - Entity
      summary: Update Entity Schema
      description: Update Entity Schema
      operationId: updateEntitySchema
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                schema:
                  type: object
                  properties:
                    update_new_date:
                      type: object
                      properties:
                        action:
                          type: string
                          example: delete
            examples:
              Update Entity Schema:
                value:
                  schema:
                    update_new_date:
                      action: delete
      responses:
        "200":
          description: Updating any entity field
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      message:
                        type: string
                        example: Entity Successfully Updated
                  status:
                    type: boolean
                    example: true
    parameters:
      - name: entity_id
        in: path
        required: true
        schema:
          type: string
          example: (Type an entity ID)
    description: Entity ID
  /entity/{entity_id}/data:
    get:
      tags:
        - Entity Data
      summary: Get Entity Data
      description: Get Entity Data
      operationId: getEntityData
      parameters:
        - name: page
          in: query
          schema:
            type: string
            example: number
          description: (default 1)
        - name: amount
          in: query
          schema:
            type: string
            example: number
          description: "(default: 20, max: 1000)"
        - name: fields
          in: query
          schema:
            type: string
            example: ""
          description: comma-separated list of fields to return
        - name: order_by
          in: query
          schema:
            type: string
            example: asc/desc
        - name: filter
          in: query
          schema:
            type: string
            example: ""
          description: >-
            JSON object. Filter by an entity field. Requires the index
            paramenter
        - name: index
          in: query
          required: true
          schema:
            type: string
          description: >-
            First index searchable field from the entity field added to the
            filter parameter
      responses:
        "200":
          description: Getting entity data by filter
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    items:
                      type: object
                      properties:
                        charge_amount:
                          example: null
                        created_at:
                          type: string
                          example: "2024-11-06T11:32:36.467Z"
                        id:
                          type: string
                          example: 672b53d43bc47400095f3831
                        int_field:
                          example: null
                        monthly_revenue:
                          type: number
                          example: 2345.34
                        update_date:
                          type: string
                          example: "2024-11-01T03:00:00.000Z"
                        updated_at:
                          type: string
                          example: "2024-11-06T11:32:36.467Z"
                    example:
                      - charge_amount: null
                        created_at: "2024-11-06T11:32:36.467Z"
                        id: 672b53d43bc47400095f3831
                        int_field: null
                        monthly_revenue: 2345.34
                        update_date: "2024-11-01T03:00:00.000Z"
                        updated_at: "2024-11-06T11:32:36.467Z"
                      - charge_amount: null
                        created_at: "2024-11-06T11:34:33.380Z"
                        id: 672b5449dbac110009ce878f
                        int_field: null
                        monthly_revenue: 2193.43
                        update_date: "2024-10-01T03:00:00.000Z"
                        updated_at: "2024-11-06T11:34:33.380Z"
                      - charge_amount: null
                        created_at: "2024-11-06T11:34:47.772Z"
                        id: 672b54573bc47400095f4634
                        int_field: null
                        monthly_revenue: 2889.23
                        update_date: "2024-09-01T03:00:00.000Z"
                        updated_at: "2024-11-06T11:34:47.772Z"
                  status:
                    type: boolean
                    example: true
              examples:
                Getting entity data by filter:
                  value:
                    result:
                      - charge_amount: null
                        created_at: "2024-11-06T11:32:36.467Z"
                        id: 672b53d43bc47400095f3831
                        int_field: null
                        monthly_revenue: 2345.34
                        update_date: "2024-11-01T03:00:00.000Z"
                        updated_at: "2024-11-06T11:32:36.467Z"
                      - charge_amount: null
                        created_at: "2024-11-06T11:34:33.380Z"
                        id: 672b5449dbac110009ce878f
                        int_field: null
                        monthly_revenue: 2193.43
                        update_date: "2024-10-01T03:00:00.000Z"
                        updated_at: "2024-11-06T11:34:33.380Z"
                      - charge_amount: null
                        created_at: "2024-11-06T11:34:47.772Z"
                        id: 672b54573bc47400095f4634
                        int_field: null
                        monthly_revenue: 2889.23
                        update_date: "2024-09-01T03:00:00.000Z"
                        updated_at: "2024-11-06T11:34:47.772Z"
                    status: true
    put:
      tags:
        - Entity Data
      summary: Edit Entity Data
      description: Edit Entity Data
      operationId: editEntityData
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  example: 672b5449dbac110009ce878f
                monthly_revenue:
                  type: number
                  example: 1239.45
            examples:
              Edit Entity Data:
                value:
                  id: 672b5449dbac110009ce878f
                  monthly_revenue: 1239.45
      responses:
        "200":
          description: Editing an entity data
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: 1 item(s) updated
                  status:
                    type: boolean
                    example: true
              examples:
                Editing an entity data:
                  value:
                    result: 1 item(s) updated
                    status: true
    post:
      tags:
        - Entity Data
      summary: Add Entity Data
      description: Add Entity Data
      operationId: addEntityData
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                monthly_revenue:
                  type: number
                  example: 2345.34
                update_date:
                  type: string
                  example: "2024-11-01T03:00:00.000Z"
            examples:
              Add Entity Data:
                value:
                  monthly_revenue: 2345.34
                  update_date: "2024-11-01T03:00:00.000Z"
      responses:
        "200":
          description: Add Entity Data
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: 1 Data Added
                  status:
                    type: boolean
                    example: true
              examples:
                Add Entity Data:
                  value:
                    result: 1 Data Added
                    status: true
    delete:
      tags:
        - Entity Data
      summary: Delete Entity Data
      description: Delete Entity Data
      operationId: deleteEntityData
      responses:
        "200":
          description: Delete Entity Data
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: 2 item(s) deleted
                  status:
                    type: boolean
                    example: true
              examples:
                Delete Entity Data:
                  value:
                    result: 2 item(s) deleted
                    status: true
    parameters:
      - name: entity_id
        in: path
        required: true
        schema:
          type: string
          example: (Type an entity ID)
    description: Entity ID
  /entity/{entity_id}/data/backup:
    post:
      tags:
        - Entity Data
      summary: Export Entity Data
      description: |
        Export data from the entity to a file in the Files.
      operationId: exportEntityData
      parameters:
        - name: entity_id
          in: path
          required: true
          schema:
            type: string
          description: Entity ID
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                file_address:
                  type: string
                  example: /my_data/export.csv
                  description: Path in the Files to save the export.
                headers:
                  type: boolean
                  example: true
                  description: Whether to include headers in the export.
              required:
                - file_address
      responses:
        "200":
          description: Exporting data
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      file_address:
                        type: string
                        example: /my_data/export.csv
                  status:
                    type: boolean
                    example: true
  /dashboard/{dashboardID}/widget/{widgetID}:
    get:
      tags:
        - Widgets
      summary: Widget Information
      description: |
        Retrieve the complete JSON structure of the dashboard widget, including all settings and data/resource instructions used to populate the widget's data.
      operationId: getWidgetInformation
      responses:
        "200":
          description: Getting a widget information
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      analysis_run:
                        example: null
                      dashboard:
                        type: string
                        example: 623c74a15a13360011803f3e
                      data:
                        type: array
                        items:
                          type: object
                          properties:
                            origin:
                              type: string
                              example: 6238a3a27d792400139e5b47
                            query:
                              type: string
                              example: last_value
                            variables:
                              type: array
                              items:
                                type: string
                                example: temperature
                              example:
                                - temperature
                        example:
                          - origin: 6238a3a27d792400139e5b47
                            query: last_value
                            variables:
                              - temperature
                          - origin: 62308e38de51960019697e76
                            query: last_value
                            variables:
                              - temperature
                      display:
                        type: object
                        properties:
                          header_buttons:
                            type: array
                            items: {}
                            example: []
                          help:
                            type: string
                            example: ""
                          show_units:
                            type: boolean
                            example: true
                          show_variables:
                            type: boolean
                            example: true
                          theme:
                            type: object
                            properties:
                              color:
                                type: object
                                properties:
                                  background:
                                    type: string
                                    example: hsla(332, 33%, 73%, 1)
                                  button:
                                    type: string
                                    example: hsla(112, 91%, 58%, 1)
                                  dot:
                                    type: string
                                    example: hsla(0, 97%, 48%, 1)
                                  header:
                                    type: string
                                    example: hsla(336, 81%, 51%, 1)
                          variables:
                            type: array
                            items:
                              type: object
                              properties:
                                origin:
                                  type: string
                                  example: 6238a3a27d792400139e5b47
                                variable:
                                  type: string
                                  example: temperature
                            example:
                              - origin: 6238a3a27d792400139e5b47
                                variable: temperature
                              - origin: 62308e38de51960019697e76
                                variable: temperature
                      id:
                        type: string
                        example: 623c79da5a13360011819b1d
                      label:
                        type: string
                        example: "Display #1"
                      realtime:
                        type: boolean
                        example: true
                      resource:
                        type: array
                        items: {}
                        example: []
                      token:
                        example: null
                      type:
                        type: string
                        example: display
                  status:
                    type: boolean
                    example: true
              examples:
                Getting a widget information:
                  value:
                    result:
                      analysis_run: null
                      dashboard: 623c74a15a13360011803f3e
                      data:
                        - origin: 6238a3a27d792400139e5b47
                          query: last_value
                          variables:
                            - temperature
                        - origin: 62308e38de51960019697e76
                          query: last_value
                          variables:
                            - temperature
                      display:
                        header_buttons: []
                        help: ""
                        show_units: true
                        show_variables: true
                        theme:
                          color:
                            background: hsla(332, 33%, 73%, 1)
                            button: hsla(112, 91%, 58%, 1)
                            dot: hsla(0, 97%, 48%, 1)
                            header: hsla(336, 81%, 51%, 1)
                        variables:
                          - origin: 6238a3a27d792400139e5b47
                            variable: temperature
                          - origin: 62308e38de51960019697e76
                            variable: temperature
                      id: 623c79da5a13360011819b1d
                      label: "Display #1"
                      realtime: true
                      resource: []
                      token: null
                      type: display
                    status: true
    put:
      tags:
        - Widgets
      summary: Edit Widget
      description: |
        Edit properties of a JSON within a dashboard of your profile.
      operationId: editWidget
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                dashboard:
                  type: string
                  example: 623c74a15a13360011803f3e
                display:
                  type: object
                  properties:
                    header_buttons:
                      type: array
                      items: {}
                    show_units:
                      type: boolean
                      example: true
                    show_variables:
                      type: boolean
                      example: true
                    theme:
                      type: object
                      properties:
                        color:
                          type: object
                          properties:
                            background:
                              type: string
                              example: hsla(332, 33%, 73%, 1)
                            button:
                              type: string
                              example: hsla(112, 91%, 58%, 1)
                            dot:
                              type: string
                              example: hsla(0, 97%, 48%, 1)
                            header:
                              type: string
                              example: hsla(336, 81%, 51%, 1)
                    variables:
                      type: array
                      items:
                        type: object
                        properties:
                          origin:
                            type: string
                            example: 6238a3a27d792400139e5b47
                          variable:
                            type: string
                            example: temperature
                      example:
                        - origin: 6238a3a27d792400139e5b47
                          variable: temperature
                        - origin: 62308e38de51960019697e76
                          variable: temperature
                label:
                  type: string
                  example: "Display #1"
                realtime:
                  type: boolean
                  example: true
                type:
                  type: string
                  example: display
            examples:
              Card Widget Example:
                value:
                  display:
                    alias: Ice Cream Widget
                    header_buttons:
                      - color: null
                        icon: ""
                        text: ""
                        trigger: widget
                        widget: null
                    frame_settings:
                      shadow:
                        hide: false
                      header_visibility: show_always
                    theme:
                      color:
                        background: hsl(210, 12%, 12%)
                        header: hsl(210, 65%, 60%)
                        text: hsl(210, 20%, 92%)
                    show_variables: true
                    formula:
                      enable: false
                      unit_type: origin
                      fixed_unit: ""
                      apply_all_matching_formulas: false
                    number_format:
                      decimals: -1
                      show_thousand: false
                    max_points: 10
                    show_chart: true
                    show_unit: true
                    url: ""
                    variable: temperature
                  data:
                    - qty: 10
                      origin: 68c9baabb24379000ab1c8cc
                      variables:
                        - temperature
                  resource: []
                  id: 68c9bab8fe8818000a7ec597
                  label: Temperature
                  realtime: null
                  type: card
                  cache: null
      responses:
        "200":
          description: Editing a widget
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: Successfully Updated
                  status:
                    type: boolean
                    example: true
              examples:
                Editing a widget:
                  value:
                    result: Successfully Updated
                    status: true
    delete:
      tags:
        - Widgets
      summary: Delete Widget
      description: |
        Delete a widget from the dashboard.

        :::warning  

        Deleting a widget does not automatically remove it from the dashboard arrangement. You must manually edit the dashboard arrangement to remove the deleted widget.  

        :::

      operationId: deleteWidget
      responses:
        "200":
          description: Deleting a Widget
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: Successfully Removed
                  status:
                    type: boolean
                    example: true
              examples:
                Deleting a Widget:
                  value:
                    result: Successfully Removed
                    status: true
    parameters:
      - name: dashboardID
        in: path
        required: true
        schema:
          type: string
          example: (Type a dashboard ID)
      - name: widgetID
        in: path
        required: true
        schema:
          type: string
          example: (Type a widget ID)
  /data/{dashboardID}/{widgetID}:
    get:
      tags:
        - Widgets
      summary: Resolve Widget Data
      description: |
        Retrieve all the data necessary to display a widget, according to its configuration in the `data` and `resource` fields.
      operationId: getWidgetData
      responses:
        "200":
          description: Getting widget Data
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      content:
                        type: array
                        items:
                          type: object
                          properties:
                            data:
                              type: object
                              properties:
                                origin:
                                  type: string
                                  example: 6238a3a27d792400139e5b47
                                query:
                                  type: string
                                  example: last_value
                                variables:
                                  type: array
                                  items:
                                    type: string
                                    example: temperature
                                  example:
                                    - temperature
                            result:
                              type: array
                              items:
                                type: object
                                properties:
                                  device:
                                    type: string
                                    example: 6238a3a27d792400139e5b47
                                  group:
                                    type: string
                                    example: 3ac3e21100e473e57d9a1b26
                                  id:
                                    type: string
                                    example: 62b1a9d75e374e00112e3ca4
                                  origin:
                                    type: string
                                    example: 6238a3a27d792400139e5b47
                                  serie:
                                    type: string
                                    example: 3ac3e21100e473e57d9a1b26
                                  time:
                                    type: string
                                    example: "2022-06-21T11:21:59.415Z"
                                  value:
                                    type: number
                                    example: 71
                                  variable:
                                    type: string
                                    example: temperature
                              example:
                                - device: 6238a3a27d792400139e5b47
                                  group: 3ac3e21100e473e57d9a1b26
                                  id: 62b1a9d75e374e00112e3ca4
                                  origin: 6238a3a27d792400139e5b47
                                  serie: 3ac3e21100e473e57d9a1b26
                                  time: "2022-06-21T11:21:59.415Z"
                                  value: 71
                                  variable: temperature
                        example:
                          - data:
                              origin: 6238a3a27d792400139e5b47
                              query: last_value
                              variables:
                                - temperature
                            result:
                              - device: 6238a3a27d792400139e5b47
                                group: 3ac3e21100e473e57d9a1b26
                                id: 62b1a9d75e374e00112e3ca4
                                origin: 6238a3a27d792400139e5b47
                                serie: 3ac3e21100e473e57d9a1b26
                                time: "2022-06-21T11:21:59.415Z"
                                value: 71
                                variable: temperature
                          - data:
                              origin: 62308e38de51960019697e76
                              query: last_value
                              variables:
                                - temperature
                            result:
                              - device: 62308e38de51960019697e76
                                id: 62309cb173cb3b001a031db5
                                metadata:
                                  old_value: "45"
                                origin: 62308e38de51960019697e76
                                time: "2022-03-15T14:03:29.476Z"
                                unit: C
                                value: "33"
                                variable: temperature
                      widget:
                        type: object
                        properties:
                          analysis_run:
                            example: null
                          dashboard:
                            type: string
                            example: 623c74a15a13360011803f3e
                          data:
                            type: array
                            items:
                              type: object
                              properties:
                                origin:
                                  type: string
                                  example: 6238a3a27d792400139e5b47
                                query:
                                  type: string
                                  example: last_value
                                variables:
                                  type: array
                                  items:
                                    type: string
                                    example: temperature
                                  example:
                                    - temperature
                            example:
                              - origin: 6238a3a27d792400139e5b47
                                query: last_value
                                variables:
                                  - temperature
                              - origin: 62308e38de51960019697e76
                                query: last_value
                                variables:
                                  - temperature
                          display:
                            type: object
                            properties:
                              header_buttons:
                                type: array
                                items: {}
                                example: []
                              show_units:
                                type: boolean
                                example: true
                              show_variables:
                                type: boolean
                                example: true
                              theme:
                                type: object
                                properties:
                                  color:
                                    type: object
                                    properties:
                                      background:
                                        type: string
                                        example: hsla(332, 33%, 73%, 1)
                                      button:
                                        type: string
                                        example: hsla(112, 91%, 58%, 1)
                                      dot:
                                        type: string
                                        example: hsla(0, 97%, 48%, 1)
                                      header:
                                        type: string
                                        example: hsla(336, 81%, 51%, 1)
                              variables:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    origin:
                                      type: string
                                      example: 6238a3a27d792400139e5b47
                                    variable:
                                      type: string
                                      example: temperature
                                example:
                                  - origin: 6238a3a27d792400139e5b47
                                    variable: temperature
                                  - origin: 62308e38de51960019697e76
                                    variable: temperature
                          id:
                            type: string
                            example: 623c79da5a13360011819b1d
                          label:
                            type: string
                            example: "Display #1"
                          realtime:
                            type: string
                            example: "true"
                          resource:
                            type: array
                            items: {}
                            example: []
                          type:
                            type: string
                            example: display
                  status:
                    type: boolean
                    example: true
              examples:
                Getting widget Data:
                  value:
                    result:
                      content:
                        - data:
                            origin: 6238a3a27d792400139e5b47
                            query: last_value
                            variables:
                              - temperature
                          result:
                            - device: 6238a3a27d792400139e5b47
                              group: 3ac3e21100e473e57d9a1b26
                              id: 62b1a9d75e374e00112e3ca4
                              origin: 6238a3a27d792400139e5b47
                              serie: 3ac3e21100e473e57d9a1b26
                              time: "2022-06-21T11:21:59.415Z"
                              value: 71
                              variable: temperature
                        - data:
                            origin: 62308e38de51960019697e76
                            query: last_value
                            variables:
                              - temperature
                          result:
                            - device: 62308e38de51960019697e76
                              id: 62309cb173cb3b001a031db5
                              metadata:
                                old_value: "45"
                              origin: 62308e38de51960019697e76
                              time: "2022-03-15T14:03:29.476Z"
                              unit: C
                              value: "33"
                              variable: temperature
                      widget:
                        analysis_run: null
                        dashboard: 623c74a15a13360011803f3e
                        data:
                          - origin: 6238a3a27d792400139e5b47
                            query: last_value
                            variables:
                              - temperature
                          - origin: 62308e38de51960019697e76
                            query: last_value
                            variables:
                              - temperature
                        display:
                          header_buttons: []
                          show_units: true
                          show_variables: true
                          theme:
                            color:
                              background: hsla(332, 33%, 73%, 1)
                              button: hsla(112, 91%, 58%, 1)
                              dot: hsla(0, 97%, 48%, 1)
                              header: hsla(336, 81%, 51%, 1)
                          variables:
                            - origin: 6238a3a27d792400139e5b47
                              variable: temperature
                            - origin: 62308e38de51960019697e76
                              variable: temperature
                        id: 623c79da5a13360011819b1d
                        label: "Display #1"
                        realtime: "true"
                        resource: []
                        type: display
                    status: true
    parameters:
      - name: dashboardID
        in: path
        required: true
        schema:
          type: string
          example: (Type a dashboard ID)
      - name: widgetID
        in: path
        required: true
        schema:
          type: string
          example: (Type a widget ID)
  /dashboard/{dashboardID}/widget:
    post:
      tags:
        - Widgets
      summary: Create Widget
      description: >
        Create a widget within a specific dashboard in your profile.

        Each widget has unique properties. To ensure accuracy, we recommend opening your Admin Developer Panel, navigating to the desired Dashboard, and copying the Widget's JSON structure directly.  

        :::warning  

        After you create a widget, it is not automatically added to the dashboard's Arrangement parameter. You must manually edit the dashboard arrangement to include the widget's position in the grid.  

        :::

      operationId: createDashboardWidget
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                analysis_run:
                  type: string
                  example: Analysis to trigger when a button is pressed. Used by Form and Dynamic Table widgets.
                dashboard:
                  type: string
                  description: Your Dashboard ID
                data:
                  type: array
                  items:
                    type: object
                  description: Data that will be available to your widget.
                display:
                  type: object
                  description: The display property of your widget. Each widget has it's unique properties.
                id:
                  type: string
                label:
                  type: string
                  example: Title Label of the Widget
                realtime:
                  type: boolean
                  example: true
                type:
                  type: string
                  example: The widget unique type.
            examples:
              Card Widget Example:
                value:
                  analysis_run: null
                  display:
                    alias: Ice Cream
                    header_buttons:
                      - color: null
                        icon: ""
                        text: ""
                        trigger: widget
                        widget: null
                    help: You can edit this widget to add a message here
                    frame_settings:
                      shadow:
                        hide: false
                      header_visibility: show_always
                    theme:
                      color:
                        background: hsl(210, 12%, 12%)
                        header: hsl(210, 65%, 60%)
                        text: hsl(210, 20%, 92%)
                    show_variables: true
                    formula:
                      enable: false
                      unit_type: origin
                      fixed_unit: ""
                      apply_all_matching_formulas: false
                    number_format:
                      decimals: -1
                      show_thousand: false
                    max_points: 10
                    show_chart: true
                    show_unit: true
                    url: ""
                    variable: temperature
                  data:
                    - qty: 10
                      origin: 68c9baabb24379000ab1c8cc
                      variables:
                        - temperature
                  resource: []
                  id: 68c9bab8fe8818000a7ec597
                  label: Temperature
                  realtime: null
                  type: card
                  cache: null
      responses:
        "200":
          description: ""
    parameters:
      - name: dashboardID
        in: path
        required: true
        schema:
          type: string
          example: (Type a dashboard ID)
  /dashboard/{dashboardID}/widget/{widgetID}/token:
    get:
      tags:
        - Widgets
      summary: Generate Token
      description: |
        Generates a secure, public token for [embedding](/docs/tagoio/widgets/general/embedding-widgets-to-your-website) a specific widget from a dashboard.  
        Use this token to display the widget in external applications or websites via the TagoIO embed service.  

        Example embed URL:  

        `https://embed.REGION.tago.io?widget=YOUR-WIDGET-ID&dashboard=YOUR-DASHBOARD-ID&token=YOUR-EMBED-TOKEN`  

        This endpoint is intended for scenarios where you want to share or display a widget outside of the TagoIO platform while maintaining access control.
      operationId: generateToken
      responses:
        "200":
          description: Generating a token
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      widget_token:
                        type: string
                        example: ebe71a39-8f9f-4114-8bf3-6b3dcc19ad72
                  status:
                    type: boolean
                    example: true
              examples:
                Generating a token:
                  value:
                    result:
                      widget_token: ebe71a39-8f9f-4114-8bf3-6b3dcc19ad72
                    status: true
    parameters:
      - name: dashboardID
        in: path
        required: true
        schema:
          type: string
          example: (Type a dashboard ID)
      - name: widgetID
        in: path
        required: true
        schema:
          type: string
          example: (Type a widget ID)
  /dashboard/{dashboardID}:
    get:
      tags:
        - Dashboards
      summary: Dashboard Information
      description: |
        Get settings information of the dashboard.
      operationId: getInformation
      responses:
        "200":
          description: Getting a dashboard information
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      arrangement:
                        type: array
                        items:
                          type: object
                          properties:
                            height:
                              type: number
                              example: 3
                            tab:
                              example: null
                            widget_id:
                              type: string
                              example: 6230e740f5772600124c81e1
                            width:
                              type: number
                              example: 1
                            x:
                              type: number
                              example: 0
                            "y":
                              type: number
                              example: 0
                        example:
                          - height: 3
                            tab: null
                            widget_id: 6230e740f5772600124c81e1
                            width: 1
                            x: 0
                            "y": 0
                          - height: 3
                            tab: null
                            widget_id: 6230e75df5772600124c81e2
                            width: 1
                            x: 1
                            "y": 0
                          - height: 3
                            tab: null
                            widget_id: 6230e44cf5772600124c81de
                            width: 1
                            x: 2
                            "y": 0
                          - height: 3
                            tab: null
                            widget_id: 6230e84df5772600124c81e7
                            width: 2.3333333333333335
                            x: 0.3333333333333333
                            "y": 7
                          - height: 5
                            tab: null
                            widget_id: 62750cf1253eb800126aefc0
                            width: 2
                            x: 2.666666666666667
                            "y": 7
                      background:
                        type: object
                        properties: {}
                      blueprint_device_behavior:
                        example: null
                      blueprint_devices:
                        type: array
                        items:
                          type: object
                          properties:
                            conditions:
                              type: array
                              items:
                                type: object
                                properties:
                                  key:
                                    type: string
                                    example: kmutable
                                  value:
                                    type: string
                                    example: vmutable
                              example:
                                - key: kmutable
                                  value: vmutable
                            filter_conditions:
                              type: array
                              items: {}
                              example: []
                            id:
                              type: string
                              example: 6230e392f5772600124c81db
                            name:
                              type: string
                              example: mutable_device
                        example:
                          - conditions:
                              - key: kmutable
                                value: vmutable
                            filter_conditions: []
                            id: 6230e392f5772600124c81db
                            name: mutable_device
                          - conditions:
                              - key: kimmutable
                                value: vimmutable
                            filter_conditions: []
                            id: 6230e42af5772600124c81dc
                            name: immutable_device
                          - conditions:
                              - key: klegacy
                                value: vlegacy
                            filter_conditions: []
                            id: 6230e42af5772600124c81dd
                            name: legacy_device
                      blueprint_selector_behavior:
                        example: null
                      created_at:
                        type: string
                        example: "2022-03-15T19:05:54.839Z"
                      group_by:
                        type: array
                        items: {}
                        example: []
                      icon:
                        type: object
                        properties: {}
                      id:
                        type: string
                        example: 6230e392f5772600124c81da
                      label:
                        type: string
                        example: Device Types Blueprint
                      last_access:
                        type: string
                        example: "2022-06-21T11:51:07.642Z"
                      setup:
                        type: object
                        properties: {}
                      tabs:
                        type: array
                        items: {}
                        example: []
                      tags:
                        type: array
                        items: {}
                        example: []
                      theme:
                        example: null
                      type:
                        type: string
                        example: blueprint
                      updated_at:
                        type: string
                        example: "2022-06-21T11:51:07.642Z"
                      visible:
                        type: boolean
                        example: true
                  status:
                    type: boolean
                    example: true
              examples:
                Getting a dashboard information:
                  value:
                    result:
                      arrangement:
                        - height: 3
                          tab: null
                          widget_id: 6230e740f5772600124c81e1
                          width: 1
                          x: 0
                          "y": 0
                        - height: 3
                          tab: null
                          widget_id: 6230e75df5772600124c81e2
                          width: 1
                          x: 1
                          "y": 0
                        - height: 3
                          tab: null
                          widget_id: 6230e44cf5772600124c81de
                          width: 1
                          x: 2
                          "y": 0
                        - height: 3
                          tab: null
                          widget_id: 6230e84df5772600124c81e7
                          width: 2.3333333333333335
                          x: 0.3333333333333333
                          "y": 7
                        - height: 5
                          tab: null
                          widget_id: 62750cf1253eb800126aefc0
                          width: 2
                          x: 2.666666666666667
                          "y": 7
                      background: {}
                      blueprint_device_behavior: null
                      blueprint_devices:
                        - conditions:
                            - key: kmutable
                              value: vmutable
                          filter_conditions: []
                          id: 6230e392f5772600124c81db
                          name: mutable_device
                        - conditions:
                            - key: kimmutable
                              value: vimmutable
                          filter_conditions: []
                          id: 6230e42af5772600124c81dc
                          name: immutable_device
                        - conditions:
                            - key: klegacy
                              value: vlegacy
                          filter_conditions: []
                          id: 6230e42af5772600124c81dd
                          name: legacy_device
                      blueprint_selector_behavior: null
                      created_at: "2022-03-15T19:05:54.839Z"
                      group_by: []
                      icon: {}
                      id: 6230e392f5772600124c81da
                      label: Device Types Blueprint
                      last_access: "2022-06-21T11:51:07.642Z"
                      setup: {}
                      tabs: []
                      tags: []
                      theme: null
                      type: blueprint
                      updated_at: "2022-06-21T11:51:07.642Z"
                      visible: true
                    status: true
    put:
      tags:
        - Dashboards
      summary: Edit Dashboard
      description: |
        Modify any property of the dashboard

        :::warning
        The arrangement is **not automatically populated** when you create a widget.  
        After creating a widget, you **must manually edit the arrangement field** to include the new widget and specify its position in the dashboard.
        :::

        Each item in the arrangement array represents a widget's placement and sizing.
      operationId: editDashboard
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                label:
                  type: string
                  description: The Dashboard Label
                type:
                  type: string
                  enum:
                    - dashboard
                    - blueprint
                  example: blueprint
                  description: The type of dashboard. Can be "dashboard" or "blueprint".
                group_by:
                  type: array
                  items: {}
                visible:
                  type: boolean
                  example: true
                  description: Determines if the dashboard is visible in the sidebar. If set to false, the dashboard remains accessible from the Dashboard list.
                icon:
                  type: object
                  properties:
                    color:
                      type: string
                      example: hsl(328, 89%, 47%)
                    url:
                      type: string
                      example: >-
                        https://svg.internal.tago.io/arrowheads-pointing-to-the-left.svg
                tabs:
                  type: array
                  items:
                    type: object
                    properties:
                      key:
                        type: string
                        example: "1648142133869"
                      link:
                        type: string
                        example: ""
                      value:
                        type: string
                        example: new tab test
                  example:
                    - key: "1648142133869"
                      link: ""
                      value: new tab test
                    - key: "1648142564354"
                      link: ""
                      value: "new tab 2 "
                    - key: "1648142571171"
                      link: ""
                      value: "new tab 3 "
                tags:
                  type: array
                  items:
                    type: object
                    properties:
                      key:
                        type: string
                        example: updatedkey
                      value:
                        type: string
                        example: updatedvalue
                  example:
                    - key: updatedkey
                      value: updatedvalue
                    - key: updatedkey
                      value: updatedvalue
                blueprint_devices:
                  type: array
                  description: >
                    Only present for dashboards of type "blueprint".

                    Defines the list of devices associated with a blueprint dashboard. Each device entry describes a device type, its conditions, and optional filter conditions.
                  items:
                    type: object
                    properties:
                      id:
                        type: string
                        description: The unique identifier of the blueprint device.
                        example: 68d2f3e0a6343f0009318e4c
                      name:
                        type: string
                        description: The name of the blueprint.
                        example: sensor
                      type:
                        type: string
                        description: The type of the blueprint.
                        enum:
                          - device
                          - entity
                        example: device
                      conditions:
                        type: array
                        description: List of tag conditions that define this blueprint's characteristics.
                        items:
                          type: object
                          properties:
                            key:
                              type: string
                              description: The condition key.
                              example: is_sensor
                            value:
                              type: string
                              description: The condition value.
                              example: "true"
                        example:
                          - key: is_sensor
                            value: "true"
                      filter_conditions:
                        type: array
                        description: Optional filter conditions for the device.
                        items:
                          type: object
                          properties:
                            type:
                              type: string
                              description: The type of filter condition.
                              example: tag_match
                            tag_key:
                              type: string
                              description: The tag key to match.
                              example: location
                            blueprint_device:
                              type: string
                              description: The name of the blueprint device to match against.
                              example: customer
                        example:
                          - type: tag_match
                            tag_key: location
                            blueprint_device: customer
                  example:
                    - id: 68d2f3e0a6343f0009318e4c
                      name: sensor
                      type: device
                      conditions:
                        - key: is_sensor
                          value: "true"
                      filter_conditions: []
                    - id: 68d2f3e0a6343f0009318e4d
                      name: customer
                      type: device
                      conditions:
                        - key: company
                          value: JohnDoe
                      filter_conditions: []
                arrangement:
                  type: array
                  description: |
                    The arrangement property defines the layout and positioning of widgets within the dashboard grid.
                  items:
                    type: object
                    properties:
                      height:
                        type: number
                        example: 3
                        description: The height of the widget in grid units.
                      tab:
                        description: The tab identifier if the widget is placed in a tab, or null.
                        example: null
                      widget_id:
                        type: string
                        example: 6230e740f5772600124c81e1
                        description: The ID of the widget.
                      width:
                        type: number
                        example: 1
                        description: The width of the widget in grid units.
                      x:
                        type: number
                        example: 0
                        description: The X (column) position of the widget in the grid.
                      y:
                        type: number
                        example: 0
                        description: The Y (row) position of the widget in the grid.
                  example:
                    - height: 3
                      tab: null
                      widget_id: 6230e740f5772600124c81e1
                      width: 1
                      x: 0
                      y: 0
                    - height: 3
                      tab: null
                      widget_id: 6230e75df5772600124c81e2
                      width: 1
                      x: 1
                      y: 0
                    - height: 3
                      tab: null
                      widget_id: 6230e44cf5772600124c81de
                      width: 1
                      x: 2
                      y: 0
                    - height: 3
                      tab: null
                      widget_id: 6230e84df5772600124c81e7
                      width: 2.33
                      x: 0.33
                      y: 7
                    - height: 5
                      tab: null
                      widget_id: 62750cf1253eb800126aefc0
                      width: 2
                      x: 2.67
                      y: 7
      responses:
        "200":
          description: Updating a dashboard information
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: Successfully Updated
                  status:
                    type: boolean
                    example: true
              examples:
                Updating a dashboard information:
                  value:
                    result: Successfully Updated
                    status: true
    delete:
      tags:
        - Dashboards
      summary: Delete Dashboard
      description: |
        Delete the dashboard
      operationId: deleteDashboard
      responses:
        "200":
          description: Deleting a dashboard
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: Successfully Removed
                  status:
                    type: boolean
                    example: true
              examples:
                Deleting a dashboard:
                  value:
                    result: Successfully Removed
                    status: true
    parameters:
      - name: dashboardID
        in: path
        required: true
        schema:
          type: string
          example: (Type a dashboard ID)
  /dashboard:
    get:
      tags:
        - Dashboards
      summary: List Dashboards
      description: |
        Retrieves a list with all dashboards from the profile
      operationId: listDashboards
      parameters:
        - name: page
          in: query
          schema:
            type: string
            example: "1"
          description: Page number.
        - name: amount
          in: query
          schema:
            type: string
            example: "5"
          description: Amount of dashboards per page.
        - name: orderBy
          in: query
          schema:
            type: string
            example: name
          description: Order dashboard by name.
        - name: fields[]
          in: query
          description: |
            Select which properties to include for each dashboard in the response.
            Pass the parameter multiple times to include more than one field.

            Example: `?fields[]=label&fields[]=id&fields[]=type`
          schema:
            type: array
            items:
              type: string
              enum: [label, id, type, tags, visible, created_at, last_access]
          style: form
          explode: true
      responses:
        "200":
          description: Get a list of dashboards
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      description: Dashboard ID
                      example: "623c74a15a13360011803f3e"
                    label:
                      type: string
                      description: Dashboard title label
                      example: "Door Sensor"
                    tags:
                      type: array
                      description: Dashboard tags
                      items:
                        type: object
                        properties:
                          key:
                            type: string
                            example: "vehicle"
                          value:
                            type: string
                            example: "gas"
                      example: []
                    profile:
                      type: string
                      description: Profile ID
                      example: "612ea05e3cc0780012715111"
                    visible:
                      type: boolean
                      description: Visibility status
                      example: true
                    group_by:
                      type: array
                      description: List of tags to group in the sidebar
                      items:
                        type: string
                      example: []
                    created_at:
                      type: string
                      format: date-time
                      description: Creation timestamp
                      example: "2022-03-24T13:39:45.504Z"
                    icon:
                      type: object
                      description: Dashboard icon
                      properties:
                        color:
                          type: string
                          example: "hsl(328, 89%, 47%)"
                        url:
                          type: string
                          example: "https://svg.internal.tago.io/arrowheads-pointing-to-the-left.svg"
                      example: {}
                    last_access:
                      type: string
                      format: date-time
                      description: Last access timestamp
                      example: "2022-06-13T20:53:32.583Z"
                    type:
                      type: string
                      description: Dashboard type
                      enum: [dashboard, blueprint]
                      example: "dashboard"
                    tabs:
                      type: array
                      description: Dashboard tabs
                      items:
                        type: object
                        properties:
                          key:
                            type: string
                            example: "1648142133869"
                          link:
                            type: string
                            example: ""
                          value:
                            type: string
                            example: "tab test"
                      example: []
    post:
      tags:
        - Dashboards
      summary: Create Dashboard
      description: |
        Creates a dashboard of type Blueprint or Normal Dashboard into your profile.

        It's recommended to access your Admin Developer panel and Copy the Dashboard JSON Structure to see all available fields.
      operationId: createDashboard
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - label
                - type
              properties:
                group_by:
                  type: array
                  items: {}
                  description: List of tags to group in the sidebar
                  example: []
                icon:
                  type: object
                  properties:
                    color:
                      type: string
                      example: hsl(328, 89%, 47%)
                    url:
                      type: string
                      example: >-
                        https://svg.internal.tago.io/arrowheads-pointing-to-the-left.svg
                label:
                  type: string
                  example: Tracker dashboard
                tabs:
                  type: array
                  items:
                    type: object
                    properties:
                      key:
                        type: string
                        example: "1648142133869"
                      link:
                        type: string
                        example: ""
                      value:
                        type: string
                        example: tab test
                  example:
                    - key: "1648142133869"
                      link: ""
                      value: tab test
                    - key: "1648142564354"
                      link: ""
                      value: "tab 2 "
                    - key: "1648142571171"
                      link: ""
                      value: "tab 3 "
                tags:
                  type: array
                  items:
                    type: object
                    properties:
                      key:
                        type: string
                        example: vehicle
                      value:
                        type: string
                        example: gas
                  example:
                    - key: vehicle
                      value: gas
                    - key: speed
                      value: mph
                type:
                  type: string
                  enum:
                    - dashboard
                    - blueprint
                  example: blueprint
                  description: The type of dashboard. Can be "dashboard" or "blueprint".
                visible:
                  type: boolean
                  example: true
                  default: true
            examples:
              Create Dashboard:
                value:
                  group_by: []
                  icon:
                    color: hsl(328, 89%, 47%)
                    url: >-
                      https://svg.internal.tago.io/arrowheads-pointing-to-the-left.svg
                  label: Tracker dashboard
                  profile: 612ea05e3cc0780012715111
                  tabs:
                    - key: "1648142133869"
                      link: ""
                      value: tab test
                    - key: "1648142564354"
                      link: ""
                      value: "tab 2 "
                    - key: "1648142571171"
                      link: ""
                      value: "tab 3 "
                  tags:
                    - key: vehicle
                      value: gas
                    - key: speed
                      value: mph
                  type: dashboard
                  visible: true
      responses:
        "201":
          description: Creating a dashboard
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      dashboard:
                        type: string
                        example: 614e0aa36f480300126652f9a38
                  status:
                    type: boolean
                    example: true
              examples:
                Creating a dashboard:
                  value:
                    result:
                      dashboard: 614e0aa36f480300126652f9a38
                    status: true

  /dashboard/{dashboardID}/duplicate:
    post:
      tags:
        - Dashboards
      summary: Duplicate Dashboard
      description: |
        Duplicate an existing dashboard, including its configuration, widgets, and settings.  
        Optionally, set a new label for the duplicated dashboard and provide setup parameters to customize the copy.  

        Use this endpoint to quickly clone dashboards for reuse or further customization.
      operationId: duplicateDashboard
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                new_label:
                  type: string
                  description: New label for the duplicated dashboard.
                  example: Ice Cream Machine and Freezer - Copy
                setup:
                  type: object
                  description: Setup configuration for the duplicated dashboard.
                  properties:
                    is_configured:
                      type: boolean
                      description: Indicates if the dashboard is configured.
                      example: true
                    config:
                      type: array
                      description: List of configuration objects for the dashboard.
                      items:
                        type: object
                        properties:
                          id:
                            type: string
                            description: Analysis ID, Device ID, Blueprint Device/Entity ID.
                            example: 68c9baabb24379000ab1c8cc
                          name:
                            type: string
                            description: Reference name that will be displayed when setting up the copy.
                            example: Freezer Simulator
            examples:
              Duplicate dashboard:
                value:
                  setup:
                    is_configured: true
                    config:
                      - id: 68c9baabb24379000ab1c8cc
                        name: Freezer Simulator
                  new_label: Ice Cream Machine and Freezer - Copy
      responses:
        "201":
          description: Dashboard duplicated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      dashboard_id:
                        type: string
                        example: 62b0df7927ce4d0012cf3c10
                      message:
                        type: string
                        example: Copy sent
                  status:
                    type: boolean
                    example: true
    parameters:
      - name: dashboardID
        in: path
        required: true
        schema:
          type: string
          example: (Type a dashboard ID)

  /dashboard/{dashboardID}/share/public:
    get:
      tags:
        - Dashboards
      summary: Generate Public Token
      description: |
        Make your dashboard accessible to anyone by generating a public access token.  

        Public dashboards allow you to share live data and visualizations with users who do not have a TagoIO/TagoRUN account. 
        You control the expiration and can revoke access at any time.  

        [Learn more about sharing dashboards and public access](/docs/tagoio/dashboards/sharing-dashboards)
      operationId: generatePublicToken
      parameters:
        - name: expire_time
          in: query
          required: true
          schema:
            type: string
            example: 1 day
          description: Time given in hours,days,weeks,months
      responses:
        "200":
          description: Generating a  Public Token
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      expire_time:
                        type: string
                        example: "2022-06-20T23:10:59.285Z"
                      token:
                        type: string
                        example: 026b43fb-b33e-477a-bf17-70d1a0498562
                  status:
                    type: boolean
                    example: true
    parameters:
      - name: dashboardID
        in: path
        required: true
        schema:
          type: string
          example: (Type a dashboard ID)
  /dashboard/{dashboardID}/analysis:
    get:
      tags:
        - Dashboards
      summary: List Analysis related to Dashboard
      description: |
        List of analysis related to this dashboard
      operationId: listAnalysisRelatedToDashboard
      responses:
        "200":
          description: Getting a list of analysis related to the dashboard
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          example: 61969a2c87160b00189326e9
                        name:
                          type: string
                          example: Analysis 001
                    example:
                      - id: 61969a2c87160b00189326e9
                        name: Analysis 001
                      - id: 61969a2c87160b00189326d2
                        name: Analysis 002
                  status:
                    type: boolean
                    example: true
    parameters:
      - name: dashboardID
        in: path
        required: true
        schema:
          type: string
          example: 5f3e782ba1d6300027315c0e
  /dashboard/{dashboardID}/devices:
    get:
      tags:
        - Dashboards
      summary: List Devices related to Dashboard
      description: |
        List of devices related to this dashboard
      operationId: listDevicesRelatedToDashboard
      responses:
        "200":
          description: Getting a list of devices related to a dashboard
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          example: 6238a3a27d792400139e5b47
                        name:
                          type: string
                          example: Device 001
                    example:
                      - id: 6238a3a27d792400139e5b47
                        name: Device 001
                      - id: 6238a294ea60bc00120f0371
                        name: Device 002
                      - id: 6230e64df5772600124c81df
                        name: Device 003
                      - id: 62322173635f730011d1874c
                        name: Device 004
                  status:
                    type: boolean
                    example: true
              examples:
                Getting a list of devices related to a dashboard:
                  value:
                    result:
                      - id: 6238a3a27d792400139e5b47
                        name: Device 001
                      - id: 6238a294ea60bc00120f0371
                        name: Device 002
                      - id: 6230e64df5772600124c81df
                        name: Device 003
                      - id: 62322173635f730011d1874c
                        name: Device 004
                    status: true
    parameters:
      - name: dashboardID
        in: path
        required: true
        schema:
          type: string
          example: (Type your dashboard ID)
  /files:
    get:
      tags:
        - Files
      summary: List Files
      description: Get profile file list
      operationId: getProfileFileList
      parameters:
        - name: qty
          in: query
          schema:
            type: string
            example: number
          description: Quantity of files to be returned in the response
      responses:
        "200":
          description: Get Profile's Files List
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      files:
                        type: array
                        items:
                          type: object
                          properties:
                            filename:
                              type: string
                              example: layer01.png
                            last_modified:
                              type: string
                              example: "2023-10-16T13:25:04.000Z"
                            public:
                              type: boolean
                              example: true
                            size:
                              type: number
                              example: 63480
                        example:
                          - filename: layer01.png
                            last_modified: "2023-10-16T13:25:04.000Z"
                            public: true
                            size: 63480
                          - filename: layer02.png
                            last_modified: "2023-10-16T13:23:58.000Z"
                            public: true
                            size: 233444
                      folders:
                        type: array
                        items:
                          type: string
                          example: reports
                        example:
                          - reports
                          - image
                      total:
                        type: number
                        example: 50
                      usage:
                        type: number
                        example: 6.02
                  status:
                    type: boolean
                    example: true
              examples:
                Get Profile's Files List:
                  value:
                    result:
                      files:
                        - filename: layer01.png
                          last_modified: "2023-10-16T13:25:04.000Z"
                          public: true
                          size: 63480
                        - filename: layer02.png
                          last_modified: "2023-10-16T13:23:58.000Z"
                          public: true
                          size: 233444
                      folders:
                        - reports
                        - image
                      total: 50
                      usage: 6.02
                    status: true
    put:
      tags:
        - Files
      summary: Move File
      description: Move file location within your profile
      operationId: editAFile
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                type: object
                properties:
                  from:
                    type: string
                    example: /layer05.png
                  to:
                    type: string
                    example: /images/layer05.png
              example:
                - from: /layer05.png
                  to: /images/layer05.png
            examples:
              Edit a file:
                value:
                  - from: /layer05.png
                    to: /images/layer05.png
      responses:
        "200":
          description: Edit a file
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: Successfully Updated
                  status:
                    type: boolean
                    example: true
              examples:
                Edit a file:
                  value:
                    result: Successfully Updated
                    status: true
    post:
      tags:
        - Files
        - Upload
      summary: Upload File
      description: Upload file
      operationId: uploadFilePart
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                filename:
                  type: string
                  example: /Screenshot 2023-11-03 at 16.35.29.png
                multipart_action:
                  type: string
                  example: end
                parts:
                  type: array
                  items:
                    type: object
                    properties:
                      ETag:
                        type: string
                        example: '"0f75e3da7675ca382dac146ed1247162"'
                      PartNumber:
                        type: number
                        example: 1
                  example:
                    - ETag: '"0f75e3da7675ca382dac146ed1247162"'
                      PartNumber: 1
                upload_id:
                  type: string
                  example: >-
                    TJdGVdXNEdTQq9yIdclq8z3wPZ9dSA8NiLkDAhPb54H2FxW.k2jpsr1nmh7UeaWIYi7DdNllhDAv0JTvLWwEggYkWXhW8W7foUdlemg0aeQcj95D0yJJN65hdv9_RXYvzg7g4SiJ9YIj.y1R5LN.wvwznXnrzbOQ5hLjQ2eOqMI-
            examples:
              Upload file part 1:
                value:
                  contentType: image/png
                  filename: /Screenshot 2023-11-03 at 16.35.29.png
                  multipart_action: start
                  public: true
              Upload file part 2:
                value:
                  file: (binary)
                  filename: /Screenshot 2023-11-03 at 16.35.29.png
                  multipart_action: upload
                  part: 1
                  upload_id: >-
                    TJdGVdXNEdTQq9yIdclq8z3wPZ9dSA8NiLkDAhPb54H2FxW.
                    k2jpsr1nmh7UeaWIYi7DdNllhDAv0JTvLWwEggYkWXhW8W7foUdlemg0aeQcj95D0yJJN65hdv9_RXYvzg7g4SiJ9YIj.y1R5LN.wvwznXnrzbOQ5hLjQ2eOqMI-
              Upload file part 3:
                value:
                  filename: /Screenshot 2023-11-03 at 16.35.29.png
                  multipart_action: end
                  parts:
                    - ETag: '"0f75e3da7675ca382dac146ed1247162"'
                      PartNumber: 1
                  upload_id: >-
                    TJdGVdXNEdTQq9yIdclq8z3wPZ9dSA8NiLkDAhPb54H2FxW.k2jpsr1nmh7UeaWIYi7DdNllhDAv0JTvLWwEggYkWXhW8W7foUdlemg0aeQcj95D0yJJN65hdv9_RXYvzg7g4SiJ9YIj.y1R5LN.wvwznXnrzbOQ5hLjQ2eOqMI-
      responses:
        "200":
          description: Upload file part 1 / Upload file part 2 / Upload file part 3
          headers:
            Etag:
              schema:
                type: string
                example: W/"12e-fdk/2Vt3///sBaogLtoHsVN43c0"
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    example: >-
                      TJdGVdXNEdTQq9yIdclq8z3wPZ9dSA8NiLkDAhPb54H2FxW.k2jpsr1nmh7UeaWIYi7DdNllhDAv0JTvLWwEggYkWXhW8W7foUdlemg0aeQcj95D0yJJN65hdv9_RXYvzg7g4SiJ9YIj.y1R5LN.wvwznXnrzbOQ5hLjQ2eOqMI-
                    anyOf:
                      - type: string
                        example: >-
                          TJdGVdXNEdTQq9yIdclq8z3wPZ9dSA8NiLkDAhPb54H2FxW.k2jpsr1nmh7UeaWIYi7DdNllhDAv0JTvLWwEggYkWXhW8W7foUdlemg0aeQcj95D0yJJN65hdv9_RXYvzg7g4SiJ9YIj.y1R5LN.wvwznXnrzbOQ5hLjQ2eOqMI-
                      - type: object
                        properties:
                          $metadata:
                            type: object
                            properties:
                              attempts:
                                type: number
                                example: 1
                              extendedRequestId:
                                type: string
                                example: >-
                                  etfQlHP3vxwKW5DnCMCxnNvqHxmq8YxostIXn3qP0GwM34BtB11KAKuU7it4+REbO7iJKMobqZI=
                              httpStatusCode:
                                type: number
                                example: 200
                              requestId:
                                type: string
                                example: 7V63NVZWY2EZFVQJ
                              totalRetryDelay:
                                type: number
                                example: 0
                          ETag:
                            type: string
                            example: '"0f75e3da7675ca382dac146ed1247162"'
                          ServerSideEncryption:
                            type: string
                            example: AES256
                      - type: object
                        properties:
                          file:
                            type: string
                            example: >-
                              https://api.tago.io/file/61fab40aa5c9f40012a5ff93/Screenshot%202023-11-03%20at%2016.35.29.png
                  status:
                    type: boolean
                    example: true
              examples:
                Upload file part 1:
                  value:
                    result: >-
                      TJdGVdXNEdTQq9yIdclq8z3wPZ9dSA8NiLkDAhPb54H2FxW.k2jpsr1nmh7UeaWIYi7DdNllhDAv0JTvLWwEggYkWXhW8W7foUdlemg0aeQcj95D0yJJN65hdv9_RXYvzg7g4SiJ9YIj.y1R5LN.wvwznXnrzbOQ5hLjQ2eOqMI-
                    status: true
                Upload file part 2:
                  value:
                    result:
                      $metadata:
                        attempts: 1
                        extendedRequestId: >-
                          etfQlHP3vxwKW5DnCMCxnNvqHxmq8YxostIXn3qP0GwM34BtB11KAKuU7it4+REbO7iJKMobqZI=
                        httpStatusCode: 200
                        requestId: 7V63NVZWY2EZFVQJ
                        totalRetryDelay: 0
                      ETag: '"0f75e3da7675ca382dac146ed1247162"'
                      ServerSideEncryption: AES256
                    status: true
                Upload file part 3:
                  value:
                    result:
                      file: >-
                        https://api.tago.io/file/61fab40aa5c9f40012a5ff93/Screenshot%202023-11-03%20at%2016.35.29.png
                    status: true
    delete:
      tags:
        - Files
      summary: Delete a File
      description: Delete a file
      operationId: deleteAFile
      responses:
        "200":
          description: Deleting a file
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: Successfully Removed
                  status:
                    type: boolean
                    example: true
              examples:
                Deleting a file:
                  value:
                    result: Successfully Removed
                    status: true
  /files/permission:
    put:
      tags:
        - Files
      summary: Edit Permission
      description: Edit Permission
      operationId: editPermission
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                type: object
                properties:
                  file:
                    type: string
                    example: /layer05.png
                  public:
                    type: boolean
                    example: true
              example:
                - file: /layer05.png
                  public: true
            examples:
              Edit Permission:
                value:
                  - file: /layer05.png
                    public: true
      responses:
        "200":
          description: Editing file to be public
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: Successfully Updated
                  status:
                    type: boolean
                    example: true
              examples:
                Editing file to be public:
                  value:
                    result: Successfully Updated
                    status: true
  /files/copy:
    put:
      tags:
        - Files
      summary: Copy File
      description: File Copy
      operationId: fileCopy
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                type: object
                properties:
                  from:
                    type: string
                    example: /layer05.png
                  to:
                    type: string
                    example: /layer05 - Copy.png
              example:
                - from: /layer05.png
                  to: /layer05 - Copy.png
            examples:
              File Copy:
                value:
                  - from: /layer05.png
                    to: /layer05 - Copy.png
      responses:
        "200":
          description: Making a file copy
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: Successfully Updated
                  status:
                    type: boolean
                    example: true
              examples:
                Making a file copy:
                  value:
                    result: Successfully Updated
                    status: true
  /account/plan:
    get:
      tags:
        - Statistics / Billing
      summary: Account Plan
      description: Get the Account Plan
      operationId: getTheAccountPlan
      responses:
        "200":
          description: Getting the account plan
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      plan:
                        type: string
                        example: starter
                  status:
                    type: boolean
                    example: true
              examples:
                Getting the account plan:
                  value:
                    result:
                      plan: starter
                    status: true
  /account/allocation:
    get:
      tags:
        - Account
      summary: Resources Allocation
      description: Get account resources allocation
      operationId: getAccountResourcesAllocation
      responses:
        "200":
          description: Get account resources' allocation
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    items:
                      type: object
                      properties:
                        analysis:
                          type: number
                          example: 200
                        data_records:
                          type: number
                          example: 6667
                        email:
                          type: number
                          example: 17
                        file_storage:
                          type: number
                          example: 80
                        input:
                          type: number
                          example: 33334
                        output:
                          type: number
                          example: 100000
                        profile:
                          type: string
                          example: 62cdb70512b7320012dc2880
                        push_notification:
                          type: number
                          example: 4
                        run_users:
                          type: number
                          example: 0
                        sms:
                          type: number
                          example: 5
                        updated_at:
                          type: string
                          example: "2022-07-15T12:11:07.521Z"
                    example:
                      - analysis: 200
                        data_records: 6667
                        email: 17
                        file_storage: 80
                        input: 33334
                        output: 100000
                        profile: 62cdb70512b7320012dc2880
                        push_notification: 4
                        run_users: 0
                        sms: 5
                        updated_at: "2022-07-15T12:11:07.521Z"
                      - analysis: 1600
                        data_records: 633333
                        email: 43
                        file_storage: 100
                        input: 433333
                        output: 1800000
                        profile: 612ea05e3cc0780012715111
                        push_notification: 83
                        run_users: 8
                        sms: 0
                        updated_at: "2022-07-15T12:11:07.521Z"
                      - analysis: 1200
                        data_records: 160000
                        email: 40
                        file_storage: 20
                        input: 533333
                        output: 1100000
                        profile: 61fab4d9a5c9f40012a5ff93
                        push_notification: 13
                        run_users: 2
                        sms: 5
                        updated_at: "2022-07-15T12:11:07.521Z"
                  status:
                    type: boolean
                    example: true
              examples:
                Get account resources' allocation:
                  value:
                    result:
                      - analysis: 200
                        data_records: 6667
                        email: 17
                        file_storage: 80
                        input: 33334
                        output: 100000
                        profile: 62cdb70512b7320012dc2880
                        push_notification: 4
                        run_users: 0
                        sms: 5
                        updated_at: "2022-07-15T12:11:07.521Z"
                      - analysis: 1600
                        data_records: 633333
                        email: 43
                        file_storage: 100
                        input: 433333
                        output: 1800000
                        profile: 612ea05e3cc0780012715111
                        push_notification: 83
                        run_users: 8
                        sms: 0
                        updated_at: "2022-07-15T12:11:07.521Z"
                      - analysis: 1200
                        data_records: 160000
                        email: 40
                        file_storage: 20
                        input: 533333
                        output: 1100000
                        profile: 61fab4d9a5c9f40012a5ff93
                        push_notification: 13
                        run_users: 2
                        sms: 5
                        updated_at: "2022-07-15T12:11:07.521Z"
                    status: true
    post:
      tags:
        - Account
      summary: Update Resources Allocation
      description: Update the account resources allocation
      operationId: updateTheAccountResourcesAllocation
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                type: object
                required:
                  - profile
                properties:
                  profile:
                    type: string
                    example: 62cdb70512b7320012dc0880
                  analysis:
                    type: number
                    example: 200
                  data_records:
                    type: number
                    example: 6667
                  email:
                    type: number
                    example: 17
                  file_storage:
                    type: number
                    example: 80
                  input:
                    type: number
                    example: 33334
                  output:
                    type: number
                    example: 100000
                  push_notification:
                    type: number
                    example: 4
                  run_users:
                    type: number
                    example: 0
                  sms:
                    type: number
                    example: 5
              example:
                - analysis: 200
                  data_records: 6667
                  email: 17
                  file_storage: 80
                  input: 33334
                  output: 100000
                  profile: 62cdb70512b7320012dc0880
                  push_notification: 4
                  run_users: 0
                  sms: 5
                - analysis: 1600
                  data_records: 633333
                  email: 43
                  file_storage: 100
                  input: 433333
                  output: 1800000
                  profile: 612ea05e3cc07800127u5111
                  push_notification: 83
                  run_users: 8
                  sms: 0
                - analysis: 1100
                  data_records: 160000
                  email: 40
                  file_storage: 20
                  input: 533333
                  output: 1100000
                  profile: 61fab4d9a5c9f40012a5wf93
                  push_notification: 13
                  run_users: 2
                  sms: 5
            examples:
              Update the account resources allocation:
                value:
                  - analysis: 200
                    data_records: 6667
                    email: 17
                    file_storage: 80
                    input: 33334
                    output: 100000
                    profile: 62cdb70512b7320012dc0880
                    push_notification: 4
                    run_users: 0
                    sms: 5
                  - analysis: 1600
                    data_records: 633333
                    email: 43
                    file_storage: 100
                    input: 433333
                    output: 1800000
                    profile: 612ea05e3cc07800127u5111
                    push_notification: 83
                    run_users: 8
                    sms: 0
                  - analysis: 1100
                    data_records: 160000
                    email: 40
                    file_storage: 20
                    input: 533333
                    output: 1100000
                    profile: 61fab4d9a5c9f40012a5wf93
                    push_notification: 13
                    run_users: 2
                    sms: 5
      responses:
        "200":
          description: Update the account's allocation
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: Profile resource allocation Successfully Updated
                  status:
                    type: boolean
                    example: true
              examples:
                Update the account's allocation:
                  value:
                    result: Profile resource allocation Successfully Updated
                    status: true
  /account/login:
    post:
      tags:
        - Account
      summary: Login to Account
      description: |
        Login to account using email and password
      operationId: loginToAccount
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - email
                - password
              properties:
                email:
                  type: string
                  example: example@mail.com
                password:
                  type: string
                  example: yourpassword
            examples:
              Login to Account:
                value:
                  email: example@mail.com
                  password: yourpassword
      responses:
        "200":
          description: Login
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      company:
                        type: string
                        example: companyname
                      email:
                        type: string
                        example: example@mail.com
                      id:
                        type: string
                        example: 612ea05e3cc078001371895110
                      name:
                        type: string
                        example: Your Name
                      phone:
                        type: string
                        example: "+9396363457126"
                      profiles:
                        type: array
                        items:
                          type: object
                          properties:
                            account:
                              type: string
                              example: 612ea05e3cc078001371895110
                            id:
                              type: string
                              example: 612ea05e3cc078001371895111
                            logo_url:
                              example: null
                            name:
                              type: string
                              example: profilename
                        example:
                          - account: 612ea05e3cc078001371895110
                            id: 612ea05e3cc078001371895111
                            logo_url: null
                            name: profilename
                      type:
                        type: string
                        example: user
                  status:
                    type: boolean
                    example: true
  /account:
    get:
      tags:
        - Account
      summary: Account Information
      description: |
        Get all information from current account
      operationId: getAccountInformation
      responses:
        "200":
          description: Get information about account
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      active:
                        type: boolean
                        example: true
                      blocked:
                        type: boolean
                        example: false
                      company:
                        type: string
                        example: companyname
                      created_at:
                        type: string
                        example: "2021-08-31T21:34:22.107Z"
                      email:
                        type: string
                        example: example@email.com
                      id:
                        type: string
                        example: 612ea05e3cc07800127152207
                      language:
                        type: string
                        example: en
                      last_login:
                        type: string
                        example: "2021-09-13T17:59:30.983Z"
                      name:
                        type: string
                        example: Account Name
                      newsletter:
                        type: boolean
                        example: true
                      options:
                        type: object
                        properties:
                          decimal_separator:
                            type: string
                            example: ","
                          last_whats_new:
                            type: string
                            example: "2021-08-02T18:00:00.000Z"
                          thousand_separator:
                            type: string
                            example: .
                          user_view_welcome:
                            type: boolean
                            example: true
                      otp:
                        type: object
                        properties: {}
                      phone:
                        example: null
                      plan:
                        type: string
                        example: free
                      send_invoice:
                        type: boolean
                        example: false
                      stripe_id:
                        example: null
                      timezone:
                        type: string
                        example: America/Sao_Paulo
                      type:
                        type: string
                        example: user
                      updated_at:
                        type: string
                        example: "2021-09-09T19:21:52.049Z"
                  status:
                    type: boolean
                    example: true
              examples:
                Get information about account:
                  value:
                    result:
                      active: true
                      blocked: false
                      company: companyname
                      created_at: "2021-08-31T21:34:22.107Z"
                      email: example@email.com
                      id: 612ea05e3cc07800127152207
                      language: en
                      last_login: "2021-09-13T17:59:30.983Z"
                      name: Account Name
                      newsletter: true
                      options:
                        decimal_separator: ","
                        last_whats_new: "2021-08-02T18:00:00.000Z"
                        thousand_separator: .
                        user_view_welcome: true
                      otp: {}
                      phone: null
                      plan: free
                      send_invoice: false
                      stripe_id: null
                      timezone: America/Sao_Paulo
                      type: user
                      updated_at: "2021-09-09T19:21:52.049Z"
                    status: true
    put:
      tags:
        - Account
      summary: Edit Account
      description: |
        Edit current account
      operationId: editAccount
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                company:
                  type: string
                  example: TagoIO
                language:
                  type: string
                  example: en
                name:
                  type: string
                  example: John Doee
                options:
                  type: object
                  properties:
                    date_format:
                      type: string
                      example: YYYY-MM-DD
                    decimal_separator:
                      type: string
                      example: .
                    show_last_updated_at:
                      type: string
                      example: footer
                    thousand_separator:
                      type: string
                      example: ","
                    time_format:
                      type: string
                      example: "24"
                phone:
                  type: string
                  example: "+00000000000"
                timezone:
                  type: string
                  example: America/Glace_Bay
            examples:
              Edit Account:
                value:
                  company: TagoIO
                  language: en
                  name: John Doee
                  options:
                    date_format: YYYY-MM-DD
                    decimal_separator: .
                    show_last_updated_at: footer
                    thousand_separator: ","
                    time_format: "24"
                  phone: "+00000000000"
                  timezone: America/Glace_Bay
          text/plain:
            examples:
              Edit Account:
                value: |-
                  {
                      "language": "en",
                      "name": "Account Name",
                      "options": {
                          "date_format": "YYYY-MM-DD", //"YYYY-MM-DD", "DD-MM-YYYY", or "MM-DD-YYYY"
                          "time_format": "12", //"12" or "24"
                          "decimal_separator": ".", //must be the oposite of the "thousand_separator value"
                          "thousand_separator": ",", //must be the oposite of the "decimal_separator value"
                          "show_last_updated_at": "footer" //widget "footer" or "menu"
                      },
                      "phone": "+00000000000", //type the country code plus the phone number
                      "timezone": "America/Glace_Bay",
                      "company": "TagoIO"
                  }
      responses:
        "200":
          description: Account edited successfuly
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: Account Successfully Updated
                  status:
                    type: boolean
                    example: true
              examples:
                Account edited successfuly:
                  value:
                    result: Account Successfully Updated
                    status: true
  /am:
    get:
      tags:
        - Access Management
      summary: List Policies
      description: List all access policies in your profile
      operationId: getPolicyList
      parameters:
        - name: orderBy
          in: query
          required: true
          schema:
            type: string
            example: created_at
      responses:
        "200":
          description: Getting Policy List
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    items:
                      type: object
                      properties:
                        active:
                          type: boolean
                          description: Indicates if the policy is active
                          example: true
                        id:
                          type: string
                          example: 654a7e62a34b9c000006886c2
                        profile:
                          type: string
                          example: 62fa9e65e0badb0019200
                        name:
                          type: string
                          example: My Analysis Policy
                        created_at:
                          type: string
                          description: Date and time when the policy was created
                          example: "2023-11-01T12:34:56.789Z"
                        tags:
                          type: array
                          items: {}
                          example: []
                  status:
                    type: boolean
                    example: true
    post:
      tags:
        - Access Management
      summary: Create Policy
      description: Create a policy that targets either Run User or Analysis
      operationId: createPolicy
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  title: User Policy
                  required: ["name", "permissions", "targets", "active"]
                  properties:
                    name:
                      type: string
                      description: "Name of the policy"
                      example: "User permissions"
                    permissions:
                      type: array
                      description: "Array of permission objects"
                      items:
                        type: object
                        properties:
                          effect:
                            type: string
                            enum: ["allow", "deny"]
                            description: "Allow or deny the permission"
                            example: "allow"
                          action:
                            type: array
                            items:
                              type: string
                            description: "Actions allowed: access, edit, delete, create"
                            example: ["access"]
                          resource:
                            type: array
                            items:
                              type: string
                            description: "Resources: device, dashboard, analysis, run_user, etc."
                            example: ["device"]
                    targets:
                      type: array
                      description: 'Global: ["run_user"]. Specific: ["run_user", "id", "user_id"]. Tag-based: ["run_user", "tag_match", "tag_key"]'
                      items:
                        type: array
                        items:
                          type: string
                        example: ["run_user"]
                      example: [["run_user"]]
                    tags:
                      type: array
                      description: "Optional tags for targeting specific users/analysis"
                      items:
                        type: object
                        properties:
                          key:
                            type: string
                            description: "Tag key"
                            example: "user"
                          value:
                            type: string
                            description: "Tag value"
                            example: "admin"
                      example: [{ "key": "user", "value": "admin" }]
                    active:
                      type: boolean
                      description: "Whether the policy is active"
                      example: true
                - type: object
                  title: Analysis Policy
                  required: ["name", "permissions", "targets", "active"]
                  properties:
                    name:
                      type: string
                      description: "Name of the policy"
                      example: "Policy"
                    permissions:
                      type: array
                      description: "Array of permission objects"
                      items:
                        type: object
                        properties:
                          effect:
                            type: string
                            enum: ["allow", "deny"]
                            description: "Allow or deny the permission"
                            example: "allow"
                          action:
                            type: array
                            items:
                              type: string
                            description: "Actions allowed: access, edit, delete, create"
                            example: ["edit", "delete", "create", "access"]
                          resource:
                            type: array
                            items:
                              type: string
                            description: "Resources: device, dashboard, analysis, run_user, etc."
                            example: ["device"]
                    targets:
                      type: array
                      description: 'Global: ["analysis"]. Specific: ["analysis", "id", "analysis_id"]. Tag-based: ["analysis", "tag_match", "tag_key"]'
                      items:
                        type: array
                        items:
                          type: string
                        example: ["analysis"]
                      example: [["analysis"]]
                    tags:
                      type: array
                      description: "Optional tags for targeting specific users/analysis"
                      items:
                        type: object
                        properties:
                          key:
                            type: string
                            description: "Tag key"
                            example: "user"
                          value:
                            type: string
                            description: "Tag value"
                            example: "admin"
                      example: [{ "key": "user", "value": "admin" }]
                    active:
                      type: boolean
                      description: "Whether the policy is active"
                      example: true
            examples:
              "Create Policy - Run User (Global)":
                value:
                  name: "User permissions"
                  permissions:
                    - effect: "allow"
                      action: ["access"]
                      resource: ["device"]
                  targets: [["run_user"]]
                  tags:
                    - key: "user"
                      value: "admin"
                  active: true
              "Create Policy - Run User (Specific ID)":
                value:
                  name: "User permissions"
                  permissions:
                    - effect: "allow"
                      action: ["access"]
                      resource: ["device"]
                  targets: [["run_user", "id", "68b5dd292ee817000af854dc"]]
                  tags:
                    - key: "user"
                      value: "admin"
                  active: true
              "Create Policy - Run User (Tag Match)":
                value:
                  name: "User permissions"
                  permissions:
                    - effect: "allow"
                      action: ["access"]
                      resource: ["device"]
                  targets: [["run_user", "tag_match", "account_token"]]
                  tags:
                    - key: "user"
                      value: "admin"
                  active: true
              "Create Policy - Analysis (Global)":
                value:
                  name: "Policy"
                  permissions:
                    - effect: "allow"
                      action: ["edit", "delete", "create", "access"]
                      resource: ["device"]
                  targets: [["analysis"]]
                  tags:
                    - key: "user"
                      value: "admin"
                  active: true
              "Create Policy - Analysis (Specific ID)":
                value:
                  name: "Policy"
                  permissions:
                    - effect: "allow"
                      action: ["edit", "delete", "create", "access"]
                      resource: ["device"]
                  targets: [["analysis", "id", "68b5dd292ee817000af854dc"]]
                  tags:
                    - key: "user"
                      value: "admin"
                  active: true
              "Create Policy - Analysis (Tag Match)":
                value:
                  name: "Policy"
                  permissions:
                    - effect: "allow"
                      action: ["edit", "delete", "create", "access"]
                      resource: ["device"]
                  targets: [["analysis", "tag_match", "account_token"]]
                  tags:
                    - key: "user"
                      value: "admin"
                  active: true
          text/plain:
            examples:
              "Create Policy - Run User (Global)":
                value: |-
                  {
                      "name": "User permissions",
                      "permissions": [
                          {
                              "effect": "allow",
                              "action": ["access"],
                              "resource": ["device"]
                          }
                      ],
                      "targets": [["run_user"]],
                      "tags": [{"key": "user", "value": "admin"}],
                      "active": true
                  }
              "Create Policy - Analysis (Global)":
                value: |-
                  {
                      "name": "Policy",
                      "permissions": [
                          {
                              "effect": "allow",
                              "action": ["edit", "delete", "create", "access"],
                              "resource": ["device"]
                          }
                      ],
                      "targets": [["analysis"]],
                      "tags": [{"key": "user", "value": "admin"}],
                      "active": true
                  }
      responses:
        "201":
          description: Create Policy - Run User / Create Policy - Analysis
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      am_id:
                        type: string
                        example: 654a8bf3fefe2f00099a16a2
                  status:
                    type: boolean
                    example: true
  /{am_id}:
    put:
      tags:
        - Access Management
      summary: Update Policy
      description: Update policy
      operationId: updatePolicy
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                active:
                  type: boolean
                  example: true
                name:
                  type: string
                  example: Updated policy name
                permissions:
                  type: array
                  items:
                    type: object
                    properties:
                      action:
                        type: array
                        items:
                          type: string
                          example: access
                        example:
                          - access
                      effect:
                        type: string
                        example: denied
                      resource:
                        type: array
                        items:
                          type: string
                          example: device
                        example:
                          - device
                  example:
                    - action:
                        - access
                      effect: denied
                      resource:
                        - device
                tags:
                  type: array
                  items:
                    type: object
                    properties:
                      key:
                        type: string
                        example: access
                      value:
                        type: string
                        example: blocked
                  example:
                    - key: access
                      value: blocked
                targets:
                  type: array
                  items:
                    type: array
                    items:
                      type: string
                      example: run_user
                    example:
                      - run_user
                  example:
                    - - run_user
            examples:
              Update policy:
                value:
                  active: true
                  name: Updated policy name
                  permissions:
                    - action:
                        - access
                      effect: denied
                      resource:
                        - device
                  tags:
                    - key: access
                      value: blocked
                  targets:
                    - - run_user
          text/plain:
            examples:
              Update policy:
                value: |-
                  {
                      "name": "Updated Policy Name", //edit the policy name
                      "permissions": [
                          {
                              "effect": "allow",
                              "action": [
                                  "access"
                              ],
                              "resource": [
                                  "device"
                              ] //updating resouces, they can be "device", "dashboard" and "run_user" types
                          }
                      ],
                      "targets": [
                          [
                              "run_user"
                          ] // update  the target, possible "run_user" and "analysis" types
                      ],
                      "tags": [
                          {
                              "key": "access",
                              "value": "admin"
                          }
                          ], //able to update tags 
                      "active": true //able to active and deactive policy (true or false)
                  }
      responses:
        "200":
          description: Updating a policy
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: Access Management Successfully Updated
                  status:
                    type: boolean
                    example: true
              examples:
                Updating a policy:
                  value:
                    result: Access Management Successfully Updated
                    status: true
    parameters:
      - name: am_id
        in: path
        required: true
        schema:
          type: string
          example: (Type a Access Management/Policy ID)
        description: Can be obtained in the GET Policy response
  /am/{am_id}:
    delete:
      tags:
        - Access Management
      summary: Delete Policy
      description: Delete Policy
      operationId: deletePolicy
      responses:
        "200":
          description: Delete policy
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: Access Management Successfully Deleted
                  status:
                    type: boolean
                    example: true
              examples:
                Delete policy:
                  value:
                    result: Access Management Successfully Deleted
                    status: true
    parameters:
      - name: am_id
        in: path
        required: true
        schema:
          type: string
          example: (Type an Access Management/Policy ID)
        description: Can be obtained in the GET Policy request response
  /profiled/{id}/statistics:
    get:
      tags:
        - Profile
      summary: Profile Statistics
      description: Get your Profile Statistics
      operationId: getAProfileStatistics
      parameters:
        - name: date
          in: query
          schema:
            type: string
            example: YYYY-MM-DD
          description: Filter the statistics by specific date
        - name: timezone
          in: query
          schema:
            type: string
            example: Your account's timezone
          description: >-
            Filter the statiscs with the timezone applied if not it returns the
            UTC time
      responses:
        "200":
          description: Getting a profile statistics
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    items:
                      type: object
                      properties:
                        data_records:
                          type: number
                          example: 151611
                        file_storage:
                          type: number
                          example: 49.89
                        input:
                          type: number
                          example: 39933
                        output:
                          type: number
                          example: 1272
                        time:
                          type: string
                          example: "2023-11-08T04:01:36.124Z"
                    example:
                      - data_records: 151611
                        file_storage: 49.89
                        input: 39933
                        output: 1272
                        time: "2023-11-08T04:01:36.124Z"
                      - data_records: 151691
                        file_storage: 49.89
                        input: 40165
                        output: 1272
                        time: "2023-11-08T05:01:35.986Z"
                      - data_records: 151863
                        file_storage: 49.89
                        input: 40397
                        output: 1272
                        time: "2023-11-08T06:01:35.963Z"
                      - data_records: 152389
                        file_storage: 49.89
                        input: 40629
                        output: 1272
                        time: "2023-11-08T07:01:36.021Z"
                      - data_records: 152497
                        file_storage: 49.89
                        input: 40861
                        output: 1272
                        time: "2023-11-08T08:01:36.019Z"
                      - data_records: 152609
                        file_storage: 49.89
                        input: 41093
                        output: 1272
                        time: "2023-11-08T09:01:35.908Z"
                      - data_records: 152981
                        file_storage: 49.89
                        input: 41325
                        output: 1272
                        time: "2023-11-08T10:01:36.052Z"
                      - data_records: 153105
                        file_storage: 49.89
                        input: 41566
                        output: 1272
                        time: "2023-11-08T11:01:36.155Z"
                      - data_records: 153373
                        file_storage: 49.89
                        input: 41789
                        output: 1272
                        time: "2023-11-08T12:01:35.906Z"
                      - data_records: 153517
                        file_storage: 49.89
                        input: 42030
                        output: 1272
                        time: "2023-11-08T13:01:35.873Z"
                      - data_records: 150262
                        file_storage: 49.89
                        input: 42253
                        output: 1272
                        time: "2023-11-08T14:01:35.967Z"
                      - data_records: 150422
                        file_storage: 49.89
                        input: 42485
                        output: 1272
                        time: "2023-11-08T15:01:35.992Z"
                      - data_records: 150422
                        file_storage: 49.89
                        input: 42717
                        output: 1272
                        time: "2023-11-08T16:01:35.825Z"
                      - data_records: 151054
                        file_storage: 49.89
                        input: 42949
                        output: 1272
                        time: "2023-11-08T17:01:35.903Z"
                      - data_records: 151242
                        file_storage: 49.89
                        input: 43181
                        output: 1272
                        time: "2023-11-08T18:01:35.995Z"
                      - data_records: 151242
                        file_storage: 49.89
                        input: 43413
                        output: 1272
                        time: "2023-11-08T19:01:35.946Z"
                  status:
                    type: boolean
                    example: true
              examples:
                Getting a profile statistics:
                  value:
                    result:
                      - data_records: 151611
                        file_storage: 49.89
                        input: 39933
                        output: 1272
                        time: "2023-11-08T04:01:36.124Z"
                      - data_records: 151691
                        file_storage: 49.89
                        input: 40165
                        output: 1272
                        time: "2023-11-08T05:01:35.986Z"
                      - data_records: 151863
                        file_storage: 49.89
                        input: 40397
                        output: 1272
                        time: "2023-11-08T06:01:35.963Z"
                      - data_records: 152389
                        file_storage: 49.89
                        input: 40629
                        output: 1272
                        time: "2023-11-08T07:01:36.021Z"
                      - data_records: 152497
                        file_storage: 49.89
                        input: 40861
                        output: 1272
                        time: "2023-11-08T08:01:36.019Z"
                      - data_records: 152609
                        file_storage: 49.89
                        input: 41093
                        output: 1272
                        time: "2023-11-08T09:01:35.908Z"
                      - data_records: 152981
                        file_storage: 49.89
                        input: 41325
                        output: 1272
                        time: "2023-11-08T10:01:36.052Z"
                      - data_records: 153105
                        file_storage: 49.89
                        input: 41566
                        output: 1272
                        time: "2023-11-08T11:01:36.155Z"
                      - data_records: 153373
                        file_storage: 49.89
                        input: 41789
                        output: 1272
                        time: "2023-11-08T12:01:35.906Z"
                      - data_records: 153517
                        file_storage: 49.89
                        input: 42030
                        output: 1272
                        time: "2023-11-08T13:01:35.873Z"
                      - data_records: 150262
                        file_storage: 49.89
                        input: 42253
                        output: 1272
                        time: "2023-11-08T14:01:35.967Z"
                      - data_records: 150422
                        file_storage: 49.89
                        input: 42485
                        output: 1272
                        time: "2023-11-08T15:01:35.992Z"
                      - data_records: 150422
                        file_storage: 49.89
                        input: 42717
                        output: 1272
                        time: "2023-11-08T16:01:35.825Z"
                      - data_records: 151054
                        file_storage: 49.89
                        input: 42949
                        output: 1272
                        time: "2023-11-08T17:01:35.903Z"
                      - data_records: 151242
                        file_storage: 49.89
                        input: 43181
                        output: 1272
                        time: "2023-11-08T18:01:35.995Z"
                      - data_records: 151242
                        file_storage: 49.89
                        input: 43413
                        output: 1272
                        time: "2023-11-08T19:01:35.946Z"
                    status: true
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          example: Type a Profile ID
        description: Can be found in the profile's information tab "More"
  /profile/{id}/summary:
    get:
      tags:
        - Profile
      summary: Profile Summary
      description: Get your Profile Summary
      operationId: getAProfileSummary
      responses:
        "200":
          description: Get a general summary of your profile resources
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      addons:
                        type: object
                        properties:
                          control_tower:
                            type: boolean
                            example: true
                          custom_dns:
                            type: boolean
                            example: false
                          mobile:
                            type: boolean
                            example: false
                          profile:
                            type: string
                            example: 61fac4d9a5c9f40012a5ff92
                          updated_at:
                            type: string
                            example: "2023-09-06T13:47:08.192Z"
                      amount:
                        type: object
                        properties:
                          action:
                            type: number
                            example: 37
                          am:
                            type: number
                            example: 5
                          analysis:
                            type: number
                            example: 18
                          connectors:
                            type: number
                            example: 32
                          dashboard:
                            type: number
                            example: 231
                          device:
                            type: number
                            example: 79
                          dictionary:
                            type: number
                            example: 7
                          networks:
                            type: number
                            example: 9
                          run_users:
                            type: number
                            example: 5
                          tcore:
                            type: number
                            example: 2
                          tcore_cluster:
                            type: number
                            example: 2
                      limit:
                        type: object
                        properties:
                          analysis:
                            type: number
                            example: 5
                          data_records:
                            type: number
                            example: 250000
                          email:
                            type: number
                            example: 10
                          file_storage:
                            type: number
                            example: 132
                          input:
                            type: number
                            example: 350000
                          output:
                            type: number
                            example: 342153
                          push_notification:
                            type: number
                            example: 58
                          run_users:
                            type: number
                            example: 5
                          sms:
                            type: number
                            example: 60
                          tcore:
                            type: number
                            example: 1
                      limit_used:
                        type: object
                        properties:
                          analysis:
                            type: number
                            example: 0
                          dashboard_output:
                            type: number
                            example: 65
                          data_records:
                            type: number
                            example: 151242
                          email:
                            type: number
                            example: 0
                          file_storage:
                            type: number
                            example: 49.89
                          input:
                            type: number
                            example: 43463
                          output:
                            type: number
                            example: 1272
                          push_notification:
                            type: number
                            example: 0
                          run_users:
                            type: number
                            example: 5
                          sms:
                            type: number
                            example: 0
                          tcore:
                            type: number
                            example: 3
                          tcore_cluster:
                            type: number
                            example: 2
                      tago_run:
                        type: string
                        example: johndoee.tago.run
                  status:
                    type: boolean
                    example: true
              examples:
                Getting a profile summary:
                  value:
                    result:
                      addons:
                        control_tower: true
                        custom_dns: false
                        mobile: false
                        profile: 61fac4d9a5c9f40012a5ff92
                        updated_at: "2023-09-06T13:47:08.192Z"
                      amount:
                        action: 37
                        am: 5
                        analysis: 18
                        connectors: 32
                        dashboard: 231
                        device: 79
                        dictionary: 7
                        networks: 9
                        run_users: 5
                        tcore: 2
                        tcore_cluster: 2
                      limit:
                        analysis: 5
                        data_records: 250000
                        email: 10
                        file_storage: 132
                        input: 350000
                        output: 342153
                        push_notification: 58
                        run_users: 5
                        sms: 60
                        tcore: 1
                      limit_used:
                        analysis: 0
                        dashboard_output: 65
                        data_records: 151242
                        email: 0
                        file_storage: 49.89
                        input: 43463
                        output: 1272
                        push_notification: 0
                        run_users: 5
                        sms: 0
                        tcore: 3
                        tcore_cluster: 2
                      tago_run: johndoee.tago.run
                    status: true
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          example: Type a profile ID
        description: Can be found in the profile's information tab "More"
  /profile/{id}:
    get:
      tags:
        - Profile
      summary: Profile Information
      description: Get your profile settings
      operationId: getAProfileDetails
      responses:
        "200":
          description: Get a Profile Details
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      account_plan:
                        type: string
                        example: starter
                      addons:
                        type: object
                        properties:
                          control_tower:
                            type: boolean
                            example: true
                          custom_dns:
                            type: boolean
                            example: false
                          mobile:
                            type: boolean
                            example: false
                          profile:
                            type: string
                            example: 61fac4d9a5c9f40012a5ff92
                          updated_at:
                            type: string
                            example: "2023-09-06T13:47:08.192Z"
                      allocation:
                        type: object
                        properties:
                          analysis:
                            type: number
                            example: 5
                          data_records:
                            type: number
                            example: 250000
                          email:
                            type: number
                            example: 10
                          file_storage:
                            type: number
                            example: 132
                          input:
                            type: number
                            example: 350000
                          output:
                            type: number
                            example: 342153
                          push_notification:
                            type: number
                            example: 58
                          run_users:
                            type: number
                            example: 5
                          sms:
                            type: number
                            example: 60
                      info:
                        type: object
                        properties:
                          account:
                            type: string
                            example: 612ea05e3cc07800127153892
                          banner_url:
                            example: null
                          created_at:
                            type: string
                            example: "2022-02-02T16:44:09.134Z"
                          id:
                            type: string
                            example: 61fac4d9a5c9f40012a5ff92
                          logo_url:
                            type: string
                            example: ""
                          name:
                            type: string
                            example: Test Profile
                          region:
                            type: string
                            example: us-1
                          rpm:
                            type: object
                            properties:
                              data_input:
                                type: number
                                example: 98283293
                              data_output:
                                type: number
                                example: 10
                          updated_at:
                            type: string
                            example: "2023-10-13T11:54:20.081Z"
                  status:
                    type: boolean
                    example: true
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          example: Type a profile ID
        description: Can be found in the profile's information tab "More"
  /profile/{profile_id}/backup:
    post:
      tags:
        - Backup
      summary: Create Backup
      description: |
        Initiates a new backup generation for the specified profile. The backup is processed asynchronously in a background queue.

        **What's included in the backup:**
        - User storage files (uploaded via `/files` route)
        - Dashboard version history
        - Analysis script versions
        - All resource configurations as JSON files (devices, actions, dashboards, analysis, access management, networks, connectors, secrets, dictionaries, run users, etc.)

        **Important notes:**
        - Backups are rate-limited (1 per day based on your account timezone)
        - Free plan users do not have access to backup features
        - Backup generation may take several minutes depending on profile size
        - Restoration is manual - you can write scripts to parse the JSON files and recreate resources via API, or contact TagoIO support
      operationId: createProfileBackup
      responses:
        "200":
          description: Backup creation initiated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Backup generation has been queued and will be processed shortly. You can check the status using the list backups endpoint.
                  profile:
                    type: string
                    example: 61fac4d9a5c9f40012a5ff92
                  backup_id:
                    type: string
                    example: 678abc123def456789012345
        "403":
          description: Forbidden - Free plan or rate limit exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Daily backup limit reached (1 backups per day). Please try again in 8 hours or contact support to increase your limit.
    get:
      tags:
        - Backup
      summary: List Backups
      description: |
        Retrieves a paginated list of all backups for the specified profile. Use this endpoint to check backup status and find backup IDs for download or deletion.

        **Backup statuses:**
        - `queued` - Backup request received, waiting for processing
        - `processing` - Backup generation in progress
        - `completed` - Backup ready for download
        - `failed` - Backup generation failed (check error_message)
      operationId: listProfileBackups
      parameters:
        - name: page
          in: query
          required: false
          schema:
            type: integer
            example: 1
          description: Page number for pagination (default 1)
        - name: amount
          in: query
          required: false
          schema:
            type: integer
            example: 20
          description: Number of items per page (default 20)
        - name: orderBy
          in: query
          required: false
          schema:
            type: string
            example: created_at,desc
          description: Sort order (e.g., 'created_at,desc' or 'created_at,asc')
      responses:
        "200":
          description: List of backups retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: true
                  result:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          example: 678abc123def456789012345
                        profile:
                          type: string
                          example: 61fac4d9a5c9f40012a5ff92
                        file_path:
                          type: string
                          example: profile/61fac4d9a5c9f40012a5ff92/versioning/backup/backup-61fac4d9a5c9f40012a5ff92.zip
                        version_id:
                          type: string
                          example: abc123def456
                        file_size:
                          type: number
                          example: 15728640
                          description: File size in bytes
                        status:
                          type: string
                          enum: [queued, processing, completed, failed]
                          example: completed
                        error_message:
                          type: string
                          example: null
                          description: Error message if status is 'failed'
                        created_at:
                          type: string
                          example: "2025-01-07T14:30:00.000Z"
        "403":
          description: Forbidden - Free plan users cannot access backup features
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Backup feature is not available on the free plan. Please upgrade your plan to access backup functionality.
    parameters:
      - name: profile_id
        in: path
        required: true
        schema:
          type: string
          example: 61fac4d9a5c9f40012a5ff92
        description: The ID of the profile
  /profile/{profile_id}/backup/{backup_id}/download:
    post:
      tags:
        - Backup
      summary: Download Backup
      description: |
        Generates a secure, time-limited download URL for a specific backup. The download URL is valid for **2 hours**.

        **Security:** This endpoint requires account password verification to prevent unauthorized access to backup data. If you have Two-Factor Authentication (2FA) enabled, you must also provide the OTP code.

        **Important:** Only backups with status `completed` can be downloaded.
      operationId: downloadProfileBackup
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - password
              properties:
                password:
                  type: string
                  description: Your account password for verification
                  example: your_account_password
                otp_type:
                  type: string
                  enum: [authenticator, sms, email]
                  description: Type of OTP if 2FA is enabled (optional)
                  example: authenticator
                pin_code:
                  type: string
                  description: OTP code if 2FA is enabled (optional)
                  example: "123456"
            examples:
              Without 2FA:
                value:
                  password: your_account_password
              With 2FA enabled:
                value:
                  password: your_account_password
                  otp_type: authenticator
                  pin_code: "123456"
      responses:
        "200":
          description: Download URL generated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                    example: https://s3.amazonaws.com/tago-io/...?X-Amz-Algorithm=...
                    description: Pre-signed S3 URL for downloading the backup (valid for 2 hours)
                  size:
                    type: number
                    example: 15728640
                    description: File size in bytes
                  size_unit:
                    type: string
                    example: bytes
                  file_size_mb:
                    type: string
                    example: "15.00"
                    description: File size in megabytes (formatted)
                  expire_at:
                    type: string
                    example: "2025-01-07T16:30:00.000Z"
                    description: When the download URL expires
                  backup_id:
                    type: string
                    example: 678abc123def456789012345
                  created_at:
                    type: string
                    example: "2025-01-07T14:30:00.000Z"
        "400":
          description: Bad request - Backup not ready or invalid parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: "Backup is not ready for download. Current status: processing"
        "401":
          description: Unauthorized - Invalid password or OTP
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Invalid password
        "404":
          description: Not found - Backup does not exist
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Backup not found or you don't have permission to access it.
    parameters:
      - name: profile_id
        in: path
        required: true
        schema:
          type: string
          example: 61fac4d9a5c9f40012a5ff92
        description: The ID of the profile
      - name: backup_id
        in: path
        required: true
        schema:
          type: string
          example: 678abc123def456789012345
        description: The ID of the backup to download
  /profile/{profile_id}/backup/{backup_id}:
    delete:
      tags:
        - Backup
      summary: Delete Backup
      description: |
        Permanently removes a backup from storage. This action is irreversible.

        **Security:** This endpoint requires account password verification to prevent accidental or unauthorized deletion. If you have Two-Factor Authentication (2FA) enabled, you must also provide the OTP code.
      operationId: deleteProfileBackup
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - password
              properties:
                password:
                  type: string
                  description: Your account password for verification
                  example: your_account_password
                otp_type:
                  type: string
                  enum: [authenticator, sms, email]
                  description: Type of OTP if 2FA is enabled (optional)
                  example: authenticator
                pin_code:
                  type: string
                  description: OTP code if 2FA is enabled (optional)
                  example: "123456"
            examples:
              Without 2FA:
                value:
                  password: your_account_password
              With 2FA enabled:
                value:
                  password: your_account_password
                  otp_type: authenticator
                  pin_code: "123456"
      responses:
        "200":
          description: Backup deleted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: Backup successfully removed
                  status:
                    type: boolean
                    example: true
        "401":
          description: Unauthorized - Invalid password or OTP
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Invalid password
        "404":
          description: Not found - Backup does not exist
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Backup not found or you don't have permission to delete it.
    parameters:
      - name: profile_id
        in: path
        required: true
        schema:
          type: string
          example: 61fac4d9a5c9f40012a5ff92
        description: The ID of the profile
      - name: backup_id
        in: path
        required: true
        schema:
          type: string
          example: 678abc123def456789012345
        description: The ID of the backup to delete
  /profile/{id}/service:
    put:
      tags:
        - Profile
      summary: Configure Service Provider
      description: |
        Configure external service providers for your profile. This allows you to set up integrations with third-party services for SMS and Email messaging.

        **Available service providers:**

        | Service Type | Provider | Description |
        |--------------|----------|-------------|
        | `sms` | Twilio | Send SMS messages via Twilio |
        | `sms` | SNS | Send SMS messages via Amazon SNS |
        | `email` | SendGrid | Send emails via SendGrid API |
        | `email` | SES | Send emails via Amazon SES |
        | `email` | SMTP | Send emails via custom SMTP server |

        **Important notes:**
        - Credentials are securely stored using [TagoIO Secrets](/docs/tagoio/getting-started/secrets). You must create the appropriate secrets before configuring a service provider.
        - Each service type can only have one active provider configuration at a time
        - Use the test endpoint to verify your configuration before using it in production

        **Required secrets by provider:**
        - **Twilio SMS**: Create two Text secrets containing your Twilio SID and Auth Token
        - **SNS SMS**: Create an AWS SQS Secret with your AWS credentials (region, access key, secret key)
        - **SendGrid Email**: Create a Text secret containing your SendGrid API Key
        - **SES Email**: Create an AWS SQS Secret with your AWS credentials (region, access key, secret key)
        - **SMTP Email**: Create an SMTP Secret with your server configuration
      operationId: configureProfileService
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: object
                  description: Email service configuration
                  properties:
                    provider:
                      type: string
                      enum: [sendgrid, ses, smtp]
                      description: The email provider to use
                      example: smtp
                    from:
                      type: string
                      description: Sender email address
                      example: noreply@example.com
                    secrets:
                      type: object
                      description: Secret IDs for provider credentials
                      properties:
                        data:
                          type: string
                          description: Secret ID containing SMTP configuration (required for SMTP provider) or AWS SQS Secret (required for SES provider)
                          example: 68c9977a28079e0010aaf399
                        api_key:
                          type: string
                          description: Secret ID containing SendGrid API Key (required for SendGrid provider)
                          example: 68c9977a28079e0010aaf399
                sms:
                  type: object
                  description: SMS service configuration
                  properties:
                    provider:
                      type: string
                      enum: [twilio, sns]
                      description: The SMS provider to use
                      example: twilio
                    from:
                      type: string
                      description: Sender phone number in E.164 format (required for Twilio, optional for SNS)
                      example: "+15551234567"
                    secrets:
                      type: object
                      description: Secret IDs for provider credentials
                      properties:
                        twilio_sid:
                          type: string
                          description: Secret ID containing Twilio Account SID (required for Twilio provider)
                          example: 674f1740f9ccd2000aaa4551
                        twilio_token:
                          type: string
                          description: Secret ID containing Twilio Auth Token (required for Twilio provider)
                          example: 674f1736f9ccd2000aaa4550
                        data:
                          type: string
                          description: Secret ID containing AWS SQS Secret (required for SNS provider)
                          example: 68c9977a28079e0010aaf399
            examples:
              Configure SMS and Email:
                value:
                  email:
                    provider: smtp
                    from: noreply@example.com
                    secrets:
                      data: 68c9977a28079e0010aaf399
                  sms:
                    provider: twilio
                    from: "+15551234567"
                    secrets:
                      twilio_sid: 674f1740f9ccd2000aaa4551
                      twilio_token: 674f1736f9ccd2000aaa4550
              Configure SMS only:
                value:
                  sms:
                    provider: twilio
                    from: "+15551234567"
                    secrets:
                      twilio_sid: 674f1740f9ccd2000aaa4551
                      twilio_token: 674f1736f9ccd2000aaa4550
              Configure Email with SendGrid:
                value:
                  email:
                    provider: sendgrid
                    from: noreply@example.com
                    secrets:
                      api_key: 68c9977a28079e0010aaf399
              Configure Email with SMTP:
                value:
                  email:
                    provider: smtp
                    from: noreply@example.com
                    secrets:
                      data: 68c9977a28079e0010aaf399
              Configure Email with SES:
                value:
                  email:
                    provider: ses
                    from: noreply@example.com
                    secrets:
                      data: 68c9977a28079e0010aaf399
              Configure SMS with SNS:
                value:
                  sms:
                    provider: sns
                    secrets:
                      data: 68c9977a28079e0010aaf399
      responses:
        "200":
          description: Service provider configured successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: Service provider configured successfully
                  status:
                    type: boolean
                    example: true
        "400":
          description: Bad request - Invalid configuration
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Invalid credentials format for the selected provider
        "401":
          description: Unauthorized - Invalid or missing token
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Unauthorized
        "403":
          description: Forbidden - Insufficient permissions
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: You do not have permission to configure services for this profile
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          example: 61fac4d9a5c9f40012a5ff92
        description: The ID of the profile
  /profile/{id}/service/test/{service_type}:
    post:
      tags:
        - Profile
      summary: Test Service Provider
      description: |
        Test a configured service provider by sending a test message. This helps verify that your service provider configuration is working correctly before using it in production.

        **Supported service types:**
        - `sms` - Sends a test SMS message to the specified phone number
        - `email` - Sends a test email to the specified email address

        **Important notes:**
        - A service provider must be configured before testing
        - Test messages will consume your provider's quota/credits
        - For SMS, ensure the recipient number is in E.164 format (e.g., +15551234567)
      operationId: testProfileService
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - to
              properties:
                to:
                  type: string
                  description: |
                    The recipient address for the test message.
                    - For SMS: Phone number in E.164 format (e.g., +15551234567)
                    - For Email: Email address (e.g., user@example.com)
                  example: "+15559876543"
                message:
                  type: string
                  description: Custom test message content (optional). If not provided, a default test message will be sent.
                  example: This is a test message from TagoIO
                subject:
                  type: string
                  description: Email subject line (only for email service type, optional)
                  example: Test Email from TagoIO
            examples:
              Test SMS:
                value:
                  to: "+15559876543"
                  message: This is a test SMS from TagoIO
              Test Email:
                value:
                  to: user@example.com
                  subject: Test Email from TagoIO
                  message: This is a test email from TagoIO to verify your email service configuration.
      responses:
        "200":
          description: Test message sent successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      message:
                        type: string
                        example: Test message sent successfully
                      message_id:
                        type: string
                        description: Provider's message ID for tracking (if available)
                        example: SM1234567890abcdef1234567890abcdef
                  status:
                    type: boolean
                    example: true
        "400":
          description: Bad request - Invalid recipient or message format
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Invalid phone number format. Use E.164 format (e.g., +15551234567)
        "404":
          description: Service provider not configured
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: No service provider configured for the specified service type
        "500":
          description: Provider error - Failed to send test message
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: "Failed to send test message: Invalid credentials"
    parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          example: 61fac4d9a5c9f40012a5ff92
        description: The ID of the profile
      - name: service_type
        in: path
        required: true
        schema:
          type: string
          enum: [sms, email]
          example: sms
        description: The type of service to test (sms or email)
  /dictionary:
    get:
      tags:
        - Dictionary
      summary: List Dictionaries
      description: List of Dictionaries
      operationId: getDictionaryList
      responses:
        "200":
          description: Getting the dictionary list
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    items:
                      type: object
                      properties:
                        created_at:
                          type: string
                          example: "2023-02-13T16:56:53.086Z"
                        fallback:
                          type: string
                          example: en-US
                        id:
                          type: string
                          example: 63ea6bd581db210009ff8f1d
                        languages:
                          type: array
                          items:
                            type: object
                            properties:
                              active:
                                type: boolean
                                example: true
                              code:
                                type: string
                                example: en-US
                          example:
                            - active: true
                              code: en-US
                            - active: true
                              code: es-ES
                            - active: true
                              code: pt-BR
                        name:
                          type: string
                          example: Admin Dashboard
                        slug:
                          type: string
                          example: ADM
                        updated_at:
                          type: string
                          example: "2023-02-13T16:56:53.086Z"
                    example:
                      - created_at: "2023-02-13T16:56:53.086Z"
                        fallback: en-US
                        id: 63ea6bd581db210009ff8f1d
                        languages:
                          - active: true
                            code: en-US
                          - active: true
                            code: es-ES
                          - active: true
                            code: pt-BR
                        name: Admin Dashboard
                        slug: ADM
                        updated_at: "2023-02-13T16:56:53.086Z"
                  status:
                    type: boolean
                    example: true
    post:
      tags:
        - Dictionary
      summary: Create Dictionary
      description: Create Dictionary
      operationId: createDictionary
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - slug
              properties:
                name:
                  type: string
                  example: dic.DICT
                slug:
                  type: string
                  example: DIC
                fallback:
                  type: string
                  example: fr-FR
                languages:
                  type: array
                  items:
                    type: object
                    properties:
                      code:
                        type: string
                        example: fr-FR
                      message:
                        type: string
                        example: "true"
                  example:
                    - code: fr-FR
                      message: "true"
            examples:
              Create Dictionary:
                value:
                  fallback: fr-FR
                  languages:
                    - code: fr-FR
                      message: "true"
                  name: dic.DICT
                  slug: DIC
      responses:
        "201":
          description: Creating a dictionary
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      dictionary:
                        type: string
                        example: 654bdc4449769c00097fee32
                  status:
                    type: boolean
                    example: true
  /dictionary/{dictionary_id}:
    get:
      tags:
        - Dictionary
      summary: Dictionary Information
      description: Get Dictionary Details
      operationId: getDictionaryDetails
      responses:
        "200":
          description: Getting the Dictionary details
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      created_at:
                        type: string
                        example: "2023-02-13T16:56:53.086Z"
                      fallback:
                        type: string
                        example: en-US
                      languages:
                        type: array
                        items:
                          type: object
                          properties:
                            active:
                              type: boolean
                              example: true
                            code:
                              type: string
                              example: en-US
                        example:
                          - active: true
                            code: en-US
                          - active: true
                            code: es-ES
                          - active: true
                            code: pt-BR
                      name:
                        type: string
                        example: Admin Dashboard
                      slug:
                        type: string
                        example: ADM
                      updated_at:
                        type: string
                        example: "2023-02-13T16:56:53.086Z"
                  status:
                    type: boolean
                    example: true
    put:
      tags:
        - Dictionary
      summary: Update Dictionary
      description: Update Dictionary
      operationId: updateDictionary
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                fallback:
                  type: string
                  example: fr-FR
                languages:
                  type: array
                  items:
                    type: object
                    properties:
                      active:
                        type: boolean
                        example: true
                      code:
                        type: string
                        example: fr-FR
                  example:
                    - active: true
                      code: fr-FR
                    - active: true
                      code: pt-BR
                name:
                  type: string
                  example: updated.test
                slug:
                  type: string
                  example: TEEEE
            examples:
              Update Dictionary:
                value:
                  fallback: fr-FR
                  languages:
                    - active: true
                      code: fr-FR
                    - active: true
                      code: pt-BR
                  name: updated.test
                  slug: TEEEE
      responses:
        "200":
          description: Updating a Dictionary name
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: Successfully Updated
                  status:
                    type: boolean
                    example: true
    delete:
      tags:
        - Dictionary
      summary: Delete Dictionary
      description: Delete Dictionary
      operationId: deleteDictionary
      responses:
        "200":
          description: Delete Dictionary
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: Successfully Removed
                  status:
                    type: boolean
                    example: true
    parameters:
      - name: dictionary_id
        in: path
        required: true
        schema:
          type: string
          example: (Type Dictionary ID)
        description: Can be obtained in the GET Dictionary response
  /dictionary/{dictionary_id}/{language}:
    put:
      tags:
        - Dictionary
      summary: Update Dictionary Language
      description: Update Dictionary Language
      operationId: updateDictionaryLanguage
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                dictionary:
                  type: object
                  properties:
                    test:
                      type: string
                      example: teste
            examples:
              Update Dictionary Language:
                value:
                  dictionary:
                    test: teste
      responses:
        "200":
          description: Put Dictionary Language
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: Dictionary language Successfully Updated
                  status:
                    type: boolean
                    example: true
    parameters:
      - name: dictionary_id
        in: path
        required: true
        schema:
          type: string
          example: (Type Dictionary ID)
        description: Can be obtained in the GET Dictionary response
      - name: language
        in: path
        required: true
        schema:
          type: string
          example: Language Code
        description: Language that will be updated
  /dictionary/{slug_or_dictionary_id}/{language}:
    get:
      tags:
        - Dictionary
      summary: Get Dictionary Language Details
      description: Get Dictionary Language Details
      operationId: getDictionaryLanguageDetails
      responses:
        "200":
          description: Getting a dictionary language details
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      key:
                        type: string
                        example: value
                  status:
                    type: boolean
                    example: true
    parameters:
      - name: slug_or_dictionary_id
        in: path
        required: true
        schema:
          type: string
          example: (Type Slug or Dictionary ID)
        description: Can be obtained in the GET Dictionary response
      - name: language
        in: path
        required: true
        schema:
          type: string
          example: Language Code
        description: Language that will be returned keys
  /account/profile/token:
    post:
      tags:
        - Profile
      summary: Generate Profile-Token
      description: |
        Generates and retrieves a new token for the account
      operationId: generateProfileToken
      security: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - email
                - name
                - password
                - profile_id
              properties:
                email:
                  type: string
                  example: example@mail.com
                name:
                  type: string
                  example: Token name
                password:
                  type: string
                  example: yourpassword
                profile_id:
                  type: string
                  example: 712ea05e3cc07800127151111
            examples:
              Generate Profile-Token:
                value:
                  email: example@mail.com
                  name: newtoken
                  password: yourpassword
                  profile_id: 712ea05e3cc07800127151111
      responses:
        "200":
          description: token created successfuly
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: object
                    properties:
                      created_by:
                        type: string
                        example: 712ea05e3cc07800127151110
                      name:
                        type: string
                        example: your name
                      permission:
                        type: string
                        example: full
                      profile:
                        type: string
                        example: 712ea05e3cc07800127151111
                      token:
                        type: string
                        example: ecjkfc55e-229e-4083-9667-d868h79a41e9
                  status:
                    type: boolean
                    example: true
  /tags/keys/{type}:
    get:
      tags:
        - Profile
      summary: List Used Tags
      description: Get a list containing all device tags in use on your profile
      operationId: getTags
      responses:
        "200":
          description: Get Device Tags
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: array
                    items:
                      type: string
                      example: numbervalue
                    example:
                      - numbervalue
                      - vumeter
                      - test
                      - bp
                      - area
                      - block
                      - horizontal
                      - multiple
                      - user
                      - problem
                      - formula
                      - chart
                      - BP
                  status:
                    type: boolean
                    example: true
    parameters:
      - name: type
        in: path
        required: true
        schema:
          type: string
          example: Device
        description: (Accepts Analysis, Device, User, Dashboard, Action)

  /integration/network/resolve/{serieNumber}/{AuthorizationKey}:
    get:
      tags:
        - Network Ingest
      summary: Find Device by Serial & Authorization Key
      description: >-
        Retrieve a valid device token using the device's serial number and a profile authorization key.  

        This endpoint is recommended when you need additional security or if your Network is available to multiple profiles, as it allows serial numbers to be duplicated across different profiles.  

        You must have both a Network and a Network-Token to use this endpoint.
      operationId: getDeviceTokenWithSerialNumberAuthorization
      security:
        - Network-Token: []
      responses:
        "200":
          description: Successfully Token Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: <string>
                  status:
                    type: boolean
                    example: true
    parameters:
      - name: serieNumber
        in: path
        required: true
        schema:
          type: string
        description: Device Serial Number registered at TagoIO
      - name: AuthorizationKey
        in: path
        required: true
        schema:
          type: string
        description: Authorization key for the profile, used to resolve the device token when multiple profiles may have the same serial number.
  /integration/network/resolve/{serieNumber}:
    get:
      tags:
        - Network Ingest
      summary: Find Device by Serial
      description: >-
        Get a valid device-token using token serial number only. It will match the serial in any profile.

        :::warning  

        If the serial number is duplicated between different profiles, you will get the device-token only for the latest device created. See [Find Device with Authorization](/docs/api/get-device-token-with-serial-number-authorization) for multiple profiles support.  

        :::

        You must have a Network and a Network-Token to use this query.
      operationId: getDeviceTokenWithSerialNumber
      security:
        - Network-Token: []
      responses:
        "200":
          description: got a valid token
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: <string>
                  status:
                    type: boolean
                    example: true
    parameters:
      - name: serieNumber
        in: path
        required: true
        schema:
          type: string
        description: Device Serial Number registered at TagoIO

  /integration/network/{deviceID}/params:
    post:
      tags:
        - Network Ingest
      summary: Edit Device Configuration Parameter
      description: >-
        Edit a device configuration parameter using the Network-token. You must already have the device ID to use this endpoint.

        This is useful when your Network integration requires configuration parameters for performing downlinks, or if your decoder benefits from configuration parameters for parsing data.

        :::info

        To obtain the **Device ID**, first resolve the device-token, then use the [Device Information](/docs/api/current-device-information) endpoint to retrieve detailed information about the device.

        :::
      operationId: editDeviceConfigurationParameter
      security:
        - Network-Token: []
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                    example: 6114b901cd09d0fa0013636afcc
                  key:
                    type: string
                    example: downlink_url
                  sent:
                    type: boolean
                    example: true
                  value:
                    type: string
                    example: https://mydownlink.url.io
              example:
                - id: 6114b901cd09d0fa0013636afcc
                  key: downlink_url
                  sent: true
                  value: https://mydownlink.url.io
            examples:
              Edit Device Configuration Parameter:
                value:
                  - id: 6114b901cd09d0fa0013636afcc
                    key: downlink_url
                    sent: true
                    value: https://mydownlink.url.io
      responses:
        "200":
          description: Edit the configuration parameter
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: Device Configuration Parameter Updated
                  status:
                    type: boolean
                    example: true
    parameters:
      - name: deviceID
        in: path
        required: true
        schema:
          type: string
  /integration/network/data:
    post:
      tags:
        - Network Ingest
      summary: Send Data using Network
      description: >-
        Send data to TagoIO using the Network instead.


        This endpoint allows the [Network Payload Parser](/docs/tagoio/devices/payload-parser/) to identify and redirect
        data to the correct device created using the Network associated with the
        Network Token and [Authorization Token](/docs/tagoio/integrations/general/authorization/).


        The Network's Payload Parser is required to set the serial within the
        network parser. For example:


        ``` javascript
         if (Array.isArray(payload)) {
           const payload_received = payload.find(x => x.variable === "payload");
           serial = payload_received?.metadata?.serial;
         }

         ```
      operationId: sendDataUsingNetwork
      parameters:
        - $ref: "#/components/parameters/authorization_token"
      security:
        - Network-Token: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/NetworkDeviceData"
          text/plain:
            schema:
              type: string
              description: >
                Arbitrary payload. Your [Network Payload Parser](/docs/tagoio/devices/payload-parser/) must normalize this
                text to the TagoIO array format accepted by application/json.
            examples:
              Send Data using Network:
                value: >
                  Any format data that your Payload Parser can normalize to TagoIO format.
      responses:
        "200":
          description: Send Data
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: string
                    example: 1 Data Added
                  status:
                    type: boolean
                    example: true
