К содержанию

История

Что и когда произошло с записью и кто это сделал: история сделки, история контакта и журнал событий всей организации. Изменения компаний и задач — в журнале.

Журнал событий

GET /activity-log

Все изменения в организации, новые сверху, страницами: сделки, контакты, компании и задачи, комментарии, настройки, команда, мотивация и выгрузки сделок — кто, когда, в какой записи и что изменил; импортированная история — с автором и временем из прежней системы. Фильтры: кто (actorIds, actorGroups), какие записи (kinds: deal, contact, company, task…), что произошло (actions), какое поле (field), период (from, to). История компаний и задач — здесь, с kinds=company или kinds=task.

Параметры запроса

  • actions string[]

    количество ≤ 8 · без повторов

    Значения: created changed stage assigned deleted restored completed comment

  • actorGroups string[]

    количество ≤ 3 · без повторов

    Значения: import automation system

  • actorIds string[] · uuid

    количество ≤ 50 · без повторов

  • cursor string

    длина 1–512

  • field string

    шаблон ^(?:[A-Za-z]{1,40}|cf:[0-9a-fA-F-]{36})$

  • from string · date-time

  • kinds string[]

    количество ≤ 7 · без повторов

    Значения: deal contact company task settings team compensation

  • limit integer

    1–100 · по умолчанию 50

  • to string · date-time

Пример запроса

bash
curl 'https://your-company.altahub.ai/api/v1/activity-log' \
  -H 'Authorization: Bearer alta_…'
js
const response = await fetch('https://your-company.altahub.ai/api/v1/activity-log', {
  method: 'GET',
  headers: {
    Authorization: 'Bearer alta_…',
  },
});
const data = await response.json();
python
import requests

response = requests.get(
    "https://your-company.altahub.ai/api/v1/activity-log",
    headers={"Authorization": "Bearer alta_…"},
)
data = response.json()
php
<?php
$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://your-company.altahub.ai/api/v1/activity-log', [
    'headers' => ['Authorization' => 'Bearer alta_…'],
]);
$data = json_decode((string) $response->getBody(), true);

Ответ 200

Успешный ответ.

