Scaleway logo
IAM API

An API key is a unique identifier, used to authenticate requests made to the Scaleway API. An API key consists of an access key and a secret key. The access key is like a unique ID or username, and not a sensitive piece of information. The secret key however is more sensitive, as it is like a password to authenticate the access key.

Previously, an API key was associated with a single Scaleway ProjectOpen in new context. The API key therefore had full read/write access to all resources on this Project, and only this Project.

With IAM, an API key is now associated with an IAM userOpen in new context or applicationOpen in new context. This allows fine-grained access to be defined for the IAM user bearing the API key across different Organizations, Projects, and resources.


List API keys

GET
https://api.scaleway.com
/iam/v1alpha1/api-keys

List API keys. By default, the API keys listed are ordered by creation date in ascending order. This can be modified via the order_by field. You can define additional parameters for your query such as editable, expired, access_key and bearer_id.

List API keys › query Parameters

order_by
​scaleway.iam.v1alpha1.ListAPIKeysRequest.OrderBy · enum

Criteria for sorting results.

Enum values:
created_at_asc
created_at_desc
updated_at_asc
updated_at_desc
expires_at_asc
expires_at_desc
access_key_asc
access_key_desc
Default: created_at_asc
page
​integer · int32

Page number. Value must be greater or equal to 1.

page_size
​integer · uint32

Number of results per page. Value must be between 1 and 100.

organization_id
​string

ID of Organization.

editable
​boolean

Defines whether to filter out editable API keys or not.

expired
​boolean

Defines whether to filter out expired API keys or not.

access_key
​string · deprecated

Filter by access key (deprecated in favor of access_keys).

description
​string

Filter by description.

bearer_id
​string

Filter by bearer ID.

bearer_type
​scaleway.iam.v1alpha1.BearerType · enum

Filter by type of bearer.

Enum values:
unknown_bearer_type
user
application
Default: unknown_bearer_type
access_keys
​string[]

Filter by a list of access keys.

List API keys › Responses

200

List of API keys.

total_count
​integer · uint32

Total count of API Keys.


Create an API key

POST
https://api.scaleway.com
/iam/v1alpha1/api-keys

Create an API key. You must specify the application_id or the user_id and the description. You can also specify the default_project_id, which is the Project ID of your preferred Project, to use with Object Storage. The access_key and secret_key values are returned in the response. Note that the secret key is only shown once. Make sure that you copy and store both keys somewhere safe.

Create an API key › Request Body

application_id
​string | null

ID of the application.

user_id
​string | null

ID of the user.

expires_at
​string | null · date-time

Expiration date of the API key. (RFC 3339 format)

default_project_id
​string | null

Default Project ID to use with Object Storage.

description
​string

Description of the API key (max length is 200 characters).

Create an API key › Responses

200
access_key
​string

Access key of the API key.

secret_key
​string | null

Secret key of the API Key.

application_id
​string | null

ID of application that bears the API key.

user_id
​string | null

ID of user that bears the API key.

description
​string

Description of API key.

created_at
​string | null · date-time

Date and time of API key creation. (RFC 3339 format)

updated_at
​string | null · date-time

Date and time of last API key update. (RFC 3339 format)

expires_at
​string | null · date-time

Date and time of API key expiration. (RFC 3339 format)

default_project_id
​string

Default Project ID specified for this API key.

editable
​boolean

Defines whether or not the API key is editable.

deletable
​boolean

Defines whether or not the API key is deletable.

managed
​boolean

Defines whether or not the API key is managed.

creation_ip
​string

IP address of the device that created the API key.

srn
​string

The SRN of the API key.


Get an API key

GET
https://api.scaleway.com
/iam/v1alpha1/api-keys/{access_key}

Retrieve information about an API key, specified by the access_key parameter. The API key's details, including either the user_id or application_id of its bearer are returned in the response. Note that the string value for the secret_key is nullable, and therefore is not displayed in the response. The secret_key value is only displayed upon API key creation.

Get an API key › path Parameters

access_key
​string · required

Access key to search for.

Get an API key › Responses

200
access_key
​string

Access key of the API key.

secret_key
​string | null

Secret key of the API Key.

application_id
​string | null

ID of application that bears the API key.

user_id
​string | null

ID of user that bears the API key.

description
​string

Description of API key.

created_at
​string | null · date-time

Date and time of API key creation. (RFC 3339 format)

updated_at
​string | null · date-time

Date and time of last API key update. (RFC 3339 format)

expires_at
​string | null · date-time

Date and time of API key expiration. (RFC 3339 format)

default_project_id
​string

Default Project ID specified for this API key.

editable
​boolean

Defines whether or not the API key is editable.

deletable
​boolean

Defines whether or not the API key is deletable.

managed
​boolean

Defines whether or not the API key is managed.

creation_ip
​string

IP address of the device that created the API key.

srn
​string

The SRN of the API key.


Delete an API key

DELETE
https://api.scaleway.com
/iam/v1alpha1/api-keys/{access_key}

Delete an API key. Note that this action is irreversible and cannot be undone. Make sure you update any configurations using the API keys you delete.

Delete an API key › path Parameters

access_key
​string · required

Access key to delete.

Delete an API key › Responses

No data returned

Update an API key

PATCH
https://api.scaleway.com
/iam/v1alpha1/api-keys/{access_key}

Update the parameters of an API key, including default_project_id and description.

Update an API key › path Parameters

access_key
​string · required

Access key to update.

Update an API key › Request Body

default_project_id
​string | null

New default Project ID to set.

description
​string | null

New description to update.

expires_at
​string | null · date-time

New expiration date of the API key. (RFC 3339 format)

Update an API key › Responses

200
access_key
​string

Access key of the API key.

secret_key
​string | null

Secret key of the API Key.

application_id
​string | null

ID of application that bears the API key.

user_id
​string | null

ID of user that bears the API key.

description
​string

Description of API key.

created_at
​string | null · date-time

Date and time of API key creation. (RFC 3339 format)

updated_at
​string | null · date-time

Date and time of last API key update. (RFC 3339 format)

expires_at
​string | null · date-time

Date and time of API key expiration. (RFC 3339 format)

default_project_id
​string

Default Project ID specified for this API key.

editable
​boolean

Defines whether or not the API key is editable.

deletable
​boolean

Defines whether or not the API key is deletable.

managed
​boolean

Defines whether or not the API key is managed.

creation_ip
​string

IP address of the device that created the API key.

srn
​string

The SRN of the API key.