User
Manage users
List users
Returns the list of all users.
Request Information
GEThttps://api-test.hrpeak.com/v2/users
The API uses basic authentication and the API key must be sent in the Authorization request header.
curl https://api-test.hrpeak.com/v2/users
     -H "Authorization: API_KEY"
URI parameters
pageoptional
The zero-based page number. Data type is integer. Default value is 0.
per_pageoptional
The number of items per page. Maximum value is 1000. Data type is integer. Default value is 100.
active_items_onlyoptional
List only items with active status. Data type is boolean. Default value is true.
department_idoptional
List only users in a specific department.
department_external_idoptional
List only users in a specific department.
languageoptional
Role names can be multilingual. The language of the role names. Data type is integer. Default value is English.
Possible values
ValueText
0English
1Turkish
Request Uri Sample
https://api-test.hrpeak.com/v2/users/?page=0&per_page=20
https://api-test.hrpeak.com/v2/users/?page=0&per_page=20&department_id=tb3tge6uua8qy4xevgfccs77b2
Response Information
id
Unique id of the user.
full_name
Name of the user.
department
Department of the user.
id
Unique id of the department.
name
Name of the department.
external_id
A unique string to associate the department to an external record.
roles
Roles of the user. This property value is an array.
id
Unique id of the child role.
name
Name of the role.
position
Position of the user.
id
Unique id of the position.
name
Name of the position.
external_id
A unique string to associate the position to an external record.
passive
This property value is set to true if the user is not active. Data type is boolean.
external_id
A unique string to associate the user to an external record.
Sample Response
{
  "status": 0,
  "total_data_count": 1000,
  "data": [
    {
      "id": "m57ge3eywa9syvn2nm2dstwycw",
      "full_name": "Maria Simith",
      "department": {
        "id": "s4cq2elkbyypwmbb28sznzkbss",
        "name": "Recruiting Team",
        "external_id": "RT"
      },
      "roles": [
        {
          "id": "jcbdm4ktb6jnywmh9tesxnz972",
          "name": "Recruiter"
        }
      ],
      "position": {
        "id": "5zqk96l83s5xy8n2ue6bwk7p22",
        "name": "HR Manager",
        "external_id": "HRMNG"
      },
      "passive": true,
      "external_id": "A0001"
    }
  ]
}
Error Responses
Error messages can vary. More specific error information may be included.
Internal server error
{
  "status": 500,
  "error_message": "A generic error has occurred on the server."
}
Get user
Returns the details of a user.
Request Information
GEThttps://api-test.hrpeak.com/v2/users/{id}
The API uses basic authentication and the API key must be sent in the Authorization request header.
curl https://api-test.hrpeak.com/v2/users/{id}
     -H "Authorization: API_KEY"
URI parameters
idrequired
Unique id of the user.
languageoptional
Role names can be multilingual. The language of the role names. Data type is integer. Default value is English.
Possible values
ValueText
0English
1Turkish
Request Uri Sample
https://api-test.hrpeak.com/v2/users/e9fuugmkt97kwhbd2ytr6k7y9w
Response Information
id
Unique id of the user.
full_name
Name of the user.
department
Department of the user.
id
Unique id of the department.
name
Name of the department.
external_id
A unique string to associate the department to an external record.
roles
Roles of the user. This property value is an array.
id
Unique id of the child role.
name
Name of the role.
position
Position of the user.
id
Unique id of the position.
name
Name of the position.
external_id
A unique string to associate the position to an external record.
passive
This property value is set to true if the user is not active. Data type is boolean.
external_id
A unique string to associate the user to an external record.
Sample Response
{
  "status": 0,
  "data": {
    "id": "3hqwmzv3gbryy8c969khu7a86s",
    "full_name": "Maria Simith",
    "department": {
      "id": "99dyzl55l6ntytzwm5fd79jlea",
      "name": "Recruiting Team",
      "external_id": "RT"
    },
    "roles": [
      {
        "id": "tgenpl4l6az5wqmwuttx32fyjq",
        "name": "Recruiter"
      }
    ],
    "position": {
      "id": "la2dsgjj62zsytn8uhzwh5lsyx",
      "name": "HR Manager",
      "external_id": "HRMNG"
    },
    "passive": true,
    "external_id": "A0001"
  }
}
Error Responses
Error messages can vary. More specific error information may be included.
Bad request
{
  "status": 400,
  "error_message": "Invalid request."
}
Not found
{
  "status": 404,
  "error_message": "Record not found."
}
Internal server error
{
  "status": 500,
  "error_message": "A generic error has occurred on the server."
}
Get user by external id
Returns the details of a user.
Request Information
GEThttps://api-test.hrpeak.com/v2/users/external_id/{id}
The API uses basic authentication and the API key must be sent in the Authorization request header.
curl https://api-test.hrpeak.com/v2/users/external_id/{id}
     -H "Authorization: API_KEY"
