Skip to main content
POST
/
v1
/
employees
Add Employee
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    userName: 'Jagatheesan M',
    emailId: 'mjagatheesan.g@gmail.com',
    password: 'Strong@123',
    roleId: '271e6693-2130-4ea9-b02d-e6d57516186d',
    teamId: ['5f6fe61c-15c6-47b7-899d-dba99da2464c'],
    workMode: 'remote'
  })
};

fetch('https://api.trackpilots.com/v1/employees', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "success": true,
  "statusCode": 200,
  "statusMessage": "User added successfully",
  "error": null,
  "response": {
    "userName": "Jagatheesan M",
    "emailId": "mjagatheesan.g@gmail.com",
    "userId": "7f9a0d29-c3a3-419a-87f6-11c34948cf7e"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
userName
string
required
Required string length: 2 - 100
Example:

"Jagatheesan M"

emailId
string<email>
required
Example:

"mjagatheesan.g@gmail.com"

password
string<password>
required

Must contain at least 1 uppercase letter, 1 lowercase letter, 1 number, and 1 special character.

Required string length: 8 - 128
Pattern: ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^A-Za-z\d]).{8,128}$
Example:

"Strong@123"

roleId
string<uuid>
required
Example:

"271e6693-2130-4ea9-b02d-e6d57516186d"

teamId
string<uuid>[]
required
Minimum array length: 1
Example:
["5f6fe61c-15c6-47b7-899d-dba99da2464c"]
workMode
enum<string>
required
Available options:
remote,
office,
hybrid
Example:

"remote"

Response

User added successfully.

success
boolean
Example:

true

statusCode
integer<int32>
Example:

200

statusMessage
string
Example:

"User added successfully"

error
unknown
response
object