json
{
  "items": [
    {
      "id": "0192f3a1-7c2e-7b4d-9a61-000000000055",
      "at": "2026-10-24T16:45:00Z",
      "actor": {
        "kind": "member",
        "id": "0192f3a1-7c2e-7b4d-9a61-000000000002",
        "name": "Ирина Мельник",
        "former": false
      },
      "importedFrom": null,
      "record": {
        "type": "task",
        "id": "0192f3a1-7c2e-7b4d-9a61-00000000003c",
        "title": "Перезвонить по счёту",
        "state": "live"
      },
      "kind": "task",
      "history": null,
      "task": {
        "id": "0192f3a1-7c2e-7b4d-9a61-00000000003c",
        "title": "Перезвонить по счёту",
        "kind": "call",
        "type": null,
        "event": "completed",
        "attributes": [],
        "outcome": "call",
        "next": {
          "id": "0192f3a1-7c2e-7b4d-9a61-00000000003d",
          "title": "Отправить счёт",
          "dueAt": "2026-10-29T09:00:00Z"
        },
        "reschedule": null
      },
      "comment": null,
      "settings": null,
      "team": null,
      "compensation": null,
      "export": null
    },
    {
      "id": "0192f3a1-7c2e-7b4d-9a61-000000000056",
      "at": "2026-10-22T09:05:00Z",
      "actor": {
        "kind": "member",
        "id": "0192f3a1-7c2e-7b4d-9a61-000000000002",
        "name": "Ирина Мельник",
        "former": false
      },
      "importedFrom": null,
      "record": {
        "type": "deal",
        "id": "0192f3a1-7c2e-7b4d-9a61-000000000014",
        "title": "Кофемашины для сети кофеен",
        "state": "live"
      },
      "kind": "comment",
      "history": null,
      "task": null,
      "comment": {
        "preview": "Клиентка просит счёт до пятницы",
        "deleted": false
      },
      "settings": null,
      "team": null,
      "compensation": null,
      "export": null
    },
    {
      "id": "0192f3a1-7c2e-7b4d-9a61-000000000052",
      "at": "2026-10-21T12:40:00Z",
      "actor": {
        "kind": "member",
        "id": "0192f3a1-7c2e-7b4d-9a61-000000000002",
        "name": "Ирина Мельник",
        "former": false
      },
      "importedFrom": null,
      "record": {
        "type": "deal",
        "id": "0192f3a1-7c2e-7b4d-9a61-000000000014",
        "title": "Кофемашины для сети кофеен",
        "state": "live"
      },
      "kind": "history",
      "history": {
        "event": "moved",
        "via": "manual",
        "stage": {
          "from": {
            "id": "0192f3a1-7c2e-7b4d-9a61-00000000001f",
            "name": "Новый запрос"
          },
          "to": {
            "id": "0192f3a1-7c2e-7b4d-9a61-000000000020",
            "name": "Переговоры"
          }
        },
        "status": null,
        "owner": null,
        "amount": null,
        "fields": [],
        "summary": null,
        "attributes": []
      },
      "task": null,
      "comment": null,
      "settings": null,
      "team": null,
      "compensation": null,
      "export": null
    },
    {
      "id": "0192f3a1-7c2e-7b4d-9a61-000000000057",
      "at": "2026-10-20T08:15:00Z",
      "actor": {
        "kind": "member",
        "id": "0192f3a1-7c2e-7b4d-9a61-000000000002",
        "name": "Ирина Мельник",
        "former": false
      },
      "importedFrom": null,
      "record": {
        "type": "contact",
        "id": "0192f3a1-7c2e-7b4d-9a61-00000000000a",
        "title": "Елена Коваль",
        "state": "live"
      },
      "kind": "history",
      "history": {
        "event": "updated",
        "via": "manual",
        "stage": null,
        "status": null,
        "owner": null,
        "amount": null,
        "fields": [],
        "summary": null,
        "attributes": [
          {
            "key": "jobTitle",
            "label": null,
            "from": null,
            "to": "Менеджер по закупкам",
            "fieldType": null,
            "decimals": null
          }
        ]
      },
      "task": null,
      "comment": null,
      "settings": null,
      "team": null,
      "compensation": null,
      "export": null
    }
  ],
  "nextCursor": null,
  "searchedTo": null
}
Поля ответа
  • items object[]

    Вложенные поля: 13
    • actor object

      Вложенные поля: 4
      • former boolean

      • id string · uuid | null

      • kind string

        Значения: member automation import system

      • name string | null

    • at string · date-time

    • comment object | null

      Вложенные поля: 2
      • deleted boolean

      • preview string | null

    • compensation object | null

      Вложенные поля: 3
      • attributes object[]

        Вложенные поля: 6
        • decimals integer | null

          0–4

        • fieldType string | null

          Значения: text long_text number date datetime boolean choice multi_choice url money birthday address

        • from string | null

        • key string

        • label string | null

        • to string | null

      • event string

        Значения: plan_created plan_changed plan_archived plan_restored assignment_set assignment_removed start_date_set settings_changed adjustment_added adjustment_canceled payout_recorded payout_canceled period_closed recalculated role_created role_changed role_deleted

      • member object | null

        Вложенные поля: 2
        • id string · uuid | null

        • name string

    • export object | null

      Вложенные поля: 4
      • deals integer

        ≥ 0

      • format string

        Значения: xlsx csv

      • pipeline object | null

        Вложенные поля: 2
        • id string · uuid

        • name string

      • scope string

        Значения: all filter

    • history object | null

      Вложенные поля: 11
      • amount object | null

        Вложенные поля: 2
        • from object

          Вложенные поля: 2
          • amount string

          • currency string

        • to object

          Вложенные поля: 2
          • amount string

          • currency string

      • attributes object[]

        Вложенные поля: 6
        • decimals integer | null

          0–4

        • fieldType string | null

          Значения: text long_text number date datetime boolean choice multi_choice url money birthday address

        • from string | null

        • key string

        • label string | null

        • to string | null

      • event string

        Значения: created updated moved owner_changed comment_edited comment_deleted deleted restored comment_pinned comment_unpinned payment_recorded payment_changed payment_canceled payment_refunded payment_requested payment_request_paid payment_request_expired payment_request_canceled payment_request_failed payment_consent_given payment_credit_changed archived

      • fields string[]

        Значения: title description contactId companyId expectedCloseDate

      • owner object | null

        Вложенные поля: 2
        • from object | null

          Вложенные поля: 2
          • id string · uuid | null

          • name string

        • to object | null

          Вложенные поля: 2
          • id string · uuid | null

          • name string

      • stage object | null

        Вложенные поля: 2
        • from object | null

          Вложенные поля: 2
          • id string · uuid | null

          • name string

        • to object

          Вложенные поля: 2
          • id string · uuid | null

          • name string

      • status object | null

        Вложенные поля: 2
        • from string

          Значения: open won lost

        • to string

          Значения: open won lost

      • summary string | null

      • via string | null

        Значения: manual import form

      • merge object

        Вложенные поля: 2
        • dropped object[]

          количество ≤ 400

          Вложенные поля: 4
          • key string

          • label string | null

          • record string

          • value string

        • records object[]

          количество ≤ 4

          Вложенные поля: 3
          • id string · uuid

          • name string

          • number integer

            ≥ 1

      • payment object

        Вложенные поля: 3
        • paymentId string · uuid | null

        • paymentRequestId string · uuid | null

        • refundId string · uuid | null

    • id string · uuid

    • importedFrom string | null

    • kind string

      Значения: history task comment settings team compensation export

    • record object

      Вложенные поля: 4
      • id string · uuid | null

      • state string

        Значения: live archived deleted

      • title string

      • type string

        Значения: deal contact company task settings team compensation export

    • settings object | null

      Вложенные поля: 3
      • area string

        Значения: organization pipeline field currency_rate access_role currency_rate_auto_fill marketing_spend migration payment_method payment_method_group tag task_type product product_category product_price coupon tax_rate billing_entity

      • attributes object[]

        Вложенные поля: 6
        • decimals integer | null

          0–4

        • fieldType string | null

          Значения: text long_text number date datetime boolean choice multi_choice url money birthday address

        • from string | null

        • key string

        • label string | null

        • to string | null

      • event string

        Значения: created updated deleted archived restored

    • task object | null

      Вложенные поля: 9
      • attributes object[]

        Вложенные поля: 6
        • decimals integer | null

          0–4

        • fieldType string | null

          Значения: text long_text number date datetime boolean choice multi_choice url money birthday address

        • from string | null

        • key string

        • label string | null

        • to string | null

      • event string

        Значения: created updated rescheduled reassigned completed reopened canceled deleted restored

      • id string · uuid

      • kind string

        Значения: task call meeting email reminder chat

      • next object | null

        Вложенные поля: 4
        • dueAt string · date-time | null

        • id string · uuid

        • title string

        • allDay boolean

      • outcome string | null

        Значения: call message meeting no_answer no_contact

      • reschedule object | null

        Вложенные поля: 2
        • note string | null

        • reason string | null

          Значения: client_asked no_answer no_time other

      • title string

      • type object | null

        Вложенные поля: 3
        • icon string

        • id string · uuid

        • name string

    • team object | null

      Вложенные поля: 6
      • email string | null

      • event string

        Значения: invitation_issued invitation_revoked invitation_accepted membership_created membership_disabled membership_enabled membership_role_changed membership_dismissed membership_restored membership_renamed

      • handedOverTo object | null

        Вложенные поля: 2
        • id string · uuid | null

        • name string

      • member object | null

        Вложенные поля: 2
        • id string · uuid | null

        • name string

      • role object | null

        Вложенные поля: 2
        • from string | null

        • to string

      • roleName object | null

        Вложенные поля: 4
        • from string | null

        • fromSystemKey string | null

          Значения: owner admin manager

        • to string | null

        • toSystemKey string | null

          Значения: owner admin manager

  • nextCursor string | null

  • searchedTo string · date-time | null

