Providers
Management of service providers (Service Providers). Providers are external entities that can handle calls on the platform. Read access requires supervisor, write access requires manager.
Endpoints
| Method | Endpoint | Description | Minimum Role |
|---|---|---|---|
GET | /api/v1/providers | List providers | supervisor |
POST | /api/v1/providers | Create provider | manager |
GET | /api/v1/providers/:id | Get provider | supervisor |
PUT | /api/v1/providers/:id | Update provider | manager |
DELETE | /api/v1/providers/:id | Delete provider | manager |
GET | /api/v1/providers/:id/users | List provider users | supervisor |
POST | /api/v1/providers/:id/users | Associate user with provider | manager |
DELETE | /api/v1/providers/:id/users/:user_id | Dissociate user | manager |
List Providers
GET /api/v1/providersQuery Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number |
page_size | integer | 20 | Items per page |
sort_by | string | name | Sort field |
sort_order | string | asc | Sort direction |
Request Example
bash
curl -X GET "https://voki.avanter.com.br/api/v1/providers" \
-H "Authorization: Bearer eyJhbGci..." \
-H "X-Tenant: avanter"Success Response (200)
json
{
"data": [
{
"id": "c9d0e1f2-a3b4-5678-ijkl-901234567890",
"name": "Consultoria Médica XYZ",
"document": "98.765.432/0001-10",
"email": "contato@consultoriaxyz.com.br",
"phone": "+5511988887777",
"active": true,
"user_count": 3,
"inserted_at": "2026-01-20T10:00:00Z",
"updated_at": "2026-01-20T10:00:00Z"
}
],
"meta": {
"current_page": 1,
"page_size": 20,
"total_pages": 1,
"total_count": 1
}
}Create Provider
POST /api/v1/providersRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Provider name |
document | string | No | CNPJ or CPF |
email | string | No | Contact email |
phone | string | No | Phone number |
Request Example
bash
curl -X POST https://voki.avanter.com.br/api/v1/providers \
-H "Authorization: Bearer eyJhbGci..." \
-H "X-Tenant: avanter" \
-H "Content-Type: application/json" \
-d '{
"service_provider": {
"name": "Clínica ABC",
"document": "11.222.333/0001-44",
"email": "contato@clinicaabc.com.br",
"phone": "+5511977776666"
}
}'Success Response (201)
json
{
"data": {
"id": "d0e1f2a3-b4c5-6789-jklm-012345678901",
"name": "Clínica ABC",
"document": "11.222.333/0001-44",
"email": "contato@clinicaabc.com.br",
"phone": "+5511977776666",
"active": true,
"user_count": 0,
"inserted_at": "2026-02-18T14:00:00Z",
"updated_at": "2026-02-18T14:00:00Z"
}
}Get Provider
GET /api/v1/providers/:idRequest Example
bash
curl -X GET https://voki.avanter.com.br/api/v1/providers/c9d0e1f2-a3b4-5678-ijkl-901234567890 \
-H "Authorization: Bearer eyJhbGci..." \
-H "X-Tenant: avanter"Update Provider
PUT /api/v1/providers/:idRequest Example
bash
curl -X PUT https://voki.avanter.com.br/api/v1/providers/c9d0e1f2-a3b4-5678-ijkl-901234567890 \
-H "Authorization: Bearer eyJhbGci..." \
-H "X-Tenant: avanter" \
-H "Content-Type: application/json" \
-d '{
"service_provider": {
"name": "Consultoria Médica XYZ Atualizada",
"active": true
}
}'Delete Provider
DELETE /api/v1/providers/:idRequest Example
bash
curl -X DELETE https://voki.avanter.com.br/api/v1/providers/d0e1f2a3-b4c5-6789-jklm-012345678901 \
-H "Authorization: Bearer eyJhbGci..." \
-H "X-Tenant: avanter"Success Response (204)
No response body.
List Provider Users
GET /api/v1/providers/:provider_id/usersRequest Example
bash
curl -X GET https://voki.avanter.com.br/api/v1/providers/c9d0e1f2-a3b4-5678-ijkl-901234567890/users \
-H "Authorization: Bearer eyJhbGci..." \
-H "X-Tenant: avanter"Success Response (200)
json
{
"data": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Dr. Carlos Mendes",
"email": "carlos@consultoriaxyz.com.br",
"role": "attendant",
"active": true
}
]
}Associate User with Provider
POST /api/v1/providers/:provider_id/usersRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
user_id | uuid | Yes | User ID |
Request Example
bash
curl -X POST https://voki.avanter.com.br/api/v1/providers/c9d0e1f2-a3b4-5678-ijkl-901234567890/users \
-H "Authorization: Bearer eyJhbGci..." \
-H "X-Tenant: avanter" \
-H "Content-Type: application/json" \
-d '{
"user_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}'Success Response (201)
json
{
"data": {
"message": "User associated with provider"
}
}Dissociate User from Provider
DELETE /api/v1/providers/:provider_id/users/:user_idRequest Example
bash
curl -X DELETE https://voki.avanter.com.br/api/v1/providers/c9d0e1f2-a3b4-5678-ijkl-901234567890/users/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
-H "Authorization: Bearer eyJhbGci..." \
-H "X-Tenant: avanter"Success Response (204)
No response body.
