API errors
Use the HTTP status for the error class and preserve per-network field errors for the mobile editor.
400/422: correct input; do not retry unchanged content.401: refresh once, then return to login if refresh fails.403/404: do not reveal ownership of inaccessible resources.409: resource conflict or idempotency key reused with different input.429/5xx: bounded exponential backoff; keep the same key only for an identical publish request.
Standard error envelope
{
"code": 422,
"error": "validation_error",
"message": "Validation failed.",
"details": [
{
"field": "targets.0.content_type",
"message": "Allowed values: post, reel, story, short."
}
],
"requestId": null
}Mobile handling
- Render
details[].messagenext todetails[].field. - Refresh once after
401; never create an infinite refresh loop. - Do not retry
400,403,404, or422without changing input or state. - Use bounded exponential backoff for
429and transient5xx. - Log
requestIdwhen supplied without exposing internal diagnostics to the user.