История контакта

GET /contacts/{contactId}/activity

Всё, что произошло с контактом, новые сверху, страницами: создание и каждое изменение полей и тегов (что было и что стало), комментарии, что произошло с его задачами. only оставляет одно: notes, history или tasks. Чаты и звонки через API недоступны.

Параметры пути

  • contactId string · uuid обязательно

Параметры запроса

  • cursor string

    длина 1–512

  • limit integer

    1–100 · по умолчанию 30

  • only string

    Значения: notes history tasks

Пример запроса

bash
curl 'https://your-company.altahub.ai/api/v1/contacts/{contactId}/activity' \
  -H 'Authorization: Bearer alta_…'
js
const response = await fetch('https://your-company.altahub.ai/api/v1/contacts/{contactId}/activity', {
  method: 'GET',
  headers: {
    Authorization: 'Bearer alta_…',
  },
});
const data = await response.json();
python
import requests

response = requests.get(
    "https://your-company.altahub.ai/api/v1/contacts/{contactId}/activity",
    headers={"Authorization": "Bearer alta_…"},
)
data = response.json()
php
<?php
$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://your-company.altahub.ai/api/v1/contacts/{contactId}/activity', [
    'headers' => ['Authorization' => 'Bearer alta_…'],
]);
$data = json_decode((string) $response->getBody(), true);

Ответ 200

Успешный ответ.

