Agents
Create an agent
Creates an agent, blank or from a Diska template (template_id).
POST https://api.diska.ai/v1/agents
Scope: agents:write
The agent starts as a draft (status: draft): publish it to make it available on your channels. The DISKA API does not list templates.
Request body
application/json
| Field | Type | Required | Description |
|---|---|---|---|
name | string | null | No | Agent name. Default: Novo agente, or the template's name. Up to 120 characters. |
agent_type | string | null | No | Agent type. Default: inbound, or the template's type. One of: inbound, outbound, voice_widget, chat. |
editing_mode | string | null | No | Default: prompt for a blank agent, flow from a template. |
template_id | string | null | No | Diska agent template. Without it, the agent is created blank. Up to 64 characters. |
{
"name": "Recepção",
"agent_type": "inbound",
"editing_mode": "prompt"
}
Examples
curl -X POST "https://api.diska.ai/v1/agents" \
-H "Authorization: Bearer $DISKA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Recepção","agent_type":"inbound","editing_mode":"prompt"}'
import os
import requests
response = requests.post(
"https://api.diska.ai/v1/agents",
headers={"Authorization": f"Bearer {os.environ['DISKA_API_KEY']}"},
json={
"name": "Recepção",
"agent_type": "inbound",
"editing_mode": "prompt",
},
timeout=30,
)
response.raise_for_status()
print(response.json())
// Node.js 18 or later, in a .mjs file
const response = await fetch('https://api.diska.ai/v1/agents', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.DISKA_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "Recepção",
"agent_type": "inbound",
"editing_mode": "prompt"
})
})
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_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('DISKA_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Recepção',
'agent_type' => 'inbound',
'editing_mode' => 'prompt',
]),
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));
Try it
Send the request from this page, with your key. The key stays on this page: it is not stored and is only sent to api.diska.ai. Use a test key with the fewest scopes you need.
POST
https://api.diska.ai/v1/agentsStarts with dsk_. It stays in this browser tab only.
Enter an API key (dsk_…).
Response 201
| Field | Type | Description |
|---|---|---|
id | string | Agent ID. |
name | string | Agent name. |
slug | string | Readable agent identifier. |
description | string | null | Description, or null. |
status | string | draft, active, inactive or archived. A published agent is active. |
agent_type | string | inbound, outbound, voice_widget or chat. |
editing_mode | string | prompt or flow (Flow Builder). It does not change after creation. Default: prompt. |
version | integer | Agent version number. Default: 1. |
phone_number | string | null | Number assigned to the agent, or null. |
public_channel_enabled | boolean | true when the agent's public link is on. Default: false. |
created_at | string | Creation date (ISO 8601). |
updated_at | string | Last change date (ISO 8601). |
{
"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"
}
Errors
| Code | When |
|---|---|
404 | Modelo não encontrado. — the template_id does not exist. |
422 | The template could not be installed. |
Errors common to every endpoint (401, 403, 422, 429 and 5xx) are in Errors.

