Docs
Devices

Devices

List Devices

GET /v2/devices

ParameterDescription
attributesSpecifies which attributes to retrieve. Can include values like 'serial', 'number', 'carrier', 'service_provider', and 'batch'. If null, retrieves all information.
includesSpecifies related entities to include in the query. Contains arrays for 'device' and 'enterprise', each with its own set of possible values, such as 'name', 'imei', 'code' for the 'device' array, and 'name', 'cnpj' for the 'enterprise' array.
filtersSpecifies filters for various fields such as 'chips.serial', 'chips.number', 'chips.carrier', 'chips.service_provider', 'chips.batch', 'device.name', 'device.imei', 'device.code', 'enterprise.name', 'enterprise.cnpj'. Each filter field supports conditions like 'eq', 'neq', 'ilk', 'ew', 'sw'.
searchSpecifies the search query with a maximum length of 100 characters.
limitSpecifies the maximum number of results to return. Must be a number between 1 and 100.
pageSpecifies the page number for paginated results. Must be a number greater than or equal to 0.
countIndicates whether to include the total count of results in the response.
sortSpecifies sorting criteria for 'number' and 'serial' fields. Values can be -1 (descending order) or 1 (ascending order).

Responses

StatusMeaningDescription
200OKDefault Response
400Bad RequestBad Request

This operation does not require authentication

Create Devices

POST /v2/devices

Payload

{
  "body": {
    "data": [
      {
        "attributes": {
          "name": "Device 1",
          "imei": "1234567890123456789012345",
          "batch": "ABC123",
          "code": "XYZ789"
        },
        "relationships": {
          "chip": {
            "type": "chip",
            "id": "abc123456789xyz"
          },
          "enterprise": {
            "type": "enterprise",
            "id": "xyz987654321abc"
          },
          "vehicle": {
            "type": "vehicle",
            "id": "123abc456def789"
          },
          "type": {
            "type": "type",
            "id": "456def789123abc"
          }
        }
      },
      {
        "attributes": {
          "name": "Device 2",
          "imei": "9876543210987654321098765"
        },
        "relationships": {
          "chip": {
            "type": "chip",
            "id": "def456789123abc"
          }
        }
      }
    ]
  }
}
FieldDescriptionRequired
dataArray of data objects representing devices.true
attributesObject containing device attributes.true
- nameString named after device name, with the maximum length of 21 characters.true
- imeiString named after device IMEI, with the maximum length of 25 characters, must consist of numbers only.true
- batchString named after device batch, with the maximum length of 50 characters.false
- codeString named after device casode, with the maximum length of 20 characters.false
relationshipsObject containing relationships with other entities.false
- chipObject representing relationship with a chip.false
-- typeString named after the type of relationship, must be 'chip'.true
-- idString named after the ID of the chip, must consist of 15 alphanumeric characters.true
- enterpriseObject representing relationship with an enterprise.false
-- typeString named after the type of relationship, must be 'enterprise'.true
-- idString named after the ID of the enterprise, must consist of 15 alphanumeric characters.true
- vehicleObject representing relationship with a vehicle.false
-- typeString named after the type of relationship, must be 'vehicle'.true
-- idString named after the ID of the vehicle, must consist of 15 alphanumeric characters.true
- typeObject representing relationship with a type.false
-- typeString named after the type of relationship, must be 'type'.true
-- idString named after the ID of the type, must consist of 15 alphanumeric characters.true

Responses

StatusMeaningDescription
200OKDefault Response
400Bad RequestOne of 'Bad Request', 'Device(s) Already Exists', 'Duplicated `names` Was Listed', 'Resource Already Exists' or 'Device(S) And Chip(S) Do Not Belong To Same Enterprise'

This operation does not require authentication

Delete Devices

DELETE /v2/devices

Payload

{
  "body": {
    "data": [
      {
        "type": "devices",
        "id": "abc123456789xyz"
      },
      {
        "type": "devices",
        "id": "def456789123abc"
      }
    ]
  }
}
FieldDescriptionRequired
dataArray of data objects representing devices.
typeString named after the type of the data object, must be 'devices'.true
idString named after the ID of the device, must consist of 15 alphanumeric characters.true

