curl --request POST \ --url https://api.headlessagents.ai/call/{agent_id} \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <api-key>' \ --data '{ "request": "What is the weather like in San Francisco?", "conversation_id": "bc8e506e4a6f49ad"}'
Copy
{ "thread_id": "50cc9455b84d48ffad6b4c9fd41b561e", "conversation_id": "bc8e506e4a6f49ad", "agent_id": "2ec10f28abac4e01", "success": true, "response": "Hi there! How can I help you today?", "function_result": null}
Endpoints
Call Agent
Send a request to an agent and get their response
POST
/
call
/
{agent_id}
Call an agent
Copy
curl --request POST \ --url https://api.headlessagents.ai/call/{agent_id} \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <api-key>' \ --data '{ "request": "What is the weather like in San Francisco?", "conversation_id": "bc8e506e4a6f49ad"}'
Copy
{ "thread_id": "50cc9455b84d48ffad6b4c9fd41b561e", "conversation_id": "bc8e506e4a6f49ad", "agent_id": "2ec10f28abac4e01", "success": true, "response": "Hi there! How can I help you today?", "function_result": null}
Optional structured data returned by the agent, null if no structured data
Copy
{ "thread_id": "50cc9455b84d48ffad6b4c9fd41b561e", "conversation_id": "bc8e506e4a6f49ad", "agent_id": "2ec10f28abac4e01", "success": true, "response": "I am a greeting assistant designed to help with welcoming users...", "function_result": null}