URI parameters
idrequired
A unique string to associate the user to an external record.
languageoptional
Role names can be multilingual. The language of the role names. Data type is integer. Default value is English.
Possible values
ValueText
0English
1Turkish
Request Uri Sample
https://api-test.hrpeak.com/v2/users/external_id/A0001
Response Information
id
Unique id of the user.
full_name
Name of the user.
department
Department of the user.
id
Unique id of the department.
name
Name of the department.
external_id
A unique string to associate the department to an external record.
roles
Roles of the user. This property value is an array.
id
Unique id of the child role.
name
Name of the role.
position
Position of the user.
id
Unique id of the position.
name
Name of the position.
external_id
A unique string to associate the position to an external record.
passive
This property value is set to true if the user is not active. Data type is boolean.
external_id
A unique string to associate the user to an external record.
Sample Response
{
  "status": 0,
  "data": {
    "id": "lrd2jmfl3yhxwbz899ehy559t2",
    "full_name": "Maria Simith",
    "department": {
      "id": "wrrbup9f9dkzwrv8wkulrqd3kq",
      "name": "Recruiting Team",
      "external_id": "RT"
    },
    "roles": [
      {
        "id": "rk4n7h98ybw6y4xlmnfj2g7eqs",
        "name": "Recruiter"
      }
    ],
    "position": {
      "id": "s56d7drcqyq2w7xeu4vpk4q5wz",
      "name": "HR Manager",
      "external_id": "HRMNG"
    },
    "passive": true,
    "external_id": "A0001"
  }
}
Error Responses
Error messages can vary. More specific error information may be included.
Not found
{
  "status": 404,
  "error_message": "Record not found."
}
Internal server error
{
  "status": 500,
  "error_message": "A generic error has occurred on the server."
}
Insert user
Create a new user.
Request Information
POSThttps://api-test.hrpeak.com/v2/users
The API uses basic authentication and the API key must be sent in the Authorization request header.
curl -X POST https://api-test.hrpeak.com/v2/users
     -H "Authorization: API_KEY"
     -d {JSON body}
