This route is used to import up to 100 users at a time directly via the Phin API. This will create users in the specified company and treats them as if they were imported via one of our user syncs or CSV uploader.
Body Reference
Field | Type | Required |
users | array[user] | Yes |
User Object Reference
Field | Type | Description | Required |
string | The valid user email | Yes | |
first | string | The first name of the user | Yes |
last | string | The last name of the user | Yes |
supvname
|
string | The full name of this user's manager | No |
supvemail
|
string | The valid email of this user's manager | No |
deptid
|
string | The ID of this user's department | No |
deptname
|
string | The name of this user's department | No |
emplid
|
string | The employee ID of this user | No |
title
|
string | The title of this user | No |
ophone
|
string | The office phone number of this user | No |
phone
|
string | The mobile phone number of this user | No |
As a convenience sending a GET request to this route will return an object of all the user fields we support importing as well as a description for each, similar to above.
Body Sample
{ "users":
[
{
"email": “sampleuser@example.com”,
"first": “John”,
"last": “Doe”
},
{
"email": “sampleuser2@example.com”,
"first": “Jane”,
"last": “Doe”,
"title": "Senior Partner"
},
...
]
}
Response Reference
Field | Type | Description |
---|---|---|
companyId | string | The ID of the company these users were created in |
newUserIds | array[string] | An array of the newly created user IDs in Phin |
failures | array[string] | If any users failed to be created, this field is returned for users that failed and the reason they could not be imported |
Response Sample
{
"companyId": "exampleCompanyId",
"newUserIds":
[
"newUserId1",
"newUserId2"
],
"failures":
[
"Could not create user at index: 3. Duplicate email detected in request."
]
}
Error Reference
Code | Message | Explanation | |
---|---|---|---|
207 | Partial success | Some users were created, but at least one failed. Check the failures field returned to see which users failed and why they could not be created | |
400 | Bad request | All users failed to be created or the request was missing required fields | |
500 | Failed to import users | Something went wrong when starting or during the import. Reach out to Phin Support if this persists |