API

Create user

POST/api/crm/v2/team.add_userv2
operationId: team.addUser

Creates a user. The partner mode creates a user in the partner account with any role except owner. The affiliate mode creates a user in the affiliate account with any role except owner. The created record is returned in data.row.list[0].

Authorization

api-token + language + role

Request body multipart/form-data

oneOf
One of the options
object (TeamAddUserPartner)

Mode partner, multipart/form-data. Errors: 328 — invalid email format, 110 — password is shorter than 6 characters.

firm_permission_role_idsarray of integerrequired

User roles, at least one; any role except owner

emailstring · emailrequired

Example: user@fs.pro

passwordstringrequired

Example: qwerty123

phone_format_idinteger (PhoneFormatId) required

Country code: 1-🇷🇺(+7|8), 2-🇦🇿(+994|0), 3-🇧🇾(+375|80), 4-🇰🇿(+7|8), 6-🇷🇸(+381|0), 7-🇹🇷(+90|0), 8-🇺🇦(+380|0), 9-🇵🇹(+351|0), 10-🇰🇬(+996|0), 11-🇺🇸(+1), 12-🇫🇷(+33|0), 13-🇲🇩(+373|0), 15-🇪🇪(+372), 18-🇬🇪(+995), 19-🇺🇿(+998), 22-🇵🇱(+48|0), 23-🇹🇯(+992|8), 25-🇷🇴(+40|0), 44-🇨🇭(+41|0)

Example: 1

phone_numberstringrequired

Example: 9999999999

telegram_user_idstringcan be null

Digits only; an empty value is saved as NULL

Example: 476962294

timezonestringrequired

Example: Europe/Kaliningrad

languagestringrequired

Example: ru

namestringcan be null

Example: John Smith

photostring · binary

Responses

OK

object
statusstringrequired

Values:successerror

Example: success

dataobject
rowobject
listarray of oneOf
oneOf
One of the options
object (TeamUserPartnerFull)

Mode partner, full user record (GET /team?id=)

idintegerrequired

Example: 1

blockedbooleanrequired

Example: false

date_creationstring (DataTimeFormatSQL)

Example: 2024-05-02 08:31:16

namestringcan be null

Example: John Smith

photostringcan be null

Example: data:image/jpeg;base64,/9j/4AAQSkZJRg...

emailstringrequired

Example: operator@fs.pro

phone_format_idinteger (PhoneFormatId)

Country code: 1-🇷🇺(+7|8), 2-🇦🇿(+994|0), 3-🇧🇾(+375|80), 4-🇰🇿(+7|8), 6-🇷🇸(+381|0), 7-🇹🇷(+90|0), 8-🇺🇦(+380|0), 9-🇵🇹(+351|0), 10-🇰🇬(+996|0), 11-🇺🇸(+1), 12-🇫🇷(+33|0), 13-🇲🇩(+373|0), 15-🇪🇪(+372), 18-🇬🇪(+995), 19-🇺🇿(+998), 22-🇵🇱(+48|0), 23-🇹🇯(+992|8), 25-🇷🇴(+40|0), 44-🇨🇭(+41|0)

Example: 1

phone_numberstring

Example: 9999999999

telegram_user_idstringcan be null

Example: 476962294

otp_enabledboolean

Example: false

timezonestring

Example: Europe/Kaliningrad

languagestring

Example: ru

permission_rolesarray of objectrequired

All user roles, sorted by role id

idintegerrequired

Example: 5

namestringrequired

Role name from the roles directory; value set is open

Example: head_of_sales

bound_settingsarray of stringcan be null
can_toggle_blockbooleanrequired

The block toggle is available in this row to the current user; the rule is determined by the server, do not infer it from role names

Example: true

can_manage_sessionsbooleanrequired

The current user can view and close sessions of this entry

Example: false