Enterprises
List Enterprises
GET /v2/enterprises/
Parameter | Description |
---|---|
attributes | Specifies which attributes to retrieve. Can include values like 'serial', 'number', 'carrier', 'service_provider', and 'batch'. If null, retrieves all information. |
includes | Specifies 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. |
filters | Specifies 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'. |
search | Specifies the search query with a maximum length of 100 characters. |
limit | Specifies the maximum number of results to return. Must be a number between 1 and 100. |
page | Specifies the page number for paginated results. Must be a number greater than or equal to 0. |
count | Indicates whether to include the total count of results in the response. |
sort | Specifies sorting criteria for 'number' and 'serial' fields. Values can be -1 (descending order) or 1 (ascending order). |
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Default Response |
400 | Bad Request | Bad Request |
This operation does not require authentication
Create Enterprises
POST /v2/enterprises/
Payload
{
"body": {
"data": {
"attributes": {
"name": "Example Company",
"cnpj": "12345678901234",
"timezone": "America/New_York",
"phone1": "(123) 456-7890",
"phone2":"(123) 123-4567",
"email": "info@example.com",
"contact_name": "John Doe",
"webpage": "http://example.com",
"assistance_emergency_tel": "911",
"theft_emergency_tel": "911",
"fantasy_name": "Example"
},
"relationships": {
"country": {
"type": "country",
"id": "abc1234567890def"
}
}
}
}
}
Field | Description | Required |
---|---|---|
data | Object containing data attributes and relationships. | true |
attributes | Object containing attributes of the company. | true |
- name | String named after the name of the company, maximum length of 250 characters. | true |
- cnpj | String named after the CNPJ of the company, maximum length of 25 characters. | true |
- timezone | String named after the timezone of the company, must be a valid timezone string from the list of known timezones, or null. | true |
- phone1 | String named after the primary phone number of the company, maximum length of 100 characters, or null. | false |
- phone2 | String named after the secondary phone number of the company, maximum length of 100 characters, or null. | false |
String named after the email address of the company, maximum length of 100 characters, or null. | false | |
- contact_name | String named after the contact name of the company, maximum length of 100 characters, or null. | false |
- webpage | String named after the webpage URL of the company, maximum length of 255 characters, or null. | false |
- assistance_emergency_tel | String named after the assistance emergency telephone number of the company, maximum length of 100 characters, or null. | false |
- theft_emergency_tel | String named after the theft emergency telephone number of the company, maximum length of 100 characters, or null. | false |
- fantasy_name | String named after the fantasy name of the company, maximum length of 100 characters, or null. | false |
relationships | Object containing relationship information. | true |
- country | Object representing the relationship with a country. | false |
-- type | String named after the type of relationship, must be 'country'. | true |
-- id | String named after the ID of the country, must consist of 15 alphanumeric characters. | true |
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Default Response |
400 | Bad Request | One of 'Bad Request' or 'Failed to Create Enterprise' |
This operation does not require authentication
Show Enterprise
GET /v2/enterprises/{id}
Parameter | Description | Required |
---|---|---|
attributes | An optional array of strings specifying the attributes to be retrieved. Valid attributes include 'name', 'phone1', 'phone2', 'email', 'contact_name', 'created_at', 'updated_at', 'deactivated_at', 'cnpj', 'webpage', 'timezone', 'assistance_emergency_tel', 'theft_emergency_tel', 'fantasy_name'. If null, all information is retrieved. | false |
includes | An optional object specifying related entities to include in the query. Contains arrays for 'addresses' and 'document'. Each array can include values like 'formatted_address', 'city', 'region', 'zip_code', 'file_size', 'created_at', 'folder', 'key_name', 'mime', 'name'. | false |
- addresses | An array of address attributes to include in the response. Valid attributes include 'formatted_address', 'city', 'region', 'zip_code'. | false |
- document | An array of document attributes to include in the response. Valid attributes include 'file_size', 'created_at', 'folder', 'key_name', 'mime', 'name'. | false |
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Default Response |
400 | Bad Request | Bad Request |
401 | Unauthorized | Unauthorized |
404 | Not Found | Not Found |
This operation does not require authentication
Update Enterprises
PATCH /v2/enterprises/{id}
Payload
{
"body": {
"data": {
"attributes": {
"name": "Example Company",
"cnpj": "12345678901234",
"timezone": "America/New_York",
"phone1": "(123) 456-7890",
"phone2":"(123) 123-4567",
"email": "info@example.com",
"contact_name": "John Doe",
"webpage": "http://example.com",
"assistance_emergency_tel": "911",
"theft_emergency_tel": "911",
"fantasy_name": "Example"
},
"relationships": {
"country": {
"type": "country",
"id": "abc1234567890def"
}
}
}
}
}
Field | Description | Required |
---|---|---|
data | Object containing data attributes and relationships. | true |
attributes | Object containing attributes of the company. | true |
- name | String named after the name of the company, maximum length of 250 characters. | true |
- cnpj | String named after the CNPJ of the company, maximum length of 25 characters. | true |
- timezone | String named after the timezone of the company, must be a valid timezone string from the list of known timezones, or null. | true |
- phone1 | String named after the primary phone number of the company, maximum length of 100 characters, or null. | false |
- phone2 | String named after the secondary phone number of the company, maximum length of 100 characters, or null. | false |
String named after the email address of the company, maximum length of 100 characters, or null. | false | |
- contact_name | String named after the contact name of the company, maximum length of 100 characters, or null. | false |
- webpage | String named after the webpage URL of the company, maximum length of 255 characters, or null. | false |
- assistance_emergency_tel | String named after the assistance emergency telephone number of the company, maximum length of 100 characters, or null. | false |
- theft_emergency_tel | String named after the theft emergency telephone number of the company, maximum length of 100 characters, or null. | false |
- fantasy_name | String named after the fantasy name of the company, maximum length of 100 characters, or null. | false |
relationships | Object containing relationship information. | true |
- country | Object representing the relationship with a country. | false |
-- type | String named after the type of relationship, must be 'country'. | true |
-- id | String named after the ID of the country, must consist of 15 alphanumeric characters. | true |
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Default Response |
400 | Bad Request | Bad Request |
401 | Unauthorized | Unauthorized |
404 | Not Found | Not Found |
This operation does not require authentication
Delete Enterprises
DELETE /v2/enterprises/{id}
Parameters
{
"params": {
"id": "ABC1234567890DEF"
}
}
Field | Description | Required |
---|---|---|
id | String specifying the ID. Must be alphanumeric and exactly 15 characters long. | true |
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Default Response |
400 | Bad Request | One of 'Bad Request', 'Cannot Delete Self Enterprise', 'Cannot Delete a Main Client Enterprise', 'Cannot Delete Enterprise With Other Affiliations', 'Invalid Affiliation', 'Enterprise Not Affiliated' or 'Cannot Delete Enterprise With Devices, Chips, Vehicles or Users' |
401 | Unauthorized | Unauthorized |
404 | Not Found | Not Found |
This operation does not require authentication
Update {situation} Enterprises
PATCH /v2/enterprises/{id}/status/{situation}
Parameters
{
"params": {
"id": "ABC1234567890DEF",
"situation": "activation"
}
}
Field | Description | Required |
---|---|---|
id | String containing the ID, must follow the alphanumeric pattern and have a length of 15 characters. | true |
situation | String indicating the situation, must be either 'activation' or 'deactivation'. | true |
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Default Response |
This operation does not require authentication