Errors

Unauthorized

401 - You are not authorized to access this resource

Overview

The 401 Unauthorized error occurs when the request lacks valid authentication credentials or the provided credentials are invalid.

HTTP Status Code

401

Error Response

{
  "type": "https://scan-documents.com/docs/errors/unauthorized",
  "title": "Unauthorized",
  "status": 401,
  "message": "You are not authorized to access this resource."
}

Common Causes

  • Missing API key in the request headers
  • Invalid or expired API key
  • Attempting to access a protected resource without authentication
  • Malformed Authorization header

How to Fix

  1. Include API Key: Ensure you include a valid API key in your request headers:
curl -X GET https://api.scan-documents.com/v1/files \
  -H "Authorization: Bearer YOUR_API_KEY"
  1. Verify API Key: Check that your API key is correct and hasn't been revoked or expired. You can generate a new API key from your account dashboard.

  2. Check Header Format: Ensure the Authorization header follows the correct format:

Authorization: Bearer YOUR_API_KEY