Agentes
Listar agentes
Lista os agentes da organização, do alterado mais recentemente para o mais antigo.
GET https://api.diska.ai/v1/agents
Âmbito: agents:read
Sem o filtro status, os agentes arquivados não aparecem. A lista não é paginada.
Parâmetros
Na query string
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
agent_type | string | null | Não | Só agentes deste tipo. Um de: inbound, outbound, voice_widget, chat. |
status | string | null | Não | Só agentes neste estado. Use archived para ver os arquivados. Um de: draft, active, inactive, archived. |
search | string | null | Não | Texto contido no nome. Até 200 caracteres. |
Exemplos
curl "https://api.diska.ai/v1/agents" \
-H "Authorization: Bearer $DISKA_API_KEY"
import os
import requests
response = requests.get(
"https://api.diska.ai/v1/agents",
headers={"Authorization": f"Bearer {os.environ['DISKA_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
print(response.json())
// Node.js 18 ou superior, num ficheiro .mjs
const response = await fetch('https://api.diska.ai/v1/agents', {
headers: { Authorization: `Bearer ${process.env.DISKA_API_KEY}` }
})
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`)
console.log(await response.json())
<?php
$ch = curl_init('https://api.diska.ai/v1/agents');
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('DISKA_API_KEY')],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
if ($status >= 400) {
throw new RuntimeException("HTTP $status: $body");
}
print_r(json_decode($body, true));
Experimentar
Envie o pedido a partir desta página, com a sua chave. A chave fica só nesta página: não é guardada e só é enviada para api.diska.ai. Use uma chave de teste com os âmbitos mínimos.
GET
https://api.diska.ai/v1/agentsComeça por dsk_. Fica só neste separador do browser.
query
query
query
Introduza uma chave API (dsk_…).
Resposta 200
| Campo | Tipo | Descrição |
|---|---|---|
items | array | Os agentes. |
items[].id | string | Identificador do agente. |
items[].name | string | Nome do agente. |
items[].slug | string | Identificador legível do agente. |
items[].description | string | null | Descrição, ou null. |
items[].status | string | draft, active, inactive ou archived. Um agente publicado fica active. |
items[].agent_type | string | inbound, outbound, voice_widget ou chat. |
items[].editing_mode | string | prompt ou flow (Flow Builder). Não muda depois de criado. Padrão: prompt. |
items[].version | integer | Número da versão do agente. Padrão: 1. |
items[].phone_number | string | null | Número atribuído ao agente, ou null. |
items[].public_channel_enabled | boolean | true quando o Link público do agente está activo. Padrão: false. |
items[].created_at | string | Data de criação (ISO 8601). |
items[].updated_at | string | Data da última alteração (ISO 8601). |
{
"items": [
{
"id": "3f1c2a7e-5b9d-4c1e-8f3a-2d6b7e9c1a40",
"name": "Recepção",
"slug": "recepcao",
"description": "Atende as chamadas da recepção.",
"status": "active",
"agent_type": "inbound",
"editing_mode": "prompt",
"version": 3,
"phone_number": "+244900000000",
"public_channel_enabled": false,
"created_at": "2026-10-25T18:40:00Z",
"updated_at": "2026-10-25T18:40:00Z"
}
]
}
Erros
Este endpoint não tem erros próprios.
Os erros comuns a todos os endpoints (401, 403, 422, 429 e 5xx) estão em Erros.

