Region
Manage regions
List regions
Returns the list of all regions.
Request Information
GEThttps://api-test.hrpeak.com/v2/regions
The API uses basic authentication and the API key must be sent in the Authorization request header.
curl https://api-test.hrpeak.com/v2/regions
     -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.
Request Uri Sample
https://api-test.hrpeak.com/v2/regions/?page=0&per_page=20
Response Information
id
Unique id of the region.
name
Name of the region.
passive
This property value is set to true if the region is not active. Data type is boolean.
external_id
A unique string to associate the region to an external record.
locations
Locations of the region. This property value is an array.
id
Unique id of the location.
name
Name of the location.
passive
This property value is set to true if the location is not active. Data type is boolean.
external_id
A unique string to associate the location to an external record.
Sample Response
{
  "status": 0,
  "total_data_count": 1000,
  "data": [
    {
      "id": "3l7y5fqn5khpwtxpamq424ymks",
      "name": "West",
      "passive": true,
      "external_id": "W",
      "locations": [
        {
          "id": "2b2awzpvm7s6ylnlfaxxmcuu6x",
          "name": "New York City",
          "external_id": "NYC"
        }
      ]
    }
  ]
}
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 region
Returns the details of a region.
Request Information
GEThttps://api-test.hrpeak.com/v2/regions/{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/regions/{id}
     -H "Authorization: API_KEY"
URI parameters
idrequired
Unique id of the region.
Request Uri Sample
https://api-test.hrpeak.com/v2/regions/qnmwvkplp7gjwnvjvw36ljnhgq
Response Information
id
Unique id of the region.
name
Name of the region.
passive
This property value is set to true if the region is not active. Data type is boolean.
external_id
A unique string to associate the region to an external record.
locations
Locations of the region. This property value is an array.
id
Unique id of the location.
name
Name of the location.
passive
This property value is set to true if the location is not active. Data type is boolean.
external_id
A unique string to associate the location to an external record.
Sample Response
{
  "status": 0,
  "data": {
    "id": "v3q284cgua63w4vk2ccl2cyzvs",
    "name": "West",
    "passive": true,
    "external_id": "W",
    "locations": [
      {
        "id": "rsm4eglk9fgrycvhnsf3f8c3mz",
        "name": "New York City",
        "external_id": "NYC"
      }
    ]
  }
}
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 region by external id
Returns the details of a region.
Request Information
GEThttps://api-test.hrpeak.com/v2/regions/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/regions/external_id/{id}
     -H "Authorization: API_KEY"
URI parameters
idrequired
A unique string to associate the region to an external record.
Request Uri Sample
https://api-test.hrpeak.com/v2/regions/external_id/W
Response Information
id
Unique id of the region.
name
Name of the region.
passive
This property value is set to true if the region is not active. Data type is boolean.
external_id
A unique string to associate the region to an external record.
locations
Locations of the region. This property value is an array.
id
Unique id of the location.
name
Name of the location.
passive
This property value is set to true if the location is not active. Data type is boolean.
external_id
A unique string to associate the location to an external record.
Sample Response
{
  "status": 0,
  "data": {
    "id": "8s2ulgz3kp39yfbe54vz7eg2cq",
    "name": "West",
    "passive": true,
    "external_id": "W",
    "locations": [
      {
        "id": "7vjgz7trpwvuwwb87aazpky6x2",
        "name": "New York City",
        "external_id": "NYC"
      }
    ]
  }
}
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 region
Create a new region.
Request Information
POSThttps://api-test.hrpeak.com/v2/regions
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/regions
     -H "Authorization: API_KEY"
     -d {JSON body}
