Acknowledge inbound messages

Mark inbound messages as processed so the next poll with acked=false only returns what your agent has not confirmed yet.

Confirm up to 500 messages in one call once your agent has processed them. The next GET /v3/inbound/messages?acked=false then leaves them out — the reliable way to catch up after your agent was down: on start-up, page through acked=false, process each message, acknowledge it.

POST /v3/inbound/messages/ack

Idempotent: acknowledging a message again keeps the first acknowledgement time. Works for stored and forward-only messages. IDs that are not messages of your workspace are returned in not_found (they are never an error). A route with auto_ack_on_forward acknowledges a message by itself when its forward got a 2xx, so a push-plus-poll agent only polls what the push missed. Requires a `full_access` key. Limit: 120 calls per minute per key.

Request body

ParameterTypeRequiredDescription
idsuuid[]Required1–500 inbound message IDs.

Responses

StatusDescription
200{ acknowledged, not_found } — acknowledged counts every matched message (already-acknowledged ones included).
400validation_error — 1 to 500 message IDs (uuid) are required.
401Missing or invalid API key.
403insufficient_scope — only a full_access key may acknowledge.
429Rate limit exceeded (120 calls per minute).

Code examples

cURL
curl -X POST https://api.wemail.io/v3/inbound/messages/ack \
  -H "Authorization: Bearer afn_live_…" \
  -H "Content-Type: application/json" \
  -d '{"ids":["6f1c2a1e-7d3b-4b7e-9f0e-2a4c8d9b1e55"]}'
# 200 {"acknowledged":1,"not_found":[]}
Node.js
// Catch up after downtime: process every unacknowledged message, then acknowledge it.
const H = { Authorization: `Bearer ${process.env.WEMAIL_API_KEY}`, "Content-Type": "application/json" };
let cursor;
do {
  const url = new URL("https://api.wemail.io/v3/inbound/messages");
  url.searchParams.set("acked", "false");
  if (cursor) url.searchParams.set("cursor", cursor);
  const page = await (await fetch(url, { headers: H })).json();
  for (const m of page.items) await handle(m);
  if (page.items.length) {
    await fetch("https://api.wemail.io/v3/inbound/messages/ack", { method: "POST", headers: H, body: JSON.stringify({ ids: page.items.map((m) => m.id) }) });
  }
  cursor = page.next_cursor;
} while (cursor);
Python
import os, requests

H = {"Authorization": f"Bearer {os.environ['WEMAIL_API_KEY']}"}
page = requests.get("https://api.wemail.io/v3/inbound/messages", params={"acked": "false"}, headers=H).json()
ids = [m["id"] for m in page["items"]]
r = requests.post("https://api.wemail.io/v3/inbound/messages/ack", json={"ids": ids}, headers=H)
print(r.json())  # {'acknowledged': …, 'not_found': []}