Skip to main content

Error Response Format

All errors follow a consistent JSON format:

HTTP Status Codes

Error Types

400 Bad Request

Returned when the request is malformed or contains invalid data.
Solution: Ensure you’re uploading a .pdf or .docx file.
Solution: Compress or split your document to be under 10MB.
Solution: Ensure the file has content and is not corrupted.
Solution: Validate your JSON schema syntax. Use a JSON validator.
Solution: Include the file field in your multipart form data.
Solution: Include the output_schema field in your request.

401 Unauthorized

Authentication failed.
Common causes:
  • Missing Authorization header
  • Incorrect API key
  • Typo in the Bearer token format
  • Using an expired or revoked key
Solution: Verify your API key and ensure the header format is Authorization: Bearer pk_your_key.

403 Forbidden

Origin not allowed (playground endpoint only).
Solution: The playground is only accessible through parsefy.io. For production use, join the waitlist to get an API key and use /v1/extract.

429 Too Many Requests

Rate limit exceeded.
Or for credit limits:
Solution: Implement retry logic with exponential backoff. See Rate Limits.

500 Server Error

An unexpected error occurred during processing.
Common causes:
  • Corrupted document
  • Document format not actually PDF/DOCX
  • Encrypted or password-protected file
  • Temporary service issues
Solution: Verify your document is valid and try again. If the issue persists, contact support.

SDK Error Handling

Python

JavaScript/TypeScript

Extraction-Level Errors

Even when the HTTP request succeeds (200), the extraction itself might fail. These errors are returned in the response:

Error Codes

When extraction fails, you’re still charged credits for the processing attempt. The metadata field shows resource usage.

Best Practices

Always Check Errors

Check both HTTP errors (try/catch) and extraction errors (response.error).

Implement Retries

Use exponential backoff for 429 and 500 errors.

Log Errors

Log error details for debugging. Include the document name and schema.

Validate Inputs

Check file type and size before sending to avoid 400 errors.

Comprehensive Error Handling Example