Skip to content
Docs
API 1.0.0 · 22 Nov 2026

Search the docs

    Română

    Tasks

    Schedule the next step of a deal, complete it, and read the open and the done ones.

    On this page

    Schedule a task

    POST /crm/v1/deals/{dealId}/tasks

    Schedules the next step of an open deal: a call, an e-mail, a meeting or a task, due today or later. The deal has one more revision afterwards.

    Parameters

    NameInTypeRequiredMeaning
    dealId path string (uuid) Yesrequired The deal.

    Request body

    FieldTypeRequiredMeaning
    operationId string (uuid) Yesrequired A UUID you choose for this change. Send it again to repeat the request.
    expectedRevision integer Yesrequired The revision of the deal you read.
    kind string Yesrequired What is to be done: call, email, meeting or task. One of call, email, meeting, task
    text string Yesrequired What is to be done.
    due string (date) Yesrequired The day it is due, today or later.
    owner string Nooptional Identifier of the owner who does it. The owner of the deal by default.

    Responses

    StatusMeaningBody
    202 The change was accepted. The body is the operation result. 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
    404 The request was refused. The code is deal_not_found or owner_not_found. Error
    409 The request was refused. The code is revision_conflict, operation_reused or deal_closed. Error
    422 The request was refused. The code is kind_not_valid, text_required or date_not_valid. 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 -X POST "$RDC_BASE_URL/crm/v1/deals/7f2c8e49-5a01-4d73-b9e6-0c3d1a8f5b37/tasks" \
      -H "Authorization: Bearer $RDC_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
      "operationId": "c87683c9-eebe-42a8-a4bb-4b38e8e2949a",
      "expectedRevision": 2,
      "kind": "call",
      "text": "Confirm the delivery date for the new shop.",
      "due": "2026-11-27"
    }'

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/crm/v1/deals/7f2c8e49-5a01-4d73-b9e6-0c3d1a8f5b37/tasks`, {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        "operationId": "c87683c9-eebe-42a8-a4bb-4b38e8e2949a",
        "expectedRevision": 2,
        "kind": "call",
        "text": "Confirm the delivery date for the new shop.",
        "due": "2026-11-27"
      }),
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'POST',
        f'{os.environ["RDC_BASE_URL"]}/crm/v1/deals/7f2c8e49-5a01-4d73-b9e6-0c3d1a8f5b37/tasks',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
        json={
            'operationId': 'c87683c9-eebe-42a8-a4bb-4b38e8e2949a',
            'expectedRevision': 2,
            'kind': 'call',
            'text': 'Confirm the delivery date for the new shop.',
            'due': '2026-11-27',
        },
    )
    result = response.json()

    PHP

    <?php
    
    $body = <<<'JSON'
    {
      "operationId": "c87683c9-eebe-42a8-a4bb-4b38e8e2949a",
      "expectedRevision": 2,
      "kind": "call",
      "text": "Confirm the delivery date for the new shop.",
      "due": "2026-11-27"
    }
    JSON;
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/crm/v1/deals/7f2c8e49-5a01-4d73-b9e6-0c3d1a8f5b37/tasks');
    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")}/crm/v1/deals/7f2c8e49-5a01-4d73-b9e6-0c3d1a8f5b37/tasks");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    request.Content = new StringContent("""
    {
      "operationId": "c87683c9-eebe-42a8-a4bb-4b38e8e2949a",
      "expectedRevision": 2,
      "kind": "call",
      "text": "Confirm the delivery date for the new shop.",
      "due": "2026-11-27"
    }
    """, System.Text.Encoding.UTF8, "application/json");
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 202

    JSON

    {
      "operationId": "c87683c9-eebe-42a8-a4bb-4b38e8e2949a",
      "status": "accepted",
      "aggregateRevision": 3
    }

    Complete a task

    POST /crm/v1/deals/{dealId}/tasks/{taskId}/complete

    Marks a task of the deal done. The deal has one more revision afterwards.

    Parameters

    NameInTypeRequiredMeaning
    dealId path string (uuid) Yesrequired The deal.
    taskId path string (uuid) Yesrequired The task.

    Request body

    FieldTypeRequiredMeaning
    operationId string (uuid) Yesrequired A UUID you choose for this change. Send it again to repeat the request.
    expectedRevision integer Yesrequired The revision of the deal you read.

    Responses

    StatusMeaningBody
    202 The change was accepted. The body is the operation result. 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
    404 The request was refused. The code is deal_not_found or task_not_found. Error
    409 The request was refused. The code is revision_conflict, operation_reused or task_already_done. 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 -X POST "$RDC_BASE_URL/crm/v1/deals/0d7e2b85-f1a3-4c69-b2d4-93a8e5c61d38/tasks/869a20bf-5d9e-47b3-9882-b46092090e12/complete" \
      -H "Authorization: Bearer $RDC_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
      "operationId": "8e90ef03-62ba-403f-9555-e280d26d85f7",
      "expectedRevision": 5
    }'

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/crm/v1/deals/0d7e2b85-f1a3-4c69-b2d4-93a8e5c61d38/tasks/869a20bf-5d9e-47b3-9882-b46092090e12/complete`, {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        "operationId": "8e90ef03-62ba-403f-9555-e280d26d85f7",
        "expectedRevision": 5
      }),
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'POST',
        f'{os.environ["RDC_BASE_URL"]}/crm/v1/deals/0d7e2b85-f1a3-4c69-b2d4-93a8e5c61d38/tasks/869a20bf-5d9e-47b3-9882-b46092090e12/complete',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
        json={
            'operationId': '8e90ef03-62ba-403f-9555-e280d26d85f7',
            'expectedRevision': 5,
        },
    )
    result = response.json()

    PHP

    <?php
    
    $body = <<<'JSON'
    {
      "operationId": "8e90ef03-62ba-403f-9555-e280d26d85f7",
      "expectedRevision": 5
    }
    JSON;
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/crm/v1/deals/0d7e2b85-f1a3-4c69-b2d4-93a8e5c61d38/tasks/869a20bf-5d9e-47b3-9882-b46092090e12/complete');
    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")}/crm/v1/deals/0d7e2b85-f1a3-4c69-b2d4-93a8e5c61d38/tasks/869a20bf-5d9e-47b3-9882-b46092090e12/complete");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    request.Content = new StringContent("""
    {
      "operationId": "8e90ef03-62ba-403f-9555-e280d26d85f7",
      "expectedRevision": 5
    }
    """, System.Text.Encoding.UTF8, "application/json");
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 202

    JSON

    {
      "operationId": "8e90ef03-62ba-403f-9555-e280d26d85f7",
      "status": "accepted",
      "aggregateRevision": 6
    }

    List tasks

    GET /crm/v1/tasks

    Returns tasks in pages, the one due first first. A task is an activity with a due day.

    Parameters

    NameInTypeRequiredMeaning
    dealId query string (uuid) Nooptional Only the records of this deal.
    companyId query string (uuid) Nooptional Only the records of this company.
    done query boolean Nooptional Only the done tasks (true) or only the open ones (false).
    limit query integer Nooptional Records per page. Default 100 Range 1 – 500
    cursor query string Nooptional The nextCursor of the previous page.

    Responses

    StatusMeaningBody
    200 A page of records. ActivityPage
    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/crm/v1/tasks?limit=20" \
      -H "Authorization: Bearer $RDC_TOKEN"

    JavaScript

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

    PHP

    <?php
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/crm/v1/tasks?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")}/crm/v1/tasks?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

    JSON

    {
      "items": [
        {
          "id": "869a20bf-5d9e-47b3-9882-b46092090e12",
          "companyId": "61d54dde-e1f3-43da-b2fc-a4a21540e5f3",
          "dealId": "0d7e2b85-f1a3-4c69-b2d4-93a8e5c61d38",
          "kind": "meeting",
          "text": "Go through the offer with the owner.",
          "by": "andrei-pop",
          "at": "2026-11-20T09:48:00Z",
          "minutes": null,
          "due": "2026-11-26",
          "done": false,
          "doneAt": null
        },
        {
          "id": "2382dafd-949b-4882-bf52-387d683ce3fd",
          "companyId": "61d54dde-e1f3-43da-b2fc-a4a21540e5f3",
          "dealId": "b58f4a20-7e19-4d3c-a6c2-15e9d07b3a35",
          "kind": "task",
          "text": "Send the price list for the events hall.",
          "by": "andrei-pop",
          "at": "2026-11-18T10:05:00Z",
          "minutes": null,
          "due": "2026-11-25",
          "done": false,
          "doneAt": null
        }
      ],
      "nextCursor": null
    }