Employments
The periods of a person's employment by effective date: read them and record a dated change of job, manager, workplace, contract or salary.
On this page
List the periods of employment
GET /hr/v1/employees/{employeeId}/employments
Returns the periods of employment of a person, the oldest first. Each period has the day it starts and the day it ends, and the next one starts the day after.
Parameters
| Name | In | Type | Required | Meaning |
|---|---|---|---|---|
employeeId | path | string (uuid) | Yesrequired | The person. |
limit | query | integer | Nooptional | Records per page. Default 100 Range 1 – 500 |
cursor | query | string | Nooptional | The nextCursor of the previous page. |
Responses
| Status | Meaning | Body |
|---|---|---|
200 | A page of records. | EmploymentPage |
401 | The token is missing, not valid or has ended. | Error |
403 | The token does not give access to this data, or to this account. | Error |
404 | The request was refused. The code is employee_not_found. | Error |
429 | The request was refused. The code is rate_limited. | Error |
503 | The request was refused. The code is unavailable. | Error |
Request
curl
curl "$RDC_BASE_URL/hr/v1/employees/6ffcab16-c274-48c9-9d5a-053841a88f43/employments?limit=20" \
-H "Authorization: Bearer $RDC_TOKEN" JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/hr/v1/employees/6ffcab16-c274-48c9-9d5a-053841a88f43/employments?limit=20`, {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
},
});
const result = await response.json(); Python
import os
import requests
response = requests.request(
'GET',
f'{os.environ["RDC_BASE_URL"]}/hr/v1/employees/6ffcab16-c274-48c9-9d5a-053841a88f43/employments?limit=20',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
)
result = response.json() PHP
<?php
$curl = curl_init(getenv('RDC_BASE_URL') . '/hr/v1/employees/6ffcab16-c274-48c9-9d5a-053841a88f43/employments?limit=20');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RDC_TOKEN'),
],
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl); C#
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/hr/v1/employees/6ffcab16-c274-48c9-9d5a-053841a88f43/employments?limit=20");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); Response 200
{
"items": [
{
"id": "82404c5b-ef96-4fac-a53e-70947d76f935",
"employeeId": "6ffcab16-c274-48c9-9d5a-053841a88f43",
"from": "2019-03-01",
"to": "2022-12-31",
"job": "Accountant",
"departmentId": "finance",
"managerId": "e50d7ef0-7fcc-4201-b93b-817b578ba173",
"workplaceId": "office",
"contractType": "indefinite",
"contractEnd": null,
"grossSalary": "6200.00"
},
{
"id": "ef12c119-4ef0-4fb4-9a40-ce5432a12b01",
"employeeId": "6ffcab16-c274-48c9-9d5a-053841a88f43",
"from": "2023-01-01",
"to": null,
"job": "Chief accountant",
"departmentId": "finance",
"managerId": "e50d7ef0-7fcc-4201-b93b-817b578ba173",
"workplaceId": "office",
"contractType": "indefinite",
"contractEnd": null,
"grossSalary": "9400.00"
}
],
"nextCursor": null
} Change the job, manager, workplace, contract or salary
POST /hr/v1/employees/{employeeId}/employments
Starts a new period of employment on effectiveFrom with the fields you send and the rest carried over. The period that runs ends the day before, and earlier periods are not rewritten. effectiveFrom must be after the first day of the period that runs; it may be in the future.
Parameters
| Name | In | Type | Required | Meaning |
|---|---|---|---|---|
employeeId | path | string (uuid) | Yesrequired | The person. |
Request body
| Field | Type | Required | Meaning |
|---|---|---|---|
operationId | string (uuid) | Yesrequired | A UUID you choose for this change. Send it again to repeat the request. |
expectedRevision | integer | Yesrequired | The revision of the person you read. |
effectiveFrom | string (date) | Yesrequired | The first day the new period applies. After the first day of the period that runs. |
job | string | Nooptional | The new job. |
departmentId | string | Nooptional | The new department. One of finance, sales, hr, payroll, purchasing, warehouse, logistics, retail, it |
managerId | string (uuid) | Nooptional | The new manager, null for none. |
workplaceId | string | Nooptional | The new workplace. One of office, warehouse, shop |
contractType | string | Nooptional | The new contract type. One of indefinite, fixed-term |
contractEnd | string (date) | Nooptional | The last day of the contract if it is fixed-term. |
grossSalary | string | Nooptional | The new gross monthly salary in RON, as a decimal string. |
Responses
| Status | Meaning | Body |
|---|---|---|
202 | The change was accepted. The body is the operation result. | OperationResult |
400 | The request cannot be read or breaks the contract: the JSON is malformed, a field is missing or unknown, or a type is wrong. fields names each one. | Error |
401 | The token is missing, not valid or has ended. | Error |
403 | The token does not give access to this data, or to this account. | Error |
404 | The request was refused. The code is employee_not_found, manager_not_found, department_not_found or workplace_not_found. | Error |
409 | The request was refused. The code is revision_conflict or operation_reused. | Error |
422 | The request was refused. The code is employment_ended, date_not_valid, not_after_current, job_required, salary_not_valid, contract_not_valid, no_change or same_person. | Error |
429 | The request was refused. The code is rate_limited. | Error |
503 | The request was refused. The code is unavailable. | Error |
Request
curl
curl -X POST "$RDC_BASE_URL/hr/v1/employees/11729ba4-78ca-4dfb-9165-03367b42d67a/employments" \
-H "Authorization: Bearer $RDC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"expectedRevision": 1,
"effectiveFrom": "2027-01-01",
"job": "Senior picker",
"grossSalary": "5900.00",
"operationId": "3a3da32a-344e-4e8d-a4c5-45882f708756"
}' JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/hr/v1/employees/11729ba4-78ca-4dfb-9165-03367b42d67a/employments`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"expectedRevision": 1,
"effectiveFrom": "2027-01-01",
"job": "Senior picker",
"grossSalary": "5900.00",
"operationId": "3a3da32a-344e-4e8d-a4c5-45882f708756"
}),
});
const result = await response.json(); Python
import os
import requests
response = requests.request(
'POST',
f'{os.environ["RDC_BASE_URL"]}/hr/v1/employees/11729ba4-78ca-4dfb-9165-03367b42d67a/employments',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
json={
'expectedRevision': 1,
'effectiveFrom': '2027-01-01',
'job': 'Senior picker',
'grossSalary': '5900.00',
'operationId': '3a3da32a-344e-4e8d-a4c5-45882f708756',
},
)
result = response.json() PHP
<?php
$body = <<<'JSON'
{
"expectedRevision": 1,
"effectiveFrom": "2027-01-01",
"job": "Senior picker",
"grossSalary": "5900.00",
"operationId": "3a3da32a-344e-4e8d-a4c5-45882f708756"
}
JSON;
$curl = curl_init(getenv('RDC_BASE_URL') . '/hr/v1/employees/11729ba4-78ca-4dfb-9165-03367b42d67a/employments');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RDC_TOKEN'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => $body,
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl); C#
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/hr/v1/employees/11729ba4-78ca-4dfb-9165-03367b42d67a/employments");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
"expectedRevision": 1,
"effectiveFrom": "2027-01-01",
"job": "Senior picker",
"grossSalary": "5900.00",
"operationId": "3a3da32a-344e-4e8d-a4c5-45882f708756"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); Response 202
{
"operationId": "3a3da32a-344e-4e8d-a4c5-45882f708756",
"status": "accepted",
"aggregateRevision": 2
}