Nexora

Agents

Create and manage AI agents within your workspace.

GET/api/agentsJWT

List Agents

Retrieve all agents in the current workspace.

Headers

HeaderValue
X-Workspace-IDyour-workspace-id

Response

json
{
  "data": [
    {
      "id": "uuid",
      "name": "Support Bot",
      "system_prompt": "You are a helpful...",
      "model": "gpt-4o-mini",
      "workspace_id": "uuid",
      "created_at": "2024-01-01T00:00:00Z"
    }
  ]
}
POST/api/agentsJWT

Create Agent

Create a new AI agent. Requires owner or admin role.

Headers

HeaderValue
X-Workspace-IDyour-workspace-id

Request Body

NameTypeRequiredDescription
namestringRequiredAgent name
system_promptstringRequiredSystem prompt / instructions
modelstringOptionalAI model (default: gpt-4o-mini)
welcome_messagestringOptionalInitial greeting message

Response

json
{
  "data": {
    "id": "uuid",
    "name": "Support Bot",
    "system_prompt": "You are a helpful...",
    "model": "gpt-4o-mini"
  },
  "message": "Agent created successfully"
}
GET/api/agents/:idJWT

Get Agent

Retrieve a single agent by ID.

Headers

HeaderValue
X-Workspace-IDyour-workspace-id

URL Parameters

NameTypeRequiredDescription
idstringRequiredAgent ID (UUID)

Response

json
{
  "data": {
    "id": "uuid",
    "name": "Support Bot",
    "system_prompt": "...",
    "model": "gpt-4o-mini",
    "welcome_message": "Hi! How can I help?",
    "widget_color": "#6c5ce7",
    "allowed_origins": ["https://example.com"],
    "created_at": "2024-01-01T00:00:00Z"
  }
}
PUT/api/agents/:idJWT

Update Agent

Update an existing agent. Requires owner or admin role.

Headers

HeaderValue
X-Workspace-IDyour-workspace-id

URL Parameters

NameTypeRequiredDescription
idstringRequiredAgent ID

Request Body

NameTypeRequiredDescription
namestringOptionalAgent name
system_promptstringOptionalSystem prompt
modelstringOptionalAI model

Response

json
{
  "data": { "id": "uuid", "name": "Updated Bot" },
  "message": "Agent updated successfully"
}
DELETE/api/agents/:idJWT

Delete Agent

Delete an agent and all its data. Requires owner or admin role.

Headers

HeaderValue
X-Workspace-IDyour-workspace-id

URL Parameters

NameTypeRequiredDescription
idstringRequiredAgent ID

Response

json
{
  "message": "Agent deleted successfully"
}