json
{
  "items": [
    {
      "id": "0192f3a1-7c2e-7b4d-9a61-000000000058",
      "type": "note",
      "at": "2026-10-24T16:45:00Z",
      "actor": {
        "id": "0192f3a1-7c2e-7b4d-9a61-000000000002",
        "name": "Ирина Мельник"
      },
      "note": {
        "body": "Удобнее писать в Telegram",
        "editedAt": null,
        "version": 1,
        "mentions": [],
        "pinned": null,
        "attachments": []
      },
      "history": null,
      "task": null,
      "call": null,
      "message": null
    },
    {
      "id": "0192f3a1-7c2e-7b4d-9a61-00000000003c",
      "type": "task",
      "at": "2026-10-21T12:40:00Z",
      "actor": {
        "id": "0192f3a1-7c2e-7b4d-9a61-000000000002",
        "name": "Ирина Мельник"
      },
      "note": null,
      "history": null,
      "task": {
        "id": "0192f3a1-7c2e-7b4d-9a61-00000000003c",
        "title": "Перезвонить по счёту",
        "kind": "call",
        "type": null,
        "event": "created",
        "attributes": [],
        "outcome": null,
        "next": null,
        "reschedule": null
      },
      "call": null,
      "message": null
    },
    {
      "id": "0192f3a1-7c2e-7b4d-9a61-000000000054",
      "type": "history",
      "at": "2026-10-20T08:15:00Z",
      "actor": {
        "id": "0192f3a1-7c2e-7b4d-9a61-000000000001",
        "name": "Андрей Шевченко"
      },
      "note": null,
      "history": {
        "event": "created",
        "via": "manual",
        "stage": null,
        "status": null,
        "owner": null,
        "amount": null,
        "fields": [],
        "summary": null,
        "attributes": [
          {
            "key": "phone",
            "label": null,
            "from": null,
            "to": "+380501234567",
            "fieldType": null,
            "decimals": null
          }
        ]
      },
      "task": null,
      "call": null,
      "message": null
    }
  ],
  "nextCursor": null,
  "pinned": []
}
Поля ответа
  • items object[]

    Вложенные поля: 11
    • actor object | null

      Вложенные поля: 2
      • id string · uuid | null

      • name string

    • at string · date-time

    • call object | null

      Вложенные поля: 8
      • clientNumber string | null

      • direction string

        Значения: incoming outgoing

      • durationSeconds integer | null

        ≥ 0

      • id string · uuid

      • inProgress boolean

      • recording boolean

      • result string | null

        Значения: answered no_answer busy unreachable failed

      • talkSeconds integer | null

        ≥ 0

    • history object | null

      Вложенные поля: 11
      • amount object | null

        Вложенные поля: 2
        • from object

          Вложенные поля: 2
          • amount string

          • currency string

        • to object

          Вложенные поля: 2
          • amount string

          • currency string

      • attributes object[]

        Вложенные поля: 6
        • decimals integer | null

          0–4

        • fieldType string | null

          Значения: text long_text number date datetime boolean choice multi_choice url money birthday address

        • from string | null

        • key string

        • label string | null

        • to string | null

      • event string

        Значения: created updated moved owner_changed comment_edited comment_deleted deleted restored comment_pinned comment_unpinned payment_recorded payment_changed payment_canceled payment_refunded payment_requested payment_request_paid payment_request_expired payment_request_canceled payment_request_failed payment_consent_given payment_credit_changed archived

      • fields string[]

        Значения: title description contactId companyId expectedCloseDate

      • owner object | null

        Вложенные поля: 2
        • from object | null

          Вложенные поля: 2
          • id string · uuid | null

          • name string

        • to object | null

          Вложенные поля: 2
          • id string · uuid | null

          • name string

      • stage object | null

        Вложенные поля: 2
        • from object | null

          Вложенные поля: 2
          • id string · uuid | null

          • name string

        • to object

          Вложенные поля: 2
          • id string · uuid | null

          • name string

      • status object | null

        Вложенные поля: 2
        • from string

          Значения: open won lost

        • to string

          Значения: open won lost

      • summary string | null

      • via string | null

        Значения: manual import form

      • merge object

        Вложенные поля: 2
        • dropped object[]

          количество ≤ 400

          Вложенные поля: 4
          • key string

          • label string | null

          • record string

          • value string

        • records object[]

          количество ≤ 4

          Вложенные поля: 3
          • id string · uuid

          • name string

          • number integer

            ≥ 1

      • payment object

        Вложенные поля: 3
        • paymentId string · uuid | null

        • paymentRequestId string · uuid | null

        • refundId string · uuid | null

    • id string · uuid

    • message object | null

      Вложенные поля: 2
      • chat object

        Вложенные поля: 3
        • account object

          Вложенные поля: 4
          • displayName string

          • id string · uuid

          • owner object

            Вложенные поля: 2
            • id string · uuid

            • name string

          • username string | null

        • id string · uuid

        • provider string

          Значения: telegram

      • entry object | null

        Вложенные поля: 15
        • at string · date-time

        • author object | null

          Вложенные поля: 2
          • id string · uuid

          • name string

        • call object | null

          Вложенные поля: 3
          • answered boolean | null

          • direction string

            Значения: in out

          • seconds integer | null

            ≥ 0

        • dealId string · uuid | null

        • deleted boolean

        • direction string

          Значения: in out

        • editedAt string · date-time | null

        • failure string | null

        • files object[]

          Вложенные поля: 11
          • contentType string | null

          • durationSeconds integer | null

            ≥ 0

          • gone boolean

          • hasPreview boolean

          • height integer | null

            ≥ 1

          • id string · uuid

          • kind string

            Значения: photo voice audio video video_note document sticker

          • name string | null

          • sizeBytes integer | null

            ≥ 0

          • waveform integer[] | null

            количество ≤ 128 · 0–31

          • width integer | null

            ≥ 1

        • id string · uuid

        • kind string

          Значения: text media call other

        • origin string

          Значения: client alta device history

        • otherKind string | null

          Значения: sticker location contact poll game unsupported

        • status string | null

          Значения: queued sending sent read failed cancelled

        • text string | null

    • note object | null

      Вложенные поля: 6
      • attachments object[]

        The comment's files in their order (empty without files): id, name, size in bytes, type, and an audio's or a video's length. A signed-in member opens one through GET /note-files/{id}; an API key sees them here but does not open them.

        Вложенные поля: 5
        • contentType string

        • durationSeconds integer | null

          0–86400

        • id string · uuid

        • name string

          длина 1–255

        • size integer

          ≥ 1

      • body string

      • editedAt string · date-time | null

      • mentions object[]

        Вложенные поля: 3
        • memberId string · uuid | null

        • name string

        • text string

      • pinned object | null

        Вложенные поля: 2
        • at string · date-time

        • by object

          Вложенные поля: 2
          • id string · uuid | null

          • name string

      • version integer

        ≥ 1

    • task object | null

      Вложенные поля: 9
      • attributes object[]

        Вложенные поля: 6
        • decimals integer | null

          0–4

        • fieldType string | null

          Значения: text long_text number date datetime boolean choice multi_choice url money birthday address

        • from string | null

        • key string

        • label string | null

        • to string | null

      • event string

        Значения: created updated rescheduled reassigned completed reopened canceled deleted restored

      • id string · uuid

      • kind string

        Значения: task call meeting email reminder chat

      • next object | null

        Вложенные поля: 4
        • dueAt string · date-time | null

        • id string · uuid

        • title string

        • allDay boolean

      • outcome string | null

        Значения: call message meeting no_answer no_contact

      • reschedule object | null

        Вложенные поля: 2
        • note string | null

        • reason string | null

          Значения: client_asked no_answer no_time other

      • title string

      • type object | null

        Вложенные поля: 3
        • icon string

        • id string · uuid

        • name string

    • type string

      Значения: note history task call message

    • callAnalysis object

      Вложенные поля: 1
      • transcript object

        Вложенные поля: 1
        • state string

          Значения: queued transcribing held done failed

    • paymentReport object

      Вложенные поля: 9
      • card object | null

        Вложенные поля: 3
        • brand string | null

        • issuer string | null

        • maskedNumber string | null

      • method string | null

      • occurredAt string · date-time

      • orderReference string | null

      • payer string | null

      • payerEmail string | null

      • payerPhone string | null

      • productCount integer

        ≥ 0

      • products object[]

        количество ≤ 20

        Вложенные поля: 4
        • amount string

          шаблон ^[0-9]+\.[0-9]{2}$

        • currency string

          шаблон ^[A-Z]{3}$

        • name string

        • quantity string

  • nextCursor string | null

  • pinned object[]

    количество ≤ 3

    Вложенные поля: 11
    • actor object | null

      Вложенные поля: 2
      • id string · uuid | null

      • name string

    • at string · date-time

    • call object | null

      Вложенные поля: 8
      • clientNumber string | null

      • direction string

        Значения: incoming outgoing

      • durationSeconds integer | null

        ≥ 0

      • id string · uuid

      • inProgress boolean

      • recording boolean

      • result string | null

        Значения: answered no_answer busy unreachable failed

      • talkSeconds integer | null

        ≥ 0

    • history object | null

      Вложенные поля: 11
      • amount object | null

        Вложенные поля: 2
        • from object

          Вложенные поля: 2
          • amount string

          • currency string

        • to object

          Вложенные поля: 2
          • amount string

          • currency string

      • attributes object[]

        Вложенные поля: 6
        • decimals integer | null

          0–4

        • fieldType string | null

          Значения: text long_text number date datetime boolean choice multi_choice url money birthday address

        • from string | null

        • key string

        • label string | null

        • to string | null

      • event string

        Значения: created updated moved owner_changed comment_edited comment_deleted deleted restored comment_pinned comment_unpinned payment_recorded payment_changed payment_canceled payment_refunded payment_requested payment_request_paid payment_request_expired payment_request_canceled payment_request_failed payment_consent_given payment_credit_changed archived

      • fields string[]

        Значения: title description contactId companyId expectedCloseDate

      • owner object | null

        Вложенные поля: 2
        • from object | null

          Вложенные поля: 2
          • id string · uuid | null

          • name string

        • to object | null

          Вложенные поля: 2
          • id string · uuid | null

          • name string

      • stage object | null

        Вложенные поля: 2
        • from object | null

          Вложенные поля: 2
          • id string · uuid | null

          • name string

        • to object

          Вложенные поля: 2
          • id string · uuid | null

          • name string

      • status object | null

        Вложенные поля: 2
        • from string

          Значения: open won lost

        • to string

          Значения: open won lost

      • summary string | null

      • via string | null

        Значения: manual import form

      • merge object

        Вложенные поля: 2
        • dropped object[]

          количество ≤ 400

          Вложенные поля: 4
          • key string

          • label string | null

          • record string

          • value string

        • records object[]

          количество ≤ 4

          Вложенные поля: 3
          • id string · uuid

          • name string

          • number integer

            ≥ 1

      • payment object

        Вложенные поля: 3
        • paymentId string · uuid | null

        • paymentRequestId string · uuid | null

        • refundId string · uuid | null

    • id string · uuid

    • message object | null

      Вложенные поля: 2
      • chat object

        Вложенные поля: 3
        • account object

          Вложенные поля: 4
          • displayName string

          • id string · uuid

          • owner object

            Вложенные поля: 2
            • id string · uuid

            • name string

          • username string | null

        • id string · uuid

        • provider string

          Значения: telegram

      • entry object | null

        Вложенные поля: 15
        • at string · date-time

        • author object | null

          Вложенные поля: 2
          • id string · uuid

          • name string

        • call object | null

          Вложенные поля: 3
          • answered boolean | null

          • direction string

            Значения: in out

          • seconds integer | null

            ≥ 0

        • dealId string · uuid | null

        • deleted boolean

        • direction string

          Значения: in out

        • editedAt string · date-time | null

        • failure string | null

        • files object[]

          Вложенные поля: 11
          • contentType string | null

          • durationSeconds integer | null

            ≥ 0

          • gone boolean

          • hasPreview boolean

          • height integer | null

            ≥ 1

          • id string · uuid

          • kind string

            Значения: photo voice audio video video_note document sticker

          • name string | null

          • sizeBytes integer | null

            ≥ 0

          • waveform integer[] | null

            количество ≤ 128 · 0–31

          • width integer | null

            ≥ 1

        • id string · uuid

        • kind string

          Значения: text media call other

        • origin string

          Значения: client alta device history

        • otherKind string | null

          Значения: sticker location contact poll game unsupported

        • status string | null

          Значения: queued sending sent read failed cancelled

        • text string | null

    • note object | null

      Вложенные поля: 6
      • attachments object[]

        The comment's files in their order (empty without files): id, name, size in bytes, type, and an audio's or a video's length. A signed-in member opens one through GET /note-files/{id}; an API key sees them here but does not open them.

        Вложенные поля: 5
        • contentType string

        • durationSeconds integer | null

          0–86400

        • id string · uuid

        • name string

          длина 1–255

        • size integer

          ≥ 1

      • body string

      • editedAt string · date-time | null

      • mentions object[]

        Вложенные поля: 3
        • memberId string · uuid | null

        • name string

        • text string

      • pinned object | null

        Вложенные поля: 2
        • at string · date-time

        • by object

          Вложенные поля: 2
          • id string · uuid | null

          • name string

      • version integer

        ≥ 1

    • task object | null

      Вложенные поля: 9
      • attributes object[]

        Вложенные поля: 6
        • decimals integer | null

          0–4

        • fieldType string | null

          Значения: text long_text number date datetime boolean choice multi_choice url money birthday address

        • from string | null

        • key string

        • label string | null

        • to string | null

      • event string

        Значения: created updated rescheduled reassigned completed reopened canceled deleted restored

      • id string · uuid

      • kind string

        Значения: task call meeting email reminder chat

      • next object | null

        Вложенные поля: 4
        • dueAt string · date-time | null

        • id string · uuid

        • title string

        • allDay boolean

      • outcome string | null

        Значения: call message meeting no_answer no_contact

      • reschedule object | null

        Вложенные поля: 2
        • note string | null

        • reason string | null

          Значения: client_asked no_answer no_time other

      • title string

      • type object | null

        Вложенные поля: 3
        • icon string

        • id string · uuid

        • name string

    • type string

      Значения: note history task call message

    • callAnalysis object

      Вложенные поля: 1
      • transcript object

        Вложенные поля: 1
        • state string

          Значения: queued transcribing held done failed

    • paymentReport object

      Вложенные поля: 9
      • card object | null

        Вложенные поля: 3
        • brand string | null

        • issuer string | null

        • maskedNumber string | null

      • method string | null

      • occurredAt string · date-time

      • orderReference string | null

      • payer string | null

      • payerEmail string | null

      • payerPhone string | null

      • productCount integer

        ≥ 0

      • products object[]

        количество ≤ 20

        Вложенные поля: 4
        • amount string

          шаблон ^[0-9]+\.[0-9]{2}$

        • currency string

          шаблон ^[A-Z]{3}$

        • name string

        • quantity string

