Skip to main content
All Wordsmith API error responses follow a consistent JSON format. This page documents the error envelope, all possible error codes, and how to handle errors in your integration.

Error response format

Every error response includes a JSON body with the following structure:
string
required
A machine-readable code identifying the type of error. Use this for programmatic error handling.
string
required
Legacy alias for error_code. Both fields always contain the same value. New integrations should use error_code.
string
A human-readable description of the error. Useful for debugging and logging. Not all errors include a message.
A request with an OAuth access token uses this format too, except for token and scope failures. Those use the OAuth error format.

Error codes reference

Authentication & authorization

OAuth errors

An OAuth access token that is invalid, expired or revoked, or that lacks the route’s scope, gets an OAuth error body and a WWW-Authenticate header instead of the format above:
The OAuth endpoints (/oauth/register, /oauth/token, /oauth/revoke) answer with the standard OAuth 2.1 error codes in the same error and error_description format. The ones an app is most likely to see:

Request validation

File upload

Long-running operations

Reviews

Questions & sessions

Artifacts

Playbooks

Reports

Repositories

Sharing & members

Tasks

Audit feed

Webhook endpoints

Rate limiting & credits

Server errors

Handling errors

  1. Check the HTTP status code to determine the error category (4xx = client error, 5xx = server error).
  2. Switch on error_code for specific handling logic (e.g., retrying on rate_limit_exceeded, re-uploading on invalid_upload_job).
  3. Log the message for debugging purposes.

Retry strategy

  • 429 (rate_limit_exceeded): Wait for the Retry-After header’s value, then retry, backing off exponentially if you are limited again. See Rate limits.
  • 500 (internal_error): Retry up to 3 times with backoff. If the error persists, contact support.
  • 429 (upstream_rate_limited): Retry after a minute.
  • 409 (upload_completion_in_progress): Retry after a short wait.
  • 503 (artifact_export_unavailable, temporarily_unavailable, research_source_unavailable, upstream_timeout): Retry after a short wait, backing off if it happens again.
  • 400/401/403/404: Do not retry — fix the request or credentials first. The exception is a 403 protected_content with reason protection_unavailable: retry after a short wait.
  • 400 (task_thread_reply_partially_delivered): Never retry. The reply was already sent.
  • 400 (task_thread_reply_draft_incomplete): Never retry. The draft already exists.

Example error handling