400 Bad Request
Problem
The API returns400 Bad Request when the request is missing required parameters or has invalid values.
Common Error Messages
Missing automation ID:docId field in your request body with your automation ID.
Invalid template override:
https://docs.google.com/document/d/DOC_ID/edit) or just the document ID.
401 Unauthorized
Problem
API requests return401 Unauthorized with a message indicating authentication failure.
Common Error Messages & Causes
- Missing or wrong API key
- Expired Google refresh token
- Copied key has extra whitespace
Error message:Ensure you include the Find your API key at Workspace Settings > API Key in the DocsAutomator app.
Authorization header with the correct format:402 Payment Required
Problem
The API returns402 Payment Required, indicating your document generation quota has been exceeded.
Error message:
Solution
- Check your current usage at Settings > Billing in the DocsAutomator app
- Enable overage documents in billing settings to continue beyond your plan limit
- Upgrade your plan or wait for the billing cycle to reset
- 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 returns404 Not Found when trying to create a document or access an automation.
Common Error Messages
How to Find Your Automation ID
- Open the automation in the DocsAutomator app
- The automation ID is displayed on the settings page
- Or call
GET /automationsto list all automations with their IDs
429 Too Many Requests
Problem
The API returns429 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-Afterheader: When present, wait the indicated number of seconds before retrying
500 Internal Server Error
Problem
The API returns500 Internal Server Error, indicating something went wrong on the server side.
What to Do
- Retry the request after a short delay. Transient errors (Google API timeouts, etc.) are often resolved by retrying.
- Check your template for issues such as very large images, complex formatting, or corrupted elements.
- Verify your data does not contain unexpected characters or excessively long values.
- Contact support if the error persists. Include the request payload (without your API key) and the approximate timestamp.
Debugging Tips
- 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.
Related
API Introduction
API setup, authentication, and code examples
Run History
Monitor all document generation attempts