👶Creating a User

This step shows how to create Groups users via GroupsAPI

Below is a list of available parameters when creating a user.

Parameter
Type
Required
Default
Description

name

string

Yes

n/a

Name of the user

surname

string

Yes

n/a

Surname of the user

email

string

Yes

n/a

Email of the user

username

string

Yes

n/a

Username of the user

role

string

No

u

Role of the user(see)

psd

string

No

null

Password of the user

mobile

string

No

null

Mobile of the user

login_allowed

bool

No

true

Flag if the login is allowed

active

bool

No

true

Flag if the user is active

lang

string

No

tr-TR

Language of the user(see). This option modifies: session interface, panel interface and mails.

timezone

string

No

Europe/Istanbul

Timezone of the user(see) This option modifies: how the user sees sessions' hours.

expires_at

string

No

null

Date which the user will expire(see)

Example request

curl -L -X POST 'https://<DOMAIN>/xapi/v2/user' \
-H 'Content-Type: application/json' \
--data-raw '{
    "name": "John",
    "surname": "Doe",
    "username": "johndoe",
    "email": "[email protected]"
}'

Example response

You must securely store the USER_GUID to perform other operations for the user.

A successful create operation will return 201 Created with body including the following information:

{
  "user_guid": "6D9D158D-5A41-4FE5-A151-DE008BC978DE",
  "name": "John",
  "surname": "Doe",
  "username": "johndoe",
  "email": "[email protected]",
  "role": "u",
  "mobile": null,
  "login_allowed": true,
  "status": 1,
  "lang": "en-US",
  "timezone": "Europe/Istanbul",
  "expires_at": null,
  "creation_date": null,
  "updating_date": null
}

Last updated

Was this helpful?