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:
error_code
string
required
A machine-readable code identifying the type of error. Use this for programmatic error handling.
ws_api_error_code
string
required
Legacy alias for error_code. Both fields always contain the same value. New integrations should use error_code.
message
string
A human-readable description of the error. Useful for debugging and logging. Not all errors include a message.

Error Codes Reference

Authentication & Authorization

Request Validation

File Upload

Questions & Sessions

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): Retry with exponential backoff.
  • 500 (internal_error): Retry up to 3 times with backoff. If the error persists, contact support.
  • 400/401/403/404: Do not retry — fix the request or credentials first.

Example Error Handling