Create a chat
curl --request POST \
--url https://api.arg.ai/api/agent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"organization_id": "<string>",
"chat_id": "<string>",
"workspace_id": "<string>",
"agent_name": "<string>"
}
'import requests
url = "https://api.arg.ai/api/agent"
payload = {
"title": "<string>",
"organization_id": "<string>",
"chat_id": "<string>",
"workspace_id": "<string>",
"agent_name": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
organization_id: '<string>',
chat_id: '<string>',
workspace_id: '<string>',
agent_name: '<string>'
})
};
fetch('https://api.arg.ai/api/agent', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{}{
"detail": "<string>"
}Agent
Create a chat
Create the chat an agent run happens in. You can skip this and let POST /api/agent/message create one implicitly on the first send.
POST
/
api
/
agent
Create a chat
curl --request POST \
--url https://api.arg.ai/api/agent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"organization_id": "<string>",
"chat_id": "<string>",
"workspace_id": "<string>",
"agent_name": "<string>"
}
'import requests
url = "https://api.arg.ai/api/agent"
payload = {
"title": "<string>",
"organization_id": "<string>",
"chat_id": "<string>",
"workspace_id": "<string>",
"agent_name": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
organization_id: '<string>',
chat_id: '<string>',
workspace_id: '<string>',
agent_name: '<string>'
})
};
fetch('https://api.arg.ai/api/agent', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{}{
"detail": "<string>"
}Authorizations
bearerAuthapiKeyAuth
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Chat title. Defaults to New Chat.
Organization the chat belongs to.
Client-supplied UUID to create the chat under.
Workspace the chat belongs to. Required with agent_name.
Name of a subagent defined in the workspace's .agents/ folder. Every turn of the chat then runs with that agent's instructions and tool allowlist instead of the default assistant.
Response
Successful response
The response is of type object.