Agents
The Agents API has methods for managing AI agents and chat bots.
Create agent
Create AI agent.
POST /api/agents
Body parameters
uidstringrequiredUnique identifier (cannot contain whitespace and must contain at least one non-digit).
namestringrequiredAgent name. Used in listings, @mentions etc.
providerstringrequiredThe AI provider for the agent, must be one of
anthropic,gemini,kapa,openaiorweavy.
modelstringrequiredThe model to use for the agent, e.g. "gpt-4.1-mini" or "gemini-2.0-flash" etc.
instructionsstringHigh-level system instructions describing the desired agent behavior, e.g. main objectives, tone, response style etc.
functionsarray of objectsA list of function definitions that lets the agent interface with external API endpoints.
knowledgearray of integersIds of files apps for agent's knowledge.
web_searchbooleanAllow the agent to search the web and answer questions with up-to-date information beyond its knowledge cutoff.
max_tokensintegerMaximum number of tokens to generate before stopping.
picturestringProfile picture. Can be a public URL, a base64 encoded data URI or a blob id.
directorystringOptional user directory for the agent (
idorname).
commentstringComment or other application-specific information about the agent.
tagsarray of stringsA list of tags to associate with the agent.
metadataobjectAdditional metadata properties, e.g.
{ "color": "blue", "size": "XL" }.
Example request
curl {WEAVY-URL}/api/agents
-H "Authorization: Bearer {API-KEY}"
--json "{ 'uid': 'tweety-bird', 'name': 'Tweety Bird', 'provider': 'openai', 'model': 'gpt-4.1-mini', 'instructions': 'You’re a cute cartoon character with an aggressive nature.' }"
Response codes
201 Created
400 Bad Request
401 Unauthorized
403 Forbidden
422 Validation Failed
Response schema
{
"id": "integer",
"uid": "string",
"name": "string",
"provider": "string",
"model": "string",
"instructions": "string",
"functions": [
"string"
],
"knowledge": [
"integer"
],
"web_search": "boolean",
"max_tokens": "integer",
"avatar_url": "string",
"picture": {
"id": "integer",
"name": "string",
"media_type": "string",
"width": "integer",
"height": "integer",
"size": "integer",
"thumbnail_url": "string",
"raw": "string"
},
"directory": {
"id": "integer",
"name": "string"
},
"comment": "string",
"tags": [
"string"
],
"metadata": "object",
"created_at": "string",
"updated_at": "string",
"is_agent": "boolean",
"is_trashed": "boolean"
}
Get agent
Get AI agent with specified identifier.
GET /api/agents/{agent}
Path parameters
agentstringrequiredAgent identifier (
idoruid).
Query parameters
trashedbooleantrueto return agent even if trashed.
Example request
curl {WEAVY-URL}/api/agents/tweety-bird
-H "Authorization: Bearer {API-KEY}"
Response codes
200 OK
401 Unauthorized
404 Not Found
Response schema
{
"id": "integer",
"uid": "string",
"name": "string",
"provider": "string",
"model": "string",
"instructions": "string",
"functions": [
"string"
],
"knowledge": [
"integer"
],
"web_search": "boolean",
"max_tokens": "integer",
"avatar_url": "string",
"picture": {
"id": "integer",
"name": "string",
"media_type": "string",
"width": "integer",
"height": "integer",
"size": "integer",
"thumbnail_url": "string",
"raw": "string"
},
"directory": {
"id": "integer",
"name": "string"
},
"comment": "string",
"tags": [
"string"
],
"metadata": "object",
"created_at": "string",
"updated_at": "string",
"is_agent": "boolean",
"is_trashed": "boolean"
}
Update agent
Update AI agent.
PATCH /api/agents/{agent}
Path parameters
agentstringrequiredAgent identifier (
idoruid).
Body parameters
uidstringUnique identifier (cannot contain whitespace and must contain at least one non-digit).
namestringAgent name. Used in listings, @mentions etc.
providerstringThe agent provider to use, must be one of
openai,anthropic,gemini, orkapa.
modelstringThe model to use for the agent, e.g. "gpt-4.1-mini" or "gemini-2.0-flash" etc.
instructionsstringHigh-level system instructions describing the desired agent behavior, e.g. main objectives, tone, response style etc.
functionsarray of objectsA list of function definitions that lets the agent interface with external API endpoints.
knowledgearray of integersIds of files apps for agent's knowledge.
web_searchbooleanAllow the agent to search the web and answer questions with up-to-date information beyond its knowledge cutoff.
max_tokensintegerMaximum number of tokens to generate before stopping.
picturestringProfile picture. Can be a public URL, a base64 encoded data URI or a blob id.
directorystringOptional user directory for the agent (
idorname).
commentstringComment or other application-specific information about the agent.
tagsarray of stringsA list of tags to associate with the agent.
metadataobjectAdditional metadata properties, e.g.
{ "color": "blue", "size": "XL" }.
Example request
curl -X PATCH {WEAVY-URL}/api/agents/tweety-bird
-H "Authorization: Bearer {API-KEY}"
--json "{ 'model': 'gpt-4.1-nano' }"
Response codes
200 OK
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
422 Validation Failed
Response schema
{
"id": "integer",
"uid": "string",
"name": "string",
"provider": "string",
"model": "string",
"instructions": "string",
"functions": [
"string"
],
"knowledge": [
"integer"
],
"web_search": "boolean",
"max_tokens": "integer",
"avatar_url": "string",
"picture": {
"id": "integer",
"name": "string",
"media_type": "string",
"width": "integer",
"height": "integer",
"size": "integer",
"thumbnail_url": "string",
"raw": "string"
},
"directory": {
"id": "integer",
"name": "string"
},
"comment": "string",
"tags": [
"string"
],
"metadata": "object",
"created_at": "string",
"updated_at": "string",
"is_agent": "boolean",
"is_trashed": "boolean"
}
Upsert agent
Update or insert AI agent. If an agent with the specified uid is found it is updated, otherwise it is created.
PUT /api/agents/{uid}
Path parameters
uidstringrequiredUnique identifier.
Body parameters
uidstringUnique identifier (cannot contain whitespace and must contain at least one non-digit).
namestringAgent name. Used in listings, @mentions etc.
providerstringThe agent provider to use, must be one of
openai,anthropic,gemini, orkapa.
modelstringThe model to use for the agent, e.g. "gpt-4.1-mini" or "gemini-2.0-flash" etc.
instructionsstringHigh-level system instructions describing the desired agent behavior, e.g. main objectives, tone, response style etc.
functionsarray of objectsA list of function definitions that lets the agent interface with external API endpoints.
knowledgearray of integersIds of files apps for agent's knowledge.
web_searchbooleanAllow the agent to search the web and answer questions with up-to-date information beyond its knowledge cutoff.
max_tokensintegerMaximum number of tokens to generate before stopping.
picturestringProfile picture. Can be a public URL, a base64 encoded data URI or a blob id.
directorystringOptional user directory for the agent (
idorname).
commentstringComment or other application-specific information about the agent.
tagsarray of stringsA list of tags to associate with the agent.
metadataobjectAdditional metadata properties, e.g.
{ "color": "blue", "size": "XL" }.
Example request
curl -X PUT {WEAVY-URL}/api/agents/tweety-bird
-H "Authorization: Bearer {API-KEY}"
--json "{ 'name': 'Tweety Bird', 'provider': 'openai', 'model': 'gpt-4.1-mini', 'instructions': 'You’re a cute cartoon character with an aggressive nature.' }"
Response codes
200 OK
201 Created
400 Bad Request
401 Unauthorized
403 Forbidden
422 Validation Failed
Response schema
{
"id": "integer",
"uid": "string",
"name": "string",
"provider": "string",
"model": "string",
"instructions": "string",
"functions": [
"string"
],
"knowledge": [
"integer"
],
"web_search": "boolean",
"max_tokens": "integer",
"avatar_url": "string",
"picture": {
"id": "integer",
"name": "string",
"media_type": "string",
"width": "integer",
"height": "integer",
"size": "integer",
"thumbnail_url": "string",
"raw": "string"
},
"directory": {
"id": "integer",
"name": "string"
},
"comment": "string",
"tags": [
"string"
],
"metadata": "object",
"created_at": "string",
"updated_at": "string",
"is_agent": "boolean",
"is_trashed": "boolean"
}
List agents
List AI agents.
GET /api/agents
Query parameters
autocompletebooleantrue(default) to use "autocomplete" search, otherwisefalse.
directorystringDirectory identifier (
idorname). When unspecified agents from all directories are listed.
qstringA string used to find matching items by name, e.g.
q=test.
tagstringList items with the specified tag.
trashedbooleanIndicates whether trashed items should be listed (default is
false). Specifynullto list both trashed and non-trashed items.
order_bystringSpecifies the sort order and direction for the listing, e.g.
order_by=idororder_by=id+desc.
skipintegerThe number of items to skip. Used together with
taketo return a specific range of items (for pagination).
takeintegerMaximum number of items to return in the listing. Should be a value between
1and100. Default is25.
count_onlybooleantrueto count the number of matching items instead of listing them; when specified the response will only contain thecountproperty.
Example request
curl {WEAVY-URL}/api/agents?take=25
-H "Authorization: Bearer {ACCESS-TOKEN | API-KEY}"
Response codes
200 OK
401 Unauthorized
Response schema
{
"data": [
{
"id": "integer",
"uid": "string",
"name": "string",
"provider": "string",
"model": "string",
"instructions": "string",
"functions": [
"string"
],
"knowledge": [
"integer"
],
"web_search": "boolean",
"max_tokens": "integer",
"avatar_url": "string",
"comment": "string",
"tags": [
"string"
],
"metadata": "object",
"created_at": "string",
"updated_at": "string",
"is_agent": "boolean",
"is_trashed": "boolean"
}
],
"start": "integer",
"end": "integer",
"count": "integer"
}
Trash agent
Move an AI agent to the trash.
POST /api/agents/{agent}/trash
Path parameters
agentstringrequiredIdentifier (
idoruid) of agent to trash.
Example request
curl -X POST {WEAVY-URL}/api/agents/tweety-bird/trash
-H "Authorization: Bearer {API-KEY}"
Response codes
204 No Content
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
Restore agent
Restore an AI agent from the trash.
POST /api/agents/{agent}/restore
Path parameters
agentstringrequiredIdentifier (
idoruid) of agent to restore.
Example request
curl -X POST {WEAVY-URL}/api/agents/tweety-bird/restore
-H "Authorization: Bearer {API-KEY}"
Response codes
204 No Content
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
Delete agent
Permanently delete an AI agent. Content generated by the agent won’t be removed (this includes comments, files, messages and other data).
DELETE /api/agents/{agent}
Path parameters
agentstringrequiredIdentifier (
idoruid) of agent to delete.
Example request
curl -X DELETE {WEAVY-URL}/api/agents/tweety-bird
-H "Authorization: Bearer {API-KEY}"
Response codes
204 No Content
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
Add function
Adds a function definition to the agent's tools, allowing it to interface with an external API endpoint.
POST /api/agents/{agent}/functions
Path parameters
agentstringrequiredAgent identifier (
idoruid).
Body parameters
namestringrequiredThe name of the function.
descriptionstringrequiredDescribes the purpose of the function to the agent.
urlstringrequiredUrl to the external API endpoint.
methodstringHTTP method to use when calling the endpoint (defaults to
GET).
headersobjectHeaders to include in the request, e.g.
Authorization,Content-Type,User-Agentetc.
parametersobjectA JSON schema object describing the parameters of the function (if any).
Example request
curl -X POST {WEAVY-URL}/api/agents/tweety-bird/functions
-H "Authorization: Bearer {API-KEY}"
--json "{ 'name': 'get_joke', 'description': 'Returns a joke', 'url': 'https://api.example.com/joke' }"
Response codes
201 Created
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
422 Validation Failed
Response schema
{
"name": "string",
"description": "string",
"method": "string",
"url": "string",
"headers": "object",
"parameters": "object"
}
Get function
Returns the definition for the specified function.
GET /api/agents/{agent}/functions/{name}
Path parameters
agentstringrequiredAgent identifier (
idoruid).
namestringrequiredName of function.
Example request
curl -X GET {WEAVY-URL}/api/agents/tweety-bird/functions/get_joke
-H "Authorization: Bearer {API-KEY}"
Response codes
200 OK
401 Unauthorized
404 Not Found
Response schema
{
"name": "string",
"description": "string",
"method": "string",
"url": "string",
"headers": "object",
"parameters": "object"
}
Update function
Updates an existing function definition.
PATCH /api/agents/{agent}/functions/{name}
Path parameters
agentstringrequiredAgent identifier (
idoruid).
namestringrequiredName of function to update.
Body parameters
namestringThe name of the function.
descriptionstringDescribes the purpose of the function to the agent.
methodstringHTTP method to use when calling the endpoint.
urlstringUrl to the external API endpoint.
headersobjectHeaders to include in the request, e.g.
Authorization,Content-Type,User-Agentetc.
parametersobjectA JSON schema object describing the parameters of the function (if any).
Example request
curl -X PATCH {WEAVY-URL}/api/agents/tweety-bird/functions/get_joke
-H "Authorization: Bearer {API-KEY}"
--json "{ 'name': 'get_joke', 'description': 'Returns a joke', 'url': 'https://api.example.com/joke' }"
Response codes
200 OK
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
422 Validation Failed
Response schema
{
"name": "string",
"description": "string",
"method": "string",
"url": "string",
"headers": "object",
"parameters": "object"
}
Upsert function
Add or update a function definition. If the agent already has a function with the specified name it is updated, otherwise it is added.
PUT /api/agents/{agent}/functions/{name}
Path parameters
agentstringrequiredAgent identifier (
idoruid).
namestringrequiredFunction name.
Body parameters
namestringrequiredThe name of the function.
descriptionstringrequiredDescribes the purpose of the function to the agent.
urlstringrequiredUrl to the external API endpoint.
methodstringHTTP method to use when calling the endpoint (defaults to
GET).
headersobjectHeaders to include in the request, e.g.
Authorization,Content-Type,User-Agentetc.
parametersobjectA JSON schema object describing the parameters of the function (if any).
Example request
curl -X PUT {WEAVY-URL}/api/agents/tweety-bird/functions/get_joke
-H "Authorization: Bearer {API-KEY}"
--json "{ 'name': 'get_joke', 'description': 'Returns a joke', 'url': 'https://api.example.com/joke' }"
Response codes
200 OK
201 Created
400 Bad Request
401 Unauthorized
403 Forbidden
422 Validation Failed
Response schema
{
"name": "string",
"description": "string",
"method": "string",
"url": "string",
"headers": "object",
"parameters": "object"
}
List functions
List all function definitions for an agent.
GET /api/agents/{agent}/functions
Path parameters
agentstringrequiredAgent identifier (
idoruid).
Example request
curl -X GET {WEAVY-URL}/api/agents/tweety-bird/functions
-H "Authorization: Bearer {API-KEY}"
Response codes
200 OK
401 Unauthorized
Response schema
[
{
"name": "string",
"description": "string",
"method": "string",
"url": "string",
"headers": "object",
"parameters": "object"
}
]
Remove function
Remove a function definition from the agent.
DELETE /api/agents/{agent}/functions/{name}
Path parameters
agentstringrequiredAgent identifier (
idoruid).
namestringrequiredName of function to remove.
Example request
curl -X DELETE {WEAVY-URL}/api/agents/tweety-bird/functions/get_joke
-H "Authorization: Bearer {API-KEY}"
Response codes
204 No Content
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found