Skip to main content

400 Bad Request

Problem

The API returns 400 Bad Request when the request is missing required parameters or has invalid values.

Common Error Messages

Missing automation ID:
Include the docId field in your request body with your automation ID. Invalid template override:
Use a full Google Docs URL (e.g., https://docs.google.com/document/d/DOC_ID/edit) or just the document ID.

401 Unauthorized

Problem

API requests return 401 Unauthorized with a message indicating authentication failure.

Common Error Messages & Causes

Error message:
Ensure you include the Authorization header with the correct format:
Find your API key at Workspace Settings > API Key in the DocsAutomator app.
API keys are scoped to a workspace. If you have multiple workspaces, make sure you’re using the key from the correct one.

402 Payment Required

Problem

The API returns 402 Payment Required, indicating your document generation quota has been exceeded. Error message:

Solution

  1. Check your current usage at Settings > Billing in the DocsAutomator app
  2. Enable overage documents in billing settings to continue beyond your plan limit
  3. Upgrade your plan or wait for the billing cycle to reset
  4. If overage billing is already enabled, this error means the overage cap was also reached
Preview mode documents do not count against your quota. Set "isPreview": true in your request for testing.

404 Not Found

Problem

The API returns 404 Not Found when trying to create a document or access an automation.

Common Error Messages

How to Find Your Automation ID

  1. Open the automation in the DocsAutomator app
  2. The automation ID is displayed on the settings page
  3. Or call GET /automations to list all automations with their IDs

429 Too Many Requests

Problem

The API returns 429 Too Many Requests, indicating you’ve exceeded the rate limit.

Rate Limits

Solution

  • Implement backoff: Wait and retry with exponential backoff (start at 2 seconds, double each attempt, max 60 seconds)
  • Spread requests: If generating many documents, space out requests or use async mode with the queue system
  • Check the Retry-After header: When present, wait the indicated number of seconds before retrying

500 Internal Server Error

Problem

The API returns 500 Internal Server Error, indicating something went wrong on the server side.

What to Do

  1. Retry the request after a short delay. Transient errors (Google API timeouts, etc.) are often resolved by retrying.
  2. Check your template for issues such as very large images, complex formatting, or corrupted elements.
  3. Verify your data does not contain unexpected characters or excessively long values.
  4. Contact support if the error persists. Include the request payload (without your API key) and the approximate timestamp.

Debugging Tips

When troubleshooting API issues, always check the response body for a detailed error message. DocsAutomator returns structured error responses with specific details about what went wrong.
  • Use the API playground: Each endpoint page in the API Reference tab includes an interactive playground where you can test requests directly.
  • Check Run History: Document generation attempts are logged in the Run History tab in the app, even for API-triggered generations.
  • Validate your JSON: Malformed JSON payloads return 400 Bad Request. Use a JSON validator before sending requests.

API Introduction

API setup, authentication, and code examples

Run History

Monitor all document generation attempts
Last modified on July 29, 2026