Skip to content
v1

Reference Changes feed

Changes feed

One endpoint that copies a team and then returns every change, page by page.

Overview

GET /v1/sync/changes returns a team's changes, page by page, in the order Totem recorded them. Without cursor, it starts an initial sync of every record. With the next_cursor of your last page, it returns what changed since. Each item is the current state of one record, or a removal that tells you to delete it. New kinds of record can appear in the feed in any version: store or skip an item whose kind you do not know, and keep syncing.

Store next_cursor after you apply each page, even an empty one, and send it on your next request. A cursor expires 30 days after the point in the feed it reached; a team you poll every few minutes never gets there.

This page is the reference: the parameters, the item object and the errors. Keep a copy in sync is the guide: how to apply a page, recover from each error, and run a sync client that Totem tests.

Explicit CRM note content

kind: "lead_note" is visible only with the separate note-content grant and completed note preparation. It has its own version and removal tombstones. Ordinary read keys never gain note bodies automatically. See CRM writes and notes.

Lifecycle event notifications

GET /v1/events is a separate metadata event feed, not a replacement for the changes feed. Start at the current position or request retained events, then process each page before saving its cursor. Continue while has_more is true, including empty pages. Deduplicate by the stable event id.

An event records an authorized transition of an operation, call or appointment; it does not contain private bodies and does not grant access to the referenced resource. Fetch the current resource with its own permissions. A queued operation is not a completed action, and an analysis-ready transition must reflect actually retained analysis.

Read the changes feed of one team

GET /v1/sync/changes

Reads current records and removals in capture order under the key's current scopes: the feed and CRM kinds require crm:read, calls calls:read, conversations messages:read, bookings calendar:read; notes additionally require crm:notes:read, explicit content permission and completed note capture. Start without cursor and save every next_cursor; withheld kinds advance it and can leave data empty with has_more: true, so keep paging; after gaining a scope, restart without a cursor to recover earlier withheld records. A cursor expires 30 days after its feed position or, during bootstrap, 30 days after bootstrap started.

Scopes
crm:read
Rate limit
Sync

Query parameters

  • cursor string 1–512 chars

    The next_cursor of the previous page. Omit it to start an initial sync from the beginning.

  • limit integer Range 1–100 Default 25

    Items per page, 1–100. Defaults to 25.

Headers

  • Totem-Team string Conditional ID prefix team_…

    The team to read, as a team_… id. Omit it when the key reads one team; it is required when the key reads several (400 team_required). When you send it, it must name a team the key reads: a malformed id gets 400 invalid_request, and a team outside the key gets 404 team_not_accessible, as does a request without it once the key reads no team at all.

Returns

Returns a list of FeedItem objects.

  • object string

    Always list.

  • data Array<FeedItem>

    Changes in the order Totem recorded them. A record can appear more than once during an initial sync.

  • has_more boolean

    true when more changes are ready now; false once you have caught up.

  • next_cursor string

    Always present, even on an empty page. Store it after applying the page and send it on the next call.

Errors

+ 12 common errors

GET /v1/sync/changes
curl 'https://api.totemstudio.ai/v1/sync/changes?limit=25' \
  -H "Authorization: Bearer $TOTEM_API_KEY" \
  -H "Totem-Team: $TOTEM_TEAM_ID"
