PATCH
/
iam
/
users
/
{userId}
Python
from gcore import Gcore

client = Gcore(
    api_key="My API Key",
)
user_update = client.iam.users.update(
    user_id=0,
)
print(user_update.id)
{
  "id": 123,
  "email": "jsmith@example.com",
  "name": "<string>",
  "lang": "de",
  "phone": "<string>",
  "company": "<string>",
  "reseller": 123,
  "client": 123,
  "deleted": true,
  "groups": [
    {
      "id": 1,
      "name": "Administrators"
    }
  ],
  "activated": true,
  "sso_auth": true,
  "two_fa": true,
  "auth_types": [
    "password"
  ],
  "user_type": "common",
  "is_active": true,
  "client_and_roles": [
    {
      "client_id": 123,
      "client_company_name": "<string>",
      "user_roles": [
        "2"
      ],
      "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

Path Parameters

userId
integer
required

User's ID.

Body

application/json
email
string<email>

User's email address.

name
string | null

User's name.

lang
enum<string>

User's language.

Defines language of the control panel and email messages.

Available options:
de,
en,
ru,
zh,
az
phone
string | null

User's phone.

company
string

User's company.

groups
object[]

User's group in the current account.

IAM supports 5 groups:

  • Users
  • Administrators
  • Engineers
  • Purge and Prefetch only (API)
  • Purge and Prefetch only (API+Web)
auth_types
enum<string>[]

System field. List of auth types available for the account.

Response

OK.

id
integer

User's ID.

email
string<email>

User's email address.

name
string | null

User's name.

lang
enum<string>

User's language.

Defines language of the control panel and email messages.

Available options:
de,
en,
ru,
zh,
az
phone
string | null

User's phone.

company
string

User's company.

reseller
integer

Services provider ID.

client
number

User's account ID.

deleted
boolean

Deletion flag. If true then user was deleted.

groups
object[]

User's group in the current account.

IAM supports 5 groups:

  • Users
  • Administrators
  • Engineers
  • Purge and Prefetch only (API)
  • Purge and Prefetch only (API+Web)
activated
boolean

Email confirmation:

  • true – user confirmed the email;
  • false – user did not confirm the email.
sso_auth
boolean

SSO authentication flag. If true then user can login via SAML SSO.

two_fa
boolean

Two-step verification:

  • true – user enabled two-step verification;
  • false – user disabled two-step verification.
auth_types
enum<string>[]

System field. List of auth types available for the account.

user_type
enum<string>

User's type.

Available options:
common,
reseller,
seller
is_active
boolean

User activity flag.

client_and_roles
object[]

List of user's clients. User can access to one or more clients.