SheetFast API Error Codes

This document provides details on the possible error codes that can be returned by the SheetFast API, specifically for the /generate endpoint.

Error Codes

401 Unauthorized

Missing Authorization Header

Error Message:

{
  "error": "Authorization header is missing"
}

Description: This error occurs when the request does not include an Authorization header.

Invalid Authorization Header

Error Message:

{
  "error": "Authorization header is invalid"
}

Description: This error occurs when the Authorization header is present but does not contain a valid secret key.

400 Bad Request

Invalid Data

Error Message:

{
  "error": "Invalid data",
  "reasons": [
    "field_name [value]: Error message",
    "sheets.0.name [too_long_name]: Sheet name must be 30 characters or less (example)"
  ]
}

Description: This error occurs when the payload data does not conform to the expected schema or contains invalid values. The reasons field provides detailed information about the validation errors.

CSV Extension Error

Error Message:

{
  "error": "Invalid data",
  "reasons": ["CSVExtension [xlsx]: CSVExtension cannot be 'xlsx'"]
}

Description: This error occurs when the CSVExtension field in the options is set to 'xlsx', which is not allowed.

S3 Upload Error

Error Message:

{
  "error": "S3 Upload Error",
  "reasons": ["details of the S3 error, returned by your provider"]
}

Description: This error occurs when there is an issue with uploading files to S3. The message field provides specific information about the error.

404 Not Found

Project Not Found

Error Message:

{
  "error": "Authorization header is invalid"
}

Description: This error occurs when the provided secret key does not match any existing project.

500 Internal Server Error

General Internal Error

Error Message:

{
  "error": "Internal error"
}

Description: This error occurs when there is an unexpected issue on the server side. It could be due to various reasons like database connectivity issues, unhandled exceptions, etc.