Creates or updates multiple users based on the received data.
The provided tags will be added to existing users.
Attention: The importing process will enqueue an async job that might take some minutes to get executed. You may check the import progress by including `include=progress` in the request params.
You can add 1500 user records per user importer.
> A very common error is to get the response after making this POST request and think that the user is created instantly.
The users will only be imported when the user_importer.state = 'done'
You may check errors on user_importer.import_errors and calling user_importer_items endpoint with the param with_errors=true
By default, the importer finds a given user by email. If you want to find a user by CPF or username, you should send the field user_login
Note that, if you send CPF and email without user_login (which defaults to email), the importer will find or create the user with the email, and it will update the CPF. If you send user_login = 'cpf', the importer will find or create the user with the CPF, and it will update the field email and username. If you send user_login = 'username', the importer will find or create the user with the username, and it will update the field email and CPF.
A common mistake it to send cpf: “xxxxxxxxx”, email: “” without sending user_login. You may get the error that the that CPF is already being used for another user. In that case, user user_login: “cpf” and don't send the email field.
The consequences of inactivating a contract are:
Users can't interact with it. For instance: sending feedback, answering a review, answering a 1:1, etc.
Users can, though, see data from past interactions, such as received feedbacks or reviews.
Contract is removed from shared objectives
Feedback requests sent by contract are inactivated
Contract is removed from all teams
Contract is removed as supervisor of other contracts
Pulse survey participations are inactivated
Note that none of those actions will be reversed if you reactivate the contract.
***
If you need to sync custom attributes, like “t-shirt size”, you may use Custom Contract Fields.
If you need to get them programmatically, follow the steps on this article to get each field key: help.qulture.rocks/pt-BR/articles/4075294-api-da-plataforma-beta
Otherwise, you may access the Platform as a company editor (or ask HR) -> Company profile -> User Importers, and click on “Export Template”. That spreadsheet has all the available fields. For the custom fields, just copy the key in the header.
After that, you may send the key's value as you key.
E.G. for the following ContractField:
“contractField”: {
"name": "T-Shirt size", "key": "add55b58-3640-4ad8-aba2-b118b6e6472c"
}
you may add to your post payload:
“data”: [
{
"name": "joao",
"active": true,
"email": "joao@example.com.br",
"add55b58-3640-4ad8-aba2-b118b6e6472c": "SMALL"
}
This importer was built to receive many users at a time, so we recommend sending all your users in one importer. By doing so, you only need to control one enpoint and wait it to be finished in order to check for errors.
| Code | Descrição | Metadata |
|---|---|---|
| 401 | Unauthorized - Returned when token is invalid | :error: You are not authorized to perform this action |
| 400 | Bad Request - Returned when data format is invalid | :status: '400' :error: Bad Request |
Request
{
"user_importer": {
"send_invite_mails": true,
"data": [
{
"name": "joao",
"active": true,
"email": "joao@example.com.br",
"tags": ["consultor"],
"supervisor_email": "davi@example.com.br",
"supervisor_cpf": "30312345689",
"area": "North",
"location": "Westeros",
"level": "Reborn",
"rg": "123456789",
"cpf": "43000086390",
"country": "Westeros",
"education": "N/A",
"department": "Ice",
"job_title": "King in the North",
"nickname": "Knows nothing",
"sex": "male",
"gender": "cis_man",
"remove_supervisor": false,
"termination_reason": null,
"termination_cause": null,
"birth_date": "1990-01-30",
"termination_date": null,
"admission_date": "2015-11-01",
"last_career_move_date": "2016-01-30"
},
{
"name": "davi",
"active": true,
"email": "davi@example.com.br",
"tags": ["consultor", "gerente"]
}
]
}
}
Response
Status: 201 Created
{
"user_importer": {
"id": 17,
"company_id": 1,
"state": "enqueued",
"user_importer_data_id": 17,
"created_at": "2018-03-15T20:30:13.354-03:00"
}
}
| Param Name | Description |
|---|---|
|
user_importer
Required |
Importer JSON object Validations:
|
|
user_importer[send_invite_mails]
Optional |
Sends invitations to all the active users created on the import. Validations:
|
|
user_importer[data]
Required |
Array of users to be imported Validations:
|
|
user_importer[data][name]
Required |
User name Validations:
|
|
user_importer[data][active]
Required |
Boolean indicating if the user is active Validations:
|
|
user_importer[data][default_contract_for_user]
Optional |
Boolean indicating if the contract is default_contract_for_user, i.e., if this company should be the default to be opened at login for this user (only needed if user has more than one company) Validations:
|
|
user_importer[data][blocked]
Optional |
Boolean indicating if the contract is blocked, i.e. can not login nor receive emails but still appears in the platform as active Validations:
|
|
user_importer[data][email]
Optional |
User email (unique user identifier).
Validations:
|
|
user_importer[data][supervisor_email]
Optional |
User supervisor email.
Validations:
|
|
user_importer[data][tags]
Optional |
Array of strings representing in what tags the user is included Validations:
|
|
user_importer[data][tags_admin_only]
Optional |
Array of strings representing in what tags that are only visible for admins the user is included Validations:
|
|
user_importer[data][supervisor_cpf]
Optional |
Supervisor CPF (Use either supervisor_email or CPF to find a contract and assign it as the current user's supervisor).
Validations:
|
|
user_importer[data][area]
Optional |
Area Validations:
|
|
user_importer[data][location]
Optional |
Location Validations:
|
|
user_importer[data][level]
Optional |
Level Validations:
|
|
user_importer[data][rg]
Optional |
RG Validations:
|
|
user_importer[data][cpf]
Optional |
User CPF may be used as unique identifier, instead of email OR username.
Validations:
|
|
user_importer[data][cpf_password_prefix]
Optional |
Password prefix for users. When provided, the system will generate a password using this prefix combined with the first 6 digits of the user's CPF.
Validations:
|
|
user_importer[data][force_update_password]
Optional |
Force update password. When provided, the system will update the password of the user with cpf_password_prefix even if it already exists. Validations:
|
|
user_importer[data][username]
Optional |
User username may be used as unique identifier, instead of email or CPF.
Validations:
|
|
user_importer[data][identifier]
Optional |
Custom User identifier Validations:
|
|
user_importer[data][external_uid]
Optional |
If company setting enable_external_uid is active, you may use this field as the login identifier for SSO, in addition to email Validations:
|
|
user_importer[data][country]
Optional |
Country Validations:
|
|
user_importer[data][education]
Optional |
Education Validations:
|
|
user_importer[data][department]
Optional |
Department Validations:
|
|
user_importer[data][job_title]
Optional |
Job Title Validations:
|
|
user_importer[data][nickname]
Optional |
Nickname Validations:
|
|
user_importer[data][sex]
Optional |
User's sex Validations:
|
|
user_importer[data][gender]
Optional |
User's gender Validations:
|
|
user_importer[data][user_login]
Optional |
Email is the default user identifier. You may use cpf or username if you need to import users that don't have email or CPF, or for changing users' emails. Validations:
|
|
user_importer[data][preferred_language]
Optional |
User's default language Validations:
|
|
user_importer[data][termination_reason]
Optional |
Termination reason Validations:
|
|
user_importer[data][termination_cause]
Optional |
Termination cause.
Validations:
|
|
user_importer[data][birth_date]
Optional |
Birth date (YYYY-MM-DD) Validations:
|
|
user_importer[data][termination_date]
Optional |
Termination date (YYYY-MM-DD) Validations:
|
|
user_importer[data][admission_date]
Optional |
Admission date (YYYY-MM-DD) Validations:
|
|
user_importer[data][last_career_move_date]
Optional |
Last caree move date (YYYY-MM-DD) Validations:
|
|
user_importer[data][remove_supervisor]
Optional |
Warning: this is a destructive param. You you are not sure, please avoid using it. By setting this to true, the system will remove the supervisor from the contract. Validations:
|
|
user_importer[data][destroy_taggings]
Optional |
Warning: this is a destructive param. You you are not sure, please avoid using it. By setting this to true, the system will remove all tags from user. That may alter the visibility of questions for ongoing reviews, for instance. Validations:
|
|
user_importer[data][destroy_taggings_ignore_tags]
Optional |
Array of strings representing which tags should be ignored by the “destroy_taggings” option. Cannot be used with :destroy_taggins_restrict_tags option. Validations:
|
|
user_importer[data][destroy_taggings_restrict_tags]
Optional |
Array of strings representing which tags should be considered by the “destroy_taggings” option. Cannout be used with the :destroy_taggins_ignore_tags option. Validations:
|
|
user_importer[data][one_on_one_segment_member]
Optional |
Boolean indicating whether a contract should be added in the 1:1 access segment or if should be removed. If set to true, the contract will be added to the segment. If set to false, the contract will be removed from the segment. Validations:
|
|
include
Optional |
Optional data to be included in the response. Values must be separated by comma. Validations:
|