---
title: "Register operations | Docs | REGES Gateway by R&D Copilot"
description: "Prepare an operation, run its checks, validate, approve and transmit it, record the answer and follow its history."
canonical: "https://reges.rdcopilot.com/docs/api-reference/register-operations/"
language: en
updated: 2026-11-22
---

# Register operations

Prepare an operation, run its checks, validate, approve and transmit it, record the answer and follow its history.

## List register operations

GET `/reges/v1/register-operations`

Returns the register operations of an employer in pages: the open ones first, soonest deadline first, then the others, newest first. `status`, `kind`, `dueBefore` and `late` narrow the list.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `employerId` | query | `string (uuid)` | Yesrequired | The employer whose records you want. It is the `id` of an employer of your account. |
| `status` | query | `string` | Nooptional | Only operations in this status. One of `draft`, `validated`, `authorized`, `submitted`, `processing`, `registered`, `rejected`, `manual_review`, `cancelled` |
| `kind` | query | `string` | Nooptional | Only operations of this kind. One of `hire`, `change-terms`, `change-salary`, `suspend`, `resume`, `terminate`, `transfer`, `secondment` |
| `dueBefore` | query | `string (date)` | Nooptional | Only operations whose deadline is before this day. |
| `late` | query | `boolean` | Nooptional | `true` keeps only the operations that are open and past their deadline. |
| `limit` | query | `integer` | Nooptional | Records per page, from 1 to 500. Default `100` Range `1` – `500` |
| `cursor` | query | `string` | Nooptional | The `nextCursor` of the previous page. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `200` | A page of register operations. | `RegisterOperationPage` |
| `401` | The token is missing, has expired or is not ours. | `Error` |
| `403` | The token does not give access to this employer or operation. | `Error` |
| `404` | The employer does not exist in your account. | `Error` |
| `429` | There were too many requests. Nothing was processed. The header `Retry-After` gives the seconds to wait. | `Error` |
| `503` | The gateway cannot answer now. | `Error` |

### Request

curl

