Skip to main content

Workers

Workers are containers that manage assistants and handle conversations across channels. They coordinate between assistants and channels, routing messages appropriately.

List Workers

GET /workers

Returns a list of all workers in your workspace.

Query Parameters

number
Page number for pagination
number
Number of items per page

Create Worker

POST /workers

Creates a new worker and associates it with a workspace.

Request Body

string
required
Worker name
string
Worker description
string
Worker timezone (e.g., “America/Sao_Paulo”)

Response

message
string
Success message
data
object

Get Worker

GET /workers/:worker_id

Returns detailed information about a specific worker.
:worker_id
string
required
Worker unique identifier

Delete Worker

DELETE /workers/:worker_id

Removes a worker from a workspace.
:worker_id
string
required
Worker unique identifier

Create Assistant for Worker

POST /workers/:worker_id/assistants

Creates a new assistant and associates it with a specific worker.
:worker_id
string
required
Worker unique identifier

Request Body

string
required
Assistant name
string
required
System instructions for the assistant
string
AI model to use
string
AI provider (e.g., “OPENAI”)
array
List of supported language codes

How Workers Work

  1. Workers contain one or more assistants
  2. Assistants are connected to channels via workers
  3. Messages are routed to the appropriate assistant based on channel configuration
  4. Workers can be assigned to multiple channels

Examples

Create Worker

curl -X POST https://api.plati.ai/workers \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Customer Support Worker",
    "description": "Handles customer support conversations",
    "timezone": "America/Sao_Paulo"
  }'

Create Assistant for Worker

curl -X POST https://api.plati.ai/workers/worker123/assistants \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Support Assistant",
    "instructions": "You are a helpful customer support assistant.",
    "model": "gpt-4",
    "provider": "OPENAI",
    "languages": ["pt-BR", "en-US"]
  }'

Next Steps