Run your AI agents from your own code
Call an Agentis agent over HTTP and get a reply with its full brain — system prompt, knowledge base, and tools — manage the agent programmatically, or send outbound WhatsApp messages. Billed against the same credits as WhatsApp. Examples in cURL, JavaScript & Python.
Three surfaces
Run
POST /v1/chat/completionsTalk to an agent, get a reply + usage. Needs a key with the chat scope.
Manage
/v1/agents/*List your agents and configure their webhook tools. Needs a key with the manage scope.
Messaging
POST /v1/messagesSend outbound WhatsApp messages + verify contacts from a connected agent. Needs a key with the messages scope.
Authentication
Every request authenticates with a bearer API key created in your dashboard. The raw key is shown once at creation — store it securely. Keys carry scopes: chat (run agents, safe to embed client-side), manage (configure agents), and messages (send outbound) — the last two are server-side only.
Authorization: Bearer dz_live_a1b2c3d4...
Find your agent ID
Every call takes an agentId. Two ways to get it:
- Dashboard — open the agent; its ID is in the URL:
www.dailzero.com/dashboard/agent/<AGENT_ID> - API — call
GET /v1/agentswith amanage-scoped key (see List your agents below); each item'sidis the agent ID.
Run an agent — chat completions
Send the conversation so far, get the agent's reply with its persona, knowledge base, and tools. Billed by token-weighted credits.
curl https://www.dailzero.com/api/v1/chat/completions \
-H "Authorization: Bearer dz_live_..." \
-H "Content-Type: application/json" \
-d '{
"agentId": "<your-agent-id>",
"messages": [{ "role": "user", "content": "do you sell ferrari caps?" }]
}'Response
{
"message": { "role": "assistant", "content": "Yes — Ferrari F1 White Cap (₦23,000)..." },
"usage": { "input_tokens": 1240, "output_tokens": 142, "credits": 2 },
"remaining_credits": 11218
}Send a WhatsApp message
Once your agent's WhatsApp is connected, send outbound messages programmatically. Sends go through the same anti-ban pacing as the dashboard and are billed per message. Want pure outbound with no AI auto-replies? Turn AI replies off for the agent in its settings.
curl https://www.dailzero.com/api/v1/messages \
-H "Authorization: Bearer dz_live_..." \
-H "Content-Type: application/json" \
-d '{
"agentId": "<your-agent-id>",
"to": "2348012345678",
"text": "Hi! Your order #1234 has shipped"
}'Response
{
"message_id": "a1b2c3",
"status": "queued",
"usage": { "credits": 5 },
"remaining_credits": 11195
}Verify a contact
Check a number is reachable on WhatsApp before sending. Free (no credits).
curl https://www.dailzero.com/api/v1/contacts/check \
-H "Authorization: Bearer dz_live_..." \
-H "Content-Type: application/json" \
-d '{ "agentId": "<your-agent-id>", "phone": "2348012345678" }'List your agents
Find an agent's id to use in the calls above.
curl https://www.dailzero.com/api/v1/agents \ -H "Authorization: Bearer dz_live_..."
Manage an agent's tools
Define the webhook tools your agent can call — the same tools it uses on WhatsApp.
curl -X PUT https://www.dailzero.com/api/v1/agents/<id>/tools \
-H "Authorization: Bearer dz_live_..." \
-H "Content-Type: application/json" \
-d '{ "tools": [
{ "name": "check_stock", "description": "Check stock for a product",
"url": "https://your-api.com/stock", "method": "GET",
"parameters": [
{ "name": "sku", "type": "string", "description": "Product SKU", "required": true }
] }
] }'Limits & safety
- Per-key rate limit (default 60 requests/minute) →
429withRetry-After. - Optional per-key daily spending cap, set when you create the key.
- Hard per-request output cap so a single call can't run up a huge bill.
- Send an
Idempotency-Keyheader to safely retry without double-charging. - A pre-flight credit check blocks calls your balance can't cover.
Errors
Every error returns { "error": { "code", "message", "request_id" } }. Branch on code.
| Code | HTTP | Meaning |
|---|---|---|
BAD_REQUEST | 400 | Malformed request (bad JSON, missing or oversized fields). |
UNAUTHORIZED | 401 | Missing, malformed, unknown, or revoked key. |
INSUFFICIENT_CREDITS | 402 | Account balance can't cover the call. |
DAILY_CAP_HIT | 402 | The key's daily spending cap is exhausted. |
FORBIDDEN_SCOPE | 403 | The key lacks the scope this endpoint requires. |
AGENT_NOT_FOUND | 404 | The agent doesn't exist or isn't yours. |
AGENT_NOT_CONNECTED | 409 | The agent's WhatsApp isn't connected — connect it before sending. |
RATE_LIMITED | 429 | Too many requests — retry after the Retry-After header. |
INTERNAL | 500 | Something went wrong on our side. |