```bash
curl "$RDC_BASE_URL/reges/v1/register-operations?employerId=6e2aa977-c041-49c3-8c57-b9f2cd6cf3f0&limit=3" \
  -H "Authorization: Bearer $RDC_TOKEN"
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/reges/v1/register-operations?employerId=6e2aa977-c041-49c3-8c57-b9f2cd6cf3f0&limit=3`, {
  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?employerId=6e2aa977-c041-49c3-8c57-b9f2cd6cf3f0&limit=3',
    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?employerId=6e2aa977-c041-49c3-8c57-b9f2cd6cf3f0&limit=3');
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?employerId=6e2aa977-c041-49c3-8c57-b9f2cd6cf3f0&limit=3");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

### Response `200`

JSON

```json
{
  "items": [
    {
      "id": "27357abf-301f-4956-88af-73c842b85100",
      "number": "RG-2026-001471",
      "employerId": "6e2aa977-c041-49c3-8c57-b9f2cd6cf3f0",
      "contractId": "4fc60d72-3c1e-415c-a931-f0b21bfda436",
      "employee": "Mihai Stan",
      "kind": "change-salary",
      "status": "authorized",
      "date": "2026-10-26",
      "until": null,
      "deadline": {
        "date": "2026-11-20",
        "rule": "salary",
        "from": "2026-10-26",
        "workingDaysLeft": -1
      },
      "late": true,
      "details": {
        "date": "2026-10-26",
        "salary": "5600.00"
      },
      "preparedBy": {
        "id": "f3a70882-0da0-4686-bc0c-f29ce600bb0c",
        "name": "Elena Dumitru"
      },
      "authorizedBy": {
        "id": "c403d6ca-4254-4be4-8781-6be8b95a3de0",
        "name": "Ana Rusu"
      },
      "transmittedBy": null,
      "reference": null,
      "rejection": null,
      "lateReason": null,
      "correctionOf": null,
      "attempts": 0,
      "history": [
        {
          "status": "draft",
          "at": "2026-10-27T10:02:00Z",
          "by": {
            "id": "f3a70882-0da0-4686-bc0c-f29ce600bb0c",
            "name": "Elena Dumitru"
          },
          "reference": null,
          "message": null,
          "reason": null,
          "late": false
        },
        {
          "status": "validated",
          "at": "2026-10-27T10:10:00Z",
          "by": null,
          "reference": null,
          "message": null,
          "reason": null,
          "late": false
        },
        {
          "status": "authorized",
          "at": "2026-10-28T11:30:00Z",
          "by": {
            "id": "c403d6ca-4254-4be4-8781-6be8b95a3de0",
            "name": "Ana Rusu"
          },
          "reference": null,
          "message": null,
          "reason": null,
          "late": false
        }
      ],
      "revision": 3
    },
    {
      "id": "b5f54bb0-fa5e-43d6-b9fc-b5b0afe9d3d7",
      "number": "RG-2026-001481",
      "employerId": "6e2aa977-c041-49c3-8c57-b9f2cd6cf3f0",
      "contractId": "02b6b76c-19a6-4b97-af20-50b265e9d36d",
      "employee": "Radu Ionescu",
      "kind": "suspend",
      "status": "validated",
      "date": "2026-11-18",
      "until": null,
      "deadline": {
        "date": "2026-11-23",
        "rule": "suspension-days",
        "from": "2026-11-19",
        "workingDaysLeft": 0
      },
      "late": false,
      "details": {
        "date": "2026-11-18",
        "reason": "medical-leave",
        "learnedOn": "2026-11-19"
      },
      "preparedBy": {
        "id": "f3a70882-0da0-4686-bc0c-f29ce600bb0c",
        "name": "Elena Dumitru"
      },
      "authorizedBy": null,
      "transmittedBy": null,
      "reference": null,
      "rejection": null,
      "lateReason": null,
      "correctionOf": null,
      "attempts": 0,
      "history": [
        {
          "status": "draft",
          "at": "2026-11-19T15:12:00Z",
          "by": {
            "id": "f3a70882-0da0-4686-bc0c-f29ce600bb0c",
            "name": "Elena Dumitru"
          },
          "reference": null,
          "message": null,
          "reason": null,
          "late": false
        },
        {
          "status": "validated",
          "at": "2026-11-19T15:20:00Z",
          "by": null,
          "reference": null,
          "message": null,
          "reason": null,
          "late": false
        }
      ],
      "revision": 2
    },
    {
      "id": "4bbaadac-0dc6-40b0-9470-f26f8177bd8d",
      "number": "RG-2026-001483",
      "employerId": "6e2aa977-c041-49c3-8c57-b9f2cd6cf3f0",
      "contractId": "13156f30-1274-45d1-af53-672ccb3c7e04",
      "employee": "Dan Ilie",
      "kind": "hire",
      "status": "draft",
      "date": "2026-12-02",
      "until": null,
      "deadline": {
        "date": "2026-12-01",
        "rule": "hire",
        "from": "2026-12-02",
        "workingDaysLeft": 4
      },
      "late": false,
      "details": {
        "date": "2026-12-02"
      },
      "preparedBy": {
        "id": "f3a70882-0da0-4686-bc0c-f29ce600bb0c",
        "name": "Elena Dumitru"
      },
      "authorizedBy": null,
      "transmittedBy": null,
      "reference": null,
      "rejection": null,
      "lateReason": null,
      "correctionOf": null,
      "attempts": 0,
      "history": [
        {
          "status": "draft",
          "at": "2026-11-20T13:41:00Z",
          "by": {
            "id": "f3a70882-0da0-4686-bc0c-f29ce600bb0c",
            "name": "Elena Dumitru"
          },
          "reference": null,
          "message": null,
          "reason": null,
          "late": false
        }
      ],
      "revision": 1
    }
  ],
  "nextCursor": "eyJvZmZzZXQiOjN9"
}
```

## Prepare an operation

POST `/reges/v1/register-operations`

Prepares an operation as a draft and runs its checks. A hire carries the contract in `hire` and makes it; every other kind carries `contractId` and its values in `details`. The personal number of a hire is added afterwards with `editOperation`. The designated person must hold the `prepare` scope for the employer. Read the draft with `getRegisterOperation` once `status` is `completed`.

### Request body

| Field | Type | Required | Meaning |
| --- | --- | --- | --- |
| `operationId` | `string (uuid)` | Yesrequired | A UUID you choose for this change. Send it again to repeat the request. |
| `employerId` | `string (uuid)` | Yesrequired | The employer the operation is for. |
| `kind` | `string` | Yesrequired | What the operation does. One of `hire`, `change-terms`, `change-salary`, `suspend`, `resume`, `terminate`, `transfer`, `secondment` |
| `contractId` | `string (uuid)` | Nooptional | The contract the operation changes. Required for every kind but `hire`, which makes its own contract. |
| `designatedPerson` | `string (uuid)` | Yesrequired | The designated person who prepares the operation. They must hold the `prepare` scope for the employer. |
| `details` | `Details` | Nooptional | The values of the operation: required for every kind but `hire`. |
| `details.date` | `string (date)` | Yesrequired | The day the operation takes effect: the start of a hire, a suspension or a secondment, the day of a change, a transfer or a termination. |
| `details.until` | `string (date)` | Nooptional | The last day of a secondment. |
| `details.salary` | `string` | Nooptional | The new monthly gross base salary of a change of salary, in RON, as a decimal string. |
| `details.terms` | `object` | Nooptional | The terms a change of terms sets: only the fields that change. |
| `details.terms.occupation` | `string` | Nooptional | A code of the list of occupations (`listOccupations`). |
| `details.terms.contractType` | `string` | Nooptional | `indefinite` or `fixed-term`. One of `indefinite`, `fixed-term` |
| `details.terms.endDate` | `string (date)` | Nooptional | The day a fixed-term contract ends, `null` for an indefinite one. |
| `details.terms.workplace` | `Workplace` | Nooptional |  |
| `details.terms.workplace.kind` | `string` | Yesrequired | `fixed` or `mobile`. One of `fixed`, `mobile` |
| `details.terms.workplace.place` | `string` | Yesrequired | Where the work is done: a locality, or the area of a mobile workplace. |
| `details.terms.hoursPerWeek` | `integer` | Nooptional | Hours per week. Range `1` – `99` |
| `details.reason` | `string` | Nooptional | Why a suspension happens. One of `medical-leave`, `unexcused-absence`, `force-majeure`, `other` |
| `details.learnedOn` | `string (date)` | Nooptional | The day a certificate or an absence was recorded at the employer, the day the employer learned of a court decision, or of a termination. |
| `details.courtDecision` | `boolean` | Nooptional | True when the change follows a court decision: its deadline then runs from `learnedOn`. |
| `details.legalBasis` | `string` | Nooptional | The legal basis of a termination, in your words. |
| `details.to` | `string (uuid)` | Nooptional | The employer a transfer goes to, or the one the employee is seconded to. |
| `hire` | `PrepareHire` | Nooptional | The contract of a hire. Only for `hire`. |
| `hire.employeeName` | `string` | Yesrequired | The name of the employee as the contract carries it. |
| `hire.citizenship` | `string` | Yesrequired | `RO`, `EU`, `EEA` or `non-EU`. One of `RO`, `EU`, `EEA`, `non-EU` |
| `hire.contractNumber` | `string` | Yesrequired | The number of the contract. |
| `hire.concludedOn` | `string (date)` | Yesrequired | The day the contract was concluded. |
| `hire.startDate` | `string (date)` | Yesrequired | The first day of work. |
| `hire.occupation` | `string` | Yesrequired | A code of the list of occupations (`listOccupations`). |
| `hire.contractType` | `string` | Yesrequired | `indefinite` or `fixed-term`. One of `indefinite`, `fixed-term` |
| `hire.endDate` | `string (date)` | Nooptional | The last day of a fixed-term contract. Leave it out for an indefinite one. |
| `hire.workplace` | `Workplace` | Yesrequired |  |
| `hire.workplace.kind` | `string` | Yesrequired | `fixed` or `mobile`. One of `fixed`, `mobile` |
| `hire.workplace.place` | `string` | Yesrequired | Where the work is done: a locality, or the area of a mobile workplace. |
| `hire.hoursPerWeek` | `integer` | Yesrequired | Hours per week. Range `1` – `99` |
| `hire.baseSalary` | `string` | Yesrequired | The monthly gross base salary in RON, as a decimal string. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `202` | The change was accepted. The body is the operation result: `aggregateId` is the record that was created or changed. | `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, has expired or is not ours. | `Error` |
| `403` | The token does not give access to this employer or operation. | `Error` |
| `404` | `employer_not_found`: The employer does not exist in your account. `contract_not_found`: The contract does not exist in your account. | `Error` |
| `409` | `operation_reused`: The `operationId` was already used with a different request. `not_permitted`: The designated person does not hold the access permission this step needs for the employer, or it has ended. Nothing was changed. `already_open`: An operation of this kind is already being prepared for the contract. | `Error` |
| `422` | A value has the right type but the rules do not accept it: a date that does not exist, an amount that is not positive, an unknown kind of change for the contract. | `Error` |
| `429` | There were too many requests. Nothing was processed. The header `Retry-After` gives the seconds to wait. | `Error` |
| `503` | The gateway cannot answer now. | `Error` |

### Request

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

### Response `202`

JSON

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

## Get a register operation

GET `/reges/v1/register-operations/{registerOperationId}`

Returns an operation with its deadline, its history and, once the register answered, its reference or its reply, at its current revision.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `registerOperationId` | path | `string (uuid)` | Yesrequired | The register operation. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `200` | The operation at its current revision. | `RegisterOperation` |
| `401` | The token is missing, has expired or is not ours. | `Error` |
| `403` | The token does not give access to this employer or operation. | `Error` |
| `404` | The register operation does not exist in your account. | `Error` |
| `429` | There were too many requests. Nothing was processed. The header `Retry-After` gives the seconds to wait. | `Error` |
| `503` | The gateway cannot answer now. | `Error` |

### Request

curl

```bash
curl "$RDC_BASE_URL/reges/v1/register-operations/4bbaadac-0dc6-40b0-9470-f26f8177bd8d" \
  -H "Authorization: Bearer $RDC_TOKEN"
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/reges/v1/register-operations/4bbaadac-0dc6-40b0-9470-f26f8177bd8d`, {
  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/4bbaadac-0dc6-40b0-9470-f26f8177bd8d',
    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/4bbaadac-0dc6-40b0-9470-f26f8177bd8d');
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/4bbaadac-0dc6-40b0-9470-f26f8177bd8d");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

### Response `200`

JSON

```json
{
  "id": "4bbaadac-0dc6-40b0-9470-f26f8177bd8d",
  "number": "RG-2026-001483",
  "employerId": "6e2aa977-c041-49c3-8c57-b9f2cd6cf3f0",
  "contractId": "13156f30-1274-45d1-af53-672ccb3c7e04",
  "employee": "Dan Ilie",
  "kind": "hire",
  "status": "draft",
  "date": "2026-12-02",
  "until": null,
  "deadline": {
    "date": "2026-12-01",
    "rule": "hire",
    "from": "2026-12-02",
    "workingDaysLeft": 4
  },
  "late": false,
  "details": {
    "date": "2026-12-02"
  },
  "preparedBy": {
    "id": "f3a70882-0da0-4686-bc0c-f29ce600bb0c",
    "name": "Elena Dumitru"
  },
  "authorizedBy": null,
  "transmittedBy": null,
  "reference": null,
  "rejection": null,
  "lateReason": null,
  "correctionOf": null,
  "attempts": 0,
  "history": [
    {
      "status": "draft",
      "at": "2026-11-20T13:41:00Z",
      "by": {
        "id": "f3a70882-0da0-4686-bc0c-f29ce600bb0c",
        "name": "Elena Dumitru"
      },
      "reference": null,
      "message": null,
      "reason": null,
      "late": false
    }
  ],
  "revision": 1
}
```

## Change a draft

POST `/reges/v1/register-operations/{registerOperationId}/edit`

Changes one field of a draft, then runs the checks again. Only a draft can be changed; the revision grows with every accepted change. The personal number of a hire is typed here: it is checked and dropped, and only its last four digits and its birth date are kept.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `registerOperationId` | path | `string (uuid)` | Yesrequired | The register operation. |

### 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 register operation you read. |
| `field` | `string` | Yesrequired | The field of the draft to change. One of `salary`, `date`, `occupation`, `hours`, `personalNumber` |
| `value` | `string` | Yesrequired | The new value, as a string. `salary` takes a decimal string, `date` a date, `occupation` a code of the list of occupations, `hours` a whole number of hours per week. `personalNumber` takes the personal number of the employee of a hire, written with or without spaces: spaces are ignored. The number is checked and dropped: only its last four digits and the birth date it holds are kept. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `202` | The change was accepted. The body is the operation result: `aggregateId` is the record that was created or changed. | `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, has expired or is not ours. | `Error` |
| `403` | The token does not give access to this employer or operation. | `Error` |
| `404` | The register operation does not exist in your account. | `Error` |
| `409` | `revision_conflict`: The record changed since the revision you sent. Nothing was applied. `operation_reused`: The `operationId` was already used with a different request. `invalid_status`: The operation is not in a status that allows this. | `Error` |
| `422` | A value has the right type but the rules do not accept it: a date that does not exist, an amount that is not positive, an unknown kind of change for the contract. | `Error` |
| `429` | There were too many requests. Nothing was processed. The header `Retry-After` gives the seconds to wait. | `Error` |
| `503` | The gateway cannot answer now. | `Error` |

### Request

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

### Response `202`

JSON

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

## Get the checks of an operation

GET `/reges/v1/register-operations/{registerOperationId}/checks`

Runs the checks on the operation as it is now and returns each one with its severity, its result and the values behind it. `canSend` is true when no blocking check fails.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `registerOperationId` | path | `string (uuid)` | Yesrequired | The register operation. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `200` | The checks of the operation. | `Checks` |
| `401` | The token is missing, has expired or is not ours. | `Error` |
| `403` | The token does not give access to this employer or operation. | `Error` |
| `404` | The register operation does not exist in your account. | `Error` |
| `429` | There were too many requests. Nothing was processed. The header `Retry-After` gives the seconds to wait. | `Error` |
| `503` | The gateway cannot answer now. | `Error` |

### Request

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

### Response `200`

JSON

```json
{
  "registerOperationId": "447e408d-e905-4304-a4cb-9e82a9788ce6",
  "revision": 1,
  "canSend": false,
  "blocking": 1,
  "checks": [
    {
      "id": "cnp-structure",
      "severity": "blocking",
      "passed": false,
      "message": "No personal number has been entered yet.",
      "detail": {
        "check": "missing"
      }
    },
    {
      "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
      }
    }
  ]
}
```

## Validate a draft

POST `/reges/v1/register-operations/{registerOperationId}/validate`

Moves a draft to `validated`. It is refused with 422 while a blocking check fails and with 409 when `expectedRevision` is not the current revision or the operation is not a draft.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `registerOperationId` | path | `string (uuid)` | Yesrequired | The register operation. |

### 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 register operation you read. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `202` | The change was accepted. The body is the operation result: `aggregateId` is the record that was created or changed. | `OperationResult` |
| `401` | The token is missing, has expired or is not ours. | `Error` |
| `403` | The token does not give access to this employer or operation. | `Error` |
| `404` | The register operation does not exist in your account. | `Error` |
| `409` | `revision_conflict`: The record changed since the revision you sent. Nothing was applied. `operation_reused`: The `operationId` was already used with a different request. `invalid_status`: The operation is not in a status that allows this. | `Error` |
| `422` | A blocking check still fails. Nothing was validated and the operation stays a draft. | `Error` |
| `429` | There were too many requests. Nothing was processed. The header `Retry-After` gives the seconds to wait. | `Error` |
| `503` | The gateway cannot answer now. | `Error` |

### Request

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

### Response `202`

JSON

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

## Approve an operation

POST `/reges/v1/register-operations/{registerOperationId}/authorize`

Moves a validated operation to `authorized`. The designated person must hold the `approve` scope for the employer and cannot be the person who prepared the operation.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `registerOperationId` | path | `string (uuid)` | Yesrequired | The register operation. |

### 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 register operation you read. |
| `designatedPerson` | `string (uuid)` | Yesrequired | The designated person who approves. They must hold the `approve` scope for the employer and cannot be the person who prepared the operation. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `202` | The change was accepted. The body is the operation result: `aggregateId` is the record that was created or changed. | `OperationResult` |
| `401` | The token is missing, has expired or is not ours. | `Error` |
| `403` | The token does not give access to this employer or operation. | `Error` |
| `404` | The register operation does not exist in your account. | `Error` |
| `409` | `revision_conflict`: The record changed since the revision you sent. Nothing was applied. `operation_reused`: The `operationId` was already used with a different request. `invalid_status`: The operation is not in a status that allows this. `not_permitted`: The designated person does not hold the access permission this step needs for the employer, or it has ended. Nothing was changed. `same_person`: The person who prepared the operation cannot approve it. | `Error` |
| `429` | There were too many requests. Nothing was processed. The header `Retry-After` gives the seconds to wait. | `Error` |
| `503` | The gateway cannot answer now. | `Error` |

### Request

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

### Response `202`

JSON

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

## Record a transmission

POST `/reges/v1/register-operations/{registerOperationId}/submit`

Records that the designated person transmitted an approved operation with the employer’s access, and moves it to `submitted`. The designated person must hold the `transmit` scope for the employer. After the deadline `reason` is required and is kept with the transmission.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `registerOperationId` | path | `string (uuid)` | Yesrequired | The register operation. |

### 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 register operation you read. |
| `designatedPerson` | `string (uuid)` | Yesrequired | The designated person who transmitted the operation. They must hold the `transmit` scope for the employer. |
| `reason` | `string` | Nooptional | Why the operation is transmitted after its deadline. Required after the deadline. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `202` | The change was accepted. The body is the operation result: `aggregateId` is the record that was created or changed. | `OperationResult` |
| `401` | The token is missing, has expired or is not ours. | `Error` |
| `403` | The token does not give access to this employer or operation. | `Error` |
| `404` | The register operation does not exist in your account. | `Error` |
| `409` | `revision_conflict`: The record changed since the revision you sent. Nothing was applied. `operation_reused`: The `operationId` was already used with a different request. `invalid_status`: The operation is not in a status that allows this. `not_permitted`: The designated person does not hold the access permission this step needs for the employer, or it has ended. Nothing was changed. `reason_required`: A reason is required: the deadline has passed, or the outcome of a transmission is being flagged as unknown. | `Error` |
| `429` | There were too many requests. Nothing was processed. The header `Retry-After` gives the seconds to wait. | `Error` |
| `503` | The gateway cannot answer now. | `Error` |

### Request

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

### Response `202`

JSON

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

## Mark an operation as processing

POST `/reges/v1/register-operations/{registerOperationId}/acknowledge`

Moves a transmitted operation to `processing`: the register has it and has not answered yet.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `registerOperationId` | path | `string (uuid)` | Yesrequired | The register operation. |

### 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 register operation you read. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `202` | The change was accepted. The body is the operation result: `aggregateId` is the record that was created or changed. | `OperationResult` |
| `401` | The token is missing, has expired or is not ours. | `Error` |
| `403` | The token does not give access to this employer or operation. | `Error` |
| `404` | The register operation does not exist in your account. | `Error` |
| `409` | `revision_conflict`: The record changed since the revision you sent. Nothing was applied. `operation_reused`: The `operationId` was already used with a different request. `invalid_status`: The operation is not in a status that allows this. | `Error` |
| `429` | There were too many requests. Nothing was processed. The header `Retry-After` gives the seconds to wait. | `Error` |
| `503` | The gateway cannot answer now. | `Error` |

### Request

curl

```bash
curl -X POST "$RDC_BASE_URL/reges/v1/register-operations/33ac882a-d64f-4ac2-9658-37361cf74da1/acknowledge" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "6aa8f69d-e907-494e-85c6-ef5c7f99eef7",
  "expectedRevision": 9
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/reges/v1/register-operations/33ac882a-d64f-4ac2-9658-37361cf74da1/acknowledge`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "6aa8f69d-e907-494e-85c6-ef5c7f99eef7",
    "expectedRevision": 9
  }),
});
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/acknowledge',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': '6aa8f69d-e907-494e-85c6-ef5c7f99eef7',
        'expectedRevision': 9,
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "6aa8f69d-e907-494e-85c6-ef5c7f99eef7",
  "expectedRevision": 9
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/reges/v1/register-operations/33ac882a-d64f-4ac2-9658-37361cf74da1/acknowledge');
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/acknowledge");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "6aa8f69d-e907-494e-85c6-ef5c7f99eef7",
  "expectedRevision": 9
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

