Saltar al contenido principal

API documentation: AgenteUno

Full reference for the AgenteUno public API. Connect your AI agents to any system with our REST API.

Authentication

All endpoints require an API key. Create yours in Settings → API Keys. Creating keys requires the Business plan or higher.

bash
# Option 1: API Key (recommended for integrations)
curl https://api.agenteuno.ai/v1/conversations \
  -H "x-api-key: YOUR_API_KEY"

# Option 2: Bearer JWT
curl https://api.agenteuno.ai/v1/conversations \
  -H "Authorization: Bearer YOUR_JWT"

Your API key is only used to build the cURL commands. It is not sent to any server from this page.

Quick start

List conversations

bash
curl https://api.agenteuno.ai/v1/conversations \
  -H "x-api-key: YOUR_API_KEY"

Export contacts as CSV (Professional plan or higher)

bash
curl "https://api.agenteuno.ai/v1/export/contacts?format=csv" \
  -H "x-api-key: YOUR_API_KEY" \
  -o contactos.csv

Integration examples

JavaScript / TypeScript

javascript
const API_KEY = process.env.AGENTEUNO_API_KEY;
const BASE = "https://api.agenteuno.ai/v1";

async function listConversations() {
  const res = await fetch(`${BASE}/conversations`, {
    headers: { "x-api-key": API_KEY },
  });
  const { data, meta } = await res.json();
  return { data, meta };
}

async function createContact(contact) {
  const res = await fetch(`${BASE}/contacts`, {
    method: "POST",
    headers: {
      "x-api-key": API_KEY,
      "Content-Type": "application/json",
    },
    body: JSON.stringify(contact),
  });
  return res.json();
}

Python

python
import os
import requests

API_KEY = os.environ["AGENTEUNO_API_KEY"]
BASE = "https://api.agenteuno.ai/v1"
HEADERS = {"x-api-key": API_KEY}

def list_conversations(page=1, limit=20):
    r = requests.get(
        f"{BASE}/conversations",
        headers=HEADERS,
        params={"page": page, "limit": limit}
    )
    r.raise_for_status()
    return r.json()

def export_contacts_csv(path="contactos.csv"):
    r = requests.get(
        f"{BASE}/export/contacts",
        headers=HEADERS,
        params={"format": "csv"}
    )
    r.raise_for_status()
    with open(path, "wb") as f:
        f.write(r.content)

Verify webhook signatures

Every delivery includes the X-AgenteUno-Signature header with an HMAC-SHA256 signature of the request body, computed with the webhook secret.

Node.js

javascript
import { createHmac, timingSafeEqual } from "crypto";

function verifyWebhook(rawBody, signature, secret) {
  const expected = "sha256=" + createHmac("sha256", secret)
    .update(rawBody)
    .digest("hex");
  return timingSafeEqual(
    Buffer.from(signature),
    Buffer.from(expected)
  );
}

Python

python
import hmac, hashlib

def verify_webhook(raw_body: bytes, signature: str, secret: str) -> bool:
    expected = "sha256=" + hmac.new(
        secret.encode(),
        raw_body,
        hashlib.sha256
    ).hexdigest()
    return hmac.compare_digest(signature, expected)

Error codes

HTTPCodeDescription
400INVALID_INPUTInvalid or malformed request data.
401UNAUTHORIZEDMissing or invalid API key.
403FORBIDDENNo permission for this action (e.g. owners/admins only).
404NOT_FOUNDResource not found or it does not belong to your organization.
409DUPLICATEThe resource already exists (e.g. duplicate webhook URL).
429RATE_LIMITEDYou exceeded the request limit. Wait for the reset.
500INTERNAL_ERRORInternal server error. Try again later.

Usage limits

The /v1/* endpoints have a limit of 600 requests per minute per IP for reads (GET), 60 per minute for writes (POST, PUT, PATCH, DELETE) and 20 per hour for exports. Responses include these headers:

HeaderDescription
X-RateLimit-LimitTotal request limit per window.
X-RateLimit-RemainingRequests remaining in the current window.
X-RateLimit-ResetUnix timestamp of when the window resets.

Conversations

3 endpoints

Questions about the API? Write to us · Download JSON spec · Download YAML spec