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 automationId field in your request body with your automation ID. Different automation IDs in one request:
Send the automation ID once, in automationId. docId is still accepted on its own. 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:
Check that the key is still listed in Settings > API keys and was not revoked. A revoked key stops working at once. Compare the start of the key in your app with the Key column there. If no key matches, the key was revoked or belongs to another workspace. Create a new key, put it in the app, and revoke any key the app no longer needs. See API keys.
The API keys list with three keys named Original key, Make and Zapier: Invoices, with their first characters, the day each was created, when each was last used and a Revoke button

Each key has a name, its first characters, the day it was created and the day it was last used.

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
Test documents do not count against your quota. Send "mode": "test" in your request, or keep the automation in test mode, while you test.

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 Documents: Failed runs appear under the Needs attention filter on the Documents page in the app, also for runs that the API started. Click a run to see its error message.
  • 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

Documents

Monitor all document generation attempts
Last modified on November 23, 2026