GET https://xquik.com/api/v1/x/write-actions/{id}
Every X write returns a stored x_write_action record.
Store its id or writeActionId.
Poll statusUrl whenever terminal is false.
Handle X (Twitter) API errors
Use this endpoint to handle errors after an Xquik write. Xquik stores a write record in addition to the HTTP response code. An error message does not prove that a write failed. A timeout can occur after dispatch. Trustterminal, safeToRetry, sendDispatched, and nextAction.
Review X’s response codes and errors.
Xquik’s write status record uses different fields.Trust
terminal, safeToRetry, and nextAction. Never infer retry safety
from an HTTP status or error name alone.Agent algorithm
- Generate one unique
Idempotency-Keyfor the intended write. - Submit the write once.
- Store
id,request.hash,account,target,billing, andstatusUrl. - When
terminalisfalse, wait forRetry-AfterorpollAfterMs. - Poll
statusUrluntilterminalistrue. - Record
resultand settledbilling. - Retry only when
safeToRetryistrue, using a new key. - When
nextAction.typeisverify_result, verify the external state first.
Idempotency-Key only to replay the same account,
action, target, and payload. The replay returns the first answer again.
It keeps the first status, body, and Retry-After, and adds idempotent: true.
While the first request runs, the replay returns 202 and the action.
A replay sends nothing to X and charges nothing.Lifecycle
Writes X never confirms end
expired. You pay nothing for them.
Their message can read “X did not confirm this action. Check your X account before you retry.”
A post X never published fails as x_post_not_sent. You pay nothing, and safeToRetry is true.
Active actions return 202, Location, and Retry-After. Terminal actions
return 200 from this endpoint.Request
Headers
Path parameters
Response
- 200 Terminal
- 202 Active
- 401 Unauthenticated
- 404 Not found
- 429 Rate limited
Polling is complete. Store
result and settled billing. Follow
safeToRetry and nextAction before any new attempt.Retry rules
- With
retryable: falseandsafeToRetry: false, do not retry. - With
retryable: trueandsafeToRetry: false, verify the result first. - With
safeToRetry: true, request approval and retry using a new key. - With
terminal: false, keep polling, even when the original HTTP response was an error.
Response examples
200 example
202 example
- 400
{ "error": "invalid_input", "message": "Invalid input. Check the request body." } - 401
{ "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." } - 403
{ "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." } - 404
{ "error": "not_found", "message": "Resource not found." } - 429
{ "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }