REST API 42 ENDPOINTS

Public API Reference

Programmatic access to agents, workflows, knowledge bases, and more

The Orckai Public API lets you integrate AI orchestration into any application. Manage agents, execute workflows, search knowledge bases, and chat with LLMs — all through a simple REST interface with scoped API keys.

42
Endpoints
18
Scopes
100
Requests / Min
oak_
Key Prefix

Base URL

https://orckai.app/api/v1

All endpoints below are relative to this base URL.

Authentication

All endpoints (except /health) require an API key passed in the X-API-Key header. Create API keys in your dashboard under Settings → API Keys. Keys start with the oak_ prefix.

# Example request curl -H "X-API-Key: oak_your_key_here" \ https://orckai.app/api/v1/agents
Security

API keys are hashed with SHA-256 before storage. The full key is only shown once at creation time. Store it securely.

Available Scopes

Each API key has scoped permissions. Assign only the scopes your integration needs.

Scope Description
agents:readList and get agents and execution history
agents:writeCreate, update, and delete agents
agents:executeExecute agents
workflows:readList and get workflows and executions
workflows:writeCreate, update, and delete workflows
workflows:executeExecute, cancel, and retry workflows
kb:readRead knowledge bases, documents, and search
kb:writeCreate, update, delete KBs and upload documents
templates:readRead prompt templates
templates:writeCreate, update, and delete templates
mcp:readRead MCP servers and tools
mcp:writeCreate and modify MCP servers
mcp:deployDeploy MCP servers
chat:readRead chat conversations
chat:writeCreate chat completions and streams
org:readRead organization data
org:writeModify organization settings
*Full access (all scopes)

Rate Limiting

All API keys share a standard rate limit. Contact support@orckai.com to request higher limits for your organization.

Window Limit
Per Minute100
Per Hour3,000
Per Day50,000
Burst20 concurrent

Response Headers

Header Description
X-RateLimit-LimitTotal requests allowed per minute for this tier
X-RateLimit-RemainingRequests remaining in the current window
X-RateLimit-ResetTimestamp (epoch seconds) when the limit resets
429 Too Many Requests

When rate-limited, the response includes a Retry-After header with the number of seconds to wait before retrying.

Agents

Create and manage AI agents. Agents have system prompts, model configurations, and optional tool attachments.

Method Endpoint Scope Description
GET/agentsagents:readList all agents
POST/agentsagents:writeCreate an agent
GET/agents/{id}agents:readGet agent by ID
PUT/agents/{id}agents:writeUpdate an agent
DELETE/agents/{id}agents:writeDelete an agent
POST/agents/executeagents:executeExecute an agent
GET/agents/{id}/executionsagents:readList agent executions

Create Agent

POST /api/v1/agents Content-Type: application/json X-API-Key: oak_your_key { "name": "Sales Assistant", "agentType": "conversational", "executionMode": "standard", "systemPrompt": "You are a helpful sales assistant.", "goalTemplate": "Help the user with {{task}}" }

Response

{ "success": true, "data": { "id": "a1b2c3d4-...", "name": "Sales Assistant", "agentType": "conversational", "executionMode": "standard", "isActive": true, "createdAt": "2026-02-26T10:00:00.000Z" } }

Workflows

Build and execute multi-step automation workflows with triggers, agents, code steps, conditions, and actions.

Method Endpoint Scope Description
GET/workflowsworkflows:readList all workflows
POST/workflowsworkflows:writeCreate a workflow
GET/workflows/{id}workflows:readGet workflow by ID
PUT/workflows/{id}workflows:writeUpdate a workflow
DELETE/workflows/{id}workflows:writeDelete a workflow
POST/workflows/{id}/executeworkflows:executeExecute a workflow
GET/workflows/executionsworkflows:readList all executions
GET/workflows/executions/{id}workflows:readGet execution details
POST/workflows/executions/{id}/cancelworkflows:executeCancel a running execution
POST/workflows/executions/{id}/retryworkflows:executeRetry a failed execution

Execute Workflow

POST /api/v1/workflows/{id}/execute Content-Type: application/json X-API-Key: oak_your_key { "input": { "customer_name": "Acme Corp", "report_type": "quarterly" } }

Response

{ "success": true, "executionId": "e5f6g7h8-...", "status": "queued" }
Variable Interpolation