JSON body object
namerequired
Name of the region. Max length is 255.
external_idoptional
A unique string to associate the region to an external record. Max length is 50.
Request Body Sample
{
  "name": "West"
}
{
  "name": "West",
  "external_id": "W"
}
Response Information
Unique id of the region.
Sample Response
{
  "status": 0,
  "data": "sfkhxfm6wm8jylldrxh8bbc6kw"
}
Error Responses
Error messages can vary. More specific error information may be included.
Bad request
{
  "status": 400,
  "error_message": "Invalid request."
}
Name already exist
{
  "status": 1,
  "error_message": "Another item with the same name already exists."
}
External id already exist
{
  "status": 2,
  "error_message": "Another item with the same external id already exists."
}
Internal server error
{
  "status": 500,
  "error_message": "A generic error has occurred on the server."
}
Update region
Update a region.
Request Information
PATCHhttps://api-test.hrpeak.com/v2/regions/{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/regions/{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 region.
JSON body object
nameoptional
Name of the region. Max length is 255.
external_idoptional
A unique string to associate the region to an external record. Max length is 50.
activeoptional
This property value is set to true if the region is not active. Data type is boolean.
Request Uri Sample
https://api-test.hrpeak.com/v2/regions/7wsnnsezy9uhyhm9fnqzcfskg3
Request Body Sample
Update only name value.
{
  "name": "West"
}
Update name and status.
{
  "name": "West",
  "active": false
}
Response Information
id
Unique id of the region.
name
Name of the region.
passive
This property value is set to true if the region is not active. Data type is boolean.
Sample Response
{
  "status": 0,
  "data": {
    "id": "9x6xyfzmm3guwxvbvlxke7yrlq",
    "name": "West",
    "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."
}
Name already exist
{
  "status": 1,
  "error_message": "Another item with the same name already exists."
}
External id already exist
{
  "status": 2,
  "error_message": "Another item with the same external id already exists."
}
Internal server error
{
  "status": 500,
  "error_message": "A generic error has occurred on the server."
}
Update region by external id
Update a region.
Request Information
PATCHhttps://api-test.hrpeak.com/v2/regions/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/regions/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 region to an external record.
JSON body object
nameoptional
Name of the region. Max length is 255.
external_idoptional
A unique string to associate the region to an external record. Max length is 50.
activeoptional
This property value is set to true if the region is not active. Data type is boolean.
Request Uri Sample
https://api-test.hrpeak.com/v2/regions/external_id/W
Request Body Sample
Update only name value.
{
  "name": "West"
}
Update name and status.
{
  "name": "West",
  "active": false
}
Response Information
id
Unique id of the region.
name
Name of the region.
passive
This property value is set to true if the region is not active. Data type is boolean.
Sample Response
{
  "status": 0,
  "data": {
    "id": "swrngz5hytxeyznux26j7lmsnq",
    "name": "West",
    "passive": true
  }
}
Error Responses
Error messages can vary. More specific error information may be included.
Not found
{
  "status": 404,
  "error_message": "Record not found."
}
Name already exist
{
  "status": 1,
  "error_message": "Another item with the same name already exists."
}
External id already exist
{
  "status": 2,
  "error_message": "Another item with the same external id already exists."
}
Internal server error
{
  "status": 500,
  "error_message": "A generic error has occurred on the server."
}
Delete region
Delete a region.
Request Information
DELETEhttps://api-test.hrpeak.com/v2/regions/{id}
The API uses basic authentication and the API key must be sent in the Authorization request header.
curl -X DELETE https://api-test.hrpeak.com/v2/regions/{id}
     -H "Authorization: API_KEY"
URI parameters
idrequired
Unique id of the region.
Request Uri Sample
https://api-test.hrpeak.com/v2/regions/9934nmxvelvqwjn6ksh2229d8x
Response Information
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."
}
Delete region by external id
Delete a region.
Request Information
DELETEhttps://api-test.hrpeak.com/v2/regions/external_id/{id}
The API uses basic authentication and the API key must be sent in the Authorization request header.
curl -X DELETE https://api-test.hrpeak.com/v2/regions/external_id/{id}
     -H "Authorization: API_KEY"
URI parameters
idrequired
A unique string to associate the region to an external record.
Request Uri Sample
https://api-test.hrpeak.com/v2/regions/external_id/W
Response Information
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."
}