Create Employee
POSThttps://api.uber.com/v1/business/organizations/{organization_id}/employees
¶ Use Case
The Create Employee endpoint allows you to create an employee for the organization.
¶ Authorization
The Create Employee endpoint requires an access_token using the client credentials (for 1P use-case)
grant to business.employees
scope.
If an application follows third party authentication, the create employee endpoint requires the client to get authorized using the authorization endpoint
¶ Path Parameters
Name | Type | Optional | Description |
---|---|---|---|
organization_id |
string | No | Identifier for your organization. |
¶ Request Parameters
Name | Type | Optional | Description |
---|---|---|---|
employee |
object | No | An object of employee details whose account needs to be created. |
employee.first_name |
string | No | First name of the employee. |
employee.last_name |
string | No | Last name of the employee. |
employee.email |
string | No | Email id of the employee. |
employee.mobile_country_code |
string | Yes | The mobile country code of the employee. If no code is provided but mobile_number is provided, code of the organization will be taken as default code. |
employee.mobile_number |
string | Yes | The mobile number of the employee. |
employee.u4b_data |
object | Yes | Object containing employee data specific to uber for business. |
employee.u4b_data.employee_id |
string | Yes | The employee ID of the employee. |
employee.u4b_data.reviewer |
string | Yes | The email id of the reviewer. |
employee.u4b_data.is_admin |
boolean | Yes | Create Admin employee |
employee.u4b_data.groups |
array | Yes | List of groups the employee is in. Note: currently an employee can only be in one group. |
employee.u4b_data.groups[].name |
string | Yes | Group Name. |
¶ Response Fields
Name | Type | Description |
---|---|---|
employee |
struct | An object of employee details whose account has been created. |
employee.first_name |
string | First name of the employee. |
employee.last_name |
string | Last name of the employee. |
employee.email |
string | Email id of the employee. |
employee.mobile_country_code |
string | The mobile country code of the employee. If no code is provided but mobile_number is provided, code of the organization will be taken as default code. |
employee.mobile_number |
string | The mobile number of the employee. |
employee.u4b_data |
object | Object containing employee data specific to uber for business. |
employee.u4b_data.employee_id |
string | The employee ID of the employee. |
employee.u4b_data.reviewer |
string | The email id of the reviewer. |
employee.u4b_data.is_admin |
boolean | Check if employee is admin. |
employee.u4b_data.groups |
array | List of groups the employee is in. Note: currently an employee can only be in one group. |
employee.u4b_data.groups[].uuid |
string | Group UUID. |
employee.u4b_data.groups[].name |
string | Group Name. |
¶ Example Request
curl -X POST "https://api.uber.com/v1/business/organizations/<organization_id>/employees" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <TOKEN>" \
-d '{
"employee": {
"first_name": "test",
"last_name": "test",
"email": "testnew@uber.com",
"mobile_number": "1234567899",
"mobile_country_code": "+91",
"u4b_data": {
"reviewer": "test1@uber.com",
"employee_id": "test.test",
"is_admin": true,
"groups": [
{
"name": "group-2"
}
]
}
}
}'
¶ Example Response
If the employee was successfully created:
Status-Code: 200 OK
{
"employee": {
"first_name": "test",
"last_name": "test",
"email": "testneww@uber.com",
"mobile_country_code": "+91",
"mobile_number": "1234567899",
"u4b_data": {
"employee_id": "test.test",
"reviewer": "test1@uber.com",
"is_admin": true,
"groups": [
{
"uuid": "uuid",
"name": "group-2"
}
]
}
}
}
¶ Error Responses
HTTP Status | Code | Description |
---|---|---|
400 | BAD_REQUEST |
request specific message |
401 | NOT_AUTHORIZED |
Caller not authorized to make this request |
409 | ENTITY_ALREADY_EXISTS |
The employee entity already exists |
429 | rate_limited |
Rate limit exceeded |
500 | INTERNAL_SERVER_ERROR |
We have experienced a problem |