Idempotency
Repeating a request (because the network dropped, say) must never duplicate contacts, deals or messages.
- Every
POSTaccepts theIdempotency-Keyheader (1 to 255 characters). Always use it to send messages (POST /v1/conversations/{id}/messages); it is recommended on every POST. - The same key with the same body, within 24 hours, returns the same result without repeating the action.
- The same key with another body, or while the first request is still running:
409 idempotency_conflict. PUT /v1/contacts/by_identifier/{identifier}andPUT /v1/crm/deals/by_external_id/{external_id}are idempotent by design: no header needed.- In MCP,
send_messagetakes anidempotency_keyargument.
curl -X POST "https://atende.suporteja.com.br/v1/conversations/1543/messages" \
-H "Authorization: Bearer $ATENDLLY_API_KEY" -H "Content-Type: application/json" \
-H "Idempotency-Key: order-98765-shipped" \
-d '{"content": "Your order 98765 was shipped."}'