Response · 200JSON
{
  "object": "list",
  "data": [
    {
      "kind": "lead",
      "id": "lead_r72EfbRNUzuqORFJR0O8HxAwEXd93jGUTYMaMMXKSF0QbLS8CiUKJpEP34LFQG",
      "version": 3,
      "object": {
        "id": "lead_r72EfbRNUzuqORFJR0O8HxAwEXd93jGUTYMaMMXKSF0QbLS8CiUKJpEP34LFQG",
        "object": "lead",
        "livemode": false,
        "team": "team_r9uYrIW4gSFJJ6hZQ9ip1UIpPaAD1CF7NR",
        "record_kind": "lead",
        "name": "Alex",
        "surname": "Rivera",
        "date_of_birth": "1990-04-23",
        "email": "alex.rivera@example.com",
        "company": "Example Dental",
        "website": null,
        "phone": "+12025550123",
        "phone_status": "valid",
        "status": "contacted",
        "status_set_by": "ai",
        "archive_reason": null,
        "archived_from_status": null,
        "contact_permissions": {
          "do_not_contact": false,
          "email_opt_out": false,
          "email_opt_out_at": null,
          "whatsapp_consent": null,
          "provenance": {
            "do_not_contact": null,
            "email_opt_out": null,
            "whatsapp_consent": null
          }
        },
        "merged_into": null,
        "transferred_to": null,
        "revived_at": null,
        "pipeline_cleared": false,
        "converted_at": null,
        "value_at_conversion": null,
        "priority": "high",
        "tags": [
          "spring-check-up"
        ],
        "board": "brd_r72EfbRNUzuqORFJR0O8HxAwEXd93jGUTYMaMMX3trzsVUZQuHcMSuDh1aRIst",
        "stage": "stg_r72EfbRNUzuqORFJR0O8HxAwEXd93jGUTYMaMMXWBYWcKwVTY3CRZlVS3oYvs0",
        "assignees": [
          "mem_h548E7UiYhutHhucVrQCzkM0eaea0"
        ],
        "estimated_value": 1200,
        "estimated_value_currency": null,
        "source": "meta_lead_ads",
        "source_channel": null,
        "source_detail": null,
        "source_provenance": "member_editable",
        "created_at": "2026-09-28T10:15:00.000Z",
        "version": 3,
        "updated_at": "2026-09-28T10:20:01.250Z"
      }
    },
    {
      "kind": "call",
      "id": "call_m1pf4APjJWVi3Z7ulyNaW8y3lUi7V",
      "version": 5,
      "removed": {
        "reason": "deleted"
      }
    },
    {
      "kind": "notification",
      "id": "ntf_m3mtwDFyaDSKmhf9rg7Ps201S8Jc4",
      "version": 1,
      "object": {
        "id": "ntf_m3mtwDFyaDSKmhf9rg7Ps201S8Jc4",
        "object": "notification",
        "livemode": false,
        "team": "team_r9uYrIW4gSFJJ6hZQ9ip1UIpPaAD1CF7NR",
        "lead": "lead_r72EfbRNUzuqORFJR0O8HxAwEXd93jGUTYMaMMXKSF0QbLS8CiUKJpEP34LFQG",
        "call": null,
        "conversation": "conv_m3GhGjRHmFbww1g10oqOp7j3gWqPJ",
        "summary": "Alex requests a call from a person about the appointment.",
        "status": "new",
        "source": "chat",
        "handoff_reason": null,
        "created_at": "2026-10-01T08:58:00.000Z",
        "version": 1,
        "updated_at": "2026-10-01T08:58:30.000Z"
      }
    },
    {
      "kind": "notification",
      "id": "ntf_m3onOBMbZVZ3x60zRbxTZy11ThyqU",
      "version": 3,
      "removed": {
        "reason": "erased"
      }
    },
    {
      "kind": "lead_response",
      "id": "lead_r72EfbRNUzuqORFJR0O8HxAwEXd93jGUTYMaMMXKSF0QbLS8CiUKJpEP34LFQG",
      "version": 7,
      "object": {
        "id": "lead_r72EfbRNUzuqORFJR0O8HxAwEXd93jGUTYMaMMXKSF0QbLS8CiUKJpEP34LFQG",
        "object": "lead_response",
        "livemode": false,
        "team": "team_r9uYrIW4gSFJJ6hZQ9ip1UIpPaAD1CF7NR",
        "last_inbound_at": "2026-10-01T08:58:00.000Z",
        "last_outbound_at": "2026-10-01T08:59:30.000Z",
        "awaiting_reply": false,
        "last_answered_call_at": "2026-09-28T10:17:00.000Z",
        "last_whatsapp_delivery_status": "read",
        "coverage": {
          "conversations": 2,
          "calls": 1,
          "channels_without_delivery_data": [
            "email"
          ],
          "truncated": false
        },
        "version": 7,
        "updated_at": "2026-10-01T08:59:31.040Z"
      }
    }
  ],
  "has_more": false,
  "next_cursor": "eyJ2IjoxLCJ0ZWFtIjoidGVhbV9yOXVZcklXNGdTRkpKNmhaUTlpcDFVSXBQYUFEMUNGN05SIiwiZXBvY2giOjAsInQiOnsicyI6MTc5MDg0NTE3MSwibnMiOjQwMDAwMDAwfSwibiI6IjVkMjJhMTVlM2E5MmNmYTE4NzUzZTVmYzkyZmVjNzI0MjQyNjIzZDE2MGIxZTUxMzRiYTM1ODE5MmUzNzM0ZjEiLCJicyI6bnVsbH01ZPX02"
}

