Event onUserAdd
Scope:
basicWho can subscribe: any user
The onUserAdd event is triggered when a user is added to Bitrix24. The event occurs not after the invitation, but after the user logs into the account and completes the registration process.
Events will not be sent to the application until the installation is complete. Check the application installation
What the handler receives
Data is transmitted as a POST request
{
"event": "ONUSERADD",
"data": {
"ID": 123,
"ACTIVE": "Y",
"EMAIL": "user@example.com",
"NAME": "John",
"LAST_NAME": "Doe",
"PERSONAL_GENDER": "M",
"PERSONAL_BIRTHDAY": "1990-01-01",
"UF_DEPARTMENT": [1, 2],
"DATE_REGISTER": "2024-04-05T10:00:00+02:00",
"WORK_POSITION": "Developer",
"UF_EMPLOYMENT_DATE": "2024-04-05"
},
"ts": "1466439714",
"auth": {
"domain": "some-domain.bitrix24.com",
"server_endpoint": "https://oauth.bitrix.info/rest/",
"client_endpoint": "https://some-domain.bitrix24.com/rest/",
"member_id": "a223c6b3710f85df22e9377d6c4f7553"
}
}
Request parameters
Required parameters are marked with *
|
Name |
Description |
|
event* |
Symbolic event code — |
|
data* |
Data of the added user. The structure is described below |
|
ts* |
Date and time the event was sent |
|
auth* |
Authorization and account data. The structure is described below |
Parameter data
Required parameters are marked with *
|
Name |
Description |
|
ID* |
User identifier |
|
ACTIVE* |
Active flag. Possible values:
|
|
EMAIL |
User's email |
|
NAME |
User's first name |
|
LAST_NAME |
User's last name |
|
PERSONAL_GENDER |
Gender: |
|
PERSONAL_BIRTHDAY |
Date of birth in |
|
Array of department |
|
|
DATE_REGISTER* |
Registration date in |
|
WORK_POSITION |
User's job title |
|
UF_EMPLOYMENT_DATE |
Employment date in |
Some fields may be absent or have a value of null if the application does not have access to them.
Parameter auth
Required parameters are marked with *
|
Name |
Description |
|
access_token* |
Token for accessing the API |
|
expires_in* |
Time in seconds until the token expires |
|
scope* |
Scope under which the event occurred |
|
domain* |
Bitrix24 address where the event occurred |
|
server_endpoint* |
Bitrix24 authorization server address needed for refreshing OAuth 2.0 tokens |
|
status* |
Status of the application that subscribed to this event:
|
|
client_endpoint* |
Common path for API method calls for Bitrix24 where the event occurred |
|
member_id* |
Identifier of Bitrix24 where the event occurred |
|
refresh_token* |
Token for renewing authorization OAuth 2.0 |
|
application_token* |
Token for secure event processing |
Continue your exploration
- Event Handler
- Register a new event handler event.bind
- Event After Successful Application Installation OnAppInstall
- Event on Application Payment onAppPayment
- Event on Receiving Permission for Using onAppMethodConfirm Methods
- Event on Application Uninstallation: onAppUninstall