Rela AIRela AI Docs
API Reference

Agents API

CRUD endpoints for WhatsApp, Email, and Machine agents with request/response examples.

Agent Endpoints

MethodEndpointDescription
GET/api/v1/agentsList agents
POST/api/v1/agentsCreate agent
GET/api/v1/agents/{agent_id}Get agent
PUT/api/v1/agents/{agent_id}Update agent
DELETE/api/v1/agents/{agent_id}Delete agent

Required permissions: view_agents for reads, manage_agents for writes.

Create WhatsApp Agent

POST /api/v1/agents
{
  "name": "Technical Support",
  "type": "whatsapp",
  "system_prompt": "You are an industrial technical support assistant...",
  "whatsapp_number_id": "wn_abc123",
  "model": "gemini-2.0-flash",
  "temperature": 0.3,
  "tools": ["tool_id_1", "tool_id_2"]
}

Response 201:

{
  "id": "agent_xyz789",
  "name": "Technical Support",
  "type": "whatsapp",
  "status": "active",
  "created_at": "2026-03-25T10:00:00Z"
}

Create Email Agent

POST /api/v1/agents
{
  "name": "Report Processor",
  "type": "email",
  "system_prompt": "Analyze reports received via email...",
  "email_account_id": "ea_def456",
  "model": "gemini-2.0-flash",
  "temperature": 0.2,
  "tools": ["tool_id_3"]
}
The email agent requires a previously configured active email account in the system.

Create Machine Agent

Machine agents process data from sensors and industrial equipment:

POST /api/v1/agents
{
  "name": "Vibration Monitor",
  "type": "machine",
  "system_prompt": "Analyze vibration readings and detect anomalies...",
  "model": "gemini-2.0-flash",
  "temperature": 0.1,
  "tools": ["tool_id_4", "tool_id_5"],
  "trigger_config": {
    "event_types": ["vibration.threshold_exceeded"],
    "cooldown_minutes": 15
  }
}

List Agents

GET /api/v1/agents?type=whatsapp&status=active&skip=0&limit=20

Available filters:

ParameterValues
typewhatsapp, email, machine
statusactive, inactive, error
skipPagination offset (default: 0)
limitItems per page (default: 20)

Update Agent

PUT /api/v1/agents/{agent_id}
{
  "name": "Technical Support v2",
  "system_prompt": "Updated prompt...",
  "temperature": 0.4
}

Only the fields included in the body are updated. Omitted fields retain their current values.

Delete Agent

DELETE /api/v1/agents/{agent_id}

Response 204 with no content. Deletion is permanent and removes all configurations associated with the agent.

Deleting an agent does not erase its conversation history. It is retained according to the tenant's retention policy.

On this page