Cancel or correct an operation
Cancel an operation before anything was transmitted, correct one the register rejected with a new draft, and handle a transmission whose outcome you do not know.
On this page
Three situations call for a different request: the operation was never transmitted, the register rejected it, or you cannot tell whether the register received it. Each has its own request, and none of them edits history.
Cancel before transmission
cancelOperation works on a draft, a validated operation and an approved one. Nothing was transmitted, so there is nothing to undo at the register: the operation becomes Cancelled (cancelled) and the contract stays as it was. Once the operation is submitted, the request answers invalid_status.
curl
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
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
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
$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#
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(); {
"operationId": "79f306dd-3bc6-4087-a53b-3c924ac4ca97",
"status": "accepted",
"aggregateId": "306e1d65-c72d-4b00-90ce-0ac75f95ec34",
"aggregateRevision": 2
} A rejected operation never changes
When the register rejects an operation, recordAnswer with rejected keeps its reply in rejection and in the history, exactly as written. The operation stays rejected and the contract stays as it was. Fixing it means a new operation.
{
"number": "RG-2026-001466",
"kind": "change-terms",
"status": "rejected",
"rejection": "Funcția nu corespunde codului COR transmis.",
"correctionOf": null,
"lastEntryOfHistory": {
"status": "rejected",
"at": "2026-11-06T11:20:00Z",
"by": null,
"reference": null,
"message": "Funcția nu corespunde codului COR transmis.",
"reason": null,
"late": false
}
} Correct with a new draft
correctOperation makes a new draft from the rejected operation. The draft has its own number, correctionOf set to the number of the rejected one and the same details; the day it is made is the day the employer learned of the error.
curl
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
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
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
$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#
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(); {
"operationId": "4b053778-fc19-4826-80c4-4d530181a37f",
"status": "accepted",
"aggregateId": "e5b7c0e7-c4bd-43fe-8907-17c9b179e09a",
"aggregateRevision": 1
} {
"number": "RG-2026-001492",
"status": "draft",
"correctionOf": "RG-2026-001466",
"deadline": {
"date": "2026-11-23",
"rule": "correction",
"from": "2026-11-23",
"workingDaysLeft": 0
}
} - Only a
rejectedoperation can be corrected. Any other status answersinvalid_status. - A rejected operation has one correction. Asking again answers
already_corrected: read the correction throughcorrectionOfand work on it.
An error in the register is corrected on the date the employer learns of it. With correction true and learnedOn, the gateway answers the same day, 23 November 2026:
Compute the deadline of a correction
curl
curl "$RDC_BASE_URL/reges/v1/deadlines?kind=change-terms&date=2026-11-09&learnedOn=2026-11-23&correction=true" \
-H "Authorization: Bearer $RDC_TOKEN" JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/reges/v1/deadlines?kind=change-terms&date=2026-11-09&learnedOn=2026-11-23&correction=true`, {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
},
});
const result = await response.json(); Python
import os
import requests
response = requests.request(
'GET',
f'{os.environ["RDC_BASE_URL"]}/reges/v1/deadlines?kind=change-terms&date=2026-11-09&learnedOn=2026-11-23&correction=true',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
)
result = response.json() PHP
<?php
$curl = curl_init(getenv('RDC_BASE_URL') . '/reges/v1/deadlines?kind=change-terms&date=2026-11-09&learnedOn=2026-11-23&correction=true');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RDC_TOKEN'),
],
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl); C#
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/reges/v1/deadlines?kind=change-terms&date=2026-11-09&learnedOn=2026-11-23&correction=true");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); {
"date": "2026-11-23",
"rule": "correction",
"from": "2026-11-23",
"workingDaysLeft": 0
} Fix the cause
Compare the draft with the reply of the register and change what needs it with
editOperation.Check
Read
listChecksuntilcanSendis true, thenvalidateOperation.Approve and transmit
authorizeOperation, thensubmitOperationafter the transmission, like any operation. See Lifecycle and statuses.
An outcome you do not know
A transmission can end without an answer: you do not know whether the register received the operation. Flag it with flagUnknownOutcome and a reason. The operation moves to manual_review, and it stays open: its deadline keeps running.
curl
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
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
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
$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#
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(); {
"operationId": "72dac4ec-ad8d-46e9-a5fd-05ec571dc530",
"status": "accepted",
"aggregateId": "b5f54bb0-fa5e-43d6-b9fc-b5b0afe9d3d7",
"aggregateRevision": 5
} - The register has it: record its answer with
recordAnswer, the reference or its words. - The register does not have it: transmit again and record it with
resubmitOperation. The same rules assubmitOperationapply, including areasonafter the deadline.
curl
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
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
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
$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#
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(); {
"operationId": "2cc45351-9f3a-470d-926d-d00717966700",
"status": "accepted",
"aggregateId": "b5f54bb0-fa5e-43d6-b9fc-b5b0afe9d3d7",
"aggregateRevision": 6
}