Skip to content
Docs
API 1.0.0 · 22 Nov 2026

Search the docs

    Română

    Leave kinds and balances

    The kinds of leave, how the working days are counted, what draws on the balance and who decides.

    On this page

    A leave request is for a kind and a range of days. The API counts the working days, tells you the balance the request leaves, and keeps the decision with the approver. The entitlement of each person is a policy of your account, not a statement of law; the API applies it.

    Kinds

    KindDraws on the balanceDays already gone
    annualYesNot accepted
    medicalNoAccepted: it is reported after it starts
    unpaidNoNot accepted
    specialNoNot accepted

    Counting the days

    days is the number of working days from from to to, both included, without Saturdays, Sundays and the public holidays of the calendar. A request that covers only such days is refused with no_working_days. A leave from Friday 27 November to Wednesday 2 December 2026 counts 2 days: 30 November and 1 December are public holidays.

    The balance

    The balance is the entitlement less the days taken. Only approved annual requests take days; a pending request takes nothing until it is approved, and a cancelled or rejected one never did. Get the leave balance returns the entitlement, the days taken, the days still pending and the balance.

    curl

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

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/hr/v1/employees/11729ba4-78ca-4dfb-9165-03367b42d67a/leave-balance`, {
      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/leave-balance',
        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/leave-balance');
    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/leave-balance");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 200

    {
      "employeeId": "11729ba4-78ca-4dfb-9165-03367b42d67a",
      "year": 2026,
      "entitlement": 21,
      "taken": 13,
      "pending": 0,
      "balance": 8
    }

    An annual request that counts more days than the balance is refused when it is made, and refused again when it is approved, because other approvals may have used the days in between (over_balance).

    A request

    A request carries days, balanceAfter (the balance once it is approved, or null for a kind that draws on none), its approverId and, while it is pending, teamAway: the day with the most teammates on approved leave when two or more are away. It is information for the approver; it does not stop the request.

    curl

    curl "$RDC_BASE_URL/hr/v1/leave-requests/bd9ccb68-cdef-4ec9-b852-dfa82203a948" \
      -H "Authorization: Bearer $RDC_TOKEN"

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/hr/v1/leave-requests/bd9ccb68-cdef-4ec9-b852-dfa82203a948`, {
      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/leave-requests/bd9ccb68-cdef-4ec9-b852-dfa82203a948',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/hr/v1/leave-requests/bd9ccb68-cdef-4ec9-b852-dfa82203a948');
    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/leave-requests/bd9ccb68-cdef-4ec9-b852-dfa82203a948");
    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": "bd9ccb68-cdef-4ec9-b852-dfa82203a948",
      "number": "LR-2026-1044",
      "employeeId": "5f6223ec-cd16-4dcc-bf30-2409b9672912",
      "kind": "annual",
      "from": "2026-11-30",
      "to": "2026-12-04",
      "days": 3,
      "balanceAfter": 10,
      "approverId": "21bd8239-2794-4320-adba-9128b6a6219b",
      "status": "pending",
      "note": null,
      "reason": null,
      "teamAway": {
        "date": "2026-12-02",
        "employeeIds": [
          "11729ba4-78ca-4dfb-9165-03367b42d67a",
          "45b8db4f-180e-40cf-99d6-2864b28b2eab"
        ]
      },
      "revision": 1
    }

    What a request must satisfy

    • It starts today or later, except medical (date_in_the_past).
    • It lies inside the period of the calendar (outside_calendar) and inside the employment of the person: not before the first day of work (before_start), not after the last day (after_last_day).
    • It does not overlap another pending or approved request of the same person (leave_overlaps).

    Deciding and cancelling

    1. Pending

      A new request. The approver approves it, or rejects it with a reason; the person, the approver or the HR lead cancels it.

    2. Approved

      The days are taken. It can be cancelled only before its first day (leave_started); the days return to the balance.

    3. Rejected, cancelled

      The request is closed and does not change any more (request_closed). A rejection keeps its reason.