REST API Examples
Common API operations with curl. All parameters like account_id and agent_id are auto-resolved from your API key.
Send an Email
curl
curl -X POST https://api.xobni.ai/api/v1/emails/send \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": ["recipient@example.com"],
"subject": "Hello from my AI agent",
"body_text": "This email was sent by my AI agent via Xobni.ai!"
}'Send with Attachments
Attachments are sent inline as base64-encoded data. Max 10 attachments, 10 MB total.
curl
curl -X POST https://api.xobni.ai/api/v1/emails/send \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": ["recipient@example.com"],
"subject": "Report attached",
"body_text": "Please find the file attached.",
"attachments": [
{
"filename": "hello.txt",
"content_type": "text/plain",
"data": "SGVsbG8gV29ybGQh"
}
]
}'List Inbox
curl
curl "https://api.xobni.ai/api/v1/emails" \
-H "Authorization: Bearer YOUR_API_KEY"Semantic Search
curl
curl -X POST https://api.xobni.ai/api/v1/search \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "meeting about project deadline",
"limit": 10
}'Store a Document
Store a JSON document in a named collection. The collection is auto-created if it doesn't exist.
curl
curl -X POST https://api.xobni.ai/api/v1/store/contacts/documents \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"data": {
"name": "Jane Doe",
"email": "jane@example.com",
"role": "CTO",
"notes": "Met at conference, interested in enterprise plan"
},
"metadata": { "source": "conference", "priority": "high" }
}'Search Storage
curl
curl -X POST https://api.xobni.ai/api/v1/store/search \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "enterprise customers interested in pricing",
"limit": 5
}'Ask AI (RAG)
Ask a question and get an AI-generated answer with source citations from your stored documents.
curl
curl -X POST https://api.xobni.ai/api/v1/store/ask \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"question": "What features does our product support?",
"collection": "product-specs"
}'Create a Webhook
curl
curl -X POST https://api.xobni.ai/api/v1/event-hooks \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "<agent-uuid>",
"url": "https://your-service.com/webhook",
"events": ["email.received", "email.sent"],
"description": "My automation webhook"
}'Test a Webhook
curl
curl -X POST https://api.xobni.ai/api/v1/event-hooks/<webhook-uuid>/test \
-H "Authorization: Bearer YOUR_API_KEY"Create a Calendar Event
curl
curl -X POST https://api.xobni.ai/api/v1/calendar/events \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Team Standup",
"start_time": "2026-03-20T10:00:00",
"end_time": "2026-03-20T10:30:00",
"timezone": "America/New_York",
"recurrence_rule": "FREQ=WEEKLY;BYDAY=MO,WE,FR",
"attendees": [{"email": "alice@example.com", "name": "Alice"}]
}'Schedule an Email
curl
curl -X POST https://api.xobni.ai/api/v1/calendar/scheduled-emails \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"send_at": "2026-03-20T09:00:00Z",
"send_request": {
"to": ["recipient@example.com"],
"subject": "Meeting Reminder",
"body_text": "Don\u0027t forget the standup at 10am!",
"cc": [],
"bcc": []
}
}'