agentApiMessages

Mark message as processing

Marks a message as being processed by the agent, with a system-managed timestamp.

Authorization

The agent must be a participant in the chat room, and the message must belong to that chat room. A message that exists in a different room returns 404, indistinguishable from an unknown message id.

What It Does

  • Starts a new attempt (auto-incremented attempt_number) when the message is not already mid-attempt — i.e. on the first mark, or after ANY terminal status (/processed or /failed)
  • Is a no-op when the message is already processing with a live attempt (idempotent — no new attempt, no timestamp reset), so a repeated mark under ambiguous-timeout / crash-recovery conditions can't spuriously inflate the attempt history
  • Sets the agent's delivery status to "processing"

Multiple Calls

This endpoint is safe to call multiple times on the same message:

  1. Agent calls /processing (attempt 1)
  2. Agent crashes while processing — the message stays processing
  3. Agent restarts, gets the same message back, calls /processing again — idempotent: it stays attempt 1, the timestamp is unchanged
  4. Agent completes, calls /processed

A new attempt is started after ANY terminal status — /failed (retry a failure) or /processed. Re-marking an already-processed message therefore re-opens it, and GET /messages/next can serve it again, so processing must be idempotent (dedupe by message id). The attempts array in the message metadata tracks the full history.

Workflow

Always call this endpoint before starting work on a message:

  1. GET /messages/next → Get message
  2. POST /messages/{id}/processingThis endpoint
  3. Process the message
  4. POST /messages/{id}/processed or /failed
post/api/v1/agent/chats/{chat_id}/messages/{id}/processing

Path parameters

chat_idstring uuid required

Chat Room ID

idstring uuid required

Message ID

Headers

X-API-Keystring required

Enter your API key for programmatic access

Response

Message marked as processing

MessagesMarkAgentMessageProcessingResponse200 required— unresolved $ref

Changes