### Response `202`

JSON

```json
{
  "operationId": "6aa8f69d-e907-494e-85c6-ef5c7f99eef7",
  "status": "accepted",
  "aggregateId": "33ac882a-d64f-4ac2-9658-37361cf74da1",
  "aggregateRevision": 10
}
```

## Record the register’s answer

POST `/reges/v1/register-operations/{registerOperationId}/answer`

Records the answer the register gave to a transmitted operation. `registered` needs the `reference` and applies the operation to its contract: a hire activates it, a change of salary sets the salary, a suspension suspends it. `rejected` needs the register’s `message`, kept exactly as written; a rejected operation is final and its correction is a new operation (`correctOperation`).

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `registerOperationId` | path | `string (uuid)` | Yesrequired | The register operation. |

### 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 register operation you read. |
| `outcome` | `string` | Yesrequired | `registered` or `rejected`. One of `registered`, `rejected` |
| `reference` | `string` | Nooptional | The reference the register gave. Required for `registered`. |
| `message` | `string` | Nooptional | The register’s reply, exactly as written. Required for `rejected`. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `202` | The change was accepted. The body is the operation result: `aggregateId` is the record that was created or changed. | `OperationResult` |
| `401` | The token is missing, has expired or is not ours. | `Error` |
| `403` | The token does not give access to this employer or operation. | `Error` |
| `404` | The register operation does not exist in your account. | `Error` |
| `409` | `revision_conflict`: The record changed since the revision you sent. Nothing was applied. `operation_reused`: The `operationId` was already used with a different request. `invalid_status`: The operation is not in a status that allows this. `answer_incomplete`: The answer is incomplete: `registered` needs a `reference`, `rejected` needs a `message`. | `Error` |
| `429` | There were too many requests. Nothing was processed. The header `Retry-After` gives the seconds to wait. | `Error` |
| `503` | The gateway cannot answer now. | `Error` |

