Fix the OVH API error “This call has not been granted” by correctly setting token permissions for API paths and methods. Our support team is always here to help you.

Fixing “This call has not been granted” OVH API Error

When you see the error message OVH API Error: This call has not been granted while using the OVH Cloud API, it means your token lacks the correct accessThis call has not been granted rights. For example, if you try to call GET /cloud/project/{project_id}/image, and the token doesn’t include permission for that path and HTTP method, the API will return this error.

Why You’re Getting the Error

There are several reasons why you might encounter the “This call has not been granted” error:

  • You didn’t assign the correct permissions to your token at the time of generation.
  • The API key being used is missing access rights for the specific method and endpoint, such as when trying to add a DNS record using the OVH API.
  • You may have misconfigured the application credentials (Application Key, Secret, and Consumer Key).
  • You’re using expired or invalid tokens.
  • Your OVH account has restricted API access due to security settings or user roles.
  • If you’re running requests in a Docker container, restarting might be necessary after changing credentials. (https://bobcares.com/blog/ovh-bridge-network-setup/)

Ultimately, this does seem to be a problem with credentials, either not configured properly or missing required rights.

How to Fix The Error

You can grant the required access when generating your token in two ways:

  1. Using the UI

Go to: https://www.ovh.com/auth/api/createToken

In the Rights section, you must define the API paths and methods. Regex functionality is available. For example:

  • Method: GET
  • Path: /cloud*

This configuration allows all GET requests under the /cloud path, including /cloud/project/{project_id}/image.

  1. Using cURL

If you’re generating the token programmatically, follow this structure:

$ curl -X POST \
-H "X-Ovh-Application: <application_key>" \
-H "Content-type: application/json" \
https://eu.api.ovh.com/1.0/auth/credential \
-d '{
"accessRules": [
{
"method": "GET",
"path": "/cloud*"
},
{
"method": "POST",
"path": "/cloud*"
},
],
"redirection": "https://ovhcloud.com/"
}'

Make sure to replace <application_key> with your actual key. This setup grants GET and POST access to all /cloud* endpoints.

Additional Checks

  • Launch Fiddler before opening Visual Studio if you’re using it for debugging.
  • Check your API key’s permissions in the OVH control panel to ensure they match the actions you’re performing.
  • If your user account has limited privileges, adjust your settings in the OVH console to allow API access.
  • Running in Docker? Restart your container after changing your AK, AS, or CK. Many users resolved the issue this way.

[If needed, Our team is available 24/7 for additional assistance.]

Conclusion

The “This call has not been granted” error is almost always caused by incorrect access configuration. Assign the right route and method permissions when generating your token to resolve it.