Skip to main content
The Chunkr API uses conventional HTTP status codes to indicate the success or failure of requests. Error responses include descriptive messages to help you understand and resolve issues.

HTTP Status Codes

Success Codes

Client Error Codes

Server Error Codes

Error Response Format

Error responses return a plain text message in the response body describing the error:
For structured error handling, check both the HTTP status code and the response body message.

Common Errors

Authentication Errors (401)

Missing Authorization Header

Cause: The Authorization header is not included in the request. Solution: Add the Authorization header with your API key:

Invalid or Inactive API Key

Cause: The API key is incorrect, has been revoked, or marked as inactive. Solution:
  • Verify your API key is correct
  • Generate a new API key from your dashboard
  • Ensure the key hasn’t been deactivated

Invalid Token Payload

Cause: The Bearer token is malformed, expired, or has an invalid signature. Solution:
  • Refresh your OAuth token
  • Verify the token is properly formatted
  • Check that the token hasn’t expired

Validation Errors (400)

Invalid Base64 Data

Cause: The file data provided is not valid base64-encoded content. Solution: Ensure your file is properly base64-encoded:

Unsupported File Type

Cause: The file type is not supported by Chunkr. Solution: Use a supported document format (PDF, images, etc.).

File Must Have a Filename

Cause: When using multipart form upload, the file field is missing a filename. Solution: Ensure your multipart request includes a filename for the file field.

Task Cannot Be Updated

Cause: You’re trying to update a task that’s not in a Succeeded or Failed state. Solution: Wait for the task to complete before attempting to update it.

Task Cannot Be Cancelled

Cause: Only tasks in Starting status can be cancelled. Solution: You cannot cancel tasks that have already begun processing.

Resource Errors (404)

Task Not Found

Cause: The task ID doesn’t exist, has expired, or belongs to a different user. Solution:
  • Verify the task ID is correct
  • Check if the task has expired (expired tasks are automatically deleted)
  • Ensure you’re using the same API key that created the task

Rate Limiting Errors (429)

Usage Limit Exceeded

Cause: You’ve exceeded the rate limit for your account or service tier. Solution: Implement exponential backoff and retry logic:
When encountering rate limits, always implement exponential backoff rather than immediately retrying.

Server Errors (500)

Internal Server Error

Cause: An unexpected error occurred on the server. Solution:
  • Check if the error is transient by retrying the request
  • Verify your request payload is valid
  • Contact support if the error persists

Database Connection Error

Cause: The server couldn’t establish a database connection. Solution: This is a server-side issue. Retry the request or contact support.

Failed to Process File

Cause: The server encountered an error while processing your file. Solution:
  • Verify your file is not corrupted
  • Check that the file size is within limits (max 1GB)
  • Try with a different file to isolate the issue

Task-Specific Errors

Task Status Messages

Tasks can fail with specific messages in the message field:

Page Limit Exceeded

Cause: The document exceeds your account’s page processing limit. Solution: Upgrade your plan or split the document into smaller files.

Task Timed Out

Cause: The task exceeded the maximum processing time (default 10 minutes). Solution:
  • The document may be too complex
  • Try with a smaller document
  • Contact support if timeouts persist

Error Handling Best Practices

1. Check Status Codes

Always check the HTTP status code before parsing the response:

2. Implement Retry Logic

For transient errors (429, 500), implement retry logic with exponential backoff:

3. Handle Specific Error Cases

Different errors require different handling:

4. Log Errors for Debugging

Log both successful and failed requests for debugging:

Next Steps

Authentication

Review authentication methods and requirements

API Overview

Learn about rate limits and API capabilities

Task Endpoints

Explore task management endpoints