Responses

StatusMeaningDescription
200OKDefault Response
400Bad RequestOne of 'Bad Request' or 'Device(s) Belong to Softruck'
401UnauthorizedUnauthorized
404Not FoundNot Found

This operation does not require authentication

Show Device

GET /v2/devices/{id}

FieldDescription
queryObject containing query parameters.
- attributesArray of attributes to retrieve. It can contain values such as 'name', 'imei', 'batch', 'created_at', 'updated_at', 'code'.
- includesObject specifying which related entities to include in the query.
-- chipArray of attributes related to the chip, including 'serial', 'number', 'service_provider'.
-- last_gpsArray of attributes related to the last GPS data, including 'last_connection_time', 'last_gps_time'.
-- enterpriseArray of attributes related to the enterprise, including 'name', 'cnpj'.
-- vehicleArray of attributes related to the vehicle, including 'plate', 'vin', 'code'.
-- typeArray of attributes related to the device type, including 'alias', 'brand_alias', 'inputs_count', 'outputs_count'.

Responses

StatusMeaningDescription
200OKDefault Response
400Bad RequestOne of 'Bad Request' or 'Conflicted Device Found. Device A Name Equal Device B Imei'
401UnauthorizedUnauthorized
404Not FoundNot Found

This operation does not require authentication

Update Device

PATCH /v2/devices/{id}

Payload

{
  "body": {
    "data": {
      "attributes": {
        "name": "ExampleName",
        "imei": "1234567890123456789012345",
        "batch": "ExampleBatch",
        "code": "ExampleCode"
      },
      "relationships": {
        "chip": {
          "type": "chip",
          "id": "abc123456789012"
        },
        "enterprise": {
          "type": "enterprise",
          "id": "def456789012345"
        },
        "vehicle": {
          "type": "vehicle",
          "id": "ghi789012345678"
        },
        "type": {
          "type": "type",
          "id": "jkl901234567890"
        }
      }
    }
  }
}
FieldDescriptionRequired
dataArray of data objects representing devices.true
attributesObject containing device attributes.true
- nameString named after device name, with the maximum length of 21 characters.true
- imeiString named after device IMEI, with the maximum length of 25 characters, must consist of numbers only.true
- batchString named after device batch, with the maximum length of 50 characters.false
- codeString named after device casode, with the maximum length of 20 characters.false
relationshipsObject containing relationships with other entities.false
- chipObject representing relationship with a chip.false
-- typeString named after the type of relationship, must be 'chip'.true
-- idString named after the ID of the chip, must consist of 15 alphanumeric characters.true
- enterpriseObject representing relationship with an enterprise.false
-- typeString named after the type of relationship, must be 'enterprise'.true
-- idString named after the ID of the enterprise, must consist of 15 alphanumeric characters.true
- vehicleObject representing relationship with a vehicle.false
-- typeString named after the type of relationship, must be 'vehicle'.true
-- idString named after the ID of the vehicle, must consist of 15 alphanumeric characters.true
- typeObject representing relationship with a type.false
-- typeString named after the type of relationship, must be 'type'.true
-- idString named after the ID of the type, must consist of 15 alphanumeric characters.true

Responses

StatusMeaningDescription
200OKDefault Response
400Bad RequestOne of 'Bad Request', 'Cannot Update Enterprise Of Associated Device(S)', 'Devices New Enterprise Does Not Belong To Same Owner', 'Cannot Update Device(s)', 'Device(S) And Vehicle(S) Do Not Belong To Same Enterprise' or 'Device(S) And Chip(S) Do Not Belong To Same Enterprise'
401UnauthorizedUnauthorized
404Not FoundNot Found

This operation does not require authentication

Udpate {situation} Devices

PATCH /v2/devices/{id}/status/{situation}

Parameters

{
  "params": {
    "id": "ABC1234567890DEF",
    "situation": "activation"
  }
}
FieldDescriptionRequired
idString containing the ID, must follow the alphanumeric pattern and have a length of 15 characters.true
situationString indicating the situation, must be either 'activation' or 'deactivation'.true

Responses

StatusMeaningDescription
200OKDefault Response

This operation does not require authentication