Skip to content

Users

User management for the platform. Most endpoints require manager role or above.

Endpoints

MethodEndpointDescriptionMinimum Role
GET/api/v1/users/meCurrent user dataattendant
GET/api/v1/usersList usersmanager
POST/api/v1/usersCreate usermanager
GET/api/v1/users/:idGet user by IDmanager
PUT/api/v1/users/:idUpdate usermanager

Note

The DELETE endpoint is not available. Users are deactivated by updating the active field.


Current User

Returns the authenticated user's data.

GET /api/v1/users/me

Request Example

bash
curl -X GET https://voki.avanter.com.br/api/v1/users/me \
  -H "Authorization: Bearer eyJhbGci..." \
  -H "X-Tenant: avanter"

Success Response (200)

json
{
  "data": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "name": "João Silva",
    "email": "joao@empresa.com",
    "role": "attendant",
    "active": true,
    "avatar_url": null,
    "mfa_enabled": false,
    "locale": "pt-BR",
    "inserted_at": "2026-01-15T10:30:00Z",
    "updated_at": "2026-02-01T14:20:00Z"
  }
}

List Users

Returns a paginated list of the tenant's users.

GET /api/v1/users

Query Parameters

ParameterTypeDefaultDescription
pageinteger1Page number
page_sizeinteger20Items per page (max 100)
sort_bystringnameSort field (name, email, role, inserted_at)
sort_orderstringascDirection (asc, desc)
searchstring-Filter by name or email
rolestring-Filter by role (attendant, supervisor, manager)
activeboolean-Filter by active/inactive status

Request Example

bash
curl -X GET "https://voki.avanter.com.br/api/v1/users?page=1&page_size=10&role=attendant" \
  -H "Authorization: Bearer eyJhbGci..." \
  -H "X-Tenant: avanter"

Success Response (200)

json
{
  "data": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "name": "João Silva",
      "email": "joao@empresa.com",
      "role": "attendant",
      "active": true,
      "avatar_url": null,
      "mfa_enabled": false,
      "locale": "pt-BR",
      "inserted_at": "2026-01-15T10:30:00Z",
      "updated_at": "2026-02-01T14:20:00Z"
    },
    {
      "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "name": "Maria Santos",
      "email": "maria@empresa.com",
      "role": "attendant",
      "active": true,
      "avatar_url": "https://example.com/avatar.jpg",
      "mfa_enabled": true,
      "locale": "pt-BR",
      "inserted_at": "2026-01-20T08:00:00Z",
      "updated_at": "2026-01-20T08:00:00Z"
    }
  ],
  "meta": {
    "current_page": 1,
    "page_size": 10,
    "total_pages": 3,
    "total_count": 25
  }
}

Create User

Creates a new user in the tenant.

POST /api/v1/users

Request Body

FieldTypeRequiredDescription
namestringYesFull name (min 2 characters)
emailstringYesUnique email within the tenant
passwordstringYesPassword (min 8 characters)
rolestringYesRole: attendant, supervisor, or manager
localestringNoLanguage: pt-BR, en-US, es-ES, fr (default: pt-BR)

Request Example

bash
curl -X POST https://voki.avanter.com.br/api/v1/users \
  -H "Authorization: Bearer eyJhbGci..." \
  -H "X-Tenant: avanter" \
  -H "Content-Type: application/json" \
  -d '{
    "user": {
      "name": "Pedro Oliveira",
      "email": "pedro@empresa.com",
      "password": "securePassword123",
      "role": "attendant",
      "locale": "pt-BR"
    }
  }'

Success Response (201)

json
{
  "data": {
    "id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
    "name": "Pedro Oliveira",
    "email": "pedro@empresa.com",
    "role": "attendant",
    "active": true,
    "avatar_url": null,
    "mfa_enabled": false,
    "locale": "pt-BR",
    "inserted_at": "2026-02-18T10:00:00Z",
    "updated_at": "2026-02-18T10:00:00Z"
  }
}

Errors

CodeDescription
422Invalid data (duplicate email, weak password, etc.)
403Permission denied (insufficient role)
json
{
  "errors": {
    "email": ["has already been taken"]
  }
}

Get User

Returns a specific user's data.

GET /api/v1/users/:id

Path Parameters

ParameterTypeDescription
iduuidUser ID

Request Example

bash
curl -X GET https://voki.avanter.com.br/api/v1/users/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
  -H "Authorization: Bearer eyJhbGci..." \
  -H "X-Tenant: avanter"

Success Response (200)

json
{
  "data": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "name": "João Silva",
    "email": "joao@empresa.com",
    "role": "attendant",
    "active": true,
    "avatar_url": null,
    "mfa_enabled": false,
    "locale": "pt-BR",
    "inserted_at": "2026-01-15T10:30:00Z",
    "updated_at": "2026-02-01T14:20:00Z"
  }
}

Errors

CodeDescription
404User not found

Update User

Updates an existing user's data.

PUT /api/v1/users/:id

Request Body

FieldTypeRequiredDescription
namestringNoFull name
emailstringNoEmail
passwordstringNoNew password
rolestringNoNew role
activebooleanNoActivate/deactivate
localestringNoLanguage

Request Example

bash
curl -X PUT https://voki.avanter.com.br/api/v1/users/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
  -H "Authorization: Bearer eyJhbGci..." \
  -H "X-Tenant: avanter" \
  -H "Content-Type: application/json" \
  -d '{
    "user": {
      "role": "supervisor",
      "active": true
    }
  }'

Success Response (200)

json
{
  "data": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "name": "João Silva",
    "email": "joao@empresa.com",
    "role": "supervisor",
    "active": true,
    "avatar_url": null,
    "mfa_enabled": false,
    "locale": "pt-BR",
    "inserted_at": "2026-01-15T10:30:00Z",
    "updated_at": "2026-02-18T11:00:00Z"
  }
}

Documentação da API Voki v4.0