История сделки

GET /deals/{dealId}/activity

Всё, что произошло со сделкой, новые сверху, страницами: создание, переходы по этапам, выигрыш, проигрыш и повторное открытие, смена ответственного, суммы, каждого поля и тегов (что было и что стало), комментарии, что произошло с её задачами, оплаты. У каждой записи — кто (actor), когда (at) и что (history, note или task). only оставляет одно: notes — комментарии, history — изменения, tasks — задачи, payments — оплаты, changes — правки названия, суммы, тегов и собственных полей (без создания сделки; в каждой записи только эти правки). Чаты и звонки через API недоступны.

Параметры пути

  • dealId string · uuid обязательно

Параметры запроса

  • cursor string

    длина 1–512

  • limit integer

    1–100 · по умолчанию 30

  • only string

    Значения: notes history tasks main payments changes

Пример запроса

bash
curl 'https://your-company.altahub.ai/api/v1/deals/{dealId}/activity' \
  -H 'Authorization: Bearer alta_…'
js
const response = await fetch('https://your-company.altahub.ai/api/v1/deals/{dealId}/activity', {
  method: 'GET',
  headers: {
    Authorization: 'Bearer alta_…',
  },
});
const data = await response.json();
python
import requests

response = requests.get(
    "https://your-company.altahub.ai/api/v1/deals/{dealId}/activity",
    headers={"Authorization": "Bearer alta_…"},
)
data = response.json()
php
<?php
$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://your-company.altahub.ai/api/v1/deals/{dealId}/activity', [
    'headers' => ['Authorization' => 'Bearer alta_…'],
]);
$data = json_decode((string) $response->getBody(), true);

Ответ 200

Успешный ответ.

json
{
  "items": [
    {
      "id": "0192f3a1-7c2e-7b4d-9a61-00000000003c",
      "type": "task",
      "at": "2026-10-24T16:45:00Z",
      "actor": {
        "id": "0192f3a1-7c2e-7b4d-9a61-000000000002",
        "name": "Ирина Мельник"
      },
      "note": null,
      "history": null,
      "task": {
        "id": "0192f3a1-7c2e-7b4d-9a61-00000000003c",
        "title": "Перезвонить по счёту",
        "kind": "call",
        "type": null,
        "event": "completed",
        "attributes": [],
        "outcome": "call",
        "next": {
          "id": "0192f3a1-7c2e-7b4d-9a61-00000000003d",
          "title": "Отправить счёт",
          "dueAt": "2026-10-29T09:00:00Z"
        },
        "reschedule": null
      },
      "call": null,
      "message": null
    },
    {
      "id": "0192f3a1-7c2e-7b4d-9a61-000000000059",
      "type": "history",
      "at": "2026-10-23T10:30:00Z",
      "actor": {
        "id": "0192f3a1-7c2e-7b4d-9a61-000000000002",
        "name": "Ирина Мельник"
      },
      "note": null,
      "history": {
        "event": "payment_recorded",
        "via": null,
        "stage": null,
        "status": null,
        "owner": null,
        "amount": null,
        "fields": [],
        "summary": null,
        "attributes": [
          {
            "key": "payment",
            "label": null,
            "from": null,
            "to": "12000.00 UAH",
            "fieldType": "money",
            "decimals": null
          },
          {
            "key": "paymentStatus",
            "label": null,
            "from": null,
            "to": "paid",
            "fieldType": null,
            "decimals": null
          },
          {
            "key": "paidAt",
            "label": null,
            "from": null,
            "to": "2026-10-23",
            "fieldType": null,
            "decimals": null
          },
          {
            "key": "paymentMethod",
            "label": null,
            "from": null,
            "to": "Карта",
            "fieldType": null,
            "decimals": null
          }
        ],
        "payment": {
          "paymentId": "0192f3a1-7c2e-7b4d-9a61-0000000000b3",
          "refundId": null,
          "paymentRequestId": null
        }
      },
      "task": null,
      "call": null,
      "message": null
    },
    {
      "id": "0192f3a1-7c2e-7b4d-9a61-000000000050",
      "type": "note",
      "at": "2026-10-22T09:05:00Z",
      "actor": {
        "id": "0192f3a1-7c2e-7b4d-9a61-000000000002",
        "name": "Ирина Мельник"
      },
      "note": {
        "body": "Клиентка просит счёт до пятницы",
        "editedAt": null,
        "version": 1,
        "mentions": [],
        "pinned": null,
        "attachments": []
      },
      "history": null,
      "task": null,
      "call": null,
      "message": null
    },
    {
      "id": "0192f3a1-7c2e-7b4d-9a61-000000000053",
      "type": "history",
      "at": "2026-10-21T12:45:00Z",
      "actor": {
        "id": "0192f3a1-7c2e-7b4d-9a61-000000000002",
        "name": "Ирина Мельник"
      },
      "note": null,
      "history": {
        "event": "updated",
        "via": "manual",
        "stage": null,
        "status": null,
        "owner": null,
        "amount": {
          "from": {
            "amount": "10000.00",
            "currency": "UAH"
          },
          "to": {
            "amount": "12000.00",
            "currency": "UAH"
          }
        },
        "fields": [],
        "summary": null,
        "attributes": [
          {
            "key": "cf:0192f3a1-7c2e-7b4d-9a61-000000000032",
            "label": "Город доставки",
            "from": null,
            "to": "Киев",
            "fieldType": "text",
            "decimals": null
          }
        ]
      },
      "task": null,
      "call": null,
      "message": null
    },
    {
      "id": "0192f3a1-7c2e-7b4d-9a61-000000000052",
      "type": "history",
      "at": "2026-10-21T12:40:00Z",
      "actor": {
        "id": "0192f3a1-7c2e-7b4d-9a61-000000000002",
        "name": "Ирина Мельник"
      },
      "note": null,
      "history": {
        "event": "moved",
        "via": "manual",
        "stage": {
          "from": {
            "id": "0192f3a1-7c2e-7b4d-9a61-00000000001f",
            "name": "Новый запрос"
          },
          "to": {
            "id": "0192f3a1-7c2e-7b4d-9a61-000000000020",
            "name": "Переговоры"
          }
        },
        "status": null,
        "owner": null,
        "amount": null,
        "fields": [],
        "summary": null,
        "attributes": []
      },
      "task": null,
      "call": null,
      "message": null
    },
    {
      "id": "0192f3a1-7c2e-7b4d-9a61-000000000051",
      "type": "history",
      "at": "2026-10-20T08:15:00Z",
      "actor": {
        "id": "0192f3a1-7c2e-7b4d-9a61-000000000001",
        "name": "Андрей Шевченко"
      },
      "note": null,
      "history": {
        "event": "created",
        "via": "manual",
        "stage": {
          "from": null,
          "to": {
            "id": "0192f3a1-7c2e-7b4d-9a61-00000000001f",
            "name": "Новый запрос"
          }
        },
        "status": null,
        "owner": null,
        "amount": null,
        "fields": [],
        "summary": null,
        "attributes": []
      },
      "task": null,
      "call": null,
      "message": null
    }
  ],
  "nextCursor": null,
  "pinned": []
}

