Skip to content
Docs
API 1.0.0 · 22 Nov 2026

Search the docs

    Română

    Conversations

    Submit a question and read the resulting answer and citations.

    On this page

    Ask a question

    POST /ai/v1/conversations

    Request body

    FieldTypeRequiredMeaning
    operationId string (uuid) Yesrequired UUID selected by the client.
    expectedRevision integer Yesrequired Revision of the record.
    question string Yesrequired Question to search for.
    scope string Yesrequired Set of sources to search. One of all, sales, contracts
    language string Yesrequired Language of the answer. One of en, ro
    conversationId string Yesrequired Stable identifier.

    Responses

    StatusMeaningBody
    202 Read the operation to follow the outcome. OperationResult
    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
    409 expectedRevision is older than the record. Error
    429 Too many requests. Retry-After gives the seconds. Error
    503 The service cannot answer now. Error

    Request

    curl

    curl -X POST "$RDC_BASE_URL/ai/v1/conversations" \
      -H "Authorization: Bearer $RDC_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
      "question": "What payment term did we agree with Hanul Ozana?",
      "scope": "all",
      "language": "en",
      "operationId": "86c4fe37-99d4-4bfc-a8f1-347afc902a56",
      "expectedRevision": 0,
      "conversationId": "review-1042"
    }'

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/ai/v1/conversations`, {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        "question": "What payment term did we agree with Hanul Ozana?",
        "scope": "all",
        "language": "en",
        "operationId": "86c4fe37-99d4-4bfc-a8f1-347afc902a56",
        "expectedRevision": 0,
        "conversationId": "review-1042"
      }),
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'POST',
        f'{os.environ["RDC_BASE_URL"]}/ai/v1/conversations',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
        json={
            'question': 'What payment term did we agree with Hanul Ozana?',
            'scope': 'all',
            'language': 'en',
            'operationId': '86c4fe37-99d4-4bfc-a8f1-347afc902a56',
            'expectedRevision': 0,
            'conversationId': 'review-1042',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $body = <<<'JSON'
    {
      "question": "What payment term did we agree with Hanul Ozana?",
      "scope": "all",
      "language": "en",
      "operationId": "86c4fe37-99d4-4bfc-a8f1-347afc902a56",
      "expectedRevision": 0,
      "conversationId": "review-1042"
    }
    JSON;
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/ai/v1/conversations');
    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")}/ai/v1/conversations");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    request.Content = new StringContent("""
    {
      "question": "What payment term did we agree with Hanul Ozana?",
      "scope": "all",
      "language": "en",
      "operationId": "86c4fe37-99d4-4bfc-a8f1-347afc902a56",
      "expectedRevision": 0,
      "conversationId": "review-1042"
    }
    """, System.Text.Encoding.UTF8, "application/json");
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 202

    JSON

    {
      "operationId": "86c4fe37-99d4-4bfc-a8f1-347afc902a56",
      "status": "accepted",
      "aggregateRevision": 1
    }

    Read the answer and its citations

    GET /ai/v1/conversations/{conversationId}

    Parameters

    NameInTypeRequiredMeaning
    conversationId path string Yesrequired Identifier of the conversation.

    Responses

    StatusMeaningBody
    200 Current result. Conversation
    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
    404 The record does not exist for this company. Error
    429 Too many requests. Retry-After gives the seconds. Error
    503 The service cannot answer now. Error

    Request

    curl

    curl "$RDC_BASE_URL/ai/v1/conversations/review-1042" \
      -H "Authorization: Bearer $RDC_TOKEN"

    JavaScript

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

    PHP

    <?php
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/ai/v1/conversations/review-1042');
    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")}/ai/v1/conversations/review-1042");
    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

    {
      "id": "review-1042",
      "revision": 1,
      "status": "answered",
      "answer": "Hanul Ozana pays by bank transfer at the end of the month after delivery. [1] Clause 6.2 of the contract sets the last day of the month after delivery as the due date. [2] On orders delivered in parts, the period starts with the last delivery. [3]",
      "citations": [
        {
          "id": "account",
          "system": "CRM",
          "title": "Hanul Ozana account notes",
          "owner": "Andrei Pop",
          "changed": "2026-11-17T15:40:00Z",
          "path": "/sales/hanul-ozana",
          "scope": "sales",
          "passage": "Hanul Ozana pays by bank transfer at the end of the month after delivery.",
          "number": 1,
          "canRead": true
        },
        {
          "id": "contract",
          "system": "DMS",
          "title": "Payment terms",
          "owner": "Ioana Marin",
          "changed": "2026-09-03T10:30:00Z",
          "path": "/contracts/payment",
          "scope": "contracts",
          "passage": "Clause 6.2 of the contract sets the last day of the month after delivery as the due date.",
          "number": 2,
          "canRead": true
        },
        {
          "id": "annex",
          "system": "DMS",
          "title": "Payment annex",
          "owner": "Ana Rusu",
          "changed": "2026-10-21T13:10:00Z",
          "path": "/contracts/payment-annex",
          "scope": "contracts",
          "passage": "On orders delivered in parts, the period starts with the last delivery.",
          "number": 3,
          "canRead": true
        }
      ],
      "hiddenCount": 0
    }