Input data is available to workflow steps via {{variable}} syntax. For example, {{customer_name}} resolves to "Acme Corp" in the example above.

Knowledge Bases

Upload documents and search them with RAG (Retrieval-Augmented Generation). Supports 50+ file types.

Method Endpoint Scope Description
GET/knowledge-baseskb:readList all knowledge bases
POST/knowledge-baseskb:writeCreate a knowledge base
GET/knowledge-bases/{id}kb:readGet knowledge base by ID
PUT/knowledge-bases/{id}kb:writeUpdate a knowledge base
DELETE/knowledge-bases/{id}kb:writeDelete a knowledge base
GET/knowledge-bases/{id}/documentskb:readList documents
POST/knowledge-bases/{id}/documentskb:writeUpload a document
POST/knowledge-bases/{id}/searchkb:readSearch with RAG

Search Knowledge Base

POST /api/v1/knowledge-bases/{id}/search Content-Type: application/json X-API-Key: oak_your_key { "query": "What is the refund policy?", "limit": 5 }

Response

{ "success": true, "data": [ { "content": "Annual plans include a 30-day money-back guarantee...", "score": 0.94, "documentName": "refund-policy.pdf" } ] }

Prompt Templates

Manage reusable prompt templates with variable placeholders.

Method Endpoint Scope Description
GET/templatestemplates:readList all templates
POST/templatestemplates:writeCreate a template
GET/templates/{id}templates:readGet template by ID
PUT/templates/{id}templates:writeUpdate a template
DELETE/templates/{id}templates:writeDelete a template
Filter by category

Use GET /templates?category=custom to filter. Valid categories: custom, chat, widget, agent.

MCP Servers

Manage MCP (Model Context Protocol) servers and discover their tools.

Method Endpoint Scope Description
GET/mcp-serversmcp:readList all MCP servers
POST/mcp-serversmcp:writeCreate an MCP server
GET/mcp-servers/{id}mcp:readGet MCP server by ID
PUT/mcp-servers/{id}mcp:writeUpdate an MCP server
GET/mcp-servers/{id}/toolsmcp:readList server tools

Chat

Send messages to LLMs and manage conversations. Supports both synchronous completions and SSE streaming.

Method Endpoint Scope Description
POST/chat/completionschat:writeSend a chat message
POST/chat/streamchat:writeStream a chat response (SSE)
GET/conversationschat:readList conversations
GET/conversations/{id}chat:readGet conversation with messages
DELETE/conversations/{id}chat:writeDelete a conversation

Chat Completion

POST /api/v1/chat/completions Content-Type: application/json X-API-Key: oak_your_key { "message": "Summarize the latest sales report", "llmConfig": { "provider": "anthropic", "model": "claude-sonnet-4-20250514", "temperature": 0.7, "maxTokens": 1024 }, "systemPrompt": "You are a business analyst." }

Response

{ "success": true, "data": { "conversationId": "c9d0e1f2-...", "message": "Based on the Q4 sales data...", "usage": { "inputTokens": 142, "outputTokens": 387 } } }
Continuing Conversations

Pass conversationId in subsequent requests to continue an existing conversation with full message history.

SSE Streaming

POST /chat/stream returns a text/event-stream response for real-time token streaming.

POST /api/v1/chat/stream Content-Type: application/json X-API-Key: oak_your_key { "message": "Explain quantum computing", "llmConfig": { "provider": "anthropic", "model": "claude-sonnet-4-20250514" } }

Event Format

data: {"content": "Quantum ", "done": false} data: {"content": "computing ", "done": false} data: {"content": "uses...", "done": false} ... data: {"content": "", "done": true, "conversationId": "c9d0e1f2-..."}

Organization

Method Endpoint Scope Description
GET/organizationorg:readGet organization info

Error Handling

All errors return a consistent JSON format:

{ "success": false, "error": "Agent not found", "code": "NOT_FOUND" }
Status Code Description
400BAD_REQUESTInvalid request body or parameters
401API_KEY_MISSING / API_KEY_INVALIDMissing or invalid API key
403SCOPE_REQUIREDAPI key lacks the required scope
404NOT_FOUNDResource not found
429RATE_LIMITEDToo many requests, check Retry-After header
500INTERNAL_ERRORServer error

Health Check

No authentication required.

GET /api/v1/health { "status": "ok", "version": "v1" }

Ready to Integrate?

Create your API key and start building integrations in minutes.