Skip to main content
POST
/
cloud
/
v1
/
users
/
assignments
Create role assignment
curl --request POST \
  --url https://api.gcore.com/cloud/v1/users/assignments \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "user_id": 777,
  "client_id": 8,
  "project_id": null
}
'
{
  "assigned_by": 123,
  "client_id": 123,
  "created_at": "2019-06-25T08:42:42Z",
  "id": 12,
  "project_id": 123,
  "updated_at": "2019-06-25T08:42:42Z",
  "user_id": 123
}

Authorizations

Authorization
string
header
required

API key for authentication. Make sure to include the word apikey, followed by a single space and then your token. Example: apikey 1234$abcdef

Body

application/json
role
enum<string>
required

User role

Available options:
ClientAdministrator,
InternalNetworkOnlyUser,
Observer,
ProjectAdministrator,
User
Example:

"ClientAdministrator"

user_id
integer
required

User ID

Example:

777

client_id
integer | null

Client ID. Required if project_id is specified

Example:

8

project_id
integer | null

Project ID

Example:

null

Response

200 - application/json

OK

assigned_by
integer | null
required
client_id
integer
required

Client ID

Example:

123

created_at
string<date-time>
required

Created timestamp

Example:

"2019-06-25T08:42:42Z"

id
integer
required

Assignment ID

Example:

12

project_id
integer | null
required

Project ID

Example:

123

role
enum<string>
required

User role

Available options:
ClientAdministrator,
InternalNetworkOnlyUser,
Observer,
ProjectAdministrator,
User
Example:

"ClientAdministrator"

updated_at
string<date-time> | null
required

Updated timestamp

Example:

"2019-06-25T08:42:42Z"

user_id
integer
required

User ID

Example:

123