Scaleway logo
IAM API

Policies control user rights, by defining one or more rules to apply to the attached principals (users, groups or applications). A policy rule has two parts:\ permission set and scope.

For each policy rule, you specify one or more permission sets (eg. “list all Instances”) and their scope (eg. “on Project A only”). This therefore defines the actions that the principles can carry out on resources within the scope.


List policies of an Organization

GET
https://api.scaleway.com
/iam/v1alpha1/policies

List the policies of an Organization. By default, the policies listed are ordered by creation date in ascending order. This can be modified via the order_by field. You must define the organization_id in the query path of your request. You can also define additional parameters to filter your query, such as user_ids, groups_ids, application_ids, and policy_name.

List policies of an Organization › query Parameters

Criteria for sorting results.

Enum values:
policy_name_asc
policy_name_desc
created_at_asc
created_at_desc
Default: policy_name_asc
page_size
​integer · uint32

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

page
​integer · int32

Page number. Value must be greater than 1.

organization_id
​string

ID of the Organization to filter.

editable
​boolean

Defines whether or not filter out editable policies.

user_ids
​string[]

Defines whether or not to filter by list of user IDs.

group_ids
​string[]

Defines whether or not to filter by list of group IDs.

application_ids
​string[]

Filter by a list of application IDs.

no_principal
​boolean

Defines whether or not the policy is attributed to a principal.

policy_name
​string

Name of the policy to fetch.

tag
​string

Filter by tags containing a given string.

policy_ids
​string[]

Filter by a list of IDs.

List policies of an Organization › Responses

200

List of policies.

total_count
​integer · uint32

Total count of policies.


Create a new policy

POST
https://api.scaleway.com
/iam/v1alpha1/policies

Create a new application. You must define the name parameter in the request. You can specify parameters such as user_id, groups_id, application_id, no_principal, rules and its child attributes.

Create a new policy › Request Body

name
​string · required

Name of the policy to create (max length is 64 characters).

description
​string

Description of the policy to create (max length is 200 characters).

organization_id
​string

ID of the Organization.

Rules of the policy to create.

tags
​string[]

Tags associated with the policy (maximum of 10 tags).

user_id
​string | null

ID of user attributed to the policy.

group_id
​string | null

ID of group attributed to the policy.

application_id
​string | null

ID of application attributed to the policy.

no_principal
​boolean | null

Defines whether or not a policy is attributed to a principal.

Create a new policy › Responses

200
id
​string

Id of the policy.

name
​string

Name of the policy.

description
​string

Description of the policy.

organization_id
​string

Organization ID of the policy.

created_at
​string | null · date-time

Date and time of policy creation. (RFC 3339 format)

updated_at
​string | null · date-time

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

editable
​boolean

Defines whether or not a policy is editable.

deletable
​boolean

Defines whether or not a policy is deletable.

managed
​boolean

Defines whether or not a policy is managed.

nb_rules
​integer · uint32

Number of rules of the policy.

nb_scopes
​integer · uint32

Number of policy scopes.

nb_permission_sets
​integer · uint32

Number of permission sets of the policy.

tags
​string[]

Tags associated with the policy.

user_id
​string | null

ID of the user attributed to the policy.

group_id
​string | null

ID of the group attributed to the policy.

application_id
​string | null

ID of the application attributed to the policy.

no_principal
​boolean | null

Defines whether or not a policy is attributed to a principal.

srn
​string

The SRN of the policy.


Get an existing policy

GET
https://api.scaleway.com
/iam/v1alpha1/policies/{policy_id}

Retrieve information about a policy, specified by the policy_id parameter. The policy's full details, including id, name, organization_id, nb_rules and nb_scopes, nb_permission_sets are returned in the response.

Get an existing policy › path Parameters

policy_id
​string · required

Id of policy to search.

Get an existing policy › Responses

200
id
​string

Id of the policy.

name
​string

Name of the policy.

description
​string

Description of the policy.

organization_id
​string

Organization ID of the policy.

created_at
​string | null · date-time

Date and time of policy creation. (RFC 3339 format)

updated_at
​string | null · date-time

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

editable
​boolean

Defines whether or not a policy is editable.