Поля — как в ответе История контакта

Связать комментарий с его копией в другой системе

PUT /notes/{noteId}/copies/{source}/{externalId}

Для сервиса, который копирует комментарии из Alta в другую систему: после того как копия создана там, он сообщает её id. source — ваше слово для системы (строчные латинские буквы, цифры, - и _), externalId — id копии там. Импорт из этой системы узнаёт копию по этому id и отвечает этим комментарием, а не приносит его второй раз; поэтому в тексте копии не нужна строка со ссылкой на комментарий. Если импорт успел принести копию раньше, чем пришла связь, и она в точности повторяет комментарий, она скрывается как дубль (duplicateHidden: true). Первая связь — created, тот же запрос ещё раз ничего не меняет (unchanged), поэтому повтор безопасен. Связать можно только комментарий, написанный в Alta: для пришедшего импортом — 409 CONFLICT (note_imported); копия, уже связанная с другим комментарием, — 409 CONFLICT (copy_of_another_comment). Нужен ключ с правом записи и право «Импорт данных» в роли автора ключа (у владельца и администратора оно есть), иначе — 403 FORBIDDEN.

Параметры пути

  • externalId string обязательно

    длина 1–200 · шаблон ^\S+$

  • noteId string · uuid обязательно

  • source string обязательно

    шаблон ^[a-z0-9_-]{1,40}$

