Search
Find documents by what they say about themselves: name, number, counterparty, project and the extracted values of an invoice.
Search documents
GET /documents/v1/search
Returns the documents that match q, with the properties that matched, the best match first.
Parameters
| Name | In | Type | Required | Meaning |
|---|---|---|---|---|
q | query | string | Yesrequired | What to find, one or more words. Every word must appear in the name, the number, the counterparty, the project or an extracted value. |
class | query | string | Nooptional | Only documents of this class. One of contract, invoice, offer, report |
limit | query | integer | Nooptional | Records per page. Default 100 Range 1 – 500 |
cursor | query | string | Nooptional | The nextCursor of the previous page. |
Responses
| Status | Meaning | Body |
|---|---|---|
200 | A page of records. | SearchPage |
400 | The request cannot be read or breaks the contract: malformed JSON, a missing or unknown field, a wrong type. fields names each one. | Error |
401 | The token is missing, expired or not ours. | Error |
403 | The token does not give access to this company or operation. | Error |
429 | The request was refused and not processed: the code is rate_limited. Wait the seconds in the header Retry-After, then send it again with the same operationId. | Error |
503 | The service cannot answer now: the code is unavailable. Send the request again with the same operationId. | Error |
Request
curl
curl "$RDC_BASE_URL/documents/v1/search?q=carpatin&limit=20" \
-H "Authorization: Bearer $RDC_TOKEN" JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/documents/v1/search?q=carpatin&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/search?q=carpatin&limit=20',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
)
result = response.json() PHP
<?php
$curl = curl_init(getenv('RDC_BASE_URL') . '/documents/v1/search?q=carpatin&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/search?q=carpatin&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": [
{
"document": {
"id": "c4619fe2-a7f9-49d9-98f7-46a02d5c39c3",
"number": "DOC-2026-0400",
"name": "Invoice AC-2026-0911",
"class": "invoice",
"counterpartyId": "a1f13366-0199-4955-9251-6bd2703ce5cf",
"counterparty": "Ambalaje Carpatin SRL",
"project": "Purchasing",
"owner": "sorin-avram",
"date": "2026-11-18",
"amount": "34862.00",
"currency": "RON",
"status": "in-review",
"version": 1,
"returned": false,
"keepUntil": "2036-12-31",
"changedAt": "2026-11-20T09:40:00Z",
"approval": {
"route": [
"ioana-marin",
"ana-rusu"
],
"decisions": [
{
"approver": "ioana-marin",
"decision": "approved",
"time": "2026-11-20T09:40:00Z"
}
],
"next": "ana-rusu"
},
"signature": null,
"readers": {
"groups": [
"finance",
"purchasing"
],
"people": [
"sorin-avram",
"ioana-marin",
"ana-rusu"
]
},
"revision": 3
},
"matched": [
"name",
"counterparty"
]
}
],
"nextCursor": null
}