Users
List Users
GET /v2/users
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 User
POST /v2/users
{
"body": {
"data": {
"attributes": {
"username": "john_doe",
"email": "john.doe@example.com",
"name": "John Doe",
"phone1": "+1234567890",
"phone2": "+9876543210",
"emergency_contact": "Jane Doe",
"emergency_phone": "+1112223333",
"document_number": "12345678901",
"cpf": "98765432109",
"birthdate": "1990-05-15",
"locale": "en_US"
},
"relationships": {
"enterprise": {
"type": "enterprise",
"id": "abc123def456ghi"
},
"roles": {
"type": "roles",
"id": "role123"
}
}
}
}
}
Field | Description | Required |
---|---|---|
data | Object | true |
attributes | Object containing user data attributes. | true |
- username | String named after user's username, trimmed, with a length between 1 and 255 characters. | true |
String named after user's email address, validated as an email format. | true | |
- name | String named after user's name, with a maximum length of 255 characters. | true |
- phone1 | String named after user's primary phone number, with a maximum length of 20 characters. | false |
- phone2 | String named after user's secondary phone number, with a maximum length of 20 characters. | false |
- emergency_contact | String named after user's emergency contact information, with a maximum length of 255 characters. | false |
- emergency_phone | String named after user's emergency phone number, with a maximum length of 20 characters. | false |
- document_number | String named after user's document number, with a maximum length of 20 characters. | false |
- cpf | String named after user's CPF, trimmed, with a length between 1 and 20 characters. | true |
- birthdate | User's birthdate. | false |
- locale | String named after user's locale, must be one of 'pt_BR', 'es_UY', or 'en_US'. | true |
relationships | Object containing relationship data. | true |
- enterprise | Object representing the relationship with an enterprise. | true |
-- type | String named after the type of relationship, must be 'enterprise'. | true |
-- id | String named after the ID of the enterprise, must consist of 15 alphanumeric characters. | true |
- roles | Object representing the relationship with roles. | false |
-- type | String named after the type of relationship, must be 'roles'. | true |
-- id | String named after the ID of the roles, must consist of 15 alphanumeric characters. | true |
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Default Response |
400 | Bad Request | One of 'Bad Request', 'Entity Duplicated' or 'Can Not Create Multiple Users For Different Enterprises' |
This operation does not require authentication
Show User
GET /v2/users/{id}
Field | Description |
---|---|
attributes | Array of attributes to retrieve. It can contain values such as 'username', 'email', 'name', etc. If null, all information is retrieved. |
includes | Specifies related entities to include in the query. It contains arrays for 'addresses', 'document', and 'enterprise', which can include values like 'formatted_address', 'city', 'name', etc. |
- addresses | Array of address attributes to include. It can contain values such as 'formatted_address', 'city', 'region', 'zip_code'. |
- document | Array of document attributes to include. It can contain values such as 'file_size', 'created_at', 'folder', 'key_name', 'mime', 'name'. |
- enterprise | Array of enterprise attributes to include. It can contain values such as 'name', 'cnpj'. |
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 User
PATCH /v2/users/{id}
Payload
{
"body": {
"data": {
"attributes": {
"username": "john_doe",
"email": "john.doe@example.com",
"name": "John Doe",
"phone1": "+1234567890",
"phone2": "+9876543210",
"emergency_contact": "Jane Doe",
"emergency_phone": "+1112223333",
"document_number": "12345678901",
"cpf": "98765432109",
"birthdate": "1990-05-15",
"locale": "en_US"
},
"relationships": {
"enterprise": {
"type": "enterprise",
"id": "abc123def456ghi"
},
"roles": {
"type": "roles",
"id": "role123"
}
}
}
}
}
Field | Description | Required |
---|---|---|
data | Object | true |
attributes | Object containing user data attributes. | true |
- username | String named after user's username, trimmed, with a length between 1 and 255 characters. | true |
String named after user's email address, validated as an email format. | true | |
- name | String named after user's name, with a maximum length of 255 characters. | true |
- phone1 | String named after user's primary phone number, with a maximum length of 20 characters. | false |
- phone2 | String named after user's secondary phone number, with a maximum length of 20 characters. | false |
- emergency_contact | String named after user's emergency contact information, with a maximum length of 255 characters. | false |
- emergency_phone | String named after user's emergency phone number, with a maximum length of 20 characters. | false |
- document_number | String named after user's document number, with a maximum length of 20 characters. | false |
- cpf | String named after user's CPF, trimmed, with a length between 1 and 20 characters. | true |
- birthdate | User's birthdate. | false |
- locale | String named after user's locale, must be one of 'pt_BR', 'es_UY', or 'en_US'. | true |
relationships | Object containing relationship data. | true |
- enterprise | Object representing the relationship with an enterprise. | true |
-- type | String named after the type of relationship, must be 'enterprise'. | true |
-- id | String named after the ID of the enterprise, must consist of 15 alphanumeric characters. | true |
- roles | Object representing the relationship with roles. | false |
-- type | String named after the type of relationship, must be 'roles'. | true |
-- id | String named after the ID of the roles, must consist of 15 alphanumeric characters. | true |
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Default Response |
400 | Bad Request | One of 'Bad Request', 'Can Not Update User Without Role', 'Can Only Update Yourself', 'Can Not Update Yourself', 'Can Not Update an User With Role Above' or 'Can Not Update an User To Role Above' |
401 | Unauthorized | Unauthorized |
404 | Not Found | Not Found |
This operation does not require authentication
Delete User
DELETE /v2/users/{id}
Payload
{
"params": {
"id": "abc123def456ghi"
}
}
Field | Description | Required |
---|---|---|
id | String representing an identifier. It must consist of 15 alphanumeric characters (uppercase and lowercase letters, and digits). | true |
Responses
Status | Meaning | Description |
---|---|---|
200 | OK | Default Response |
400 | Bad Request | One of 'Bad Request', 'Can Not Delete Self' or 'Can Not Delete an User With Role Above' |
401 | Unauthorized | Unauthorized |
404 | Not Found | Not Found |
This operation does not require authentication
Udpate {situation} Users
PATCH /v2/users/{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