POST
/
iam
/
users
Create a new user
curl --request POST \
  --url https://api.gcore.com/iam/users \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "email": "jsmith@example.com",
  "password": "<string>",
  "company": "<string>",
  "user_type": "common",
  "name": "<string>",
  "phone": "<string>",
  "seller": 123,
  "services": [
    {
      "product_name": "CDN",
      "available": true
    }
  ],
  "lang": "de",
  "custom_id": "<string>",
  "country_code": "<string>",
  "is_test": true
}'
{
  "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

Body

application/json
email
string<email>
required

User's email address. This address will be used as client's email address by default.

password
string<password>
required

User's password.

company
string
required

Client's company name.

user_type
enum<string>

User's type. It must be common.

Available options:
common
name
string

User's name. This name will be used as client's name by default.

phone
string

User's phone number. This phone will be used as client's phone by default.

seller
integer

Client's seller ID.

services
object[]

Specify products if you want to override default product availability for this client.

null – the product will inherit the default availability for this product. true – set personal availability for a client as available. Please be informed that product will not be enabled for a client until you enable it and change the service status. false – set personal availability for a client as unavailable.

lang
enum<string>

Language code.

Available options:
de,
en,
ru,
zh,
az
custom_id
string

Client's custom ID. You can use this field for your internal identification.

country_code
string

Client's country code.

is_test
boolean

System field:

  • true — a test account;
  • false — a production 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.