All pages
Powered by GitBook
1 of 1

Loading...

Create employee

Use case

In this use case, we will create a new employee with the following data set:

Use case data
API parameters with values

We will create a record for a Test Employee.

Test Employee is a Customer Support representative.

The employee password must be 12 to 20 characters long and contain one upper-case letter, one digit, and one special character.

The name of the tenant where new employee is created.

Sample API call

To create a new employee, make the following API call.

Sample request

Below is an example request body of the API call for creating an employee.

{
  "username": "test.employee@bank.com",
  "email": "test.employee@bank.com",
  "firstName": "Test",
  "lastName": "Employee",
  "roles": [
    "CUSTOMER_SERVICE"
  ],
  "password": "Vys%k6;)#,bab",
  "tenantCode": "BANK"
}
curl --location 'https://auth-api.sandbox.tuumplatform.com/api/v1/employees' \
--header 'x-channel-code: BACKOFFICE' \
--header 'x-auth-token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiT2ZmaWNlciBUZXN0IiwiZW1wbG95ZWVJZCI6IklELTEwMDAiLCJ0ZW5hbnRDb2RlIjoiTUIiLCJleHBpcnlEVGltZSI6IjIwMjQtMTEtMjVUMTM6MDc6MTUiLCJleHAiOjE3MzI1NDAwMzUsInJvbGVzIjpbIkFETUlOIl19.zIFVF28Qu62-9V6xRJI_t1QpnWd4HdPpPSFx5FaepEM' \
--header 'Content-Type: application/json' \
--data-raw '{
  "username": "test.employee@bank.com",
  "email": "test.employee@bank.com",
  "firstName": "Test",
  "lastName": "Employee",
  "roles": [
    "CUSTOMER_SERVICE"
  ],
  "password": "Vys%k6;)#,bab",
  "tenantCode": "BANK"
}'

Sample response

Below you find an example response body to the API call above.

Response
{
    "errors": null,
    "validationErrors": null,
    "data": {
        "employeeId": "ID-1183",
        "firstName": "Test",
        "lastName": "Employee",
        "username": "test.employee@bank.com",
        "email": "test.employee@bank.com",
        "authenticationMethod": "PASSWORD",
        "defaultTenantCode": "MB",
        "roles": [
            "CUSTOMER_SERVICE"
        ],
        "tenants": [
            {
                "tenantEmployeeId": "ID-1213",
                "defaultTenant": true,
                "tenantId": "ID-1000",
                "tenantCode": "BANK",
                "roles": [
                    "CUSTOMER_SERVICE"
                ]
            }
        ],
        "externalId": null,
        "lastLogin": "2024-11-25T12:28:04.635156Z",
        "blockedUntil": null,
        "failedAttempts": 0
    }
}

Result

As a result, a new employee with the employeeId: ID-1183 was created.

https://auth-api.sandbox.tuumplatform.com/api/v1/employees

Learn more about the endpoint in the Tuum developer portal.

"username": "test.employee@bank.com",
"email": "test.employee@bank.com",
"firstName": "Test",
"lastName": "Employee"
"roles": [
    "CUSTOMER_SERVICE"
  ]
"password": "Vys%k6;)#,bab"
"tenantCode": "BANK"
create employee