API reference › Basics
API overview
Base URL, authentication, request and response format, streaming and conventions of the HTTP API.
The DoubleX Agentes API is the same one the app uses. With it you create and configure agents, talk to them with streaming, call models directly, use connector tools, feed the Brain, manage skills and triggers, and download the files in Creations.
Base URL#
https://doublex.ai/apiEvery route in this reference is relative to that address: GET /api/agents means GET https://doublex.ai/api/agents.
Authentication#
Send an API key in the Authorization header:
curl https://doublex.ai/api/me -H "Authorization: Bearer $DOUBLEX_API_KEY"The key acts as the person who owns it. Each route applies the same access rules as the app: you see and change only what that person sees and changes.
Requests#
- Bodies in JSON, with
Content-Type: application/json. The exception is uploading files to the Brain, which usesmultipart/form-data. - Text in UTF-8.
- Fields a route doesn't recognize are ignored.
- Dates in ISO 8601, in UTC (
2026-10-27T14:03:11.482Z).
Responses#
Successful responses are JSON, with the resource inside a key named after it:
{ "agent": { "id": "agt_8f3a2b1c9d0e", "name": "CRM Analyst", "...": "..." } }Lists come in an array named in the plural ({ "agents": [...] }) and include everything you can see, with no pagination. Actions with nothing to return respond { "ok": true }.
New fields may appear in responses at any time. Ignore the ones you don't recognize.
Errors have the format { "error": "message" }, sometimes with a stable code. See Errors and limits.
Streaming (NDJSON)#
Routes that generate text with AI can respond in chunks, in NDJSON format: one JSON object per line, separated by \n, with Content-Type: application/x-ndjson. Read it line by line:
const res = await fetch("https://doublex.ai/api/agents/agt_8f3a2b1c9d0e/chat", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.DOUBLEX_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({ message: "Summarize the sales from yesterday" }),
});
const reader = res.body.pipeThrough(new TextDecoderStream()).getReader();
let buffer = "";
for (;;) {
const { value, done } = await reader.read();
if (done) break;
buffer += value;
let nl;
while ((nl = buffer.indexOf("\n")) >= 0) {
const line = buffer.slice(0, nl).trim();
buffer = buffer.slice(nl + 1);
if (!line) continue;
const event = JSON.parse(line);
if (event.type === "text") process.stdout.write(event.delta);
}
}IDs#
IDs are strings with a prefix that tells you the resource type:
| Prefix | Resource |
|---|---|
agt_ | Agent |
task_ | Conversation (session in the CLI) |
trg_ | Trigger |
con_ | Connector |
kno_ | Brain document |
skl_ | Skill |
team_ | Team |
usr_ | Person |
key_ | API key |
Scopes and permissions#
Agents, skills, Brain documents and connectors have a scope:
| Scope | Who sees and uses it | Who edits it |
|---|---|---|
personal | Only the owner | The owner and the organization's admins |
team | Members of the team (teamId) | The owner, the team's admins and the organization's admins |
organization | Everyone in the organization | The owner and the organization's admins |
Items you can't see respond 404, as if they didn't exist. Items you can see but can't edit respond 403 (or 404 on some routes) when you try to change them. The canEdit fields in responses tell you what you can edit.
Resources#
| Resource | Routes |
|---|---|
| Account | Who you are, language, API keys |
| Agents | Create, list, configure and delete agents |
| Conversations | Stream conversations, continue, cancel and read the history |
| Chat | Call a model directly, without an agent |
| Models and credits | Model catalog, balance and usage |
| Connectors | List connections and run tools |
| Brain | Notes, folders, links and search in the Brain |
| Skills | Reusable instructions |
| Creations | Files created by agents |
| Triggers | Schedules, webhooks and app events |
| Teams | The organization's teams |