Skip to content

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

MethodEndpointDescriptionMinimum Role
GET/api/v1/providersList providerssupervisor
POST/api/v1/providersCreate providermanager
GET/api/v1/providers/:idGet providersupervisor
PUT/api/v1/providers/:idUpdate providermanager
DELETE/api/v1/providers/:idDelete providermanager
GET/api/v1/providers/:id/usersList provider userssupervisor
POST/api/v1/providers/:id/usersAssociate user with providermanager
DELETE/api/v1/providers/:id/users/:user_idDissociate usermanager

List Providers

GET /api/v1/providers

Query Parameters

ParameterTypeDefaultDescription
pageinteger1Page number
page_sizeinteger20Items per page
sort_bystringnameSort field
sort_orderstringascSort 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/providers

Request Body

FieldTypeRequiredDescription
namestringYesProvider name
documentstringNoCNPJ or CPF
emailstringNoContact email
phonestringNoPhone 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/:id

Request 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/:id

Request 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/:id

Request 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/users

Request 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/users

Request Body

FieldTypeRequiredDescription
user_iduuidYesUser 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_id

Request 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.

Documentação da API Voki v4.0