### Request

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

### Response `202`

JSON

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

## Flag an unknown outcome

POST `/reges/v1/register-operations/{registerOperationId}/unknown`

Moves a transmitted operation to `manual_review` when you cannot tell whether the register received it. Check at the register, then record its answer or transmit again with `resubmitOperation`.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `registerOperationId` | path | `string (uuid)` | Yesrequired | The register operation. |

### 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 register operation you read. |
| `reason` | `string` | Yesrequired | Why the outcome of the transmission is not known. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `202` | The change was accepted. The body is the operation result: `aggregateId` is the record that was created or changed. | `OperationResult` |
| `401` | The token is missing, has expired or is not ours. | `Error` |
| `403` | The token does not give access to this employer or operation. | `Error` |
| `404` | The register operation does not exist in your account. | `Error` |
| `409` | `revision_conflict`: The record changed since the revision you sent. Nothing was applied. `operation_reused`: The `operationId` was already used with a different request. `invalid_status`: The operation is not in a status that allows this. `reason_required`: A reason is required: the deadline has passed, or the outcome of a transmission is being flagged as unknown. | `Error` |
| `429` | There were too many requests. Nothing was processed. The header `Retry-After` gives the seconds to wait. | `Error` |
| `503` | The gateway cannot answer now. | `Error` |