Read retained lifecycle events

GET /v1/events

Poll current-authorized retained transition metadata with one saved cursor per integration and team, deduplicating by event ID; operation completions belong only to their initiating integration and acceptance is not completion. Missing or unauthorized sources are withheld while advancing the cursor; continue immediately while has_more is true even for empty pages, otherwise poll later. Capture invents no historical transitions, cursors expire after thirty days and events expire with their source or earlier; use sync.changes separately for CRM state and removals.

Scopes
events:read
Rate limit
Sync

Query parameters

  • cursor string 1–512 chars

    Opaque cursor returned by this integration and team event feed.

  • limit integer Range 1–100 Default 25

    Items per page, 1–100. Defaults to 25.

  • start string

    Without a cursor, now initializes at the current capture position without replay; retained reads available history. Do not combine start with cursor.

    Possible values
    • now
    • retained

Headers

  • Totem-Team string Conditional ID prefix team_…

    The team to read, as a team_… id. Omit it when the key reads one team; it is required when the key reads several (400 team_required). When you send it, it must name a team the key reads: a malformed id gets 400 invalid_request, and a team outside the key gets 404 team_not_accessible, as does a request without it once the key reads no team at all.

Returns

Returns an EventList object.

Errors

+ 12 common errors

GET /v1/events
curl 'https://api.totemstudio.ai/v1/events?limit=25' \
  -H "Authorization: Bearer $TOTEM_API_KEY" \
  -H "Totem-Team: $TOTEM_TEAM_ID"
Response · 200JSON
{
  "object": "event_list",
  "data": [
    {
      "object": "event",
      "id": "evt_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "name": "operation.completed",
      "resource_type": "operation",
      "resource_id": "op_m3yGe1tkVy6hn3m9LH9m7e640wg0O",
      "status": "succeeded",
      "occurred_at": "2026-10-01T09:30:00.000Z"
    }
  ],
  "has_more": false,
  "next_cursor": "fictitious-opaque-event-cursor"
}

The FeedItem object

One change: the record's current state, or its removal.

Attributes of every variant

  • kind string

    The kind of the record, such as lead or call.

    Possible values
    • lead
    • lead_note
    • lead_attribution
    • lead_response
    • activity
    • call
  • version integer Range ≥ 1

    The record's version. Apply the item only when it is greater than the version you hold.

Variants

Each FeedItem is exactly one of these 2 variants.

With object

  • id string ID prefix lead_… note_… act_… call_… conv_… bkg_… brd_… ntf_…

    Public id of the record; the facets lead_attribution and lead_response use their lead's id.

  • object one of 10 objects

    The record as it is now.

    Matches kind:

With removed

  • id string ID prefix lead_… note_… act_… call_… conv_… bkg_… brd_… ntf_…

    Public id of the removed record.

  • removed object

    Present only on a removal.

