Skip to content

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 guide

Swagger

Swagger UI

The live, always-current reference served by the platform.

Open Swagger

Spec

OpenAPI JSON

Generate typed clients in any language from the raw spec.

View openapi.json
01

Base URLs

Every path below is relative to a regional base URL. Use the region your agent runs in — keys are not shared across regions.

RegionBase URL
United Stateshttps://api.raia2.com
Europehttps://api-eu.raia2.com
02

Authentication

The API uses secret keys sent as request headers — not bearer tokens. Which header you send determines what you are allowed to do.

HeaderScopeTypical use
Agent-Secret-KeyA single agentConversations, messages, prompts, agent files, usage and limits for that agent.
Organization-Secret-KeyOne organizationCreate and configure agents, functions, packs, API keys, live chat and platform users.
http
Agent-Secret-Key: {your-agent-secret-key}

Keep keys server-side

Secret keys grant full access within their scope. Never ship them in browser or mobile code — call the API from your own backend, and rotate keys from raia CX if one is ever exposed.
03

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

json
{
  "email": "jane@example.com",
  "firstName": "Jane",
  "lastName": "Doe"
}

2. Create a conversation

bash
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

bash
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.
04

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

MethodPathDescriptionKey
POST/api/external/usersCreate a conversation user Agent
GET/api/external/users/searchFind 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}/limitsGet conversation user limits by ID Agent
POST/api/external/users/{id}/limitsCreate conversation user limits by ID Agent
PUT/api/external/users/{id}/limitsUpdate conversation user limits by ID Agent
DELETE/api/external/users/{id}/limitsDelete conversation user limits by ID Agent

Conversations15 endpoints

MethodPathDescriptionKey
GET/api/external/conversationsGet conversations Agent
POST/api/external/conversationsCreate a new conversation Agent
DELETE/api/external/conversationsDelete all user conversations in current agent Agent
GET/api/external/conversations/statesGet 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/startStart a new conversation Agent
GET/api/external/conversations/{id}/messagesGet conversation messages Agent
POST/api/external/conversations/{id}/messagesSend a message to an agent Agent
POST/api/external/conversations/{id}/messages/asyncSend a message to an agent (async) Agent
GET/api/external/conversations/{id}/messages/{questionMessageId}/response-onGet response on Agent
PUT/api/external/conversations/{id}/modeUpdate conversation mode Agent
POST/api/external/conversations/{id}/send-manual-messageSend a manual message to a user Agent
POST/api/external/conversations/{id}/message-files/upload-urlCreate signed upload URL for conversation message file Agent
GET/api/external/conversations/{id}/message-files/{fileId}/signed-urlGet signed download URL for conversation message file Agent

Prompts4 endpoints

MethodPathDescriptionKey
POST/api/external/promptsProcess a prompt request Agent
POST/api/external/prompts/asyncCreate a prompt request Agent
GET/api/external/prompts/{id}/response-onGet a response on prompt request Agent
POST/api/external/prompts/upload-urlCreate signed upload URL for prompt file Agent

Agents12 endpoints

MethodPathDescriptionKey
GET/api/external/agents/{id}/usersGet agent users by agent ID and Organization API key Organization
GET/api/external/agents/{id}/platform-usersGet agent platform users by agent ID and Organization API key Organization
GET/api/external/agents/usersGet agent users by Agent API key Agent
GET/api/external/agents/admin-usersGet agent admin users by Agent API key Agent
GET/api/external/agents/by-api-keyGet agent by API key Agent
GET/api/external/agents/statisticGet agent statistic by API key Agent
POST/api/external/agents/webhooksCreate agent webhook Agent
GET/api/external/agents/limitsGet agent limits by Agent API key Agent
POST/api/external/agents/limitsCreate agent limits by Agent API key Agent
PUT/api/external/agents/limitsUpdate agent limits by Agent API key Agent
DELETE/api/external/agents/limitsDelete agent limits by Agent API key Agent
GET/api/external/agents/usageGet agent usage by Agent API key Agent

Agent-files7 endpoints

MethodPathDescriptionKey
POST/api/external/agent-files/uploadUpload agent file Agent
GET/api/external/agent-files/by-api-keyGet agent files by API key Agent
DELETE/api/external/agent-filesDelete agent files by IDs Agent
DELETE/api/external/agent-files/{id}/deleteDelete agent file by ID Agent
DELETE/api/external/agent-files/{id}/delete-from-vector-storeDelete agent file from vector store by ID Agent
PUT/api/external/agent-files/{id}/add-to-vector-storeAdd agent file to vector store by ID Agent
PUT/api/external/agent-files/{id}/add-to-vector-store/asyncAdd agent file to vector store asynchronously by ID Agent

Conversation Message Feedbacks1 endpoints

MethodPathDescriptionKey
POST/api/external/conversation-message-feedbacksCreate or update conversation message feedback Agent

Resource Usage Logs1 endpoints

MethodPathDescriptionKey
POST/api/external/resource-usageAdd new resource usage log. Agent

Organization API Key43 endpoints

MethodPathDescriptionKey
POST/api/external/agentsCreate 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}/scrapingList scraping configurations Organization
POST/api/external/agent-scraps/{id}/scrapingCreate 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}/runTrigger manual crawl Organization
POST/api/external/agent-scraps/{id}/scraping/{scrapingId}/cancelCancel 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}/rotateRotate agent API key Organization
GET/api/external/agent-functions/{id}/functionsList agent functions Organization
POST/api/external/agent-functions/{id}/functionsCreate 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-urlCreate agent image upload URL Organization
GET/api/external/agent-roles/by-api-keyGet agent roles by organization API key Organization
POST/api/external/organizations/by-organization-api-keyCreate organization via organization API key Organization
GET/api/external/platform-usersGet all platform users for the current organization. Organization
GET/api/external/platform-users/agentsGet 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/packsCreate a pack via organization API key Organization
GET/api/external/packsList 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-urlCreate a pack document upload URL via organization API key Organization
POST/api/external/packs/{id}/documentsAttach 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/functionsCreate a function via organization API key Organization
GET/api/external/functionsList 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
05

Rate limits

Operation typeLimit
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.

06

Errors

StatusMeaningWhat to do
400Bad request — missing or invalid fields, or the record already exists.Check the payload against the schema in the interactive guide.
403Invalid API key or secret key.Confirm you sent the right header for the right region.
404Entity not found.Verify the ID, and that it belongs to the authenticated agent.
429Rate limit exceeded.Back off and retry.
500Unexpected server error.Retry after a short delay; contact support if it persists.
07

Frequently asked questions

Where do I get an Agent Secret Key?

In raia CX, open the agent, enable the API Skill and generate a key. Organization keys are issued at the organization level and can create, rotate and revoke agent keys programmatically.

How do I keep conversation history?

Create a conversation once and reuse its ID for every message. The agent keeps full context for that conversation, and you can fetch the transcript with GET /api/external/conversations/{id}/messages.

Can I attach files?

Yes. Request a signed upload URL, upload the file directly to it, then reference the returned file in the message or prompt payload. Agent knowledge files use the agent-files endpoints instead.

Can I hand a conversation to a human?

Yes — update the conversation mode, then post replies with the send-manual-message endpoint so a human agent responds inside the same thread.