@gabriel1, sorry it took a while to compile these! The different errors come from different places and a dev had to manually compile them. Hereâs the list we have so far for the CDA:
I will update the documentation pages with these same codes shortly, but just wanted you to have them here first.
Content Delivery API Error Codes & Meanings
## INVALID_AUTHORIZATION_HEADER
This error occurs when the provided API Authorization header is invalid or absent. Ensure that the API token used in the request is valid, has appropriate Content Delivery API (CDA) access permissions, and that the header is properly formatted.
## INVALID_ENVIRONMENT
This error occurs when the GraphQL API request targets an environment that doesnât exist. Check your environment identifier in the request.
## ENVIRONMENT_NOT_READY
This error occurs when attempting to access an environment that exists but is not in a âreadyâ state. To resolve this, ensure that the environment youâre targeting has transitioned to âreadyâ status. You can check the current environmentâs status via the DatoCMS interface or API before making modification requests.
## DEACTIVATED_SITE
This error occurs when attempting to access a site that has been deactivated. To fix this, go to the DatoCMS dashboard and address any pending billing issues.
## SITE_NOT_READY
This error occurs when attempting to access a site that exists but is not in a âreadyâ state. The site may be initializing. Verify that the desired project is accessible, activated, and ready.
## INSUFFICIENT_PERMISSIONS
This error occurs when a valid API token exists but lacks the necessary permissions to access the requested environment. The authentication succeeds, but the token doesnât have the required authorization level for the operation. Ensure your API token has the appropriate role and permission settings for the environment youâre trying to access.
## INVALID_X_INCLUDE_DRAFTS_HEADER
This error occurs when the X-Include-Drafts header in your GraphQL API request has an invalid value. The header can only be set to âtrueâ to include draft content in the response. Ensure your API request uses the correct value for this header or omit it entirely if you donât need draft content.
## INVALID_X_EXCLUDE_INVALID_HEADER
This error occurs when the X-Exclude-Invalid header in your GraphQL API request has an invalid value. The header can only be set to âtrueâ to exclude invalid content items from the response. Verify that your request uses the correct value for this header or remove it if not needed.
## INVALID_X_VISUAL_EDITING_HEADER (Enterprise Feature)
This error occurs when the X-Visual-Editing header is provided, but your site doesnât have visual editing capabilities, which is an enterprise-only feature. Contact support@datocms.com for information about upgrading your plan to access this functionality.
## INVALID_X_VISUAL_EDITING_HEADER (Invalid Value)
This error occurs when the X-Visual-Editing header is provided with an invalid value. Currently, the only supported value for this header is âvercel-v1â. Ensure your API request uses the correct value for this header when using visual editing features.
## INVALID_X_BASE_EDITING_URL_HEADER
This error occurs when the X-Visual-Editing header is specified but the required X-Base-Editing-Url header is missing. When using visual editing features, you must provide the base editing URL to properly generate editing links. Ensure both headers are properly configured in your request.