POST
/
cloud
/
v1
/
users
/
assignments
import os
from gcore import Gcore

client = Gcore(
    api_key=os.environ.get("GCORE_API_KEY"),  # This is the default and can be omitted
)
role_assignment = client.cloud.users.role_assignments.create(
    role="ClientAdministrator",
    user_id=777,
)
print(role_assignment.id)
{
  "assigned_by": 123,
  "client_id": 123,
  "created_at": "2019-06-25T08:42:42Z",
  "id": 12,
  "project_id": 123,
  "role": "ClientAdministrator",
  "updated_at": "2019-06-25T08:42:42Z",
  "user_id": 123
}

Authorizations

APIKey
string
header
required

API key for authentication.

Body

application/json

Response

200 - application/json

OK

The response is of type object.