Skip to content
Docs
API 1.0.0 · 23 Nov 2026

Search the docs

    Română

    Signature

    Send an approved contract or offer to its recipients, follow each recipient and archive the document once everyone has signed.

    On this page

    Only an approved contract or offer is sent for signature. The recipients are the signatory of your company and the contacts named at the counterparty of the document. The example sends the offer DOC-2026-0397 to ana-rusu, liviu-petcu, simona-vlad.

    curl

    curl -X POST "$RDC_BASE_URL/documents/v1/documents/a88f20a7-5780-43ad-83ff-ce70dde35f59/signature-requests" \
      -H "Authorization: Bearer $RDC_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
      "operationId": "fd18085b-442a-421c-85e6-8b076d422360",
      "expectedRevision": 8,
      "by": "andrei-pop",
      "recipients": [
        "ana-rusu",
        "liviu-petcu",
        "simona-vlad"
      ]
    }'

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/documents/v1/documents/a88f20a7-5780-43ad-83ff-ce70dde35f59/signature-requests`, {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        "operationId": "fd18085b-442a-421c-85e6-8b076d422360",
        "expectedRevision": 8,
        "by": "andrei-pop",
        "recipients": [
          "ana-rusu",
          "liviu-petcu",
          "simona-vlad"
        ]
      }),
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'POST',
        f'{os.environ["RDC_BASE_URL"]}/documents/v1/documents/a88f20a7-5780-43ad-83ff-ce70dde35f59/signature-requests',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
        json={
            'operationId': 'fd18085b-442a-421c-85e6-8b076d422360',
            'expectedRevision': 8,
            'by': 'andrei-pop',
            'recipients': [
                'ana-rusu',
                'liviu-petcu',
                'simona-vlad',
            ],
        },
    )
    result = response.json()

    PHP

    <?php
    
    $body = <<<'JSON'
    {
      "operationId": "fd18085b-442a-421c-85e6-8b076d422360",
      "expectedRevision": 8,
      "by": "andrei-pop",
      "recipients": [
        "ana-rusu",
        "liviu-petcu",
        "simona-vlad"
      ]
    }
    JSON;
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/documents/v1/documents/a88f20a7-5780-43ad-83ff-ce70dde35f59/signature-requests');
    curl_setopt_array($curl, [
        CURLOPT_CUSTOMREQUEST => 'POST',
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER => [
            'Authorization: Bearer ' . getenv('RDC_TOKEN'),
            'Content-Type: application/json',
        ],
        CURLOPT_POSTFIELDS => $body,
    ]);
    $result = json_decode(curl_exec($curl), true);
    curl_close($curl);

    C#

    using System.Net.Http.Headers;
    
    var client = new HttpClient();
    var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/documents/v1/documents/a88f20a7-5780-43ad-83ff-ce70dde35f59/signature-requests");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    request.Content = new StringContent("""
    {
      "operationId": "fd18085b-442a-421c-85e6-8b076d422360",
      "expectedRevision": 8,
      "by": "andrei-pop",
      "recipients": [
        "ana-rusu",
        "liviu-petcu",
        "simona-vlad"
      ]
    }
    """, System.Text.Encoding.UTF8, "application/json");
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 202

    {
      "operationId": "fd18085b-442a-421c-85e6-8b076d422360",
      "status": "accepted",
      "aggregateRevision": 9,
      "signatureRequestId": "bcecb49b-0690-42b9-9b12-64a8efd0f8cb"
    }

    The answer carries the signatureRequestId of the new request and the revision of the document after the change.

    Who can be a recipient

    A recipient is the signatory of your company or a contact named at the counterparty, here Market Trei Brazi SRL. A document without a counterparty has the signatory of your company alone. The same person twice is refused with recipient_duplicated, and an empty list with recipients_required.

    RecipientNameRoleOf
    ana-rusuAna RusuFinance directorBrumar Distribuție SRL
    liviu-petcuLiviu PetcuPurchasing managerMarket Trei Brazi SRL
    simona-vladSimona VladShop managerMarket Trei Brazi SRL

    Any other person is refused with recipient_not_found. The recipients sign in any order.

    Follow each recipient

    Read the current request of a document with getSignatureRequest. The example is DOC-2026-0398: one recipient has signed, one received the document and one is still at sent.

    curl

    curl "$RDC_BASE_URL/documents/v1/documents/472fda2c-c118-43fc-80a9-5a708911c856/signature-request" \
      -H "Authorization: Bearer $RDC_TOKEN"

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/documents/v1/documents/472fda2c-c118-43fc-80a9-5a708911c856/signature-request`, {
      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"]}/documents/v1/documents/472fda2c-c118-43fc-80a9-5a708911c856/signature-request',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/documents/v1/documents/472fda2c-c118-43fc-80a9-5a708911c856/signature-request');
    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")}/documents/v1/documents/472fda2c-c118-43fc-80a9-5a708911c856/signature-request");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 200

    {
      "documentId": "472fda2c-c118-43fc-80a9-5a708911c856",
      "id": "e4dd8cf2-2e3f-4179-a4fc-2eac1f3ae3bc",
      "state": "open",
      "sentAt": "2026-11-20T10:00:00Z",
      "sentBy": "andrei-pop",
      "recipients": [
        {
          "id": "ana-rusu",
          "state": "signed",
          "time": "2026-11-20T10:05:00Z"
        },
        {
          "id": "mircea-balan",
          "state": "delivered",
          "time": "2026-11-20T10:02:00Z"
        },
        {
          "id": "carmen-diaconu",
          "state": "sent",
          "time": "2026-11-20T10:00:00Z"
        }
      ]
    }

    Recipient stateMeaning
    sentThe request was sent. The recipient has not received the document.
    deliveredThe recipient received the document to sign.
    signedThe recipient signed.
    declinedThe recipient declined and gave a reason.

    listSignatureRequests returns the current request of each document that has one. Filter it by state or by recipient to find the requests that wait for a person.

    curl

    curl "$RDC_BASE_URL/documents/v1/signature-requests?limit=20" \
      -H "Authorization: Bearer $RDC_TOKEN"

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/documents/v1/signature-requests?limit=20`, {
      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"]}/documents/v1/signature-requests?limit=20',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/documents/v1/signature-requests?limit=20');
    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")}/documents/v1/signature-requests?limit=20");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 200

    {
      "items": [
        {
          "documentId": "472fda2c-c118-43fc-80a9-5a708911c856",
          "id": "e4dd8cf2-2e3f-4179-a4fc-2eac1f3ae3bc",
          "state": "open",
          "sentAt": "2026-11-20T10:00:00Z",
          "sentBy": "andrei-pop",
          "recipients": [
            {
              "id": "ana-rusu",
              "state": "signed",
              "time": "2026-11-20T10:05:00Z"
            },
            {
              "id": "mircea-balan",
              "state": "delivered",
              "time": "2026-11-20T10:02:00Z"
            },
            {
              "id": "carmen-diaconu",
              "state": "sent",
              "time": "2026-11-20T10:00:00Z"
            }
          ]
        },
        {
          "documentId": "a88f20a7-5780-43ad-83ff-ce70dde35f59",
          "id": "5fecfc4e-a69d-4b8c-bfb4-4047e51257dd",
          "state": "declined",
          "sentAt": "2026-11-11T09:00:00Z",
          "sentBy": "andrei-pop",
          "recipients": [
            {
              "id": "ana-rusu",
              "state": "signed",
              "time": "2026-11-11T10:30:00Z"
            },
            {
              "id": "liviu-petcu",
              "state": "declined",
              "time": "2026-11-16T15:40:00Z",
              "reason": "Asks for a lower delivery fee before signing."
            }
          ]
        }
      ],
      "nextCursor": null
    }

    Every step of a recipient adds a line to the audit trail, so the revision of the document grows. Read the document again before you send the next change.

    How the request ends

    Request stateDocument statusMeaningNext
    openapprovedNot every recipient has signed, and none has declined.Wait for the events, or read the request.
    signedsignedEvery recipient signed.Archive the document.
    declinedapprovedOne recipient declined. That ends the request.Send a new request.

    When a recipient declines

    A decline ends the request and the document stays approved. The reason is on the recipient and in the audit trail. Send a new request with sendForSignature: it replaces the old one, and every recipient of it starts at sent, those who signed before included.

    While a request is open, a second one is refused with signature_request_open. Once every recipient has signed, the document is signed and a new request is refused with already_signed.

    Archive the signed document

    Archive a contract or an offer after it is signed. Before that, archiveDocument answers signature_required. The example archives DOC-2026-0394, which both recipients signed.

    curl

    curl -X POST "$RDC_BASE_URL/documents/v1/documents/1ac68de2-2c38-4777-8300-64463eb461b3/archive" \
      -H "Authorization: Bearer $RDC_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
      "operationId": "a2fff411-d74b-45a7-a967-98b1b163ade5",
      "expectedRevision": 8,
      "by": "ioana-marin"
    }'

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/documents/v1/documents/1ac68de2-2c38-4777-8300-64463eb461b3/archive`, {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        "operationId": "a2fff411-d74b-45a7-a967-98b1b163ade5",
        "expectedRevision": 8,
        "by": "ioana-marin"
      }),
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'POST',
        f'{os.environ["RDC_BASE_URL"]}/documents/v1/documents/1ac68de2-2c38-4777-8300-64463eb461b3/archive',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
        json={
            'operationId': 'a2fff411-d74b-45a7-a967-98b1b163ade5',
            'expectedRevision': 8,
            'by': 'ioana-marin',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $body = <<<'JSON'
    {
      "operationId": "a2fff411-d74b-45a7-a967-98b1b163ade5",
      "expectedRevision": 8,
      "by": "ioana-marin"
    }
    JSON;
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/documents/v1/documents/1ac68de2-2c38-4777-8300-64463eb461b3/archive');
    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")}/documents/v1/documents/1ac68de2-2c38-4777-8300-64463eb461b3/archive");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    request.Content = new StringContent("""
    {
      "operationId": "a2fff411-d74b-45a7-a967-98b1b163ade5",
      "expectedRevision": 8,
      "by": "ioana-marin"
    }
    """, System.Text.Encoding.UTF8, "application/json");
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 202

    {
      "operationId": "a2fff411-d74b-45a7-a967-98b1b163ade5",
      "status": "accepted",
      "aggregateRevision": 9
    }

    Events

    EventWhen
    document.signature_requestedA request for signature was sent.
    document.signature_deliveredA recipient received the document to sign.
    document.signature_signedA recipient signed. status is signed once the last recipient has.
    document.signature_declinedA recipient declined to sign, with a reason. The request ends.
    document.archivedA document was archived.

    Every event has the number of the document in data. See the Event catalogue.

    Codes and what to do

    CodeStatusCauseWhat to do
    document_not_approved409The document is not approved yet.Finish the approval, then send the request.
    class_not_signed422The class is not contract or offer.No retry. Archive an approved invoice or report.
    recipient_not_found404A recipient is not a person who can sign this document.Use the signatory of your company or a contact of the counterparty.
    recipients_required422The list of recipients is empty.Name at least one recipient.
    recipient_duplicated422A person is named twice.Name each person once.
    signature_request_open409A request is out and has not ended.No retry. Read the request, and wait for it to end.
    already_signed409Every recipient has signed.No retry. Archive the document.
    signature_request_not_found404No request was sent for the document.Send one with sendForSignature.
    signature_required409A contract or an offer is archived before it is signed.Wait until the document is signed, then archive it.
    document_not_final409The document is not approved, so it cannot be archived.No retry. Read the document again.
    revision_conflict409The expectedRevision is older than the document.Read the document again and send its revision.