Skip to content

Public Widget

Public endpoints for the customer's entry flow into the video call. These endpoints do not require JWT authentication, being accessed by the end customer.

Rate Limiting

Public endpoints are limited to 30 requests per minute per IP.

Endpoints

MethodEndpointDescription
GET/api/v1/call/:token/validateValidate access link
POST/api/v1/call/:token/joinJoin the service queue
GET/api/v1/call/status/:call_idCheck call status
POST/api/v1/call/evaluate/:call_idRate the call
GET/api/v1/call/turn-credentialsGet TURN credentials

Checks if an access link is valid and returns department information.

GET /api/v1/call/:token/validate

Path Parameters

ParameterTypeDescription
tokenstringAccess link token

Request Example

bash
curl -X GET https://voki.avanter.com.br/api/v1/call/abc123def456/validate

Success Response (200)

json
{
  "data": {
    "valid": true,
    "department_name": "Suporte Técnico",
    "company_name": "Avanter Aliado Tecnológico Ltda",
    "company_logo_url": null,
    "primary_color": "#6366f1",
    "queue_size": 2,
    "estimated_wait_time": 30,
    "online_agents": 3
  }
}
json
{
  "errors": {
    "detail": "Invalid or expired access link"
  }
}

Join Queue

Customer joins the department's service queue.

POST /api/v1/call/:token/join

Request Body

FieldTypeRequiredDescription
namestringYesCustomer name
emailstringNoCustomer email
phonestringNoCustomer phone
reasonstringNoReason for the call

Request Example

bash
curl -X POST https://voki.avanter.com.br/api/v1/call/abc123def456/join \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Carlos Ferreira",
    "email": "carlos@email.com",
    "reason": "Support with configuration"
  }'

Success Response (200)

json
{
  "data": {
    "call_id": "1a2b3c4d-5e6f-7890-abcd-ef1234567890",
    "status": "queued",
    "position": 3,
    "estimated_wait_time": 45,
    "websocket_token": "temp_ws_token_for_customer...",
    "websocket_url": "wss://voki.avanter.com.br/socket/websocket"
  }
}

Customer Flow

After joining the queue, the customer should connect via WebSocket using the websocket_token to receive real-time updates about their queue position and when the call is started.


Call Status

Checks the current status of a call (polling alternative to WebSocket).

GET /api/v1/call/status/:call_id

Request Example

bash
curl -X GET https://voki.avanter.com.br/api/v1/call/status/1a2b3c4d-5e6f-7890-abcd-ef1234567890

Success Response (200)

json
{
  "data": {
    "call_id": "1a2b3c4d-5e6f-7890-abcd-ef1234567890",
    "status": "queued",
    "position": 2,
    "estimated_wait_time": 30
  }
}

Rate Call

Allows the customer to rate the call after it is completed.

POST /api/v1/call/evaluate/:call_id

Request Body

FieldTypeRequiredDescription
ratingintegerYesRating from 1 to 5
commentstringNoOptional comment

Request Example

bash
curl -X POST https://voki.avanter.com.br/api/v1/call/evaluate/1a2b3c4d-5e6f-7890-abcd-ef1234567890 \
  -H "Content-Type: application/json" \
  -d '{
    "rating": 5,
    "comment": "Excellent service! Issue resolved quickly."
  }'

Success Response (200)

json
{
  "data": {
    "message": "Evaluation submitted successfully"
  }
}

TURN Credentials (public)

Obtains TURN credentials for the customer to establish a WebRTC connection.

GET /api/v1/call/turn-credentials

Request Example

bash
curl -X GET https://voki.avanter.com.br/api/v1/call/turn-credentials

Success Response (200)

json
{
  "data": {
    "urls": [
      "turn:voki.avanter.com.br:3478?transport=udp",
      "turn:voki.avanter.com.br:3478?transport=tcp"
    ],
    "username": "1708300800:anonymous",
    "credential": "abcdef1234567890",
    "ttl": 86400
  }
}

Documentação da API Voki v4.0