### Request

curl

```bash
curl -X POST "$RDC_BASE_URL/reges/v1/register-operations/b5f54bb0-fa5e-43d6-b9fc-b5b0afe9d3d7/unknown" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "72dac4ec-ad8d-46e9-a5fd-05ec571dc530",
  "expectedRevision": 4,
  "reason": "The transmission ended without an answer."
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/reges/v1/register-operations/b5f54bb0-fa5e-43d6-b9fc-b5b0afe9d3d7/unknown`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "72dac4ec-ad8d-46e9-a5fd-05ec571dc530",
    "expectedRevision": 4,
    "reason": "The transmission ended without an answer."
  }),
});
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/unknown',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': '72dac4ec-ad8d-46e9-a5fd-05ec571dc530',
        'expectedRevision': 4,
        'reason': 'The transmission ended without an answer.',
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "72dac4ec-ad8d-46e9-a5fd-05ec571dc530",
  "expectedRevision": 4,
  "reason": "The transmission ended without an answer."
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/reges/v1/register-operations/b5f54bb0-fa5e-43d6-b9fc-b5b0afe9d3d7/unknown');
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/unknown");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "72dac4ec-ad8d-46e9-a5fd-05ec571dc530",
  "expectedRevision": 4,
  "reason": "The transmission ended without an answer."
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