deletable
​boolean

Defines whether or not a policy is deletable.

managed
​boolean

Defines whether or not a policy is managed.

nb_rules
​integer · uint32

Number of rules of the policy.

nb_scopes
​integer · uint32

Number of policy scopes.

nb_permission_sets
​integer · uint32

Number of permission sets of the policy.

tags
​string[]

Tags associated with the policy.

user_id
​string | null

ID of the user attributed to the policy.

group_id
​string | null

ID of the group attributed to the policy.

application_id
​string | null

ID of the application attributed to the policy.

no_principal
​boolean | null

Defines whether or not a policy is attributed to a principal.

srn
​string

The SRN of the policy.


Delete a policy

DELETE
https://api.scaleway.com
/iam/v1alpha1/policies/{policy_id}

Delete a policy. You must define specify the policy_id parameter in your request. Note that when deleting a policy, all permissions it gives to its principal (user, group or application) will be revoked.

Delete a policy › path Parameters

policy_id
​string · required

Id of policy to delete.

Delete a policy › Responses

No data returned

Update an existing policy

PATCH
https://api.scaleway.com
/iam/v1alpha1/policies/{policy_id}

Update the parameters of a policy, including name, description, user_id, group_id, application_id and no_principal.

Update an existing policy › path Parameters

policy_id
​string · required

Id of policy to update.

Update an existing policy › Request Body

name
​string | null

New name for the policy (max length is 64 characters).

description
​string | null

New description of policy (max length is 200 characters).

tags
​array | null

New tags for the policy (maximum of 10 tags).

user_id
​string | null

New ID of user attributed to the policy.

group_id
​string | null

New ID of group attributed to the policy.

application_id
​string | null

New ID of application attributed to the policy.

no_principal
​boolean | null

Defines whether or not the policy is attributed to a principal.

Update an existing policy › Responses

200
id
​string

Id of the policy.

name
​string

Name of the policy.

description
​string

Description of the policy.

organization_id
​string

Organization ID of the policy.

created_at
​string | null · date-time

Date and time of policy creation. (RFC 3339 format)

updated_at
​string | null · date-time

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

editable
​boolean

Defines whether or not a policy is editable.

deletable
​boolean

Defines whether or not a policy is deletable.

managed
​boolean

Defines whether or not a policy is managed.

nb_rules
​integer · uint32

Number of rules of the policy.

nb_scopes
​integer · uint32

Number of policy scopes.

nb_permission_sets
​integer · uint32

Number of permission sets of the policy.

tags
​string[]

Tags associated with the policy.

user_id
​string | null

ID of the user attributed to the policy.

group_id
​string | null

ID of the group attributed to the policy.

application_id
​string | null

ID of the application attributed to the policy.

no_principal
​boolean | null

Defines whether or not a policy is attributed to a principal.

srn
​string

The SRN of the policy.


Clone a policy

POST
https://api.scaleway.com
/iam/v1alpha1/policies/{policy_id}/clone

Clone a policy. You must define specify the policy_id parameter in your request.

Clone a policy › path Parameters

policy_id
​string · required

Clone a policy › Request Body

Clone a policy › Responses

200
id
​string

Id of the policy.

name
​string

Name of the policy.

description
​string

Description of the policy.

organization_id
​string

Organization ID of the policy.

created_at
​string | null · date-time

Date and time of policy creation. (RFC 3339 format)

updated_at
​string | null · date-time

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

editable
​boolean

Defines whether or not a policy is editable.

deletable
​boolean

Defines whether or not a policy is deletable.

managed
​boolean

Defines whether or not a policy is managed.

nb_rules
​integer · uint32

Number of rules of the policy.

nb_scopes
​integer · uint32

Number of policy scopes.

nb_permission_sets
​integer · uint32

Number of permission sets of the policy.

tags
​string[]

Tags associated with the policy.

user_id
​string | null

ID of the user attributed to the policy.

group_id
​string | null

ID of the group attributed to the policy.

application_id
​string | null

ID of the application attributed to the policy.

no_principal
​boolean | null

Defines whether or not a policy is attributed to a principal.

srn
​string

The SRN of the policy.