Send a message to an agent
curl --request POST \
--url https://omnicommerce.ai/api/v1/agents/{agentId}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://omnicommerce.ai/api/v1/agents/{agentId}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://omnicommerce.ai/api/v1/agents/{agentId}/messages"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"agentId": "<string>",
"threadKey": "<string>",
"runId": "<string>",
"threadId": "<string>",
"status": "accepted",
"reply": "<string>",
"approvals": [
{
"interrupt_instance_id": "<string>",
"tool_name": "<string>",
"tool_args": "<unknown>",
"message": "<string>"
}
],
"error": "<string>"
}{
"agentId": "<string>",
"threadKey": "<string>",
"runId": "<string>",
"threadId": "<string>",
"status": "accepted",
"reply": "<string>",
"approvals": [
{
"interrupt_instance_id": "<string>",
"tool_name": "<string>",
"tool_args": "<unknown>",
"message": "<string>"
}
],
"error": "<string>"
}Agents
Send a message to an agent
Message the exact built-in or custom agent in the URL, using its saved model, instructions, tools, permissions and Programmatic starting mode.
Authentication
Requires an API key with agents:invoke, or a sign-in session. Organization-owned keys use their recorded creator’s current membership and agent access; keys without a valid owner are refused. API keys identify their organization; session requests include organizationId.
Conversation and execution
- The same caller, agent and
clientThreadKeycontinue one conversation. Different callers, agents and organizations are isolated. - No model, prompt or tool overrides are accepted.
wait=falsequeues durable work and returns 202;wait=truereturns the final reply or pending approvals.- Send
decisionswith the sameclientThreadKeyto approve or reject a paused run.
POST
/
api
/
v1
/
agents
/
{agentId}
/
messages
Send a message to an agent
curl --request POST \
--url https://omnicommerce.ai/api/v1/agents/{agentId}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://omnicommerce.ai/api/v1/agents/{agentId}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://omnicommerce.ai/api/v1/agents/{agentId}/messages"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"agentId": "<string>",
"threadKey": "<string>",
"runId": "<string>",
"threadId": "<string>",
"status": "accepted",
"reply": "<string>",
"approvals": [
{
"interrupt_instance_id": "<string>",
"tool_name": "<string>",
"tool_args": "<unknown>",
"message": "<string>"
}
],
"error": "<string>"
}{
"agentId": "<string>",
"threadKey": "<string>",
"runId": "<string>",
"threadId": "<string>",
"status": "accepted",
"reply": "<string>",
"approvals": [
{
"interrupt_instance_id": "<string>",
"tool_name": "<string>",
"tool_args": "<unknown>",
"message": "<string>"
}
],
"error": "<string>"
}Authorizations
Bearer API key for server-to-server access. Session auth is also supported in first-party UI flows.
Path Parameters
Body
application/json
Response
The agent's verbatim final reply or pending approvals.