### Response `202`

JSON

```json
{
  "operationId": "72dac4ec-ad8d-46e9-a5fd-05ec571dc530",
  "status": "accepted",
  "aggregateId": "b5f54bb0-fa5e-43d6-b9fc-b5b0afe9d3d7",
  "aggregateRevision": 5
}
```

## Record a new transmission

POST `/reges/v1/register-operations/{registerOperationId}/resubmit`

Records a new transmission of an operation whose status is `manual_review`, after you checked that the register did not receive it. The same rules as `submitOperation` apply, including `reason` after the deadline.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `registerOperationId` | path | `string (uuid)` | Yesrequired | The register operation. |

### 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 register operation you read. |
| `designatedPerson` | `string (uuid)` | Yesrequired | The designated person who transmitted the operation. They must hold the `transmit` scope for the employer. |
| `reason` | `string` | Nooptional | Why the operation is transmitted after its deadline. Required after the deadline. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `202` | The change was accepted. The body is the operation result: `aggregateId` is the record that was created or changed. | `OperationResult` |
| `401` | The token is missing, has expired or is not ours. | `Error` |
| `403` | The token does not give access to this employer or operation. | `Error` |
| `404` | The register operation does not exist in your account. | `Error` |
| `409` | `revision_conflict`: The record changed since the revision you sent. Nothing was applied. `operation_reused`: The `operationId` was already used with a different request. `invalid_status`: The operation is not in a status that allows this. `not_permitted`: The designated person does not hold the access permission this step needs for the employer, or it has ended. Nothing was changed. `reason_required`: A reason is required: the deadline has passed, or the outcome of a transmission is being flagged as unknown. | `Error` |
| `429` | There were too many requests. Nothing was processed. The header `Retry-After` gives the seconds to wait. | `Error` |
| `503` | The gateway cannot answer now. | `Error` |

