Skip to main content

List Agents

List all agents in the current project.

Response

agents
array
Array of agent objects
curl --location --request GET 'https://api.plaisolutions.com/agents' \
--header 'Authorization: Bearer YOUR_TOKEN'

Create Agent

Create a new AI agent.

Request Body

name
string
required
Agent name
description
string
required
Agent description
is_active
boolean
required
Whether the agent should be active
llm_model
string
required
LLM model to use (e.g., “OPENAI_GPT_4_O”, “ANTHROPIC_CLAUDE_3_5_SONNET_V1”)
llm_provider
string
required
LLM provider (OPENAI, ANTHROPIC, TOGETHERAI, BEDROCK, GROQ, OPENROUTER, COHERE, PERPLEXITY, GOOGLE, ROUTELLM)
prompt
string
System prompt for the agent
avatar
string
URL to agent avatar image
initial_message
string
Initial greeting message from the agent
max_output_tokens
integer
Maximum number of tokens in response
temperature
number
Temperature setting for response generation (0.0 - 2.0)
enable_streaming
boolean
Whether to enable streaming responses (default: true)
enable_tools
boolean
Whether to enable tool usage (default: true)
max_steps
integer
Maximum number of reasoning steps (default: 1)
vector_topk
integer
Number of top results from vector search (default: 8)
rerank_enabled
boolean
Whether to enable reranking (default: false)
rerank_topk
integer
Number of top results after reranking (default: 8)
structured_output
boolean
Whether to enable structured output (default: false)
json_schema
string
JSON schema for structured output
enable_citations
boolean
Whether to include citations in responses (default: false)

Response

Returns the created agent object.
curl --location --request POST 'https://api.plaisolutions.com/agents' \
--header 'Authorization: Bearer YOUR_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
  "name": "Customer Support Agent",
  "description": "An AI agent for handling customer support inquiries",
  "is_active": true,
  "llm_model": "OPENAI_GPT_4_O",
  "llm_provider": "OPENAI",
  "prompt": "You are a helpful customer support agent. Always be polite and professional.",
  "temperature": 0.7,
  "enable_streaming": true,
  "enable_tools": true
}'

Get Agent

Get a single agent by ID.

Path Parameters

agent_id
string
required
The unique identifier of the agent

Response

Returns the agent object.
curl --location --request GET 'https://api.plaisolutions.com/agents/agent_123' \
--header 'Authorization: Bearer YOUR_TOKEN'

Update Agent

Update an existing agent.

Path Parameters

agent_id
string
required
The unique identifier of the agent

Request Body

All fields are optional and only provided fields will be updated.
name
string
Updated agent name
description
string
Updated agent description
is_active
boolean
Updated active status
prompt
string
Updated system prompt
temperature
number
Updated temperature setting

Response

Returns the updated agent object.
curl --location --request PATCH 'https://api.plaisolutions.com/agents/agent_123' \
--header 'Authorization: Bearer YOUR_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
  "name": "Updated Agent Name",
  "is_active": false,
  "temperature": 0.5
}'

Delete Agent

Delete an agent. This action cannot be undone.

Path Parameters

agent_id
string
required
The unique identifier of the agent

Response

Returns a 204 status code on successful deletion.
Deleting an agent will also delete all associated threads, messages, and conversation history.
curl --location --request DELETE 'https://api.plaisolutions.com/agents/agent_123' \
--header 'Authorization: Bearer YOUR_TOKEN'

Invoke Agent

Send a message to an agent and get a response.

Path Parameters

agent_id
string
required
The unique identifier of the agent

Request Body

input
string
required
The input message to send to the agent
thread_id
string
Thread ID to continue an existing conversation
enable_streaming
boolean
Whether to enable streaming responses (default: false)
show_tool_calls
boolean
Whether to show tool calls in the response (default: false)
output_schema
string
JSON schema for structured output
enabled_tools
array
Array of tool IDs to enable for this invocation
variables
array
Array of metadata variables to pass to the agent
metadata_filter
object
Filter for datasource resources by metadata
documents
array
Array of documents (images or PDFs) to include in the request

Response

success
boolean
Whether the invocation was successful
error
string
Error message if the invocation failed
data
object
Response data from the agent
message_id
string
ID of the generated message
curl --location --request POST 'https://api.plaisolutions.com/agents/agent_123/invoke' \
--header 'Authorization: Bearer YOUR_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
  "input": "Hello, can you help me with my order?",
  "enable_streaming": false,
  "show_tool_calls": true
}'

Rate Agent Response

Rate a message from the agent to provide feedback.

Path Parameters

agent_id
string
required
The unique identifier of the agent

Request Body

message_id
string
required
ID of the message to rate
rating
string
required
Rating value (POSITIVE, NEGATIVE, NEUTRAL)
user_id
string
ID of the user providing the rating
description
string
Additional feedback description

Response

Returns a success confirmation.
curl --location --request POST 'https://api.plaisolutions.com/agents/agent_123/rate' \
--header 'Authorization: Bearer YOUR_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
  "message_id": "msg_456",
  "rating": "POSITIVE",
  "description": "Very helpful response"
}'

Add Tool to Agent

Add a tool to an agent, enabling it to perform additional functions.

Path Parameters

agent_id
string
required
The unique identifier of the agent

Request Body

id
string
required
ID of the tool to add

Response

Returns a 204 status code on success.
curl --location --request POST 'https://api.plaisolutions.com/agents/agent_123/tools' \
--header 'Authorization: Bearer YOUR_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
  "id": "tool_789"
}'

List Agent Tools

List all tools assigned to an agent.

Path Parameters

agent_id
string
required
The unique identifier of the agent

Response

tools
array
Array of tool objects
curl --location --request GET 'https://api.plaisolutions.com/agents/agent_123/tools' \
--header 'Authorization: Bearer YOUR_TOKEN'

Remove Tool from Agent

Remove a tool from an agent.

Path Parameters

agent_id
string
required
The unique identifier of the agent
tool_id
string
required
The unique identifier of the tool to remove

Response

Returns a 204 status code on success.
curl --location --request DELETE 'https://api.plaisolutions.com/agents/agent_123/tools/tool_789' \
--header 'Authorization: Bearer YOUR_TOKEN'

Add Datasource to Agent

Add a datasource to an agent, allowing it to access the datasource’s knowledge.

Path Parameters

agent_id
string
required
The unique identifier of the agent

Request Body

datasource_id
string
required
ID of the datasource to add

Response

Returns a 204 status code on success.
curl --location --request POST 'https://api.plaisolutions.com/agents/agent_123/datasources' \
--header 'Authorization: Bearer YOUR_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
  "datasource_id": "ds_456"
}'

List Agent Datasources

List all datasources assigned to an agent.

Path Parameters

agent_id
string
required
The unique identifier of the agent

Response

datasources
array
Array of datasource objects
curl --location --request GET 'https://api.plaisolutions.com/agents/agent_123/datasources' \
--header 'Authorization: Bearer YOUR_TOKEN'

Remove Datasource from Agent

Remove a datasource from an agent.

Path Parameters

agent_id
string
required
The unique identifier of the agent
datasource_id
string
required
The unique identifier of the datasource to remove

Response

Returns a 204 status code on success.
curl --location --request DELETE 'https://api.plaisolutions.com/agents/agent_123/datasources/ds_456' \
--header 'Authorization: Bearer YOUR_TOKEN'