---
title: "Cere și aprobă un concediu | Documentație | HR by R&D Copilot"
description: "Fă o cerere, citește-o cu zilele numărate, decide asupra ei, anulează-o și vezi cum se mișcă soldul."
canonical: "https://hr.rdcopilot.com/ro/docs/guides/request-and-approve-leave/"
language: ro
updated: 2026-11-22
---

# Cere și aprobă un concediu

Fă o cerere, citește-o cu zilele numărate, decide asupra ei, anulează-o și vezi cum se mișcă soldul.

Concediul este o cerere care așteaptă o decizie. API-ul numără zilele, verifică soldul și știe cine decide, deci ecranul tău trebuie doar să arate ce returnează. [Tipuri de concediu și solduri](https://hr.rdcopilot.com/ro/docs/concepts/leave-kinds-and-balances/) spune ce se numără.

## Fă cererea

[Cere concediu](https://hr.rdcopilot.com/ro/docs/api-reference/leave/#create-leave-request) numește persoana, tipul și prima și ultima zi. `note` este pentru aprobator.

curl

```bash
curl -X POST "$RDC_BASE_URL/hr/v1/leave-requests" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "employeeId": "1ae6d1c6-00ec-4dfc-82b8-c19a68bc30cd",
  "kind": "annual",
  "from": "2026-12-14",
  "to": "2026-12-16",
  "note": "A family event.",
  "operationId": "ad35c814-b5ca-467a-9381-c08f55aa20f7"
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/hr/v1/leave-requests`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "employeeId": "1ae6d1c6-00ec-4dfc-82b8-c19a68bc30cd",
    "kind": "annual",
    "from": "2026-12-14",
    "to": "2026-12-16",
    "note": "A family event.",
    "operationId": "ad35c814-b5ca-467a-9381-c08f55aa20f7"
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/hr/v1/leave-requests',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'employeeId': '1ae6d1c6-00ec-4dfc-82b8-c19a68bc30cd',
        'kind': 'annual',
        'from': '2026-12-14',
        'to': '2026-12-16',
        'note': 'A family event.',
        'operationId': 'ad35c814-b5ca-467a-9381-c08f55aa20f7',
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "employeeId": "1ae6d1c6-00ec-4dfc-82b8-c19a68bc30cd",
  "kind": "annual",
  "from": "2026-12-14",
  "to": "2026-12-16",
  "note": "A family event.",
  "operationId": "ad35c814-b5ca-467a-9381-c08f55aa20f7"
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/hr/v1/leave-requests');
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#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/hr/v1/leave-requests");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "employeeId": "1ae6d1c6-00ec-4dfc-82b8-c19a68bc30cd",
  "kind": "annual",
  "from": "2026-12-14",
  "to": "2026-12-16",
  "note": "A family event.",
  "operationId": "ad35c814-b5ca-467a-9381-c08f55aa20f7"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

Răspuns 202

```json
{
  "operationId": "ad35c814-b5ca-467a-9381-c08f55aa20f7",
  "status": "accepted",
  "aggregateRevision": 1
}
```

Răspunsul este rezultatul operației. Cererea există acum ca `pending`, cu `days` numărate (3, de luni 14 până miercuri 16 decembrie), cu `balanceAfter` pe care îl lasă și cu `approverId` al managerului persoanei. Din sold nu s-a luat încă nimic.

curl

```bash
curl "$RDC_BASE_URL/hr/v1/leave-requests/64ea18ca-94e2-4c6e-898b-adff492e472d" \
  -H "Authorization: Bearer $RDC_TOKEN"
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/hr/v1/leave-requests/64ea18ca-94e2-4c6e-898b-adff492e472d`, {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
  },
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'GET',
    f'{os.environ["RDC_BASE_URL"]}/hr/v1/leave-requests/64ea18ca-94e2-4c6e-898b-adff492e472d',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
)
result = response.json()
```

PHP

```php
<?php

$curl = curl_init(getenv('RDC_BASE_URL') . '/hr/v1/leave-requests/64ea18ca-94e2-4c6e-898b-adff492e472d');
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#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/hr/v1/leave-requests/64ea18ca-94e2-4c6e-898b-adff492e472d");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

Răspuns 200

```json
{
  "id": "64ea18ca-94e2-4c6e-898b-adff492e472d",
  "number": "LR-2026-1050",
  "employeeId": "1ae6d1c6-00ec-4dfc-82b8-c19a68bc30cd",
  "kind": "annual",
  "from": "2026-12-14",
  "to": "2026-12-16",
  "days": 3,
  "balanceAfter": 6,
  "approverId": "46419e0c-a16f-4e44-bed0-0b9700635fd6",
  "status": "pending",
  "note": "A family event.",
  "reason": null,
  "teamAway": null,
  "revision": 1
}
```

## Ce vede aprobatorul

Cererea lui Radu Ionescu acoperă săptămâna de 30 noiembrie. Doi dintre colegii lui de echipă sunt în concediu aprobat la 2 decembrie, deci `teamAway` numește acea zi și pe ei. Semnalul orientează decizia, dar nu o ia.

curl

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

JavaScript

```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

```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
<?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#

```csharp
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();
```

Răspuns 200

```json
{
  "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
}
```

## Decide

[Aprobă o cerere de concediu](https://hr.rdcopilot.com/ro/docs/api-reference/leave/#approve-leave) primește revizia pe care ai citit-o și persoana care decide. [Respinge o cerere de concediu](https://hr.rdcopilot.com/ro/docs/api-reference/leave/#reject-leave) primește în plus un `reason`, care rămâne la cerere. Persoana care a făcut cererea nu poate decide asupra ei (`own_request`), iar doar aprobatorul sau responsabilul de resurse umane o poate (`not_approver`).

curl

```bash
curl -X POST "$RDC_BASE_URL/hr/v1/leave-requests/bd9ccb68-cdef-4ec9-b852-dfa82203a948/approve" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "expectedRevision": 1,
  "actorId": "21bd8239-2794-4320-adba-9128b6a6219b",
  "operationId": "b45282b0-0827-4191-ba70-a0d39dc182c6"
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/hr/v1/leave-requests/bd9ccb68-cdef-4ec9-b852-dfa82203a948/approve`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "expectedRevision": 1,
    "actorId": "21bd8239-2794-4320-adba-9128b6a6219b",
    "operationId": "b45282b0-0827-4191-ba70-a0d39dc182c6"
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/hr/v1/leave-requests/bd9ccb68-cdef-4ec9-b852-dfa82203a948/approve',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'expectedRevision': 1,
        'actorId': '21bd8239-2794-4320-adba-9128b6a6219b',
        'operationId': 'b45282b0-0827-4191-ba70-a0d39dc182c6',
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "expectedRevision": 1,
  "actorId": "21bd8239-2794-4320-adba-9128b6a6219b",
  "operationId": "b45282b0-0827-4191-ba70-a0d39dc182c6"
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/hr/v1/leave-requests/bd9ccb68-cdef-4ec9-b852-dfa82203a948/approve');
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#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/hr/v1/leave-requests/bd9ccb68-cdef-4ec9-b852-dfa82203a948/approve");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "expectedRevision": 1,
  "actorId": "21bd8239-2794-4320-adba-9128b6a6219b",
  "operationId": "b45282b0-0827-4191-ba70-a0d39dc182c6"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

Răspuns 202

```json
{
  "operationId": "b45282b0-0827-4191-ba70-a0d39dc182c6",
  "status": "accepted",
  "aggregateRevision": 2
}
```

După aprobare, cererea este `approved`, cu o revizie în plus, iar zilele sunt luate:

curl

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

JavaScript

```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

```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
<?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#

```csharp
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();
```

Răspuns 200

```json
{
  "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": "approved",
  "note": null,
  "reason": null,
  "teamAway": null,
  "revision": 2
}
```

## Peste sold

O cerere de concediu de odihnă care numără mai multe zile decât soldul este refuzată la depunere, cu `422` și `over_balance`. Mihai Stan are două zile rămase, deci o cerere pentru trei este refuzată. Un concediu de alt tip nu este.

curl

```bash
curl -X POST "$RDC_BASE_URL/hr/v1/leave-requests" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "e91b4a07-3d52-4c68-b7f0-2a6c8d1e5f93",
  "employeeId": "21bd8239-2794-4320-adba-9128b6a6219b",
  "kind": "annual",
  "from": "2026-12-14",
  "to": "2026-12-16"
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/hr/v1/leave-requests`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "e91b4a07-3d52-4c68-b7f0-2a6c8d1e5f93",
    "employeeId": "21bd8239-2794-4320-adba-9128b6a6219b",
    "kind": "annual",
    "from": "2026-12-14",
    "to": "2026-12-16"
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/hr/v1/leave-requests',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': 'e91b4a07-3d52-4c68-b7f0-2a6c8d1e5f93',
        'employeeId': '21bd8239-2794-4320-adba-9128b6a6219b',
        'kind': 'annual',
        'from': '2026-12-14',
        'to': '2026-12-16',
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "e91b4a07-3d52-4c68-b7f0-2a6c8d1e5f93",
  "employeeId": "21bd8239-2794-4320-adba-9128b6a6219b",
  "kind": "annual",
  "from": "2026-12-14",
  "to": "2026-12-16"
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/hr/v1/leave-requests');
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#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/hr/v1/leave-requests");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "e91b4a07-3d52-4c68-b7f0-2a6c8d1e5f93",
  "employeeId": "21bd8239-2794-4320-adba-9128b6a6219b",
  "kind": "annual",
  "from": "2026-12-14",
  "to": "2026-12-16"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

Răspuns 422

```json
{
  "code": "over_balance",
  "message": "The annual leave left is less than the days requested.",
  "requestId": "9b4e1c2a-6d3f-4a78-b5e0-2f8c7d1a3e69"
}
```

## Anulează

[Anulează o cerere de concediu](https://hr.rdcopilot.com/ro/docs/api-reference/leave/#cancel-leave) se aplică unei cereri în așteptare și uneia aprobate, înainte de prima ei zi. Zilele se întorc în sold. Dan Ilie își anulează concediul aprobat din 27 noiembrie – 2 decembrie, iar cele 2 zile luate sunt din nou ale lui.

curl

```bash
curl -X POST "$RDC_BASE_URL/hr/v1/leave-requests/67e16d2f-dc93-4022-bda9-883f8c4a729b/cancel" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "expectedRevision": 2,
  "actorId": "11729ba4-78ca-4dfb-9165-03367b42d67a",
  "operationId": "be2a8c7a-3f1d-457e-b6e7-4a4b8f7d743f"
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/hr/v1/leave-requests/67e16d2f-dc93-4022-bda9-883f8c4a729b/cancel`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "expectedRevision": 2,
    "actorId": "11729ba4-78ca-4dfb-9165-03367b42d67a",
    "operationId": "be2a8c7a-3f1d-457e-b6e7-4a4b8f7d743f"
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/hr/v1/leave-requests/67e16d2f-dc93-4022-bda9-883f8c4a729b/cancel',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'expectedRevision': 2,
        'actorId': '11729ba4-78ca-4dfb-9165-03367b42d67a',
        'operationId': 'be2a8c7a-3f1d-457e-b6e7-4a4b8f7d743f',
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "expectedRevision": 2,
  "actorId": "11729ba4-78ca-4dfb-9165-03367b42d67a",
  "operationId": "be2a8c7a-3f1d-457e-b6e7-4a4b8f7d743f"
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/hr/v1/leave-requests/67e16d2f-dc93-4022-bda9-883f8c4a729b/cancel');
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#

```csharp
using System.Net.Http.Headers;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/hr/v1/leave-requests/67e16d2f-dc93-4022-bda9-883f8c4a729b/cancel");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "expectedRevision": 2,
  "actorId": "11729ba4-78ca-4dfb-9165-03367b42d67a",
  "operationId": "be2a8c7a-3f1d-457e-b6e7-4a4b8f7d743f"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

Răspuns 202

```json
{
  "operationId": "be2a8c7a-3f1d-457e-b6e7-4a4b8f7d743f",
  "status": "accepted",
  "aggregateRevision": 3
}
```

curl

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

JavaScript

```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

```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
<?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#

```csharp
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();
```

Răspuns 200

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