### Request

curl

```bash
curl -X POST "$RDC_BASE_URL/reges/v1/register-operations/b5f54bb0-fa5e-43d6-b9fc-b5b0afe9d3d7/resubmit" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "2cc45351-9f3a-470d-926d-d00717966700",
  "expectedRevision": 5,
  "designatedPerson": "b5192196-cb10-4857-a91d-e1eae8a64953"
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/reges/v1/register-operations/b5f54bb0-fa5e-43d6-b9fc-b5b0afe9d3d7/resubmit`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "2cc45351-9f3a-470d-926d-d00717966700",
    "expectedRevision": 5,
    "designatedPerson": "b5192196-cb10-4857-a91d-e1eae8a64953"
  }),
});
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/resubmit',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': '2cc45351-9f3a-470d-926d-d00717966700',
        'expectedRevision': 5,
        'designatedPerson': 'b5192196-cb10-4857-a91d-e1eae8a64953',
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "2cc45351-9f3a-470d-926d-d00717966700",
  "expectedRevision": 5,
  "designatedPerson": "b5192196-cb10-4857-a91d-e1eae8a64953"
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/reges/v1/register-operations/b5f54bb0-fa5e-43d6-b9fc-b5b0afe9d3d7/resubmit');
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/resubmit");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "2cc45351-9f3a-470d-926d-d00717966700",
  "expectedRevision": 5,
  "designatedPerson": "b5192196-cb10-4857-a91d-e1eae8a64953"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

### Response `202`

JSON

```json
{
  "operationId": "2cc45351-9f3a-470d-926d-d00717966700",
  "status": "accepted",
  "aggregateId": "b5f54bb0-fa5e-43d6-b9fc-b5b0afe9d3d7",
  "aggregateRevision": 6
}
```

## Cancel an operation

POST `/reges/v1/register-operations/{registerOperationId}/cancel`

Cancels a draft, a validated or an approved operation. Nothing was transmitted, so nothing needs correcting at the register.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `registerOperationId` | path | `string (uuid)` | Yesrequired | The register operation. |

### 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 register operation you read. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `202` | The change was accepted. The body is the operation result: `aggregateId` is the record that was created or changed. | `OperationResult` |
| `401` | The token is missing, has expired or is not ours. | `Error` |
| `403` | The token does not give access to this employer or operation. | `Error` |
| `404` | The register operation does not exist in your account. | `Error` |
| `409` | `revision_conflict`: The record changed since the revision you sent. Nothing was applied. `operation_reused`: The `operationId` was already used with a different request. `invalid_status`: The operation is not in a status that allows this. | `Error` |
| `429` | There were too many requests. Nothing was processed. The header `Retry-After` gives the seconds to wait. | `Error` |
| `503` | The gateway cannot answer now. | `Error` |

