Skip to content
Docs
API 1.0.0 · 22 Nov 2026

Search the docs

    Română

    Change a job or salary

    Record a dated change, read the periods it leaves and see what a change in the past is refused for.

    On this page

    A raise, a promotion or a move to another team is one request with the day it applies from. The person gets a new period; the one that ran ends the day before. Effective dates explains the rules, and this guide uses them.

    Read the person

    Get a person returns the person and their revision. Send that revision as expectedRevision: if someone else changed the person in the meantime, the request is refused with revision_conflict and you read again.

    curl

    curl "$RDC_BASE_URL/hr/v1/employees/11729ba4-78ca-4dfb-9165-03367b42d67a" \
      -H "Authorization: Bearer $RDC_TOKEN"

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/hr/v1/employees/11729ba4-78ca-4dfb-9165-03367b42d67a`, {
      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/11729ba4-78ca-4dfb-9165-03367b42d67a',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/hr/v1/employees/11729ba4-78ca-4dfb-9165-03367b42d67a');
    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/11729ba4-78ca-4dfb-9165-03367b42d67a");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 200

    {
      "id": "11729ba4-78ca-4dfb-9165-03367b42d67a",
      "number": "A-0041",
      "name": "Dan Ilie",
      "job": "Picker",
      "departmentId": "warehouse",
      "managerId": "21bd8239-2794-4320-adba-9128b6a6219b",
      "workplaceId": "warehouse",
      "contractType": "indefinite",
      "contractEnd": null,
      "startDate": "2022-02-07",
      "lastDay": null,
      "status": "active",
      "externalId": "hr-0187",
      "revision": 1
    }

    Record the change

    Send effectiveFrom and the fields that change. Here Dan Ilie becomes a senior picker with a new gross salary from 1 January 2027. The manager, the department, the workplace and the contract carry over.

    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
    }

    Read the periods

    List the periods of employment shows the one that ended on 31 December 2026 as it was, and the new one that runs from 1 January 2027. The person still shows the job and salary that apply today until that day comes.

    curl

    curl "$RDC_BASE_URL/hr/v1/employees/11729ba4-78ca-4dfb-9165-03367b42d67a/employments" \
      -H "Authorization: Bearer $RDC_TOKEN"

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/hr/v1/employees/11729ba4-78ca-4dfb-9165-03367b42d67a/employments`, {
      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/11729ba4-78ca-4dfb-9165-03367b42d67a/employments',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/hr/v1/employees/11729ba4-78ca-4dfb-9165-03367b42d67a/employments');
    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/11729ba4-78ca-4dfb-9165-03367b42d67a/employments");
    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": "79dcb76e-3156-44a0-a2b0-cb2c83a59ebd",
          "employeeId": "11729ba4-78ca-4dfb-9165-03367b42d67a",
          "from": "2022-02-07",
          "to": "2026-12-31",
          "job": "Picker",
          "departmentId": "warehouse",
          "managerId": "21bd8239-2794-4320-adba-9128b6a6219b",
          "workplaceId": "warehouse",
          "contractType": "indefinite",
          "contractEnd": null,
          "grossSalary": "5400.00"
        },
        {
          "id": "a9565edb-fc29-4d83-ba12-60f0b0d371c6",
          "employeeId": "11729ba4-78ca-4dfb-9165-03367b42d67a",
          "from": "2027-01-01",
          "to": null,
          "job": "Senior picker",
          "departmentId": "warehouse",
          "managerId": "21bd8239-2794-4320-adba-9128b6a6219b",
          "workplaceId": "warehouse",
          "contractType": "indefinite",
          "contractEnd": null,
          "grossSalary": "5900.00"
        }
      ],
      "nextCursor": null
    }

    A day before the period

    A change cannot start on or before the first day of the period that runs, because that would rewrite what was true then. It is refused with 422 and not_after_current. A day inside the period is fine: a raise that took effect on 1 October can be recorded on 23 November.

    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 '{
      "operationId": "c4e8a1d2-6f37-4b95-8a10-3d7e9b2f5c46",
      "expectedRevision": 1,
      "effectiveFrom": "2022-02-07",
      "grossSalary": "5500.00"
    }'

    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({
        "operationId": "c4e8a1d2-6f37-4b95-8a10-3d7e9b2f5c46",
        "expectedRevision": 1,
        "effectiveFrom": "2022-02-07",
        "grossSalary": "5500.00"
      }),
    });
    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={
            'operationId': 'c4e8a1d2-6f37-4b95-8a10-3d7e9b2f5c46',
            'expectedRevision': 1,
            'effectiveFrom': '2022-02-07',
            'grossSalary': '5500.00',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $body = <<<'JSON'
    {
      "operationId": "c4e8a1d2-6f37-4b95-8a10-3d7e9b2f5c46",
      "expectedRevision": 1,
      "effectiveFrom": "2022-02-07",
      "grossSalary": "5500.00"
    }
    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("""
    {
      "operationId": "c4e8a1d2-6f37-4b95-8a10-3d7e9b2f5c46",
      "expectedRevision": 1,
      "effectiveFrom": "2022-02-07",
      "grossSalary": "5500.00"
    }
    """, System.Text.Encoding.UTF8, "application/json");
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 422

    {
      "code": "not_after_current",
      "message": "The date is not after the start of the period that runs.",
      "requestId": "9b4e1c2a-6d3f-4a78-b5e0-2f8c7d1a3e69"
    }