Skip to content
Docs
API 1.0.0 · 22 Nov 2026

Search the docs

    Română

    Your own ids

    Give a record the identifier your own system uses, and find it by that identifier instead of keeping ours.

    On this page

    Every record has an id that the CRM gives it. A company, a person and a deal can also carry an externalId: the number or the key your own system uses for the same thing, such as a customer number, a form submission or a row of a file.

    Why you need it

    The answer to a change is the operation result: it carries the revision and does not carry the id of a new record. To use the record you read it, and the way to read the record you just created is its externalId.

    1. Create it with your number

      Send externalId in the body of the create request.

    2. Find it by your number

      Send externalId as a query parameter of the list: listCompanies, listPersons or listDeals. The list holds the one record.

    3. Use its id

      Use the id of the answer wherever the API names a record: companyId, the dealId of a path, duplicateDealId.

    curl

    curl "$RDC_BASE_URL/crm/v1/companies?externalId=cust-0231" \
      -H "Authorization: Bearer $RDC_TOKEN"

    JavaScript

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

    PHP

    <?php
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/crm/v1/companies?externalId=cust-0231');
    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")}/crm/v1/companies?externalId=cust-0231");
    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": [
        {
          "id": "61d54dde-e1f3-43da-b2fc-a4a21540e5f3",
          "name": "Hanul Ozana SRL",
          "cif": "RO39172541",
          "owner": "andrei-pop",
          "status": "customer",
          "industry": "Inn and restaurant",
          "employees": 18,
          "town": "Târgu Neamț",
          "county": "Neamț",
          "source": "form",
          "summary": {
            "text": "Inn and restaurant on the road to Târgu Neamț. The kitchen orders every week; a second delivery point for the events hall is being agreed.",
            "by": "andrei-pop",
            "at": "2026-11-16"
          },
          "externalId": "cust-0231",
          "customFields": {},
          "revision": 1
        }
      ],
      "nextCursor": null
    }

    Rules

    • An externalId is text of 1 to 120 characters, and it is unique among the records of its kind in your account.
    • A second record with the same externalId is refused with external_id_taken. The same request sent again with the same operationId is not a second record: you get the first outcome.
    • You can change the externalId of a company with Update a company.
    • A record that has no externalId returns null.

    The two together, an operationId per change and an externalId per record, make an import safe to run twice. See Import from a file.