JSON body object
full_namerequired
Name of the user. Max length is 100.
email_addressoptional
Email address of the user. If a password will be given to the user, the user will login the application with this e-mail address. Max length is 50.
phone_numberoptional
Phone number of the user. Max length is 50.
languageoptional
Language Data type is integer.
Possible values
ValueText
0English
1Turkish
passwordoptional
If you want to create an account for the user, set a temporary password. It will be prompted to change the password on first use. If a password is given, the e-mail address must also be specified. The user will login to the application with e-mail and password. Max length is 255.
random_passwordoptional
Automatically create a password. Data type is boolean.
send_passwordoptional
Email the temporary password to the user. Data type is boolean.
department_idoptional
Unique id of the department. Max length is 36.
department_external_idoptional
A unique string to associate the department to an external record. Max length is 50.
role_idsoptional
Roles of the user. Data type is string. This property value is an array.
position_idoptional
Unique id of the position. Max length is 36.
position_external_idoptional
A unique string to associate the position to an external record. Max length is 50.
expiry_dateoptional
After this date, the user's access to the system will be automatically disabled. Data type is datetime.
external_idoptional
A unique string to associate the user to an external record. Max length is 50.
Request Body Sample
{
  "full_name": "Maria Simith",
  "email_address": "[email protected]",
  "phone_number": "+14155552671",
  "language": 0,
  "password": "***",
  "send_password": true,
  "department_external_id": "RT",
  "role_ids": [
    "rauzhqlypzrtypng9m2nnk6y5s"
  ],
  "position_id": "h595m2auk58kw4vh84at5rw3k2",
  "expiry_date": "2026-08-04T04:22:00+03:00",
  "external_id": "A0001"
}
Response Information
Unique id of the user.
Sample Response
{
  "status": 0,
  "data": "rlj23fd8zp4vwxxrablq22pakx"
}
Error Responses
Error messages can vary. More specific error information may be included.
Bad request
{
  "status": 400,
  "error_message": "Invalid request."
}
Username already exist
{
  "status": 3,
  "error_message": "Another account with the same email address already exists."
}
External id already exist
{
  "status": 2,
  "error_message": "Another item with the same external id already exists."
}
Role not found
{
  "status": 4,
  "error_message": "Role item is not found. Submit an existing role."
}
Organization not found
{
  "status": 5,
  "error_message": "Department item is not found. Add the department first or submit an existing department."
}
Position not found
{
  "status": 6,
  "error_message": "Position item is not found. Add the position first or submit an existing position."
}
Internal server error
{
  "status": 500,
  "error_message": "A generic error has occurred on the server."
}
Update user
Update a user.
Request Information
PATCHhttps://api-test.hrpeak.com/v2/users/{id}
The API uses basic authentication and the API key must be sent in the Authorization request header.
curl -X PATCH https://api-test.hrpeak.com/v2/users/{id}
     -H "Authorization: API_KEY"
     -d {JSON body}
Below is the list of properties that can be updated on the item. Only the properties on the JSON data are updated. Don't include properties that you don't want updated in JSON.
URI parameters
idrequired
Unique id of the user.
JSON body object
full_nameoptional
Name of the user. Max length is 100.
email_addressoptional
Email address of the user. Max length is 50.
phone_numberoptional
Phone number of the user. Max length is 50.
languageoptional
Language Data type is integer.
Possible values
ValueText
0English
1Turkish
department_idoptional
Unique id of the department. Max length is 36.
department_external_idoptional
A unique string to associate the department to an external record. Max length is 50.
role_idsoptional
Roles of the user. Data type is string. This property value is an array.
position_idoptional
Unique id of the position. Max length is 36.
position_external_idoptional
A unique string to associate the position to an external record. Max length is 50.
expiry_dateoptional
A unique string to associate the parent user to an external record. Data type is datetime.
external_idoptional
A unique string to associate the user to an external record. Max length is 50.
activeoptional
This property value is set to true if the user is not active. Data type is boolean.
Request Uri Sample
https://api-test.hrpeak.com/v2/users/rpex6q55xqgwy2l6cjlrdnp42z
Request Body Sample
Update only name value.
{
  "full_name": "Maria Simith"
}
Update name and phone number.
{
  "full_name": "Maria Simith",
  "phone_number": "+14155552671"
}
Response Information
id
Unique id of the user.
full_name
Name of the user.
passive
This property value is set to true if the user is not active. Data type is boolean.
Sample Response
{
  "status": 0,
  "data": {
    "id": "bbex3z2hsh43yqnexba6cjf3eq",
    "name": "Maria Simith",
    "passive": true
  }
}
Error Responses
Error messages can vary. More specific error information may be included.
Bad request
{
  "status": 400,
  "error_message": "Invalid request."
}
Not found
{
  "status": 404,
  "error_message": "Record not found."
}
External id already exist
{
  "status": 2,
  "error_message": "Another item with the same external id already exists."
}
Role not found
{
  "status": 4,
  "error_message": "Role item is not found. Submit an existing role."
}
Organization not found
{
  "status": 5,
  "error_message": "Department item is not found. Add the department first or submit an existing department."
}
Position not found
{
  "status": 6,
  "error_message": "Position item is not found. Add the position first or submit an existing position."
}
Internal server error
{
  "status": 500,
  "error_message": "A generic error has occurred on the server."
}
Update user by external id
Update a user.
Request Information
PATCHhttps://api-test.hrpeak.com/v2/users/external_id/{id}
The API uses basic authentication and the API key must be sent in the Authorization request header.
curl -X PATCH https://api-test.hrpeak.com/v2/users/external_id/{id}
     -H "Authorization: API_KEY"
     -d {JSON body}
