Developer Hub · API
raia API — Developer Guide
The raia REST API lets you create users, start conversations, send messages, manage agents and knowledge, and pull usage data from your own applications. This page covers everything in API v1.0.0.
Interactive guide
Full API explorer
Browse every endpoint, schema and code sample, and try live requests with your own key.
Open guideSwagger
Swagger UI
The live, always-current reference served by the platform.
Open SwaggerSpec
OpenAPI JSON
Generate typed clients in any language from the raw spec.
View openapi.jsonBase URLs
Every path below is relative to a regional base URL. Use the region your agent runs in — keys are not shared across regions.
| Region | Base URL |
|---|---|
| United States | https://api.raia2.com |
| Europe | https://api-eu.raia2.com |
Authentication
The API uses secret keys sent as request headers — not bearer tokens. Which header you send determines what you are allowed to do.
| Header | Scope | Typical use |
|---|---|---|
Agent-Secret-Key | A single agent | Conversations, messages, prompts, agent files, usage and limits for that agent. |
Organization-Secret-Key | One organization | Create and configure agents, functions, packs, API keys, live chat and platform users. |
Agent-Secret-Key: {your-agent-secret-key}Keep keys server-side
Quick start
The most common flow is three calls: create (or find) a user, open a conversation, then send messages to it.
1. Create a user — POST /api/external/users
{
"email": "jane@example.com",
"firstName": "Jane",
"lastName": "Doe"
}2. Create a conversation
curl -X POST https://api.raia2.com/api/external/conversations \
-H "Agent-Secret-Key: $RAIA_AGENT_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{ "userId": "5f7b1b3b-3b3b-4b3b-3b3b-3b3b3b3b3b3b" }'3. Send a message and read the reply
curl -X POST https://api.raia2.com/api/external/conversations/{id}/messages \
-H "Agent-Secret-Key: $RAIA_AGENT_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"message": "How do I reset my password?",
"context": "User is on the login page."
}'Synchronous or async
POST .../messages waits for the agent’s answer. For long-running work, call POST .../messages/async and poll GET .../messages/{questionMessageId}/response-on. The same pattern exists for prompts.Endpoint reference
All 91 operations in API v1.0.0, grouped by resource. Open the interactive guide for full request and response schemas.
Users8 endpoints
| Method | Path | Description | Key |
|---|---|---|---|
POST | /api/external/users | Create a conversation user | Agent |
GET | /api/external/users/search | Find user by contact information | Agent |
GET | /api/external/users/{id} | Get conversation user by ID | Agent |
DELETE | /api/external/users/{id} | Delete conversation user by ID | Agent |
GET | /api/external/users/{id}/limits | Get conversation user limits by ID | Agent |
POST | /api/external/users/{id}/limits | Create conversation user limits by ID | Agent |
PUT | /api/external/users/{id}/limits | Update conversation user limits by ID | Agent |
DELETE | /api/external/users/{id}/limits | Delete conversation user limits by ID | Agent |
Conversations15 endpoints
| Method | Path | Description | Key |
|---|---|---|---|
GET | /api/external/conversations | Get conversations | Agent |
POST | /api/external/conversations | Create a new conversation | Agent |
DELETE | /api/external/conversations | Delete all user conversations in current agent | Agent |
GET | /api/external/conversations/states | Get conversation states | Agent |
GET | /api/external/conversations/{id} | Get conversation by ID | Agent |
PUT | /api/external/conversations/{id} | Update conversation | Agent |
POST | /api/external/conversations/start | Start a new conversation | Agent |
GET | /api/external/conversations/{id}/messages | Get conversation messages | Agent |
POST | /api/external/conversations/{id}/messages | Send a message to an agent | Agent |
POST | /api/external/conversations/{id}/messages/async | Send a message to an agent (async) | Agent |
GET | /api/external/conversations/{id}/messages/{questionMessageId}/response-on | Get response on | Agent |
PUT | /api/external/conversations/{id}/mode | Update conversation mode | Agent |
POST | /api/external/conversations/{id}/send-manual-message | Send a manual message to a user | Agent |
POST | /api/external/conversations/{id}/message-files/upload-url | Create signed upload URL for conversation message file | Agent |
GET | /api/external/conversations/{id}/message-files/{fileId}/signed-url | Get signed download URL for conversation message file | Agent |
Prompts4 endpoints
| Method | Path | Description | Key |
|---|---|---|---|
POST | /api/external/prompts | Process a prompt request | Agent |
POST | /api/external/prompts/async | Create a prompt request | Agent |
GET | /api/external/prompts/{id}/response-on | Get a response on prompt request | Agent |
POST | /api/external/prompts/upload-url | Create signed upload URL for prompt file | Agent |
Agents12 endpoints
| Method | Path | Description | Key |
|---|---|---|---|
GET | /api/external/agents/{id}/users | Get agent users by agent ID and Organization API key | Organization |
GET | /api/external/agents/{id}/platform-users | Get agent platform users by agent ID and Organization API key | Organization |
GET | /api/external/agents/users | Get agent users by Agent API key | Agent |
GET | /api/external/agents/admin-users | Get agent admin users by Agent API key | Agent |
GET | /api/external/agents/by-api-key | Get agent by API key | Agent |
GET | /api/external/agents/statistic | Get agent statistic by API key | Agent |
POST | /api/external/agents/webhooks | Create agent webhook | Agent |
GET | /api/external/agents/limits | Get agent limits by Agent API key | Agent |
POST | /api/external/agents/limits | Create agent limits by Agent API key | Agent |
PUT | /api/external/agents/limits | Update agent limits by Agent API key | Agent |
DELETE | /api/external/agents/limits | Delete agent limits by Agent API key | Agent |
GET | /api/external/agents/usage | Get agent usage by Agent API key | Agent |
Agent-files7 endpoints
| Method | Path | Description | Key |
|---|---|---|---|
POST | /api/external/agent-files/upload | Upload agent file | Agent |
GET | /api/external/agent-files/by-api-key | Get agent files by API key | Agent |
DELETE | /api/external/agent-files | Delete agent files by IDs | Agent |
DELETE | /api/external/agent-files/{id}/delete | Delete agent file by ID | Agent |
DELETE | /api/external/agent-files/{id}/delete-from-vector-store | Delete agent file from vector store by ID | Agent |
PUT | /api/external/agent-files/{id}/add-to-vector-store | Add agent file to vector store by ID | Agent |
PUT | /api/external/agent-files/{id}/add-to-vector-store/async | Add agent file to vector store asynchronously by ID | Agent |
Conversation Message Feedbacks1 endpoints
| Method | Path | Description | Key |
|---|---|---|---|
POST | /api/external/conversation-message-feedbacks | Create or update conversation message feedback | Agent |
Resource Usage Logs1 endpoints
| Method | Path | Description | Key |
|---|---|---|---|
POST | /api/external/resource-usage | Add new resource usage log. | Agent |
Organization API Key43 endpoints
| Method | Path | Description | Key |
|---|---|---|---|
POST | /api/external/agents | Create agent via organization API key | Organization |
GET | /api/external/agents/{id} | Get agent by ID via organization API key | Organization |
PUT | /api/external/agents/{id} | Update agent via organization API key | Organization |
GET | /api/external/agent-scraps/{id}/scraping | List scraping configurations | Organization |
POST | /api/external/agent-scraps/{id}/scraping | Create scraping configuration | Organization |
GET | /api/external/agent-scraps/{id}/scraping/{scrapingId} | Get scraping configuration | Organization |
PUT | /api/external/agent-scraps/{id}/scraping/{scrapingId} | Update scraping configuration | Organization |
DELETE | /api/external/agent-scraps/{id}/scraping/{scrapingId} | Delete scraping configuration | Organization |
POST | /api/external/agent-scraps/{id}/scraping/{scrapingId}/run | Trigger manual crawl | Organization |
POST | /api/external/agent-scraps/{id}/scraping/{scrapingId}/cancel | Cancel in-progress crawl | Organization |
POST | /api/external/agent-api-keys/{id} | Create agent API key | Organization |
GET | /api/external/agent-api-keys/{id} | List agent API keys | Organization |
GET | /api/external/agent-api-keys/{id}/api-key/{keyId} | Get agent API key | Organization |
DELETE | /api/external/agent-api-keys/{id}/api-key/{keyId} | Revoke agent API key | Organization |
POST | /api/external/agent-api-keys/{id}/api-key/{keyId}/rotate | Rotate agent API key | Organization |
GET | /api/external/agent-functions/{id}/functions | List agent functions | Organization |
POST | /api/external/agent-functions/{id}/functions | Create agent function | Organization |
GET | /api/external/agent-functions/{id}/functions/{functionId} | Get agent function | Organization |
PUT | /api/external/agent-functions/{id}/functions/{functionId} | Update agent function | Organization |
DELETE | /api/external/agent-functions/{id}/functions/{functionId} | Delete agent function | Organization |
GET | /api/external/live-chat-skill/{agentId} | Get live chat configuration | Organization |
PUT | /api/external/live-chat-skill/{agentId} | Update live chat configuration | Organization |
POST | /api/external/live-chat-skill/images/upload-url | Create agent image upload URL | Organization |
GET | /api/external/agent-roles/by-api-key | Get agent roles by organization API key | Organization |
POST | /api/external/organizations/by-organization-api-key | Create organization via organization API key | Organization |
GET | /api/external/platform-users | Get all platform users for the current organization. | Organization |
GET | /api/external/platform-users/agents | Get agents by platform user via organization API key | Organization |
PATCH | /api/external/platform-users/{userId} | Update a platform user role or status via organization API key | Organization |
POST | /api/external/packs | Create a pack via organization API key | Organization |
GET | /api/external/packs | List packs via organization API key | Organization |
GET | /api/external/packs/{id} | Get a pack via organization API key | Organization |
PUT | /api/external/packs/{id} | Update a pack via organization API key | Organization |
DELETE | /api/external/packs/{id} | Delete a pack via organization API key | Organization |
POST | /api/external/packs/documents/upload-url | Create a pack document upload URL via organization API key | Organization |
POST | /api/external/packs/{id}/documents | Attach a document to a pack via organization API key | Organization |
DELETE | /api/external/packs/{id}/documents/{fileId} | Remove a document from a pack via organization API key | Organization |
POST | /api/external/packs/{id}/link/{agentId} | Link a pack to an agent | Organization |
DELETE | /api/external/packs/{id}/link/{agentId} | Unlink a pack from an agent | Organization |
POST | /api/external/functions | Create a function via organization API key | Organization |
GET | /api/external/functions | List functions via organization API key | Organization |
GET | /api/external/functions/{id} | Get a function via organization API key | Organization |
PATCH | /api/external/functions/{id} | Update a function via organization API key | Organization |
DELETE | /api/external/functions/{id} | Delete a function via organization API key | Organization |
Rate limits
| Operation type | Limit |
|---|---|
| System operations (users, lookups, configuration) | 1,000 requests per 60 seconds, per organization |
| AI-backed operations (messages, prompts, conversations) | 300 requests per 60 seconds, per organization |
Exceeding a limit returns 429 Too Many Requests. Retry with exponential backoff and queue non-urgent traffic.
Errors
| Status | Meaning | What to do |
|---|---|---|
| 400 | Bad request — missing or invalid fields, or the record already exists. | Check the payload against the schema in the interactive guide. |
| 403 | Invalid API key or secret key. | Confirm you sent the right header for the right region. |
| 404 | Entity not found. | Verify the ID, and that it belongs to the authenticated agent. |
| 429 | Rate limit exceeded. | Back off and retry. |
| 500 | Unexpected server error. | Retry after a short delay; contact support if it persists. |
Frequently asked questions
Where do I get an Agent Secret Key?
How do I keep conversation history?
Can I attach files?
Can I hand a conversation to a human?