Skip to content

Access Key Invalid

It is an API error returned when the provided access key is invalid or incorrect, when a request carries more than one different access key, or when the key has characters that an access key never has.

{
"is_successful": false,
"error_code": "access_key_invalid",
"error_message": "The `access_key` parameter is set, but it is not correct. Please, check out the access dashboard page to get the access key—https://dash.screenshotone.com/access.",
"documentation_url": "https://screenshotone.com/docs/errors/access-key-invalid/"
}

One common reason for the “access_key_invalid” error is using an incorrect access key. This can happen if the key is copied incorrectly or if an old key is being used.

To fix this, ensure you are using the correct access key by visiting the access dashboard page and copying the key directly from there.

Typos in the access key parameter can also lead to this error. This includes missing characters or incorrect case sensitivity.

To fix this, carefully check and re-enter the access key, ensuring there are no typographical errors. Copy-pasting the key directly from the dashboard is recommended.

An access key that starts or ends with whitespace, or that contains characters an access key never has, such as spaces or non-ASCII letters, is rejected before it is checked. This often happens when the key is copied together with a line break or a quote. The error message says which of the two it is:

{
"is_successful": false,
"error_code": "access_key_invalid",
"error_message": "The access key starts or ends with whitespace. Send it exactly as it is on the access page: https://dash.screenshotone.com/access.",
"documentation_url": "https://screenshotone.com/docs/errors/access-key-invalid/"
}

To fix this, copy the key again from the access dashboard page and make sure your code doesn’t add whitespace or other characters around it.

You can send the access key in the access_key parameter, in the request body, in the X-Access-Key header or as a bearer token in the Authorization header. If one request carries two different keys, it is rejected instead of using one of them:

{
"is_successful": false,
"error_code": "access_key_invalid",
"error_message": "The request has more than one different access key. Send one key: in the `access_key` parameter, the `X-Access-Key` header, or the `Authorization` header.",
"documentation_url": "https://screenshotone.com/docs/errors/access-key-invalid/"
}

To fix this, send the key in one place only. Sending the same key in several places still works. A common cause is a default header set by an HTTP client or a proxy that still holds an old key.

In some cases, the environment where the API request is being made might be misconfigured, leading to the wrong access key being used.

To fix this, review your environment configuration settings to ensure the correct access key is being used in the appropriate environment (e.g., development, staging, production).

If you continue to face issues, please reach out to support@screenshotone.com, and we will assist you as soon as possible.