---
title: "Ghid rapid | Documentație | REGES Gateway by R&D Copilot"
description: "Înregistrează o primă angajare în mediul de test: pregătește-o, verifică-o, aprobă-o prin altă persoană, înregistrează transmiterea ei și răspunsul registrului."
canonical: "https://reges.rdcopilot.com/ro/docs/get-started/quickstart/"
language: ro
updated: 2026-11-22
---

# Ghid rapid

Înregistrează o primă angajare în mediul de test: pregătește-o, verifică-o, aprobă-o prin altă persoană, înregistrează transmiterea ei și răspunsul registrului.

Ai nevoie de datele de acces ale clientului și de adresa de bază a mediului tău de test. Exemplele le citesc din variabilele de mediu: `$RDC_BASE_URL` și `$RDC_TOKEN`. Pentru token vezi [Autentificare](https://reges.rdcopilot.com/ro/docs/get-started/authentication/), iar pentru mediul de test vezi [Test și producție](https://reges.rdcopilot.com/ro/docs/get-started/sandbox-and-live/).

La parcurs participă trei persoane desemnate: una pregătește, alta aprobă și a treia transmite. Fiecare are dreptul de acces potrivit pentru angajator. Vezi [Persoane desemnate și delegări](https://reges.rdcopilot.com/ro/docs/employers-and-access/designated-persons/).

## Pregătește angajarea

Alege un `operationId` nou și trimite angajarea cu `id`\-ul angajatorului și cu cel care pregătește ca `designatedPerson`. Contractul este descris în `hire`; codul numeric personal vine la pasul următor. Gateway-ul calculează termenul din data începerii. Datele unei angajări se transmit cel târziu în ziua anterioară începerii activității de către persoană.

curl

```bash
curl -X POST "$RDC_BASE_URL/reges/v1/register-operations" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "fd7fb0da-e8d9-4e54-831d-70ff66d2545a",
  "employerId": "6e2aa977-c041-49c3-8c57-b9f2cd6cf3f0",
  "kind": "hire",
  "designatedPerson": "f3a70882-0da0-4686-bc0c-f29ce600bb0c",
  "hire": {
    "employeeName": "Dan Ilie",
    "citizenship": "RO",
    "contractNumber": "CIM 0391/2026",
    "concludedOn": "2026-11-20",
    "startDate": "2026-12-02",
    "occupation": "432102",
    "contractType": "indefinite",
    "workplace": {
      "kind": "fixed",
      "place": "Piatra-Neamț"
    },
    "hoursPerWeek": 40,
    "baseSalary": "4400.00"
  }
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/reges/v1/register-operations`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "fd7fb0da-e8d9-4e54-831d-70ff66d2545a",
    "employerId": "6e2aa977-c041-49c3-8c57-b9f2cd6cf3f0",
    "kind": "hire",
    "designatedPerson": "f3a70882-0da0-4686-bc0c-f29ce600bb0c",
    "hire": {
      "employeeName": "Dan Ilie",
      "citizenship": "RO",
      "contractNumber": "CIM 0391/2026",
      "concludedOn": "2026-11-20",
      "startDate": "2026-12-02",
      "occupation": "432102",
      "contractType": "indefinite",
      "workplace": {
        "kind": "fixed",
        "place": "Piatra-Neamț"
      },
      "hoursPerWeek": 40,
      "baseSalary": "4400.00"
    }
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/reges/v1/register-operations',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': 'fd7fb0da-e8d9-4e54-831d-70ff66d2545a',
        'employerId': '6e2aa977-c041-49c3-8c57-b9f2cd6cf3f0',
        'kind': 'hire',
        'designatedPerson': 'f3a70882-0da0-4686-bc0c-f29ce600bb0c',
        'hire': {
            'employeeName': 'Dan Ilie',
            'citizenship': 'RO',
            'contractNumber': 'CIM 0391/2026',
            'concludedOn': '2026-11-20',
            'startDate': '2026-12-02',
            'occupation': '432102',
            'contractType': 'indefinite',
            'workplace': {
                'kind': 'fixed',
                'place': 'Piatra-Neamț',
            },
            'hoursPerWeek': 40,
            'baseSalary': '4400.00',
        },
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "fd7fb0da-e8d9-4e54-831d-70ff66d2545a",
  "employerId": "6e2aa977-c041-49c3-8c57-b9f2cd6cf3f0",
  "kind": "hire",
  "designatedPerson": "f3a70882-0da0-4686-bc0c-f29ce600bb0c",
  "hire": {
    "employeeName": "Dan Ilie",
    "citizenship": "RO",
    "contractNumber": "CIM 0391/2026",
    "concludedOn": "2026-11-20",
    "startDate": "2026-12-02",
    "occupation": "432102",
    "contractType": "indefinite",
    "workplace": {
      "kind": "fixed",
      "place": "Piatra-Neamț"
    },
    "hoursPerWeek": 40,
    "baseSalary": "4400.00"
  }
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/reges/v1/register-operations');
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")}/reges/v1/register-operations");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "fd7fb0da-e8d9-4e54-831d-70ff66d2545a",
  "employerId": "6e2aa977-c041-49c3-8c57-b9f2cd6cf3f0",
  "kind": "hire",
  "designatedPerson": "f3a70882-0da0-4686-bc0c-f29ce600bb0c",
  "hire": {
    "employeeName": "Dan Ilie",
    "citizenship": "RO",
    "contractNumber": "CIM 0391/2026",
    "concludedOn": "2026-11-20",
    "startDate": "2026-12-02",
    "occupation": "432102",
    "contractType": "indefinite",
    "workplace": {
      "kind": "fixed",
      "place": "Piatra-Neamț"
    },
    "hoursPerWeek": 40,
    "baseSalary": "4400.00"
  }
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

Răspuns 202

```json
{
  "operationId": "fd7fb0da-e8d9-4e54-831d-70ff66d2545a",
  "status": "accepted",
  "aggregateId": "447e408d-e905-4304-a4cb-9e82a9788ce6",
  "aggregateRevision": 1
}
```

Răspunsul spune că modificarea a fost acceptată. Caută-o cu `getOperation` și cu `operationId`\-ul trimis: când `status` este `completed`, `aggregateId` este `registerOperationId` al ciornei. Vezi [Operații](https://reges.rdcopilot.com/ro/docs/api-reference/operations/).

Repetă o cerere fără risc

După o depășire a timpului de așteptare, repetă cererea cu același `operationId`: modificarea se face o singură dată. O cerere diferită cu același `operationId` este refuzată cu `operation_reused`. Vezi [Idempotență și concurență](https://reges.rdcopilot.com/ro/docs/reference/idempotency/).

## Introdu codul numeric personal

Modifică ciorna: câmpul este `personalNumber`. Scrie numărul pe grupe; spațiile sunt ignorate. Este verificat doar ca structură și apoi eliminat: contractul păstrează ultimele patru cifre și data nașterii. Trimite ca `expectedRevision` revizia pe care ai citit-o.

curl

```bash
curl -X POST "$RDC_BASE_URL/reges/v1/register-operations/447e408d-e905-4304-a4cb-9e82a9788ce6/edit" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "91d8dc13-4627-4a5a-9f22-edf7ee81e418",
  "expectedRevision": 1,
  "field": "personalNumber",
  "value": "5 010118 27 532 8"
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/reges/v1/register-operations/447e408d-e905-4304-a4cb-9e82a9788ce6/edit`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "91d8dc13-4627-4a5a-9f22-edf7ee81e418",
    "expectedRevision": 1,
    "field": "personalNumber",
    "value": "5 010118 27 532 8"
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/reges/v1/register-operations/447e408d-e905-4304-a4cb-9e82a9788ce6/edit',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': '91d8dc13-4627-4a5a-9f22-edf7ee81e418',
        'expectedRevision': 1,
        'field': 'personalNumber',
        'value': '5 010118 27 532 8',
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "91d8dc13-4627-4a5a-9f22-edf7ee81e418",
  "expectedRevision": 1,
  "field": "personalNumber",
  "value": "5 010118 27 532 8"
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/reges/v1/register-operations/447e408d-e905-4304-a4cb-9e82a9788ce6/edit');
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")}/reges/v1/register-operations/447e408d-e905-4304-a4cb-9e82a9788ce6/edit");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "91d8dc13-4627-4a5a-9f22-edf7ee81e418",
  "expectedRevision": 1,
  "field": "personalNumber",
  "value": "5 010118 27 532 8"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

Răspuns 202

```json
{
  "operationId": "91d8dc13-4627-4a5a-9f22-edf7ee81e418",
  "status": "accepted",
  "aggregateId": "447e408d-e905-4304-a4cb-9e82a9788ce6",
  "aggregateRevision": 2
}
```

## Citește verificările

Gateway-ul verifică ciorna înainte să poată fi validată. `canSend` este true când nicio verificare blocantă nu eșuează. Vezi [Verificări înainte de transmitere](https://reges.rdcopilot.com/ro/docs/statuses-and-errors/checks-before-sending/).

Citește verificările unei operațiuni

curl

```bash
curl "$RDC_BASE_URL/reges/v1/register-operations/447e408d-e905-4304-a4cb-9e82a9788ce6/checks" \
  -H "Authorization: Bearer $RDC_TOKEN"
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/reges/v1/register-operations/447e408d-e905-4304-a4cb-9e82a9788ce6/checks`, {
  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"]}/reges/v1/register-operations/447e408d-e905-4304-a4cb-9e82a9788ce6/checks',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
)
result = response.json()
```

PHP

```php
<?php

$curl = curl_init(getenv('RDC_BASE_URL') . '/reges/v1/register-operations/447e408d-e905-4304-a4cb-9e82a9788ce6/checks');
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")}/reges/v1/register-operations/447e408d-e905-4304-a4cb-9e82a9788ce6/checks");
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
{
  "registerOperationId": "447e408d-e905-4304-a4cb-9e82a9788ce6",
  "revision": 2,
  "canSend": true,
  "blocking": 0,
  "checks": [
    {
      "id": "cnp-structure",
      "severity": "blocking",
      "passed": true,
      "message": "The personal number has a valid structure and its birth date is a real date.",
      "detail": {
        "check": "ok"
      }
    },
    {
      "id": "minimum-age",
      "severity": "attention",
      "passed": true,
      "message": "The employee is 25 years old; the minimum age for work is 16 years.",
      "detail": {
        "age": 25,
        "minimum": 16,
        "withConsent": 15
      }
    },
    {
      "id": "occupation-code",
      "severity": "blocking",
      "passed": true,
      "message": "Occupation code 432102 is in the list of occupations (Magaziner).",
      "detail": {
        "code": "432102"
      }
    },
    {
      "id": "minimum-salary",
      "severity": "blocking",
      "passed": true,
      "message": "The base salary of 4,400.00 RON is not below the minimum of 4,325.00 RON for this weekly schedule.",
      "detail": {
        "salary": "4400.00",
        "minimum": "4325.00"
      }
    },
    {
      "id": "working-time",
      "severity": "blocking",
      "passed": true,
      "message": "40 hours a week is within the maximum of 40 hours.",
      "detail": {
        "hours": 40,
        "maximum": 40
      }
    },
    {
      "id": "contract-state",
      "severity": "blocking",
      "passed": true,
      "message": "The contract is pending, which this operation allows.",
      "detail": {
        "status": "pending",
        "required": "pending"
      }
    },
    {
      "id": "deadline",
      "severity": "attention",
      "passed": true,
      "message": "The deadline is 1 December 2026, in 4 working days.",
      "detail": {
        "deadline": "2026-12-01",
        "late": -4
      }
    }
  ]
}
```

## Validează ciorna

Validarea mută ciorna în `validated`. Cât timp o verificare blocantă eșuează, răspunsul este 422, iar ciorna rămâne ciornă. Dacă altcineva a modificat ciorna după revizia ta, răspunsul este 409 și nu se aplică nimic.

curl

```bash
curl -X POST "$RDC_BASE_URL/reges/v1/register-operations/447e408d-e905-4304-a4cb-9e82a9788ce6/validate" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "f3e122ff-b3de-4e37-816b-035e7c22214f",
  "expectedRevision": 2
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/reges/v1/register-operations/447e408d-e905-4304-a4cb-9e82a9788ce6/validate`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "f3e122ff-b3de-4e37-816b-035e7c22214f",
    "expectedRevision": 2
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/reges/v1/register-operations/447e408d-e905-4304-a4cb-9e82a9788ce6/validate',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': 'f3e122ff-b3de-4e37-816b-035e7c22214f',
        'expectedRevision': 2,
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "f3e122ff-b3de-4e37-816b-035e7c22214f",
  "expectedRevision": 2
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/reges/v1/register-operations/447e408d-e905-4304-a4cb-9e82a9788ce6/validate');
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")}/reges/v1/register-operations/447e408d-e905-4304-a4cb-9e82a9788ce6/validate");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "f3e122ff-b3de-4e37-816b-035e7c22214f",
  "expectedRevision": 2
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

Răspuns 202

```json
{
  "operationId": "f3e122ff-b3de-4e37-816b-035e7c22214f",
  "status": "accepted",
  "aggregateId": "447e408d-e905-4304-a4cb-9e82a9788ce6",
  "aggregateRevision": 3
}
```

## Aprobă-o prin altă persoană

O persoană desemnată cu domeniul `approve` aprobă operațiunea. Aceasta trece în `authorized`.

curl

```bash
curl -X POST "$RDC_BASE_URL/reges/v1/register-operations/b5f54bb0-fa5e-43d6-b9fc-b5b0afe9d3d7/authorize" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "64b9975a-c670-4934-8a99-91c95b901952",
  "expectedRevision": 2,
  "designatedPerson": "c403d6ca-4254-4be4-8781-6be8b95a3de0"
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/reges/v1/register-operations/b5f54bb0-fa5e-43d6-b9fc-b5b0afe9d3d7/authorize`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "64b9975a-c670-4934-8a99-91c95b901952",
    "expectedRevision": 2,
    "designatedPerson": "c403d6ca-4254-4be4-8781-6be8b95a3de0"
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/reges/v1/register-operations/b5f54bb0-fa5e-43d6-b9fc-b5b0afe9d3d7/authorize',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': '64b9975a-c670-4934-8a99-91c95b901952',
        'expectedRevision': 2,
        'designatedPerson': 'c403d6ca-4254-4be4-8781-6be8b95a3de0',
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "64b9975a-c670-4934-8a99-91c95b901952",
  "expectedRevision": 2,
  "designatedPerson": "c403d6ca-4254-4be4-8781-6be8b95a3de0"
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/reges/v1/register-operations/b5f54bb0-fa5e-43d6-b9fc-b5b0afe9d3d7/authorize');
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")}/reges/v1/register-operations/b5f54bb0-fa5e-43d6-b9fc-b5b0afe9d3d7/authorize");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "64b9975a-c670-4934-8a99-91c95b901952",
  "expectedRevision": 2,
  "designatedPerson": "c403d6ca-4254-4be4-8781-6be8b95a3de0"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

Răspuns 202

```json
{
  "operationId": "64b9975a-c670-4934-8a99-91c95b901952",
  "status": "accepted",
  "aggregateId": "b5f54bb0-fa5e-43d6-b9fc-b5b0afe9d3d7",
  "aggregateRevision": 3
}
```

Regula celor doi ochi

Persoana care a pregătit operațiunea nu o poate aproba: răspunsul este `same_person`. O persoană fără domeniul `approve` este refuzată cu `not_permitted`.

## Înregistrează transmiterea

O persoană desemnată cu domeniul `transmit` transmite operațiunea aprobată cu accesul angajatorului. Înregistrează-o cu `submitOperation`: operațiunea trece în `submitted`, iar evenimentul `operation.submitted` este trimis. Exemplul a depășit termenul, deci poartă un `reason`; o operațiune în termen nu are nevoie de el.

curl

```bash
curl -X POST "$RDC_BASE_URL/reges/v1/register-operations/27357abf-301f-4956-88af-73c842b85100/submit" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "4387ad28-fee6-449b-83f5-c31574533646",
  "expectedRevision": 3,
  "designatedPerson": "b5192196-cb10-4857-a91d-e1eae8a64953",
  "reason": "The employer’s access to the register had expired and was renewed first."
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/reges/v1/register-operations/27357abf-301f-4956-88af-73c842b85100/submit`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "4387ad28-fee6-449b-83f5-c31574533646",
    "expectedRevision": 3,
    "designatedPerson": "b5192196-cb10-4857-a91d-e1eae8a64953",
    "reason": "The employer’s access to the register had expired and was renewed first."
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/reges/v1/register-operations/27357abf-301f-4956-88af-73c842b85100/submit',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': '4387ad28-fee6-449b-83f5-c31574533646',
        'expectedRevision': 3,
        'designatedPerson': 'b5192196-cb10-4857-a91d-e1eae8a64953',
        'reason': 'The employer’s access to the register had expired and was renewed first.',
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "4387ad28-fee6-449b-83f5-c31574533646",
  "expectedRevision": 3,
  "designatedPerson": "b5192196-cb10-4857-a91d-e1eae8a64953",
  "reason": "The employer’s access to the register had expired and was renewed first."
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/reges/v1/register-operations/27357abf-301f-4956-88af-73c842b85100/submit');
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")}/reges/v1/register-operations/27357abf-301f-4956-88af-73c842b85100/submit");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "4387ad28-fee6-449b-83f5-c31574533646",
  "expectedRevision": 3,
  "designatedPerson": "b5192196-cb10-4857-a91d-e1eae8a64953",
  "reason": "The employer’s access to the register had expired and was renewed first."
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

Răspuns 202

```json
{
  "operationId": "4387ad28-fee6-449b-83f5-c31574533646",
  "status": "accepted",
  "aggregateId": "27357abf-301f-4956-88af-73c842b85100",
  "aggregateRevision": 4
}
```

## Înregistrează răspunsul

Când registrul răspunde, înregistrează răspunsul. `registered` primește `reference` dată de registru; `rejected` primește `message` exact cum a fost scris. O angajare înregistrată activează contractul.

curl

```bash
curl -X POST "$RDC_BASE_URL/reges/v1/register-operations/33ac882a-d64f-4ac2-9658-37361cf74da1/answer" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "4fd6d86a-abb0-412a-a168-7a6824007b32",
  "expectedRevision": 10,
  "outcome": "registered",
  "reference": "R2026-0490409"
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/reges/v1/register-operations/33ac882a-d64f-4ac2-9658-37361cf74da1/answer`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "4fd6d86a-abb0-412a-a168-7a6824007b32",
    "expectedRevision": 10,
    "outcome": "registered",
    "reference": "R2026-0490409"
  }),
});
const result = await response.json();
```

Python

```python
import os
import requests

response = requests.request(
    'POST',
    f'{os.environ["RDC_BASE_URL"]}/reges/v1/register-operations/33ac882a-d64f-4ac2-9658-37361cf74da1/answer',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': '4fd6d86a-abb0-412a-a168-7a6824007b32',
        'expectedRevision': 10,
        'outcome': 'registered',
        'reference': 'R2026-0490409',
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "4fd6d86a-abb0-412a-a168-7a6824007b32",
  "expectedRevision": 10,
  "outcome": "registered",
  "reference": "R2026-0490409"
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/reges/v1/register-operations/33ac882a-d64f-4ac2-9658-37361cf74da1/answer');
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")}/reges/v1/register-operations/33ac882a-d64f-4ac2-9658-37361cf74da1/answer");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "4fd6d86a-abb0-412a-a168-7a6824007b32",
  "expectedRevision": 10,
  "outcome": "registered",
  "reference": "R2026-0490409"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

Răspuns 202

```json
{
  "operationId": "4fd6d86a-abb0-412a-a168-7a6824007b32",
  "status": "accepted",
  "aggregateId": "33ac882a-d64f-4ac2-9658-37361cf74da1",
  "aggregateRevision": 11
}
```

## Citește operațiunea

Operațiunea poartă termenul, istoricul și referința registrului. Înregistrează o adresă, iar evenimentele îți spun același lucru fără să citești: vezi [Catalogul de evenimente](https://reges.rdcopilot.com/ro/docs/events/event-catalogue/).

Citește o operațiune în registru

curl

```bash
curl "$RDC_BASE_URL/reges/v1/register-operations/1453a253-8c3c-41cc-99e0-23855a04de29" \
  -H "Authorization: Bearer $RDC_TOKEN"
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/reges/v1/register-operations/1453a253-8c3c-41cc-99e0-23855a04de29`, {
  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"]}/reges/v1/register-operations/1453a253-8c3c-41cc-99e0-23855a04de29',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
)
result = response.json()
```

PHP

```php
<?php

$curl = curl_init(getenv('RDC_BASE_URL') . '/reges/v1/register-operations/1453a253-8c3c-41cc-99e0-23855a04de29');
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")}/reges/v1/register-operations/1453a253-8c3c-41cc-99e0-23855a04de29");
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": "1453a253-8c3c-41cc-99e0-23855a04de29",
  "number": "RG-2026-001479",
  "employerId": "6e2aa977-c041-49c3-8c57-b9f2cd6cf3f0",
  "contractId": "9b79f86f-cc08-4468-8879-747525466dd3",
  "employee": "Ioana Marin",
  "kind": "change-salary",
  "status": "registered",
  "date": "2026-11-01",
  "until": null,
  "deadline": {
    "date": "2026-11-27",
    "rule": "salary",
    "from": "2026-11-01",
    "workingDaysLeft": 4
  },
  "late": false,
  "details": {
    "date": "2026-11-01",
    "salary": "9800.00"
  },
  "preparedBy": {
    "id": "f3a70882-0da0-4686-bc0c-f29ce600bb0c",
    "name": "Elena Dumitru"
  },
  "authorizedBy": {
    "id": "c403d6ca-4254-4be4-8781-6be8b95a3de0",
    "name": "Ana Rusu"
  },
  "transmittedBy": {
    "id": "b5192196-cb10-4857-a91d-e1eae8a64953",
    "name": "Maria Costea"
  },
  "reference": "R2026-0479033",
  "rejection": null,
  "lateReason": null,
  "correctionOf": null,
  "attempts": 1,
  "history": [
    {
      "status": "draft",
      "at": "2026-11-02T08:20:00Z",
      "by": {
        "id": "f3a70882-0da0-4686-bc0c-f29ce600bb0c",
        "name": "Elena Dumitru"
      },
      "reference": null,
      "message": null,
      "reason": null,
      "late": false
    },
    {
      "status": "validated",
      "at": "2026-11-02T08:31:00Z",
      "by": null,
      "reference": null,
      "message": null,
      "reason": null,
      "late": false
    },
    {
      "status": "authorized",
      "at": "2026-11-02T09:05:00Z",
      "by": {
        "id": "c403d6ca-4254-4be4-8781-6be8b95a3de0",
        "name": "Ana Rusu"
      },
      "reference": null,
      "message": null,
      "reason": null,
      "late": false
    },
    {
      "status": "submitted",
      "at": "2026-11-02T09:40:00Z",
      "by": {
        "id": "b5192196-cb10-4857-a91d-e1eae8a64953",
        "name": "Maria Costea"
      },
      "reference": null,
      "message": null,
      "reason": null,
      "late": false
    },
    {
      "status": "processing",
      "at": "2026-11-02T09:41:00Z",
      "by": null,
      "reference": null,
      "message": null,
      "reason": null,
      "late": false
    },
    {
      "status": "registered",
      "at": "2026-11-02T10:12:00Z",
      "by": null,
      "reference": "R2026-0479033",
      "message": null,
      "reason": null,
      "late": false
    }
  ],
  "revision": 6
}
```