Пример запроса

bash
curl -X PUT 'https://your-company.altahub.ai/api/v1/notes/{noteId}/copies/{source}/{externalId}' \
  -H 'Authorization: Bearer alta_…' \
  -H 'Content-Type: application/json' \
  -d '{}'
js
const response = await fetch('https://your-company.altahub.ai/api/v1/notes/{noteId}/copies/{source}/{externalId}', {
  method: 'PUT',
  headers: {
    Authorization: 'Bearer alta_…',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({}),
});
const data = await response.json();
python
import requests

response = requests.put(
    "https://your-company.altahub.ai/api/v1/notes/{noteId}/copies/{source}/{externalId}",
    headers={"Authorization": "Bearer alta_…"},
    json={},
)
data = response.json()
php
<?php
$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://your-company.altahub.ai/api/v1/notes/{noteId}/copies/{source}/{externalId}', [
    'headers' => ['Authorization' => 'Bearer alta_…'],
    'json' => new \stdClass(),
]);
$data = json_decode((string) $response->getBody(), true);

Ответ 200

Успешный ответ.

json
{
  "noteId": "0192f3a1-7c2e-7b4d-9a61-000000000050",
  "outcome": "created",
  "duplicateHidden": false
}
Поля ответа
  • duplicateHidden boolean

  • noteId string · uuid

  • outcome string

    Значения: created unchanged