Below is the list of properties that can be updated on the item. Only the properties on the JSON data are updated. Don't include properties that you don't want updated in JSON.
URI parameters
idrequired
A unique string to associate the user to an external record.
JSON body object
full_nameoptional
Name of the user. Max length is 100.
email_addressoptional
Email address of the user. Max length is 50.
phone_numberoptional
Phone number of the user. Max length is 50.
languageoptional
Language Data type is integer.
Possible values
ValueText
0English
1Turkish
department_idoptional
Unique id of the department. Max length is 36.
department_external_idoptional
A unique string to associate the department to an external record. Max length is 50.
role_idsoptional
Roles of the user. Data type is string. This property value is an array.
position_idoptional
Unique id of the position. Max length is 36.
position_external_idoptional
A unique string to associate the position to an external record. Max length is 50.
expiry_dateoptional
A unique string to associate the parent user to an external record. Data type is datetime.
external_idoptional
A unique string to associate the user to an external record. Max length is 50.
activeoptional
This property value is set to true if the user is not active. Data type is boolean.
Request Uri Sample
https://api-test.hrpeak.com/v2/users/external_id/A0001
Request Body Sample
Update only name value.
{
  "full_name": "Maria Simith"
}
Update name and phone number.
{
  "full_name": "Maria Simith",
  "phone_number": "+14155552671"
}
Response Information
id
Unique id of the user.
full_name
Name of the user.
passive
This property value is set to true if the user is not active. Data type is boolean.
Sample Response
{
  "status": 0,
  "data": {
    "id": "ezklkumbjumjyfxrbn9q4hpg7q",
    "name": "Maria Simith",
    "passive": true
  }
}
Error Responses
Error messages can vary. More specific error information may be included.
Not found
{
  "status": 404,
  "error_message": "Record not found."
}
External id already exist
{
  "status": 2,
  "error_message": "Another item with the same external id already exists."
}
Role not found
{
  "status": 4,
  "error_message": "Role item is not found. Submit an existing role."
}
Organization not found
{
  "status": 5,
  "error_message": "Department item is not found. Add the department first or submit an existing department."
}
Position not found
{
  "status": 6,
  "error_message": "Position item is not found. Add the position first or submit an existing position."
}
Internal server error
{
  "status": 500,
  "error_message": "A generic error has occurred on the server."
}
List roles
Returns the list of all roles.
Request Information
GEThttps://api-test.hrpeak.com/v2/roles
The API uses basic authentication and the API key must be sent in the Authorization request header.
curl https://api-test.hrpeak.com/v2/roles
     -H "Authorization: API_KEY"
Response Information
id
Unique id of the role.
name
Name of the role.
Sample Response
{
  "status": 0,
  "data": [
    {
      "id": "l2ad28vaan37wlv9hk2hp5ee9z",
      "name": "Recruiter"
    }
  ]
}
Error Responses
Error messages can vary. More specific error information may be included.
Internal server error
{
  "status": 500,
  "error_message": "A generic error has occurred on the server."
}