For AI agents: the complete documentation index is available at https://docs.dataplatform.ovh.net/llms.txt, the full documentation bundle is available at https://docs.dataplatform.ovh.net/llms-full.txt, and this page is available as Markdown at https://docs.dataplatform.ovh.net/tutorials-generate-api-keys.md.
  • 🇬🇧 English
  • Generate API and secret keys for a user / service account

    If you want to connect to the Data Platform from outside of the platform, you will need to generate API and secret keys to authenticate

    Objective

    If you want to connect to the Data Platform from outside of the platform, you will need to generate API and secret keys to authenticate. The API key is the public key associated to the user who is connecting to an API. The secret key is the private key known only to the user. The combination of the two is used to authenticate, through the generation of temporary authentication tokens.

    API and secret keys can be generated per user or service account.

    Generate a new set of API and secret keys

    For a user

    Navigate to the Users tab of the Identity Access Manager. Search for the user for which you want to generate API & Secret keys, using the search bar on the top right if needed. Edit the user.

    For a user — Users search

    In the user's settings, scroll down to the API Access panel and click on Add access.

    For a user — Users api key

    Select the lifetime of the keys (i.e. the expiration date from today) and whether you want to send an email to the user with the API & secret key information. Then press Create.

    Info

    The Default value can be changed in your Identity Access Manager settings.

    For a user — Users api key options

    A new window will open with the API and secret key values.

    Warning

    After closing the window, there is no way to view the secret key again. Make sure you keep a record a the keys either by sending an email to the user or storing them in your code.

    For a user — Users api key confirmation

    To delete a key, hover over the key that you would like to delete and click on the trash 🗑️ icon. Once the key is deleted, the credentials for the keys will become inactive and cannot be use to authenticate anymore.

    For a user — Users api key deleting

    For a service account

    Navigate to the Service Accounts tab of the Identity Access Manager. Search for the service account for which you want to generate API & Secret keys, using the search bar on the top-right if needed.

    For a service account — Sa search

    In the service account settings, locate the API Access panel and click on Add access.

    For a service account — Sa api key

    After that, the process is the same as for users. Note that if you want to send an email with a record of the API and secret keys, you need to fill in an email address for the service account.

    For a service account — Sa email

    Generate an authentication token

    Generation scripts

    Once you've created API & secret keys, you need to generate a dynamic authentication token in order to authenticate to Data Platform via an API endpoint. Authentication tokens are only active for a short time: this duration can be configured in your IAM settings.

    Generation scripts — Token settings

    To generate a token, simply run the command samples below.

    cURL
    Python 3+
    curl --request POST \
      --url https://{project_subdomain}.eu.dataplatform.ovh.net/iam/login \
      --header 'Content-Type: application/json' \
      --data '{
        "auth_mode": "apikey",
        "apikey": "",
        "secretkey": ""
      }'
    Warning

    Make to update the {project_subdomain} else your calls won't go through.

    How to find your Project subdomain.

    Go further

    If you need training or technical assistance to implement our solutions, contact your sales representative or click on this link to get a quote and ask our Professional Services experts for a custom analysis of your project.

    Ask questions, give your feedback and interact directly with the team building the Data Platform on the dedicated Discord channel.

    If you need support with your OVHcloud services, create a request in our Help Centre.

    Join our community of users.