### Request

curl

```bash
curl -X POST "$RDC_BASE_URL/reges/v1/register-operations/306e1d65-c72d-4b00-90ce-0ac75f95ec34/cancel" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "79f306dd-3bc6-4087-a53b-3c924ac4ca97",
  "expectedRevision": 1
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/reges/v1/register-operations/306e1d65-c72d-4b00-90ce-0ac75f95ec34/cancel`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "79f306dd-3bc6-4087-a53b-3c924ac4ca97",
    "expectedRevision": 1
  }),
});
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/306e1d65-c72d-4b00-90ce-0ac75f95ec34/cancel',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': '79f306dd-3bc6-4087-a53b-3c924ac4ca97',
        'expectedRevision': 1,
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "79f306dd-3bc6-4087-a53b-3c924ac4ca97",
  "expectedRevision": 1
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/reges/v1/register-operations/306e1d65-c72d-4b00-90ce-0ac75f95ec34/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")}/reges/v1/register-operations/306e1d65-c72d-4b00-90ce-0ac75f95ec34/cancel");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "79f306dd-3bc6-4087-a53b-3c924ac4ca97",
  "expectedRevision": 1
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

### Response `202`

JSON

```json
{
  "operationId": "79f306dd-3bc6-4087-a53b-3c924ac4ca97",
  "status": "accepted",
  "aggregateId": "306e1d65-c72d-4b00-90ce-0ac75f95ec34",
  "aggregateRevision": 2
}
```

## Create a correction

POST `/reges/v1/register-operations/{registerOperationId}/correct`

Creates a new draft from an operation the register rejected. The new operation has its own number, `correctionOf` set to the number of the rejected one, and the day it is created as the day the employer learned of the error. The rejected operation does not change.

### Parameters

| Name | In | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `registerOperationId` | path | `string (uuid)` | Yesrequired | The register operation. |

### 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 register operation you read. |

### Responses

| Status | Meaning | Body |
| --- | --- | --- |
| `202` | The change was accepted. The body is the operation result: `aggregateId` is the record that was created or changed. | `OperationResult` |
| `401` | The token is missing, has expired or is not ours. | `Error` |
| `403` | The token does not give access to this employer or operation. | `Error` |
| `404` | The register operation does not exist in your account. | `Error` |
| `409` | `revision_conflict`: The record changed since the revision you sent. Nothing was applied. `operation_reused`: The `operationId` was already used with a different request. `invalid_status`: The operation is not in a status that allows this. `already_corrected`: A correction of this operation already exists. | `Error` |
| `429` | There were too many requests. Nothing was processed. The header `Retry-After` gives the seconds to wait. | `Error` |
| `503` | The gateway cannot answer now. | `Error` |

### Request

curl

```bash
curl -X POST "$RDC_BASE_URL/reges/v1/register-operations/a19627dd-ae3d-486b-8ba9-07fba95000e4/correct" \
  -H "Authorization: Bearer $RDC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "operationId": "4b053778-fc19-4826-80c4-4d530181a37f",
  "expectedRevision": 6
}'
```

JavaScript

```javascript
const response = await fetch(`${process.env.RDC_BASE_URL}/reges/v1/register-operations/a19627dd-ae3d-486b-8ba9-07fba95000e4/correct`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.RDC_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "operationId": "4b053778-fc19-4826-80c4-4d530181a37f",
    "expectedRevision": 6
  }),
});
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/a19627dd-ae3d-486b-8ba9-07fba95000e4/correct',
    headers={
        'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
    },
    json={
        'operationId': '4b053778-fc19-4826-80c4-4d530181a37f',
        'expectedRevision': 6,
    },
)
result = response.json()
```

PHP

```php
<?php

$body = <<<'JSON'
{
  "operationId": "4b053778-fc19-4826-80c4-4d530181a37f",
  "expectedRevision": 6
}
JSON;

$curl = curl_init(getenv('RDC_BASE_URL') . '/reges/v1/register-operations/a19627dd-ae3d-486b-8ba9-07fba95000e4/correct');
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/a19627dd-ae3d-486b-8ba9-07fba95000e4/correct");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
  "operationId": "4b053778-fc19-4826-80c4-4d530181a37f",
  "expectedRevision": 6
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync();
```

### Response `202`

JSON

```json
{
  "operationId": "4b053778-fc19-4826-80c4-4d530181a37f",
  "status": "accepted",
  "aggregateId": "e5b7c0e7-c4bd-43fe-8907-17c9b179e09a",
  "aggregateRevision": 1
}
```
