Send a message to an agent
POST https://app.credal.ai/api/v1/agents/sendMessage Content-Type: application/json
Sends a message to a deployed agent and returns a job ID that can be used to poll for the response. Requires the api:agent:message:* scope.
Reference: https://docs.credal.ai/api-reference/v-1/api-reference/agents/send-message
Authentication
Section titled “Authentication”Authorizationheader (bearer token, required) — Bearer authentication of the formBearer <token>, where token is your auth token.
Request
Section titled “Request”Body (application/json)
This endpoint expects an object.
agentId(string, required)conversation(AgentsSendMessagePostRequestBodyContentApplicationJsonSchemaConversation, required)message(string, required)
Response
Section titled “Response”200
Message sent successfully
jobId(string, required)
Errors
Section titled “Errors”400 Bad Request Error
Section titled “400 Bad Request Error”Invalid request
any
401 Unauthorized Error
Section titled “401 Unauthorized Error”Unauthorized
any
403 Forbidden Error
Section titled “403 Forbidden Error”Forbidden
any
500 Internal Server Error
Section titled “500 Internal Server Error”Internal server error
any
Types
AgentsSendMessagePostRequestBodyContentApplicationJsonSchemaConversation
AgentsSendMessagePostRequestBodyContentApplicationJsonSchemaConversation0
type(enum, required)- Allowed values:
new
- Allowed values:
dataInputVariableSelections(map from string to list of string, optional, nullable)
AgentsSendMessagePostRequestBodyContentApplicationJsonSchemaConversation1
type(enum, required)- Allowed values:
existing
- Allowed values:
conversationId(string, required)
Examples
Request
{
"agentId": "cc3fd192-ea62-11f0-99fd-03d6b2458fff",
"conversation": {
"type": "new",
"dataInputVariableSelections": {}
},
"message": "What documents do we have about Q4 planning?"
}Response
{
"jobId": "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32"
}