Jump toUpdate content

How to create API keys

Reviewed on 09 June 2022Published on 20 June 2022

API keys are unique identifiers necessary to use the Scaleway API. You can generate API keys for yourself or for an IAM application via the Scaleway console. Each API key is scoped to one Organization only (so if you are part of multiple Organizations, you will need a different API key for each one). Each user and application can have multiple API keys in each Organization.

API keys always inherit the permissions of their bearer (the IAM user or IAM application with which they are associated), giving that bearer the exact rights and permissions that have been defined for them in the Organization via policies.

Important:
  • You can only generate API keys for yourself, and for IAM applications. You cannot generate API keys for other IAM users, regardless of your permissions.
  • You can attach API keys to your own user to test and access your infrastructure, but we do not recommend this for all use cases.
Tip:

If you plan to create API keys that will be used for a long period of time, in production for example, we recommend that you use applications as the bearers of these API keys. This way, the API keys are linked to non-human users, and are under no risk of leaving or being removed from the Organization.

Requirements:

How to generate an API key for yourself

  1. Click Identity and Access Management (IAM) from the top-right of your Organization Dashboard in the Scaleway console. The Users tab of the Identity and Access Management dashboard displays.

  2. Click your name in the list of users. You are taken to your user dashboard.

  3. Click the Credentials tab. The following screen displays:

  4. Click the «Plus Icon» button to generate a new API key. The following screen pops up:

  5. Enter an optional description for your API key, and select a preferred Project for Object Storage.

    Note:

    Preferred Projects for Object Storage - When creating and/or listing Object Storage buckets via the API, there is no available parameter to specify the Project in which you wish to list or create buckets. All buckets you create via the API will therefore be created in the preferred Project you choose when creating the API key. Similarly, when listing buckets, buckets from your preferred Project will be listed. Note that:

    • This only applies to the creation and/or listing of Object Storage buckets, and no other products or resources.
    • You can still create and/or list buckets in your Project of choice via the Scaleway console.
  6. Click Generate API Key. A screen displays showing the access key and secret key for your new API key and reminding you that this is your only chance to securely save the secret key:

  7. Ensure you have securely saved the secret key, then close the window. You are returned to the Credentials tab, where your new API key now appears in the list.

How to create an API key for an IAM application

Requirements:
  1. Click Identity and Access Management (IAM) from the top-right of your Organization Dashboard in the Scaleway console. The Users tab of the Identity and Access Management dashboard displays.

  2. Click the Applications tab. A list of the Organization’s IAM applications displays.

  3. Click the name of the application you want to create an API key for. Alternatively, click «See more Icon» next to the application, and select Overview. Either way, you are taken to the application’s Overview tab.

    Requirements:

    Follow this procedure to create an application, if you have not created one yet.

  4. Click the API keys tab.

  5. Click the «Plus Icon» button to generate a new API key. The API key creation wizard displays:

  6. Complete the information in the wizard as described in step 5 above.

  7. Click Generate API Key. A screen displays showing the access key and secret key for the new API key and reminding you that this is your only chance to securely save the secret key:

  8. Ensure you have securely saved the secret key, then close the window. You are returned to the API keys tab, where the new API key now appears in the list.

See Also