What you will learn
- Authenticate securely with the raia REST API.
- Understand the core endpoints for conversation management.
- Architect custom interfaces on top of the raia intelligence engine.
- Understand how MCP (Model Context Protocol) servers extend agent capabilities.
Authentication and Security
The raia API lets you interact with your AI agent programmatically. Because agents can execute functions and access proprietary knowledge, authentication depends on the operation: the examples in this module use an Agent-Secret-Key, while other operations can use organization credentials (Organization-Secret-Key) — check each operation's schema in the API reference.

In raia CX, open Agents → your agent → Skills. If API is not listed yet, add it with Add skill, then open Edit (pencil) and select Create API Key. Enter a Name and Expiration date and select Create key; the full key is shown once, so copy it into a private store before Done — afterwards the list shows only a masked preview. For agent-authenticated operations, pass the key in the request header as Agent-Secret-Key: YOUR_KEY. Organization operations use Organization-Secret-Key; check each operation in the published spec.
Worked example
The examples use fictional data. Follow the same checks with approved, non-sensitive information for your own task.
If API is not on the agent yet, open Add skill and select + on the API card.
- Highlight 1: + (add API)
Once added, select Edit (pencil) on the API card. Adding the skill does not create a key.
- Highlight 1: Edit (pencil)
Worked example
The examples use fictional data. Follow the same checks with approved, non-sensitive information for your own task.
With no keys yet, the list is empty. Select Create API Key.
- Highlight 1: Create API Key
- Highlight 2: No API keys yet
Enter a Name that identifies where the key will be used and choose an Expiration date, then Create key. Choose a lifetime that fits your team’s policy and plan how to replace the key before it expires.
- Highlight 1: Name
- Highlight 2: Expiration date
- Highlight 3: Create key
The full key is shown once with Save your key now - it will never be shown again. Copy it into a private password manager or secret store before you select Done. Never share the key in chat, documentation or screenshots.
- Highlight 1: Save your key now - it will never be shown again.
After Done, the list shows only a masked Key preview with Status, Expires and Created. It cannot reveal the full key again; if you lost it, create a new key and revoke the old one.
- Highlight 1: Key preview (masked)
- Highlight 2: Active
- Highlight 3: Revoke
To stop using a key, select Revoke and reopen the list to check Revoked. Update the application’s stored credential if it needs a replacement, and check that a request using the old key is refused. See the API documentation (https://api.raia2.com/api/external/docs) for the request and authentication header.
- Highlight 1: Revoked key status
- Highlight 2: Delete (only remaining action)
curl -X POST https://api.raia2.com/external/conversations \
-H "Content-Type: application/json" \
-H "Agent-Secret-Key: YOUR_AGENT_SECRET_KEY" \
-d '{ "conversationUserId": "YOUR_CONVERSATION_USER_ID" }'If a key may be compromised, revoke it immediately and create a new one. Whether an operation requires an agent or organization key is defined per operation — do not assume a key's scope limits the impact of a leak.
Core API Endpoints
The raia API is a standard RESTful interface. While endpoints exist for managing agent configuration (see the API reference), the most common use case is conversation management.

When you call POST /external/conversations, you create a conversation for a conversation user (conversationUserId) and can pass optional context — background on their account that the agent can use in the conversation. A separate POST /external/conversations/{id}/messages call then sends the user's message.
Building Custom Interfaces
While raia provides native channels (Live Chat, SMS, Email, Voice), the API lets you build completely custom user interfaces while relying on raia for the intelligence.

Common custom UI patterns
In-App Copilots
Embed the agent directly into your SaaS product's dashboard to help users navigate features.
Internal Tools
Build a custom Slack bot or internal portal where employees can query HR policies or IT documentation.
Headless E-commerce
Use the agent as a conversational search engine on a custom storefront, retrieving inventory via Functions and returning formatted answers via the API.
In this architecture, you own the frontend UI and user experience; raia handles RAG (Retrieval-Augmented Generation), tool calling, and LLM orchestration.
Extending with MCP Servers
Choose between two MCP setup surfaces according to what the external client needs. raia Command → MCP Servers creates a server scoped to the knowledge you select. raia CX → agent → Skills → MCP sets up MCP access for that configured agent. They are not the same setup.
Use the endpoint your own setup screen generates, for example: COPY_THE_ENDPOINT_FROM_YOUR_SETUP_SCREEN — this is a placeholder, not a real address. Copy the generated endpoint and credential; do not construct a URL from a pattern.
Example (hypothetical): a compatible IDE or search client queries the scoped knowledge. What a client can see or do depends on the client, the server setup and its permissions. Exact steps: Command MCP Servers · MCP Server skill
Frequently Asked Questions
Where can I find the full OpenAPI specification?
The complete, interactive API documentation is available at https://api.raia2.com/api/external/docs. You can also download the openapi.json file from there to generate client SDKs in your preferred language.
Are there rate limits on the API?
Yes. API usage is rate-limited to ensure platform stability, with specific limits depending on your organization's tier. If you receive a 429 Too Many Requests response, implement exponential backoff in your retry logic.
Can I fetch the raw vector search results via the API?
No. The API returns the agent's synthesized response, not the raw vector chunks. The intelligence engine handles the retrieval and reasoning layers internally.
Path Complete
Congratulations
You have completed the Technical Agent Builder path.
You now have the architectural knowledge to build, prompt, integrate, and orchestrate advanced AI agents on the raia platform.
- 01 — Agent Architecture
- 02 — Advanced Prompt Engineering
- 03 — Working with Functions
- 04 — Webhooks and External APIs
- 05 — Advanced Orchestration with n8n
- 06 — The raia API