AISARAISAR

Data types: platform

Reference for the platform data types: integrations and system events, teams/company/user, and the outbound message queue.

Below are the shapes of the platform-domain JSON objects returned by the matching /v1 endpoints. Each heading is the exact type name; fields shown as "..." are nested objects of the same or a related shape.

Integrations and events

Integration (IntegrationInstance)

The full representation of a connected integration. health holds the last delivery success/failure (last_success_at, last_failure_at, last_error) and a consecutive-failure counter (consecutive_failures); settings is the configuration (URL, selected events, retries, channel filter); credential.secrets holds secrets shaped like IntegrationSecrets; external_entities/mappings/funnel_mappings are the mappings to the external system.

json
{
  "id": 1,
  "type": "webhook",
  "name": "n8n Production",
  "status": "active",
  "health": {
    "last_success_at": "2026-02-01T12:00:00Z",
    "last_failure_at": null,
    "last_error": null,
    "consecutive_failures": 0
  },
  "settings": {
    "url": "https://example.com/webhook",
    "description": "Production automation",
    "signatureHeader": "X-AISAR-Signature",
    "authType": "basic",
    "selectedEventKeys": ["message.created", "conversation.created"],
    "channelFilter": "all",
    "timeoutSeconds": 30,
    "retryEnabled": true,
    "maxAttempts": 6,
    "concurrency": 4
  },
  "credential": {
    "secrets": { "...IntegrationSecrets" },
    "expires_at": null,
    "last_refreshed_at": null,
    "rotated_at": null,
    "created_at": "2026-02-04T12:00:00Z",
    "updated_at": "2026-02-04T12:00:00Z"
  },
  "external_entities": [{ "..." }],
  "mappings": [{ "..." }],
  "funnel_mappings": [{ "..." }],
  "created_at": "2026-02-01T12:00:00Z",
  "updated_at": "2026-02-04T12:00:00Z"
}

IntegrationListItem

A lightweight integration representation for lists — without health, secrets, or mappings.

json
{
  "id": 1,
  "type": "webhook",
  "name": "n8n Production",
  "status": "active",
  "settings": { "url": "https://example.com/webhook" },
  "created_at": "2026-02-01T12:00:00Z",
  "updated_at": "2026-02-04T12:00:00Z"
}

IntegrationSecrets

The shape of an integration's secrets block. The set of fields depends on authType. The values below are placeholders; send real secrets only when creating or rotating an integration.

Never put real secrets into examples, logs, or tickets. Every value in the example below is a deliberately synthetic placeholder.
json
{
  "signingSecret": "whsec_xxx_EXAMPLE",
  "bearerToken": "YOUR_BEARER_TOKEN",
  "basicUsername": "api_user",
  "basicPassword": "YOUR_PASSWORD"
}

IntegrationLog

An integration log entry. context carries the event-delivery details: the event key, status, response code, duration, and request/response bodies.

json
{
  "id": 1,
  "level": "info",
  "code": "webhook.delivery",
  "message": "Webhook delivered.",
  "context": {
    "event_key": "message.created",
    "status": "success",
    "status_code": 200,
    "duration_ms": 420,
    "request": { "url": "...", "method": "POST", "body": {} },
    "response": { "status_code": 200, "body": { "ok": true } }
  },
  "created_at": "2026-02-04T12:00:00Z"
}

IntegrationProvider

A catalog entry for an integration provider (e.g. webhook). Published providers (is_published: true) are available to connect.

json
{
  "id": 1,
  "key": "webhook",
  "name": "Webhook",
  "description": "Outbound webhook integration",
  "is_published": true,
  "created_at": "2026-02-04T12:00:00Z",
  "updated_at": "2026-02-04T12:00:00Z"
}

SystemEvent

A system-event catalog entry — the source of webhook events. key is the canonical key (e.g. message.created), group is the UI grouping. The full event catalog with payload fields is documented in the Webhooks guide.

json
{
  "id": 1,
  "key": "message.created",
  "type": "message",
  "name": "Message created",
  "description": "A new message is created in a conversation.",
  "group": "Messages",
  "metadata": {},
  "created_at": "2026-02-04T12:00:00Z",
  "updated_at": "2026-02-04T12:00:00Z"
}

Teams, company and user

Team

A team within a company. channel_access defines the team's channel access: mode is all or custom, and channel_ids is the channel list for custom mode.

json
{
  "id": 1,
  "company_id": 1,
  "name": "Support",
  "description": "Customer success team",
  "channel_access": { "mode": "all|custom", "channel_ids": [1, 2] },
  "member_ids": [1, 2, 3],
  "created_at": "2024-01-01T00:00:00Z",
  "updated_at": "2024-01-01T00:00:00Z"
}

Company

A company profile: details, locale (country_code/timezone), and the work_schedule_days working schedule (one object per weekday).

json
{
  "id": 1,
  "name": "Acme",
  "registration_number": "...",
  "website": "https://...",
  "industry_code": "...",
  "logo_url": "...",
  "country_code": "US",
  "timezone": "UTC",
  "address_line": "...",
  "postal_code": "...",
  "phone": "+77000000000",
  "respect_holidays": true,
  "work_schedule_days": [
    { "weekday": "monday", "enabled": true, "start_time": "09:00", "end_time": "18:00" }
  ]
}

CompanyMember

A company member: the nested account, a role, and the invitation status. row_key is a stable row key for the UI.

json
{
  "account": {
    "id": 1,
    "name": "John",
    "lastname": "Doe",
    "email": "john@example.com",
    "photo": "...",
    "last_login_at": "2024-01-01T00:00:00Z"
  },
  "role": "admin",
  "invitation_status": "accepted",
  "row_key": "user:1"
}

UserProfile

The current user's profile (returned by GET /me): contacts, the active company current_company_id, the roles and permissions within it, the membership list, and pending invitations.

json
{
  "id": 1,
  "name": "John",
  "lastname": "Doe",
  "email": "john@example.com",
  "email_verified": true,
  "phone": "+77000000000",
  "photo": "...",
  "country_code": "US",
  "language": "en",
  "timezone": "UTC",
  "current_company_id": 1,
  "roles": ["admin"],
  "permissions": ["company.view"],
  "company": { "...Company" },
  "memberships": [
    { "company_id": 1, "company_name": "Acme", "roles": ["admin"], "status": "active" }
  ],
  "pending_invitations": [
    {
      "guid": "...",
      "company_id": 1,
      "company_name": "Acme",
      "role": "manager",
      "invited_by_name": "Jane Doe",
      "expires_at": "2024-01-01T00:00:00Z"
    }
  ]
}

Outbound queue

OutboundQueueItem

An item in the outbound message queue.

json
{
  "id": 10,
  "company_id": 1,
  "conversation_id": 1,
  "thread_id": 2,
  "message_id": 1001,
  "channel_id": 3,
  "provider": "baileys",
  "direction": "outbound",
  "status": "queued",
  "priority": 100,
  "attempt": 0,
  "max_attempts": 5,
  "next_retry_at": null,
  "locked_at": null,
  "locked_by": null,
  "processed_at": null,
  "sent_at": null,
  "last_error": null,
  "payload": {},
  "created_by_user_id": 7,
  "created_at": "2026-02-09T18:00:00Z",
  "updated_at": "2026-02-09T18:00:00Z"
}
FieldValues
directionoutbound \| system
statusqueued \| processing \| sent \| failed \| canceled