Create a one-off messaging job. Jobs are used for fire-and-forget message processing where the agent processes a prompt and returns a response.
This endpoint requires API key authentication via the X-API-Key header.
Request Body
UUID of the user sending the message
The message content/prompt to process (max 50KB)
UUID of the agent to process the message. If not provided, uses the first available agent.
Job timeout in milliseconds (min: 1000, max: 300000)
Additional metadata to attach to the job (max 10KB)
Response
Unique job identifier for tracking
Initial job status: pending or processing
Unix timestamp of job creation
Unix timestamp when the job will timeout
{
"jobId": "550e8400-e29b-41d4-a716-446655440001",
"status": "processing",
"createdAt": 1703001234567,
"expiresAt": 1703001354567
}
Example Request
curl -X POST https://api.example.com/api/messaging/jobs \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key" \
-d '{
"userId": "550e8400-e29b-41d4-a716-446655440000",
"content": "Process this asynchronously",
"agentId": "660e8400-e29b-41d4-a716-446655440001",
"timeoutMs": 60000,
"metadata": {
"source": "api",
"priority": "high"
}
}'
Job Status Values
| Status | Description |
|---|
pending | Job created, waiting for processing |
processing | Agent is processing the message |
completed | Job finished successfully |
failed | Job failed with an error |
timeout | Job timed out waiting for response |