FeedItem · exampleJSON
{
  "kind": "lead",
  "id": "lead_r72EfbRNUzuqORFJR0O8HxAwEXd93jGUTYMaMMXKSF0QbLS8CiUKJpEP34LFQG",
  "version": 3,
  "object": {
    "id": "lead_r72EfbRNUzuqORFJR0O8HxAwEXd93jGUTYMaMMXKSF0QbLS8CiUKJpEP34LFQG",
    "object": "lead",
    "livemode": false,
    "team": "team_r9uYrIW4gSFJJ6hZQ9ip1UIpPaAD1CF7NR",
    "record_kind": "lead",
    "name": "Alex",
    "surname": "Rivera",
    "date_of_birth": "1990-04-23",
    "email": "alex.rivera@example.com",
    "company": "Example Dental",
    "website": null,
    "phone": "+12025550123",
    "phone_status": "valid",
    "status": "contacted",
    "status_set_by": "ai",
    "archive_reason": null,
    "archived_from_status": null,
    "contact_permissions": {
      "do_not_contact": false,
      "email_opt_out": false,
      "email_opt_out_at": null,
      "whatsapp_consent": null,
      "provenance": {
        "do_not_contact": null,
        "email_opt_out": null,
        "whatsapp_consent": null
      }
    },
    "merged_into": null,
    "transferred_to": null,
    "revived_at": null,
    "pipeline_cleared": false,
    "converted_at": null,
    "value_at_conversion": null,
    "priority": "high",
    "tags": [
      "spring-check-up"
    ],
    "board": "brd_r72EfbRNUzuqORFJR0O8HxAwEXd93jGUTYMaMMX3trzsVUZQuHcMSuDh1aRIst",
    "stage": "stg_r72EfbRNUzuqORFJR0O8HxAwEXd93jGUTYMaMMXWBYWcKwVTY3CRZlVS3oYvs0",
    "assignees": [
      "mem_h548E7UiYhutHhucVrQCzkM0eaea0"
    ],
    "estimated_value": 1200,
    "estimated_value_currency": null,
    "source": "meta_lead_ads",
    "source_channel": null,
    "source_detail": null,
    "source_provenance": "member_editable",
    "created_at": "2026-09-28T10:15:00.000Z",
    "version": 3,
    "updated_at": "2026-09-28T10:20:01.250Z"
  }
}

The Event object

Attributes

  • object string

    Always event.

  • id string Pattern ^evt_(?:[a-f0-9]{48}|[a-f0-9]{64})$

    Stable opaque transition identity; deduplicate deliveries by this value.

  • name string

    Captured lifecycle transition, distinct from acceptance of an asynchronous request.

    Possible values
    • operation.completed
    • call.completed
    • call.analysis_completed
    • booking.created
    • booking.rescheduled
    • booking.cancelled
    • assistant_run.completed
    • decision_request.resolved
  • resource_type string

    Kind of retained resource referenced by this event.

    Possible values
    • operation
    • call
    • booking
    • decision_request
  • resource_id string ID prefix op_… call_… bkg_… drq_…

    Current opaque ID of the exact retained resource incarnation.

  • status string

    Captured metadata status; outcome_unknown must be reconciled before repeating an effect. For decision_request.resolved it is the resolution: approved, rejected, accepted, unanswered, expired or cancelled.

    Possible values
    • succeeded
    • failed
    • cancelled
    • outcome_unknown
    • completed
    • ready
  • occurred_at string Format date-time

    Source transition time in UTC.

Event · exampleJSON
{
  "object": "event",
  "id": "evt_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "name": "operation.completed",
  "resource_type": "operation",
  "resource_id": "op_m3yGe1tkVy6hn3m9LH9m7e640wg0O",
  "status": "succeeded",
  "occurred_at": "2026-10-01T09:30:00.000Z"
}

The EventList object

Attributes

  • object string

    Always event_list.

  • data Array<Event> ≤ 100 items

    Authorized retained transitions in capture order; withheld entries still advance the cursor.

  • has_more boolean

    Continue immediately with next_cursor while true, including when data is empty.

  • next_cursor string 1–512 chars

    Opaque cursor bound to this integration and selected team; save it after processing the page.

EventList · exampleJSON
{
  "object": "event_list",
  "data": [
    {
      "object": "event",
      "id": "evt_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
      "name": "operation.completed",
      "resource_type": "operation",
      "resource_id": "op_m3yGe1tkVy6hn3m9LH9m7e640wg0O",
      "status": "succeeded",
      "occurred_at": "2026-10-01T09:30:00.000Z"
    }
  ],
  "has_more": false,
  "next_cursor": "fictitious-opaque-event-cursor"
}

API version 1.0.0