curl --request POST \
--url 'https://response.stateset.com/api/v1/agents/{id}/functions' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"function_name": "string",
"endpoint": "string",
"method": "string",
"description": "string",
"activated": true,
"parameters": [
{
"name": "string",
"type": "string",
"description": "string",
"required": true
}
],
"headers": {},
"timeout": 1
}'
{
"object": "string",
"id": "string",
"name": null,
"endpoint": null,
"method": null,
"description": null,
"activated": true,
"agent_id": null
}
Give the agent an API-call tool
The tool
POST
/
api
/
v1
/
agents
/
{id}
/
functions
curl --request POST \
--url 'https://response.stateset.com/api/v1/agents/{id}/functions' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"function_name": "string",
"endpoint": "string",
"method": "string",
"description": "string",
"activated": true,
"parameters": [
{
"name": "string",
"type": "string",
"description": "string",
"required": true
}
],
"headers": {},
"timeout": 1
}'
{
"object": "string",
"id": "string",
"name": null,
"endpoint": null,
"method": null,
"description": null,
"activated": true,
"agent_id": null
}
Path parameters
string (uuid)
required
The agent id.
Request body
CreateFunction
string
required
string
required
Public http(s) URL. Private and metadata addresses are rejected.
string
required
string
boolean
object[]
object
integer
Response
Function
string
string
string,null
string,null
string,null
string,null
boolean
string,null
Status codes
| Code | Meaning |
|---|---|
201 | The tool |
400 | Invalid request. issues names the offending field(s). |
401 | Missing, invalid, or expired API key. |
403 | The key lacks a required scope. |
404 | Not found, or not in the organization that owns the key. |
409 | Conflict — either the creation ceiling was reached for this organization (agent_limit_reached), or a request with the same Idempotency-Key is still in flight (idempotency_in_progress); retry the latter after the first attempt settles. |
422 | The Idempotency-Key was already used with a DIFFERENT request body (idempotency_key_reused). Reuse a key only to retry the identical request. |
429 | Rate limit exceeded. |
Access
| Required scope | agents:write |
| Rate limit | 30 requests per minute |
curl --request POST \
--url 'https://response.stateset.com/api/v1/agents/{id}/functions' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"function_name": "string",
"endpoint": "string",
"method": "string",
"description": "string",
"activated": true,
"parameters": [
{
"name": "string",
"type": "string",
"description": "string",
"required": true
}
],
"headers": {},
"timeout": 1
}'
{
"object": "string",
"id": "string",
"name": null,
"endpoint": null,
"method": null,
"description": null,
"activated": true,
"agent_id": null
}