Agents API

Create, update, and manage your AI agents programmatically.

List Agents

GET/agents/

Returns all agents accessible to the authenticated user.

Query Parameters

organizationuuid

Filter by organization ID

Response

[
  {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "name": "Support Agent",
    "description": "Customer support assistant",
    "model": "gpt-4o",
    "temperature": 0.7,
    "maxTokens": 1000,
    "dataSourceCount": 3,
    "documentCount": 150,
    "isActive": true,
    "createdAt": "2024-01-15T10:30:00Z",
    "updatedAt": "2024-01-15T12:00:00Z"
  }
]

Create Agent

POST/agents/

Create a new agent in your organization.

Request Body

namestringrequired

Agent name (max 255 characters)

descriptionstring

Optional description

organizationIduuidrequired

Organization to create agent in

modelstringdefault: gpt-4o

AI model: gpt-4o, gpt-4-turbo-preview, gpt-3.5-turbo, claude-3-opus-20240229, claude-3-sonnet-20240229

temperaturenumberdefault: 0.7

Response randomness (0-2)

maxTokensintegerdefault: 1000

Maximum response length

systemPromptstring

Custom system prompt

Get Agent

GET/agents/{agentId}/

Get detailed information about a specific agent.

Path Parameters

agentIduuidrequired

Agent ID

Response

Agent

iduuid

Unique identifier

namestring

Agent name

descriptionstring

Agent description

modelstring

AI model

temperaturenumber

Response randomness

maxTokensinteger

Max response length

topKinteger

Number of chunks to retrieve

similarityThresholdnumber

Relevance cutoff

useRerankingboolean

Cohere reranking enabled

useHydeboolean

HyDE enabled

useMultiQueryboolean

Multi-query enabled

useHybridSearchboolean

Hybrid search enabled

systemPromptstring

System prompt

allowGeneralKnowledgeboolean

Allow responses outside context

showSourcesboolean

Show source citations

sourceDisplayModestring

inline, footer, or expandable

dataSourceCountinteger

Number of connected sources

documentCountinteger

Number of indexed documents

isActiveboolean

Agent is active

createdAtdatetime

Creation timestamp

updatedAtdatetime

Last update timestamp

Update Agent

PATCH/agents/{agentId}/

Update agent settings. Only include fields you want to change.

Request Body

Any of the following fields (all optional):

namestring

Agent name

descriptionstring

Description

modelstring

AI model

temperaturenumber

Temperature (0-2)

maxTokensinteger

Max tokens

topKinteger

Chunks to retrieve

similarityThresholdnumber

Relevance threshold

useRerankingboolean

Enable reranking

useHydeboolean

Enable HyDE

useMultiQueryboolean

Enable multi-query

useHybridSearchboolean

Enable hybrid search

systemPromptstring

System prompt

allowGeneralKnowledgeboolean

Allow general knowledge

showSourcesboolean

Show sources

isActiveboolean

Active status

-purple-500">curl -X PATCH https://api.ragchats.ai/api/agents/AGENT_ID/ \
  -H -green-500">"Authorization: Bearer YOUR_TOKEN" \
  -H -green-500">"Content-Type: application/json" \
  -d '{
    -green-500">"name": -green-500">"Updated Agent Name",
    -green-500">"temperature": 0.5,
    -green-500">"useReranking": true
  }'

Delete Agent

DELETE/agents/{agentId}/

Permanently delete an agent and all its data. This action cannot be undone.

-purple-500">curl -X DELETE https://api.ragchats.ai/api/agents/AGENT_ID/ \
  -H -green-500">"Authorization: Bearer YOUR_TOKEN"

Response

Returns 204 No Content on success.