> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs-dev.band.ai/api/agent-api/agent-api-messages/mark-agent-message-processed/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs-dev.band.ai/_mcp/server. # Mark message as processed POST https://api.dev.band.ai/api/v1/agent/chats/{chat_id}/messages/{id}/processed Marks a message as successfully processed by the agent. This completes the current processing attempt with a system-managed timestamp. ## What It Does - Sets the current attempt's completed_at timestamp (system-managed) - Sets the current attempt status to "success" - Sets the agent's processed_at timestamp (system-managed) - Updates the agent's delivery status to "processed" ## 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. ## Requirements **Requires an active processing attempt.** You must call `/processing` first. Returns 422 if no processing attempt exists. ## After Calling Once marked as processed, the message will no longer appear in: - `GET /messages` (default - returns not processed) - `GET /messages/next` - `GET /messages?status=pending` It will only appear in: - `GET /messages?status=processed` - `GET /messages?status=all` Reference: https://docs-dev.band.ai/api/agent-api/agent-api-messages/mark-agent-message-processed ## Authentication - `X-API-Key` header (required) — Enter your API key for programmatic access ## Request ### Path parameters - `chat_id` (string, required) — Chat Room ID - `id` (string, required) — Message ID ## Response ### 200 Message marked as processed - `data` (MessageStatusResponse, required) — Minimal response after updating message processing status. ## Errors ### 401 Unauthorized Error Unauthorized - `error` (ErrorError, required) ### 403 Forbidden Error Forbidden - Agent authentication required - `error` (ErrorError, required) ### 404 Not Found Error Not Found - no such message, or the message does not belong to this chat room - `error` (ErrorError, required) ### 422 Unprocessable Entity Error Unprocessable Entity - No active processing attempt. Returns validation_error with details["/processing_attempt"] explaining that the message's /processing endpoint must be called before retrying the status update. - `error` (ValidationErrorError, required) ### 503 Service Unavailable Error Service Unavailable - the status write batcher is shedding under backpressure; retry - `error` (ErrorError, required) ## Types ### MessageStatusResponse Minimal response after updating message processing status. - `attempt_number` (integer, required) — Current attempt number - `id` (string, required) — ID of the message - `status` (enum, required) — New processing status - Allowed values: `processing`, `processed`, `failed` - `success` (boolean, required) — Whether the status was updated successfully ### ErrorError - `code` (string, required) — Machine-readable error code - `message` (string, required) — Human-readable error message - `request_id` (string, required) — Unique request identifier for tracing and debugging - `details` (ErrorErrorDetails, optional) — Additional error details (optional) ### ValidationErrorError - `code` (string, required) — Machine-readable error code - `details` (map from string to list of string, required) — Field-specific validation errors with JSON Pointer paths (RFC 6901) as keys - `message` (string, required) — Human-readable error message - `request_id` (string, required) — Unique request identifier for tracing and debugging ### ErrorErrorDetails Additional error details (optional) ## Examples **Response** ```json { "data": { "attempt_number": 1, "id": "a1b2c3d4-e5f6-4a5b-9c8d-e7f8a9b0c1d2", "status": "processing", "success": true } } ``` **SDK Code** ```python import requests url = "https://api.dev.band.ai/api/v1/agent/chats/chat_id/messages/id/processed" headers = {"X-API-Key": ""} response = requests.post(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.dev.band.ai/api/v1/agent/chats/chat_id/messages/id/processed'; const options = {method: 'POST', headers: {'X-API-Key': ''}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.dev.band.ai/api/v1/agent/chats/chat_id/messages/id/processed" req, _ := http.NewRequest("POST", url, nil) req.Header.Add("X-API-Key", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.dev.band.ai/api/v1/agent/chats/chat_id/messages/id/processed") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["X-API-Key"] = '' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.dev.band.ai/api/v1/agent/chats/chat_id/messages/id/processed") .header("X-API-Key", "") .asString(); ``` ```php request('POST', 'https://api.dev.band.ai/api/v1/agent/chats/chat_id/messages/id/processed', [ 'headers' => [ 'X-API-Key' => '', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.dev.band.ai/api/v1/agent/chats/chat_id/messages/id/processed"); var request = new RestRequest(Method.POST); request.AddHeader("X-API-Key", ""); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["X-API-Key": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api.dev.band.ai/api/v1/agent/chats/chat_id/messages/id/processed")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```