REST API Reference

Complete reference for Tora AI's REST API endpoints

Back to API Reference

Authentication

All API requests must be authenticated using an API key. You can obtain an API key from the Tora AI dashboard.

API Key Authentication

Include your API key in the Authorization header of your HTTP requests:

Authorization: Bearer YOUR_API_KEY

Example Request

curl -X GET \
  https://api.tora.ai/v1/agents \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Agent Management

The Agent Management API allows you to register, update, and manage AI agents in the Tora security system.

Endpoints

Register Agent

POST /v1/agents

Request Body:
{
  "id": "agent-123",
  "name": "Assistant Bot",
  "capabilities": ["text-generation", "code-analysis"],
  "description": "A helpful assistant that can generate text and analyze code"
}

Response:
{
  "id": "agent-123",
  "name": "Assistant Bot",
  "capabilities": ["text-generation", "code-analysis"],
  "description": "A helpful assistant that can generate text and analyze code",
  "status": "active",
  "createdAt": "2025-01-28T12:34:56Z"
}

Get Agent

GET /v1/agents/{agent_id}

Response:
{
  "id": "agent-123",
  "name": "Assistant Bot",
  "capabilities": ["text-generation", "code-analysis"],
  "status": "active",
  "createdAt": "2025-01-28T12:34:56Z",
  "updatedAt": "2025-01-28T12:34:56Z"
}

List Agents

GET /v1/agents

Query Parameters:
- status: Filter by agent status (active, inactive, restricted)
- limit: Maximum number of agents to return (default: 20, max: 100)
- offset: Pagination offset (default: 0)

Response:
{
  "agents": [
    {
      "id": "agent-123",
      "name": "Assistant Bot",
      "capabilities": ["text-generation", "code-analysis"],
      "status": "active",
      "createdAt": "2025-01-28T12:34:56Z"
    },
    {
      "id": "agent-456",
      "name": "Data Processor",
      "capabilities": ["data-processing"],
      "status": "active",
      "createdAt": "2025-01-27T10:11:12Z"
    }
  ],
  "total": 2,
  "limit": 20,
  "offset": 0
}

Policy Configuration

The Policy Configuration API allows you to create and manage security policies for your AI agents.

Endpoints

Create Policy

POST /v1/policies

Request Body:
{
  "name": "Basic Security Policy",
  "description": "Basic security policy for AI agents",
  "agentId": "agent-123",
  "rules": [
    {
      "type": "rate-limit",
      "params": {
        "maxRequests": 100,
        "timeWindow": "1h"
      }
    },
    {
      "type": "content-filter",
      "params": {
        "blockedTopics": ["malware", "hacking"],
        "sensitivity": "medium"
      }
    }
  ]
}

Response:
{
  "id": "policy-789",
  "name": "Basic Security Policy",
  "description": "Basic security policy for AI agents",
  "agentId": "agent-123",
  "rules": [...],
  "createdAt": "2025-01-28T12:34:56Z"
}

Get Policy

GET /v1/policies/{policy_id}

Response:
{
  "id": "policy-789",
  "name": "Basic Security Policy",
  "description": "Basic security policy for AI agents",
  "agentId": "agent-123",
  "rules": [...],
  "createdAt": "2025-01-28T12:34:56Z",
  "updatedAt": "2025-01-28T12:34:56Z"
}