Skip to main content

Agentes

CRUD completo para os agentes de IA da conta.

Endpoints

MétodoRotaDescrição
GET/api/v1/agentsLista agentes
POST/api/v1/agentsCria um agente
GET/api/v1/agents/{agent}Exibe um agente
PUT/PATCH/api/v1/agents/{agent}Atualiza um agente
DELETE/api/v1/agents/{agent}Remove um agente

Filtros de listagem

search (por nome), is_active, ai_connection_id.

Campos

CampoTipoObrigatórioDescrição
namestring, max 255SimNome do agente.
descriptionstringNãoResumo do propósito do agente.
instructionsstringSimPrompt do sistema — define o comportamento do agente.
ai_connection_idintegerSimID de uma conexão de IA ativa da mesma conta.
voicestringSimUma das vozes disponíveis: marin, cedar, alloy, ash, ballad, coral, echo, sage, shimmer, verse.
is_activebooleanNãoPadrão: conforme cadastro.
avatarstring, max 255NãoCaminho/URL do avatar.

Exemplo de resposta

{
"id": 12,
"name": "Atendimento Comercial",
"description": "Agente responsável por triagem e agendamentos",
"instructions": "Você é um assistente...",
"ai_connection_id": 3,
"voice": "marin",
"avatar": null,
"is_active": true,
"created_at": "2026-08-01T12:00:00Z",
"updated_at": "2026-08-01T12:00:00Z"
}
note

As ferramentas (tools) de um agente têm sua própria API — veja Ferramentas de agente.

Exemplos com curl

Listar agentes

curl "$ROUXINOL_URL/api/v1/agents?is_active=true" \
-H "Authorization: Bearer $ROUXINOL_TOKEN"

Criar um agente

curl -X POST "$ROUXINOL_URL/api/v1/agents" \
-H "Authorization: Bearer $ROUXINOL_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Atendimento Comercial",
"description": "Agente responsável por triagem e agendamentos",
"instructions": "Você é um assistente comercial simpático e objetivo.",
"ai_connection_id": 3,
"voice": "marin",
"is_active": true
}'

Exibir um agente

curl "$ROUXINOL_URL/api/v1/agents/12" \
-H "Authorization: Bearer $ROUXINOL_TOKEN"

Atualizar um agente

curl -X PATCH "$ROUXINOL_URL/api/v1/agents/12" \
-H "Authorization: Bearer $ROUXINOL_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "voice": "cedar" }'

Remover um agente

curl -X DELETE "$ROUXINOL_URL/api/v1/agents/12" \
-H "Authorization: Bearer $ROUXINOL_TOKEN"