AISARAISAR

Data types: CRM

Reference for CRM objects: funnels, snippets, segments, broadcasts, message templates, and automations.

This page describes the shapes of the CRM-domain objects the API returns. Endpoint behavior (create, update, run) lives in the matching REST groups: funnels, snippets, segments, broadcasts, templates, deals, and automations.

Funnels & snippets

Funnel

A funnel groups the stages (stages) that deals move through. status reflects the funnel state (e.g. draft) and steps is the number of stages. Each stage carries a type (new, in_progress, success or failed), an order, and a color.

json
{
  "id": 1,
  "company_id": 1,
  "name": "Support",
  "slug": "support",
  "description": "...",
  "status": "draft",
  "steps": 3,
  "updated_at": "2024-01-01T00:00:00Z",
  "stages": [
    {
      "id": 1,
      "funnel_id": 1,
      "name": "New",
      "type": "new",
      "order": 1,
      "color": "#00FF00",
      "stale_after_days": null,
      "wip_limit": null
    }
  ]
}

Snippet

A snippet is a reusable text (message) with optional attachments (files); each file carries a name, size, MIME type, and download_url.

json
{
  "id": 1,
  "company_id": 1,
  "name": "Greeting",
  "message": "Hello",
  "files": [
    {
      "id": 1,
      "name": "file.pdf",
      "size": 1234,
      "type": "application/pdf",
      "download_url": "..."
    }
  ],
  "updated_at": "2024-01-01T00:00:00Z"
}

Segments & broadcasts

Segment

A segment is a saved set of conditions (conditions) selecting contacts. Conditions are combined by group_logic (and/or); conditions_summary is a human-readable summary. estimated_count is a dynamically computed estimate of the audience size; contacts_count is the materialized number of members for static segments (type = static), otherwise null.

json
{
  "id": "1",
  "name": "New leads",
  "slug": "new-leads",
  "type": "dynamic",
  "description": "Contacts with recent inbound activity",
  "conditions": [
    { "group": 0, "type": "tag", "operator": "has_any", "value": [1, 2], "field_name": null },
    { "group": 0, "type": "channel", "operator": "in", "value": [5], "field_name": null }
  ],
  "conditions_summary": "Last inbound <= 7 days",
  "estimated_count": 120,
  "contacts_count": null,
  "members": null,
  "created_at": "2026-02-09T18:00:00Z",
  "updated_at": "2026-02-09T18:00:00Z"
}

Broadcast

A broadcast targets an audience (the same condition shape as a segment) across one or more channels with the given content. schedule defines a one-off send (mode = now/…), recurring_schedule a recurring one. The runs field holds the array of runs (BroadcastRun objects, see below).

json
{
  "id": 1,
  "company_id": 1,
  "name": "Promo Feb",
  "status": "scheduled",
  "audience": {
    "conditions": [{ "type": "tag", "operator": "has_any", "value": [1, 2] }],
    "group_logic": "and"
  },
  "channels": [],
  "content": [],
  "schedule": { "mode": "now", "scheduledAt": null },
  "recurring_schedule": null,
  "runs": [],
  "created_at": "2026-02-09T18:00:00Z",
  "updated_at": "2026-02-09T18:00:00Z"
}

BroadcastRun

A single broadcast run with delivery counters: total (recipients), sent, failed, delivered, read. status reflects the run state (e.g. completed), and started_at/completed_at are its time bounds.

json
{
  "id": 1,
  "broadcast_id": 1,
  "status": "completed",
  "total": 120,
  "sent": 115,
  "failed": 5,
  "delivered": 100,
  "read": 42,
  "started_at": "2026-03-17T10:00:00Z",
  "completed_at": "2026-03-17T10:05:00Z",
  "created_at": "2026-03-17T10:00:00Z"
}

Templates & automations

MessageTemplate

A message template is bound to a channel type (channel_type) and a language. status reflects the moderation state (e.g. draft), and body holds the text with {{name}} variables. The header_enabled/footer_enabled/buttons_enabled flags toggle those blocks; parameters describe the variables (name, type, sample_value, position), buttons the buttons, and uses_count the number of uses. This shows the base shape of a single template instance; the full WhatsApp Business logical model (the logical_template aggregate, grouping by template_group_id, per-channel meta_status/meta_status_reason/last_synced_at, and Meta synchronization) is described in the «Message templates» REST group.

json
{
  "id": 1,
  "company_id": 1,
  "template_group_id": null,
  "channel_type_id": 4,
  "channel_type": { "id": 4, "key": "whatsapp_business", "name": "WhatsApp Business" },
  "channel": null,
  "name": "Welcome",
  "slug": "welcome_v1",
  "status": "draft",
  "meta_status": null,
  "meta_status_reason": null,
  "last_synced_at": null,
  "language": "en",
  "category": "utility",
  "description": null,
  "body": "Hello, {{first_name}}",
  "header_enabled": false,
  "header_type": null,
  "header_text": null,
  "header_media_url": null,
  "footer_enabled": false,
  "footer_text": null,
  "buttons_enabled": false,
  "auth_config": null,
  "labels": ["onboarding"],
  "parameters": [
    { "id": 1, "name": "first_name", "type": "text", "sample_value": "John", "position": 1 }
  ],
  "buttons": [],
  "uses_count": 0,
  "created_at": "2026-02-09T18:00:00Z",
  "updated_at": "2026-02-09T18:00:00Z"
}

Automation

Automations use UUID identifiers and camelCase field names (unlike most CRM types, which use snake_case). activeVersionId/latestVersionId separate the published and the latest revision of the flow.

status reflects the automation state (e.g. draft) and healthStatus its health (e.g. ok). executionsCount and lastRunAt describe the run history; createdBy/updatedBy are the authors of changes.

json
{
  "id": "a1b2c3d4-0000-4000-8000-000000000001",
  "companyId": "1",
  "name": "Welcome automation",
  "description": null,
  "status": "draft",
  "healthStatus": "ok",
  "activeVersionId": null,
  "latestVersionId": null,
  "templateId": null,
  "executionsCount": 0,
  "lastRunAt": null,
  "createdAt": "2026-02-09T18:00:00Z",
  "updatedAt": "2026-02-09T18:00:00Z",
  "createdBy": "1",
  "updatedBy": "1"
}