Leadvibe API (1.0.0)

Download OpenAPI specification:

Leadvibe API for event ingestion, scoring, segments, triggers, and organization unit (OU) workflows. Notes on scoping and security:

  • Most endpoints are organization-scoped and also OU-scoped. The server derives org and OU from the authenticated context.
  • OU is selected via POST /org-units/active which sets an HttpOnly cookie named activeOu. Many endpoints require an active OU.
  • Clients must not send unit_id in requests; the server uses the active OU from context.
  • For SPA/browser clients, JWT Bearer tokens are used. API clients can also use HTTP Basic with a client_id and client_secret.

Root

Prometheus metrics

Exposes Prometheus metrics in text format. No authentication required.

Responses

Response samples

Content type
text/plain; version=0.0.4
# HELP events_ingested_total Total number of events ingested (accepted).
# TYPE events_ingested_total counter
events_ingested_total 0
# HELP queue_depth Current depth of the async processing queue.
# TYPE queue_depth gauge
queue_depth 0
# HELP event_to_slack_latency_seconds Latency in seconds from event ingestion to Slack notification.
# TYPE event_to_slack_latency_seconds histogram
# HELP http_requests_total Total number of HTTP requests by status code and method.
# TYPE http_requests_total counter

Root

Returns the SPA index page or a simple health/info payload.

Responses

Response samples

Content type
application/json
{
  • "status": "ok"
}

Home

Returns the SPA home page when Accept contains text/html; otherwise a small JSON payload for health checks.

Responses

Response samples

Content type
application/json
{
  • "status": "ok",
  • "page": "home"
}

Auth

Cleanup legacy auth cookies

Removes any residual cookies from previous auth flows.

Responses

Current user

Returns the authenticated user's basic profile. Requires a valid JWT.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "org_member_id": "om_abc123",
  • "first_name": "Jane",
  • "last_name": "Doe",
  • "email": "jane@example.com",
  • "role": "admin",
  • "verified": true
}

Events

Ingest engagement event

Requires authentication and an active OU selected via POST /org-units/active. The server derives org_id and unit_id from the authenticated context; clients must not send unit_id.

Identify the target lead with EITHER:

  • lead_id, OR
  • one or more entries in the aliases array (preferred). Each entry supplies alias_kind and raw_value.

Backward compatibility: top‑level alias_kind and alias are accepted on ingest but are deprecated and not returned by read endpoints.

Authorizations:
bearerAuthbasicAuth
Request Body schema: application/json
required
lead_id
string

Existing lead identifier; optional when aliases are provided

alias_kind
string
Enum: "email" "phone" "external_id" "cookie" "social"

Deprecated. Use aliases array.

alias
string

Deprecated. Use aliases array.

Array of objects

Preferred. One or more aliases to identify or create a lead.

event_type
required
string
timestamp
string <date-time>
object

Arbitrary JSON metadata. Max 100KB; larger payloads are rejected with 413. For DECAY events, the server sets metadata.channel to 'system'.

Responses

Request samples

Content type
application/json
Example
{
  • "lead_id": "ld_123",
  • "event_type": "page_view",
  • "timestamp": "2025-08-15T12:00:00Z",
  • "metadata": {
    }
}

Response samples

Content type
application/json
{
  • "message": "event ingested",
  • "metadata": {
    }
}

Import events from CSV

Accepts a CSV upload. The server enqueues each row as an EngagementEvent under the authenticated org and active OU. Required columns: event_type. Optional: lead_id, timestamp (RFC3339), metadata (JSON), alias columns (external_id,email,phone,cookie,social).

Authorizations:
bearerAuthbasicAuth
Request Body schema: multipart/form-data
required
file
string <binary>

CSV file with header row

Responses

Response samples

Content type
application/json
{
  • "message": "string"
}

List visible event types (OU-scoped)

Returns event type names visible in the active OU (excludes hidden types).

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
[
  • "string"
]

List distinct metadata keys for an event type (OU)

path Parameters
eventType
required
string

Responses

Response samples

Content type
application/json
{
  • "event_type": "string",
  • "properties": [
    ]
}

List engagement events (OU-scoped)

Returns events limited to the active Organization Unit (OU).

Authorizations:
bearerAuthbasicAuth
query Parameters
page
integer >= 1
Default: 1
limit
integer [ 1 .. 500 ]
Default: 50
metadata
Array of strings

Repeatable metadata key/value filters (e.g., metadata=utm_campaign:fall2025)

logic
string
Default: "and"
Enum: "and" "or"

Combine metadata filters with AND (default) or OR

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Batch delete events (OU-scoped)

Deletes events by IDs scoped to the active OU.

Authorizations:
bearerAuthbasicAuth
Request Body schema: application/json
required
ids
Array of strings

Responses

Request samples

Content type
application/json
{
  • "ids": [
    ]
}

List events for a lead (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
leadID
required
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get event score explanation

Returns per-ruleset score deltas and before/after totals for a single event.

Authorizations:
bearerAuthbasicAuth
path Parameters
eventID
required
string

Responses

Response samples

Content type
application/json
{
  • "event_id": "string",
  • "lead_id": "string",
  • "event_type": "string",
  • "occurred_at": "2019-08-24T14:15:22Z",
  • "rulesets": [
    ]
}

Export events (OU-scoped)

Downloads events as CSV for the active OU.

Authorizations:
bearerAuthbasicAuth

Responses

Response samples

Content type
text/csv
id,lead_id,event_type,timestamp
ev_001,ld_123,page_view,2025-08-15T12:00:00Z

List available channels (OU-scoped)

Returns distinct normalized channels observed in the active OU (e.g., web, email, slack, webinar, crm).

Authorizations:
bearerAuthbasicAuth

Responses

Response samples

Content type
application/json
[
  • "web",
  • "email",
  • "slack"
]

Unified activity stream (events + orders + timeline)

Returns a composite view of lead activity: filtered engagement events, orders, and a unified timeline.

Unified Activity Stream (ADR-0010):

  • Events: behavioral engagement from engagement_events table
  • Orders: transactional records from orders table (represented as synthetic activity projections)
  • Timeline: merged chronological view sorted by timestamp

OU Scoping: Only returns data for the caller's active Organizational Unit.

Synthetic Order Projections:

  • Orders appear in the orders array and timeline with type: "order"
  • These are ephemeral, read-only projections created on-demand
  • NOT persisted to engagement_events table
  • NOT scored as engagement events

Filtering behavior:

  • range, start, end: Apply to both events and orders
  • channel, minScore, maxLatency, hasDelta: Apply to events only
Authorizations:
bearerAuthbasicAuth
path Parameters
leadID
required
string

Lead UUID

query Parameters
range
string
Default: "last_7d"
Enum: "all" "last_7d" "last_24h" "last_30d" "last_90d" "today" "yesterday" "custom"

Time range filter (applies to both events and orders)

start
string <date-time>

Start timestamp (RFC3339, UTC). Required when range=custom

end
string <date-time>

End timestamp (RFC3339, UTC). Required when range=custom

channel
string
Enum: "all" "web" "email" "slack" "webinar" "crm" "system"

Channel filter (applies to events only)

minScore
integer >= 0

Minimum score filter (applies to events only)

maxLatency
integer >= 1

Maximum latency in ms (applies to events only)

hasDelta
string
Enum: "1" "true" "0" "false"

Show only events with score deltas (applies to events only)

Responses

Response samples

Content type
application/json
{
  • "events": [
    ],
  • "orders": [
    ],
  • "timeline": [
    ]
}

Analytics

Analytics across events (OU-scoped)

Authorizations:
bearerAuthbasicAuth

Responses

Response samples

Content type
application/json
{
  • "totals": {
    },
  • "by_type": {
    }
}

Event statistics (OU-scoped)

Authorizations:
bearerAuthbasicAuth

Responses

Response samples

Content type
application/json
{
  • "last_24h": {
    },
  • "top_events": [
    ]
}

Top leads (OU-scoped)

Authorizations:
bearerAuthbasicAuth

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Recent score gains (OU-scoped)

Authorizations:
bearerAuthbasicAuth

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Recent score gains (OU-scoped)

Authorizations:
bearerAuthbasicAuth

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Leads

Batch lead scores for visible leads (OU-scoped, engagement primary ruleset by default)

Returns scores for the provided lead_ids under the active OU. If ruleset is omitted or set to primary, the primary engagement ruleset is used. If no primary exists, all scores are returned as 0.

Authorizations:
bearerAuthbasicAuth
Request Body schema: application/json
required
lead_ids
required
Array of strings [ 1 .. 500 ] items
ruleset
string

primary (default) or a specific ruleset_id/name

Responses

Request samples

Content type
application/json
{
  • "lead_ids": [
    ],
  • "ruleset": "string"
}

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Get lead score (OU-scoped)

Reads a lead's score within the active OU. If ruleset_id is omitted, returns the highest score across all active rulesets for the active OU.

Authorizations:
bearerAuthbasicAuth
path Parameters
leadID
required
string

Responses

Response samples

Content type
application/json
{
  • "lead_id": "ld_123",
  • "score": 87
}

List lead scores (OU-scoped)

Returns lead scores for the active Organizational Unit (OU). When page or limit is provided, the response includes pagination metadata (total, page, limit). Notes:

  • All data is scoped to the active OU selected via POST /org-units/active.
  • Accounts have a unit_id attribute; do not supply unit_id from clients.
Authorizations:
bearerAuthbasicAuth
query Parameters
page
integer >= 1
Default: 1
limit
integer [ 1 .. 500 ]
Default: 50
range
string
Enum: "all" "today" "yesterday" "last_24h" "last_7d" "last_30d" "last_90d"

Filter leads by created_at using a named range (e.g., last_7d). Also used for session counts.

min_score
integer

Minimum total score.

max_score
integer

Maximum total score.

event_type
string

Filter by last event type per lead.

last_active
string
Enum: "any" "7d" "30d"

Filter by last activity recency (e.g., 7d or 30d).

Responses

Response samples

Content type
application/json
{
  • "leads": [
    ],
  • "total": 2,
  • "page": 1,
  • "limit": 25
}

Create a new lead (OU-scoped)

Authorizations:
bearerAuthbasicAuth
Request Body schema: application/json
required
id
required
string
object
account_id
string or null

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "metadata": { },
  • "account_id": "string"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "org_id": "string",
  • "unit_id": "string",
  • "account_id": "string",
  • "owner_id": "string",
  • "owner_name": "string",
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "merged_into": "string",
  • "metadata": { }
}

Search leads by ID or alias (OU-scoped)

Returns up to 10 leads matching a search query. Matches by lead ID prefix or alias value (email, phone, etc.). Used for autocomplete in the UI.

Authorizations:
bearerAuthbasicAuth
query Parameters
q
required
string >= 2 characters

Search query (minimum 2 characters)

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get a lead including metadata and related account (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
leadID
required
string

Responses

Response samples

Content type
application/json
{
  • "lead": {
    },
  • "account": { }
}

Patch lead metadata (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
leadID
required
string
Request Body schema: application/json
required
property name*
additional property
any

Request samples

Content type
application/json
{ }

List lead aliases (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
leadID
required
string

Get lead profile metadata (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
leadID
required
string

Get lead account metadata (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
leadID
required
string

Get lead score (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
leadID
required
string

Get a lead including metadata and related account (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
leadID
required
string

Responses

Response samples

Content type
application/json
{
  • "lead": {
    },
  • "account": { }
}

Update a lead (replace metadata, optionally account)

Authorizations:
bearerAuthbasicAuth
path Parameters
leadID
required
string
Request Body schema: application/json
required
object
account_id
string or null

Responses

Request samples

Content type
application/json
{
  • "metadata": { },
  • "account_id": "string"
}

Delete a lead (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
leadID
required
string

Responses

Create a new lead (OU-scoped)

Authorizations:
bearerAuthbasicAuth
Request Body schema: application/json
required
id
required
string
object
account_id
string or null

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "metadata": { },
  • "account_id": "string"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "org_id": "string",
  • "unit_id": "string",
  • "account_id": "string",
  • "owner_id": "string",
  • "owner_name": "string",
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "merged_into": "string",
  • "metadata": { }
}

Lead deletion status (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
leadID
required
string

Responses

Response samples

Content type
application/json
{
  • "lead_id": "ld_123",
  • "status": "completed"
}

List lead aliases (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
leadID
required
string

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Patch lead metadata (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
leadID
required
string
Request Body schema: application/json
required
property name*
additional property
any

Responses

Request samples

Content type
application/json
{
  • "industry": "SaaS",
  • "plan": "Pro"
}

Response samples

Content type
application/json
{
  • "id": "ld_123",
  • "org_id": "org_1",
  • "unit_id": "unit_default",
  • "metadata": {
    }
}

Merge leads (OU-scoped)

Consolidate multiple source leads into a target lead within the active OU. Moves events and aliases, marks sources as merged, and recomputes the target's lead scores. Cross-OU merges are not allowed. Default truncation policy is 'none'.

Authorizations:
bearerAuthbasicAuth
Request Body schema: application/json
required
targetLeadId
required
string
sourceLeadIds
required
Array of strings
object

Responses

Request samples

Content type
application/json
{
  • "targetLeadId": "string",
  • "sourceLeadIds": [
    ],
  • "truncate": {
    }
}

Response samples

Content type
application/json
{
  • "target": {
    },
  • "mergedSources": [
    ],
  • "movedEvents": 0,
  • "truncatedEvents": 0,
  • "rescore": {
    }
}

Get score explanation

Returns top drivers, a rule weights snapshot, and surge boost contributions for the specified lead. OU scoped; time window defaults to last 24 hours.

path Parameters
leadID
required
string
query Parameters
hours
integer >= 1
Default: 24

Responses

Response samples

Content type
application/json
{
  • "top_drivers": [
    ],
  • "snapshot": [
    ],
  • "surge_boost": [
    ],
  • "surge_total": 0,
  • "surge_event_count": 0,
  • "decay_applied": 0,
  • "range_hours": 0
}

Rules

List scoring rules in a set (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List scoring rules (OU-scoped)

Returns all scoring rules for the active OU.

Authorizations:
bearerAuthbasicAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create scoring rule (OU-scoped)

Authorizations:
bearerAuthbasicAuth
Request Body schema: application/json
required
rule_id
string
ruleset_id
string
org_id
string
unit_id
string
event_type
string
weight
integer
icon
string
active
boolean
start_at
string <date-time>
end_at
string <date-time>
created_at
string <date-time>
updated_at
string <date-time>
created_by
string
updated_by
string

Responses

Request samples

Content type
application/json
{
  • "event_type": "email_open",
  • "weight": 5,
  • "active": true
}

Response samples

Content type
application/json
{
  • "rule_id": "rl_2",
  • "ruleset_id": "rs_default",
  • "event_type": "email_open",
  • "weight": 5,
  • "active": true
}

Update scoring rule (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string
Request Body schema: application/json
required
rule_id
string
ruleset_id
string
org_id
string
unit_id
string
event_type
string
weight
integer
icon
string
active
boolean
start_at
string <date-time>
end_at
string <date-time>
created_at
string <date-time>
updated_at
string <date-time>
created_by
string
updated_by
string

Responses

Request samples

Content type
application/json
{
  • "rule_id": "string",
  • "ruleset_id": "string",
  • "org_id": "string",
  • "unit_id": "string",
  • "event_type": "string",
  • "weight": 0,
  • "icon": "string",
  • "active": true,
  • "start_at": "2019-08-24T14:15:22Z",
  • "end_at": "2019-08-24T14:15:22Z",
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "created_by": "string",
  • "updated_by": "string"
}

Delete scoring rule (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string

Responses

List surge triggers (OU-scoped) [Phase 2 - Paused]

Phase 2 Feature: Surge trigger functionality is temporarily paused for MVP. Endpoints exist but may return empty results. Surge multipliers (session-based scoring) remain fully functional via /settings/ou/surge-policy.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create surge trigger (OU-scoped) [Phase 2 - Paused]

Phase 2 Feature: Surge trigger functionality is temporarily paused for MVP.

Authorizations:
bearerAuth
Request Body schema: application/json
required
One of
event_type
string
window_seconds
required
integer >= 1
window_unit
string
Default: "seconds"
Enum: "seconds" "minutes" "hours" "days"
threshold_count
required
integer >= 1
webhook_url
required
string

Exactly one destination: provide webhook_url OR emails

emails
Array of strings <email> [ items <email > ]

Responses

Request samples

Content type
application/json
{
  • "event_type": "string",
  • "window_seconds": 1,
  • "window_unit": "seconds",
  • "threshold_count": 1,
  • "webhook_url": "string",
  • "emails": [
    ]
}

Response samples

Content type
application/json
{
  • "trigger_id": "string",
  • "event_type": "string",
  • "window_seconds": 1,
  • "window_unit": "seconds",
  • "threshold_count": 1,
  • "webhook_url": "string",
  • "emails": [
    ],
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z"
}

Update surge trigger [Phase 2 - Paused]

Phase 2 Feature: Surge trigger functionality is temporarily paused for MVP.

Authorizations:
bearerAuth
path Parameters
id
required
string
Request Body schema: application/json
required
One of
event_type
string
window_seconds
required
integer >= 1
window_unit
string
Default: "seconds"
Enum: "seconds" "minutes" "hours" "days"
threshold_count
required
integer >= 1
webhook_url
required
string

Exactly one destination: provide webhook_url OR emails

emails
Array of strings <email> [ items <email > ]

Responses

Request samples

Content type
application/json
{
  • "event_type": "string",
  • "window_seconds": 1,
  • "window_unit": "seconds",
  • "threshold_count": 1,
  • "webhook_url": "string",
  • "emails": [
    ]
}

List surge events (OU-scoped) [Phase 2 - Paused]

Phase 2 Feature: Surge trigger functionality is temporarily paused for MVP. This endpoint may return empty results while surge detection is disabled.

Authorizations:
bearerAuth
query Parameters
page
integer >= 1
Default: 1
limit
integer [ 1 .. 500 ]
Default: 50
start
string <date-time>

Start timestamp (RFC3339).

end
string <date-time>

End timestamp (RFC3339).

channel
string

Filter by surge channel (snapshot channel/source).

Responses

Response samples

Content type
application/json
Example
[ ]

Delete surge trigger

Authorizations:
bearerAuth
path Parameters
id
required
string

Responses

RuleSets

List scoring rule sets (OU-scoped)

Lists all scoring rulesets available in the active OU.

Authorizations:
bearerAuthbasicAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create scoring rule set (OU-scoped)

Authorizations:
bearerAuthbasicAuth
Request Body schema: application/json
required
name
string
score_column
string
Default: "total_score"
is_primary
boolean
Default: false

Responses

Request samples

Content type
application/json
{
  • "name": "Marketing",
  • "score_column": "total_score"
}

Response samples

Content type
application/json
{
  • "ruleset_id": "rs_marketing",
  • "name": "Marketing",
  • "score_column": "total_score"
}

Delete a scoring ruleset (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string

Responses

Profile

List profile field mappings (OU-scoped)

Authorizations:
bearerAuthbasicAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create profile field mapping (OU-scoped)

Authorizations:
bearerAuthbasicAuth
Request Body schema: application/json
required
source_field
required
string
profile_property
required
string

Responses

Request samples

Content type
application/json
{
  • "source_field": "utm_source",
  • "profile_property": "acquisition_source"
}

Response samples

Content type
application/json
{
  • "id": "pm_2",
  • "source_field": "utm_source",
  • "profile_property": "acquisition_source"
}

Update profile field mapping (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string
Request Body schema: application/json
required
source_field
required
string
profile_property
required
string

Responses

Request samples

Content type
application/json
{
  • "source_field": "string",
  • "profile_property": "string"
}

Delete profile field mapping (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string

Responses

List profile rule sets (OU-scoped)

Authorizations:
bearerAuthbasicAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create profile rule set (OU-scoped)

Authorizations:
bearerAuthbasicAuth
Request Body schema: application/json
required
name
required
string
enabled
boolean
is_primary
boolean
Default: false

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "enabled": true,
  • "is_primary": false
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "org_id": "string",
  • "name": "string",
  • "enabled": true,
  • "is_primary": true,
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z"
}

Update profile rule set (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string
Request Body schema: application/json
required
name
required
string
enabled
boolean
is_primary
boolean
Default: false

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "enabled": true,
  • "is_primary": false
}

Delete profile rule set (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string

Responses

List profile rules in a set (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create profile rule (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string
Request Body schema: application/json
required
profile_property
required
string
condition
required
string
comparison_value
required
string
weight
required
integer
ui_order
integer

Responses

Request samples

Content type
application/json
{
  • "profile_property": "string",
  • "condition": "string",
  • "comparison_value": "string",
  • "weight": 0,
  • "ui_order": 0
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "ruleset_id": "string",
  • "profile_property": "string",
  • "condition": "string",
  • "comparison_value": "string",
  • "weight": 0,
  • "ui_order": 0,
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z"
}

Update profile rule (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string
ruleId
required
string
Request Body schema: application/json
required
profile_property
string
condition
string
comparison_value
string
weight
integer
ui_order
integer

Responses

Request samples

Content type
application/json
{
  • "profile_property": "string",
  • "condition": "string",
  • "comparison_value": "string",
  • "weight": 0,
  • "ui_order": 0
}

List distinct lead metadata properties (OU-scoped)

Returns distinct keys observed in lead metadata for the active OU.

Authorizations:
bearerAuthbasicAuth

Responses

Response samples

Content type
application/json
[
  • "industry",
  • "plan",
  • "company",
  • "role"
]

Segments

List segments (OU-scoped)

Lists segments defined for the active OU.

Authorizations:
bearerAuthbasicAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create segment (OU-scoped)

Authorizations:
bearerAuthbasicAuth
Request Body schema: application/json
required
name
required
string
description
string
active
boolean

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "active": true
}

Response samples

Content type
application/json
{
  • "segment_id": "sg_marketing",
  • "name": "Marketing Leads",
  • "description": "Leads from marketing sources",
  • "active": true
}

Update segment (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string
Request Body schema: application/json
required
name
required
string
description
string
active
boolean

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "description": "string",
  • "active": true
}

Delete segment (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string

Responses

Count leads in a segment (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "count": 0
}

List leads in a segment (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string
query Parameters
page
integer >= 1
Default: 1
limit
integer [ 1 .. 500 ]
Default: 50

Responses

Response samples

Content type
application/json
[
  • {
    }
]

List segment rules (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create segment rule (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string
Request Body schema: application/json
required
rule_name
string
rule_type
required
string
Enum: "lead_metadata" "event_metadata"
field_name
required
string
operator
required
string
value
string
event_type
string
logic_group
integer
logic_op
string
Enum: "AND" "OR"
order_index
integer
active
boolean

Responses

Request samples

Content type
application/json
{
  • "rule_name": "string",
  • "rule_type": "lead_metadata",
  • "field_name": "string",
  • "operator": "string",
  • "value": "string",
  • "event_type": "string",
  • "logic_group": 0,
  • "logic_op": "AND",
  • "order_index": 0,
  • "active": true
}

Response samples

Content type
application/json
{
  • "rule_id": "string",
  • "segment_id": "string",
  • "org_id": "string",
  • "rule_name": "string",
  • "rule_type": "lead_metadata",
  • "field_name": "string",
  • "operator": "string",
  • "value": "string",
  • "event_type": "string",
  • "logic_group": 0,
  • "logic_op": "AND",
  • "order_index": 0,
  • "active": true,
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "created_by": "string",
  • "updated_by": "string"
}

Update segment rule (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string
ruleId
required
string
Request Body schema: application/json
required
rule_name
string
rule_type
string
Enum: "lead_metadata" "event_metadata"
field_name
string
operator
string
value
string
event_type
string
logic_group
integer
logic_op
string
Enum: "AND" "OR"
order_index
integer
active
boolean

Responses

Request samples

Content type
application/json
{
  • "rule_name": "string",
  • "rule_type": "lead_metadata",
  • "field_name": "string",
  • "operator": "string",
  • "value": "string",
  • "event_type": "string",
  • "logic_group": 0,
  • "logic_op": "AND",
  • "order_index": 0,
  • "active": true
}

Delete segment rule (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string
ruleId
required
string

Responses

Stages

Decays

List score decay rules (OU-scoped)

Retrieves decay rules that reduce scores after inactivity, scoped to the active OU.

Authorizations:
bearerAuthbasicAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create score decay rule (OU-scoped)

Authorizations:
bearerAuthbasicAuth
Request Body schema: application/json
required
inactive_for
required
integer

Duration amount

unit
required
string
Enum: "days" "hours" "weeks"
decrease
required
integer

Score decrease amount

Responses

Request samples

Content type
application/json
{
  • "inactive_for": 0,
  • "unit": "days",
  • "decrease": 0
}

Response samples

Content type
application/json
{
  • "decay_id": "dc_inactive30d",
  • "inactive_for": 30,
  • "unit": "days",
  • "decrease": 25
}

Update score decay rule (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string
Request Body schema: application/json
required
inactive_for
integer
unit
string
Enum: "days" "hours" "weeks"
decrease
integer

Responses

Request samples

Content type
application/json
{
  • "inactive_for": 0,
  • "unit": "days",
  • "decrease": 0
}

Delete score decay rule (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string

Responses

Filters

List inorganic filters (OU-scoped)

Lists configured inorganic activity filters used to flag bot-like activity in the active OU.

Authorizations:
bearerAuthbasicAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create inorganic filter (OU-scoped)

Authorizations:
bearerAuthbasicAuth
Request Body schema: application/json
required
event_type
required
string
count_threshold
required
integer
time_window_ms
required
integer
group_events
boolean

Responses

Request samples

Content type
application/json
{
  • "event_type": "string",
  • "count_threshold": 0,
  • "time_window_ms": 0,
  • "group_events": true
}

Response samples

Content type
application/json
{
  • "filter_id": "string",
  • "event_type": "string",
  • "count_threshold": 0,
  • "time_window_ms": 0,
  • "group_events": true,
  • "org_id": "string",
  • "created_by": "string",
  • "updated_by": "string"
}

Update inorganic filter (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string
Request Body schema: application/json
required
event_type
string
count_threshold
integer
time_window_ms
integer
group_events
boolean

Responses

Request samples

Content type
application/json
{
  • "event_type": "string",
  • "count_threshold": 0,
  • "time_window_ms": 0,
  • "group_events": true
}

Delete inorganic filter (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string

Responses

Triggers

List pattern/frequency triggers (OU-scoped)

Lists pattern triggers (including frequency counts) for the active OU.

Authorizations:
bearerAuthbasicAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create pattern trigger (OU-scoped)

Authorizations:
bearerAuthbasicAuth
Request Body schema: application/json
required
trigger_id
string
name
string
description
string
active
boolean
window_seconds
integer
Array of objects
webhook_url
string
emails
Array of strings <email> [ items <email > ]
created_at
string <date-time>
updated_at
string <date-time>

Responses

Request samples

Content type
application/json
{
  • "trigger_id": "string",
  • "name": "string",
  • "description": "string",
  • "active": true,
  • "window_seconds": 0,
  • "conditions": [
    ],
  • "webhook_url": "string",
  • "emails": [
    ],
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z"
}

Response samples

Content type
application/json
{
  • "trigger_id": "string",
  • "name": "string",
  • "description": "string",
  • "active": true,
  • "window_seconds": 0,
  • "conditions": [
    ],
  • "webhook_url": "string",
  • "emails": [
    ],
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z"
}

Update pattern trigger (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string
Request Body schema: application/json
required
trigger_id
string
name
string
description
string
active
boolean
window_seconds
integer
Array of objects
webhook_url
string
emails
Array of strings <email> [ items <email > ]
created_at
string <date-time>
updated_at
string <date-time>

Responses

Request samples

Content type
application/json
{
  • "trigger_id": "string",
  • "name": "string",
  • "description": "string",
  • "active": true,
  • "window_seconds": 0,
  • "conditions": [
    ],
  • "webhook_url": "string",
  • "emails": [
    ],
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z"
}

Delete pattern trigger (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string

Responses

List milestone triggers (OU-scoped)

Lists milestone triggers configured for the active OU.

Authorizations:
bearerAuthbasicAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create milestone trigger (OU-scoped)

Authorizations:
bearerAuthbasicAuth
Request Body schema: application/json
required
event_type
required
string
score_threshold
required
integer
webhook_url
string
emails
Array of strings <email> [ items <email > ]
email_subject
string
email_preheader
string
email_message
string

Responses

Request samples

Content type
application/json
{
  • "event_type": "string",
  • "score_threshold": 0,
  • "webhook_url": "string",
  • "emails": [
    ],
  • "email_subject": "string",
  • "email_preheader": "string",
  • "email_message": "string"
}

Response samples

Content type
application/json
{
  • "trigger_id": "string",
  • "org_id": "string",
  • "event_type": "string",
  • "score_threshold": 0,
  • "webhook_url": "string",
  • "emails": [
    ],
  • "email_subject": "string",
  • "email_preheader": "string",
  • "email_message": "string",
  • "name": "string",
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "created_by": "string",
  • "updated_by": "string"
}

Update milestone trigger (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string
Request Body schema: application/json
required
event_type
string
score_threshold
integer
webhook_url
string
emails
Array of strings <email> [ items <email > ]
email_subject
string
email_preheader
string
email_message
string

Responses

Request samples

Content type
application/json
{
  • "event_type": "string",
  • "score_threshold": 0,
  • "webhook_url": "string",
  • "emails": [
    ],
  • "email_subject": "string",
  • "email_preheader": "string",
  • "email_message": "string"
}

Delete milestone trigger (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string

Responses

Simulate a milestone trigger (OU-scoped)

Test a milestone trigger against a specific lead or scan historical data. Returns whether the trigger would fire and which leads match.

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string
Request Body schema: application/json
required
lead_id
string

Specific lead to test (optional)

days
integer
Default: 30

Days to look back

Responses

Request samples

Content type
application/json
{
  • "lead_id": "string",
  • "days": 30
}

Response samples

Content type
application/json
{
  • "would_fire": true,
  • "matched_leads": [
    ],
  • "total_matches": 0,
  • "message": "string"
}

List emitted milestone events (OU-scoped)

Authorizations:
bearerAuthbasicAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Export milestone events (OU-scoped)

Authorizations:
bearerAuthbasicAuth

Responses

Sequences

List sequence triggers (OU-scoped)

Lists time- or order-based sequence triggers for the active OU.

Authorizations:
bearerAuthbasicAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create sequence trigger (OU-scoped)

Authorizations:
bearerAuthbasicAuth
Request Body schema: application/json
required
event_types
required
Array of strings
window_seconds
required
integer
window_unit
required
string
Enum: "seconds" "minutes" "hours"
ordered
boolean
webhook_url
required
string
emails
Array of strings <email> [ items <email > ]
email_subject
string
email_preheader
string
email_message
string

Responses

Request samples

Content type
application/json
{
  • "event_types": [
    ],
  • "window_seconds": 0,
  • "window_unit": "seconds",
  • "ordered": true,
  • "webhook_url": "string",
  • "emails": [
    ],
  • "email_subject": "string",
  • "email_preheader": "string",
  • "email_message": "string"
}

Response samples

Content type
application/json
{
  • "trigger_id": "string",
  • "org_id": "string",
  • "unit_id": "string",
  • "name": "string",
  • "event_steps": [
    ],
  • "window_seconds": 0,
  • "window_unit": "seconds",
  • "ordered": true,
  • "fire_mode": "once",
  • "profile_filters": [
    ],
  • "lead_attribute_filters": [
    ],
  • "webhook_url": "string",
  • "emails": [
    ],
  • "email_subject": "string",
  • "email_preheader": "string",
  • "email_message": "string",
  • "slack_target_kind": "channel",
  • "slack_target_id": "string",
  • "teams_target_kind": "channel",
  • "teams_target_id": "string",
  • "hubspot_sync": true,
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "created_by": "string",
  • "updated_by": "string"
}

Update sequence trigger (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string
Request Body schema: application/json
required
event_types
Array of strings
window_seconds
integer
window_unit
string
Enum: "seconds" "minutes" "hours"
ordered
boolean
webhook_url
string
emails
Array of strings <email> [ items <email > ]
email_subject
string
email_preheader
string
email_message
string

Responses

Request samples

Content type
application/json
{
  • "event_types": [
    ],
  • "window_seconds": 0,
  • "window_unit": "seconds",
  • "ordered": true,
  • "webhook_url": "string",
  • "emails": [
    ],
  • "email_subject": "string",
  • "email_preheader": "string",
  • "email_message": "string"
}

Delete sequence trigger (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string

Responses

Simulate a sequence trigger (OU-scoped)

Test a sequence trigger against a specific lead or scan historical data. Returns whether the trigger would fire and which leads match.

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string
Request Body schema: application/json
required
lead_id
string

Specific lead to test (optional)

days
integer
Default: 30

Days to look back

Responses

Request samples

Content type
application/json
{
  • "lead_id": "string",
  • "days": 30
}

Response samples

Content type
application/json
{
  • "would_fire": true,
  • "matched_leads": [
    ],
  • "total_matches": 0,
  • "message": "string"
}

List emitted sequence events (OU-scoped)

Authorizations:
bearerAuthbasicAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Export sequence events (OU-scoped)

Authorizations:
bearerAuthbasicAuth

Responses

OrgUnits

List organization units for current user with organization info

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "units": [
    ],
  • "organization": {
    }
}

Create organization unit

Authorizations:
bearerAuth
Request Body schema: application/json
required
name
required
string

Responses

Request samples

Content type
application/json
{
  • "name": "string"
}

Response samples

Content type
application/json
{
  • "unit_id": "string",
  • "name": "string",
  • "slug": "string"
}

Update organization unit

Authorizations:
bearerAuth
path Parameters
id
required
string
Request Body schema: application/json
required
name
required
string

Responses

Request samples

Content type
application/json
{
  • "name": "string"
}

Response samples

Content type
application/json
{
  • "unit_id": "string",
  • "name": "string",
  • "slug": "string"
}

Set active Organization Unit (OU)

Validates membership and sets the activeOu cookie. Returns OU headers for convenience.

Authorizations:
bearerAuth
Request Body schema: application/json
required
ouId
required
string

The unit_id to activate for the current session

Responses

Request samples

Content type
application/json
{
  • "ouId": "string"
}

List organization members

Lists members of the current organization. Results are organization-scoped.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create organization member

Authorizations:
bearerAuth
Request Body schema: application/json
required
first_name
required
string
last_name
required
string
email
required
string <email>
password
required
string <password>
role
required
string

Responses

Request samples

Content type
application/json
{
  • "first_name": "string",
  • "last_name": "string",
  • "email": "user@example.com",
  • "password": "pa$$word",
  • "role": "string"
}

Response samples

Content type
application/json
{
  • "org_member_id": "string",
  • "first_name": "string",
  • "last_name": "string",
  • "email": "user@example.com",
  • "role": "string"
}

Update organization member

Authorizations:
bearerAuth
path Parameters
id
required
string
Request Body schema: application/json
required
first_name
string
last_name
string
email
string <email>
role
string

Responses

Request samples

Content type
application/json
{
  • "first_name": "string",
  • "last_name": "string",
  • "email": "user@example.com",
  • "role": "string"
}

Delete organization member

Authorizations:
bearerAuth
path Parameters
id
required
string

Responses

OUMemberships

List OU memberships

Lists members assigned to the specified OU with OU-scoped roles. Requires caller to be a member of that OU.

Authorizations:
bearerAuth
path Parameters
id
required
string

OU ID (unit_id)

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Assign member to OU

Assigns a member to the specified OU with a role. Idempotent. Requires OU role Owner or Operator.

Authorizations:
bearerAuth
path Parameters
id
required
string

OU ID (unit_id)

Request Body schema: application/json
required
org_member_id
required
string
role
string
Default: "Viewer"
Enum: "Owner" "Operator" "Viewer"

Responses

Request samples

Content type
application/json
{
  • "org_member_id": "string",
  • "role": "Owner"
}

Update OU membership role (Owner/Operator required)

Authorizations:
bearerAuth
path Parameters
id
required
string
memberId
required
string
Request Body schema: application/json
required
role
required
string
Enum: "Owner" "Operator" "Viewer"

Responses

Request samples

Content type
application/json
{
  • "role": "Owner"
}

Remove OU membership (Owner/Operator required)

Authorizations:
bearerAuth
path Parameters
id
required
string
memberId
required
string

Responses

Me

Get current rate limit configuration for caller

Returns whether rate limiting is enabled, the mode, keying policy, computed key for this caller, and numeric limits.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "enabled": true,
  • "mode": "observe",
  • "key_by": "org",
  • "key": "string",
  • "rps": 0,
  • "burst": 0,
  • "stage": "string"
}

Secrets

List API credentials

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create API credential pair

Authorizations:
bearerAuth
Request Body schema: application/json
required
name
required
string <= 50 characters

Human-friendly label for this credential (1–50 chars)

Responses

Request samples

Content type
application/json
{
  • "name": "string"
}

Response samples

Content type
application/json
{
  • "secret_id": "string",
  • "client_id": "string",
  • "client_secret": "string",
  • "name": "string",
  • "created_at": "2019-08-24T14:15:22Z"
}

Delete API credential

Authorizations:
bearerAuth
path Parameters
id
required
string

Responses

Stream

Server-sent events stream

SSE stream of score updates, surge events, and newly ingested events.

OU scoping:

  • Prefer passing ouId as a query param to receive only events for that OU.
  • If omitted, the server will attempt to infer an OU from the activeOu cookie.

Note: This endpoint is currently unauthenticated.

query Parameters
ouId
string

Organization Unit (OU) ID to scope the stream.

Responses

Response samples

Content type
text/event-stream
event: score_update
data: {"lead_id":"ld_123","delta":5}

Usage

Usage metrics (OU/org scoped)

Returns current-month usage across the organization and OU where applicable.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{ }

Surge

Surge metrics summary for an OU

Returns aggregated surge metrics for the specified organization unit within a time range. Requires authentication and an active organization; OU membership is enforced.

Authorizations:
bearerAuth
path Parameters
ouId
required
string

Organization Unit ID to scope the results.

query Parameters
start
required
string <date-time>

Start of the time range (RFC3339).

end
required
string <date-time>

End of the time range (RFC3339).

interval
string
Enum: "15m" "1h" "1d"

Aggregation interval. Defaults to 1h.

channel
string

Optional channel filter (e.g., 'web', 'email', 'slack').

Responses

Response samples

Content type
application/json
{
  • "ou_id": "string",
  • "start": "2019-08-24T14:15:22Z",
  • "end": "2019-08-24T14:15:22Z",
  • "interval": "15m",
  • "totals": {
    },
  • "peak": {
    },
  • "channels": [
    ],
  • "series": [
    ]
}

Admin

Backfill account mapping and profile scoring (OU-scoped)

Runs account/profile mapping and recalculates profile scores for all leads in the active OU.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "leads_processed": 0,
  • "accounts_linked": 0,
  • "accounts_created": 0,
  • "profile_scores_updated": 0
}

Backfill event metadata accountId (OU-scoped)

Adds or corrects the accountId in event metadata by joining each event's lead to its associated account within the active OU. No-op for events that already have accountId.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "events_scanned": 0,
  • "events_updated": 0,
  • "leads_without_account": 0
}

Apply profile field mappings to existing leads (OU-scoped)

Reads all leads in the active OU and applies the currently configured profile field mappings to populate lead metadata. Respects each mapping's update behavior setting.

Authorizations:
bearerAuthbasicAuth

Responses

Response samples

Content type
application/json
{
  • "leads_processed": 0,
  • "leads_updated": 0
}

Seed sample data into the active OU

Runs the seed script in non-interactive mode for the current org and active OU.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "message": "string",
  • "output": "string"
}

Wipe sample data from the active OU

Deletes records where source=seed or created_by=seed (org+OU scoped). Returns counts per delete operation.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{ }

List audit logs (OU-scoped)

Returns recent audit log entries for the active OU with optional filters and sorting.

Authorizations:
bearerAuth
query Parameters
limit
integer [ 1 .. 500 ]

Max rows to return (default 100; max 500)

offset
integer >= 0

Number of rows to skip (for pagination)

search
string

Search across user_email, path, and IP address

method
string
Enum: "GET" "POST" "PUT" "PATCH" "DELETE"

Filter by HTTP method

status_min
integer

Minimum status code (inclusive)

status_max
integer

Maximum status code (inclusive)

user_email
string

Filter by exact user email

sort_by
string
Default: "created_at"
Enum: "created_at" "user_email" "method" "path" "status" "ip" "latency_ms"

Column to sort by

sort_order
string
Default: "DESC"
Enum: "ASC" "DESC"

Sort order (ascending or descending)

Responses

Response samples

Content type
application/json
{
  • "items": [
    ],
  • "limit": 0,
  • "offset": 0
}

Settings

Get Slack app configuration (org-level)

Returns whether Slack app credentials are configured for the current organization.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "configured": true
}

Set Slack app configuration (org-level)

Sets the Slack app client ID and client secret for the current organization.

Authorizations:
bearerAuth
Request Body schema: application/json
required
client_id
required
string
client_secret
required
string

Responses

Request samples

Content type
application/json
{
  • "client_id": "string",
  • "client_secret": "string"
}

List event types with OU visibility and counts

Returns organization event types with hidden flag and per-OU event counts.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Set OU visibility for an event type

path Parameters
eventType
required
string
Request Body schema: application/json
required
hidden
boolean
max_processing_scope
string
Enum: "observe" "decide" "activate"

Ceiling for event processing in this OU; does not imply execution.

Responses

Request samples

Content type
application/json
{
  • "hidden": true,
  • "max_processing_scope": "observe"
}

Dry-run delete of all events for an event type (OU)

path Parameters
eventType
required
string

Responses

Response samples

Content type
application/json
{
  • "events_count": 0,
  • "event_scores_count": 0
}

Delete all events for an event type in the active OU

path Parameters
eventType
required
string

Responses

Response samples

Content type
application/json
{
  • "events_deleted": 0,
  • "event_scores_deleted": 0
}

Get OU Slack integration status

Returns whether the active OU is connected to a Slack workspace and basic metadata.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "connected": true,
  • "team_name": "string",
  • "team_id": "string",
  • "bot_user_id": "string",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "default_target_kind": "channel",
  • "default_target_id": "string",
  • "authorize_url": "string"
}

Begin Slack installation

Redirects the browser to Slack's OAuth installation URL using organization-specific app credentials.

Authorizations:
bearerAuth

Responses

Initiate Slack installation

Creates a short-lived, single-use OAuth state for the active OU and returns Slack's authorize URL.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "authorize_url": "string"
}

Slack OAuth callback

Handles Slack OAuth exchange and persists the OU connection, then redirects back to the Integrations page.

Responses

Disconnect OU Slack integration

Authorizations:
bearerAuth

Responses

List Slack channels for the connected workspace

Proxies Slack conversations.list and returns the upstream response. Requires the OU to be connected to Slack.

Authorizations:
bearerAuth
query Parameters
types
string
Example: types=public_channel,private_channel

Responses

Response samples

Content type
application/json
{
  • "ok": true,
  • "channels": [
    ],
  • "response_metadata": {
    }
}

List Slack users for the connected workspace

Proxies Slack users.list and returns the upstream response. Requires the OU to be connected to Slack.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "ok": true,
  • "members": [
    ],
  • "response_metadata": {
    }
}

Set default Slack notification target for the active OU

Persists the default Slack target (channel or user) for notifications.

Authorizations:
bearerAuth
Request Body schema: application/json
required
kind
required
string
Enum: "channel" "user"
id
required
string

Responses

Request samples

Content type
application/json
{
  • "kind": "channel",
  • "id": "string"
}

Send a test Slack notification to the selected target

Sends a simple test message to the provided channel or user for the active OU. If kind=user, opens a DM first.

Authorizations:
bearerAuth
Request Body schema: application/json
required
kind
required
string
Enum: "channel" "user"
id
required
string
text
string

Optional custom message

Responses

Request samples

Content type
application/json
{
  • "kind": "channel",
  • "id": "string",
  • "text": "string"
}

Response samples

Content type
application/json
{
  • "message": "string"
}

Get OU surge session policy

Returns the OU-scoped session-based surge multiplier policy for the active OU. If none exists, returns Standard defaults.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "org_id": "string",
  • "unit_id": "string",
  • "mode": "off",
  • "bands": [
    ],
  • "idle_reset_seconds": 1,
  • "multiplier_cap": 1
}

Upsert OU surge session policy

Creates or updates the session-based surge multiplier policy for the active OU.

Authorizations:
bearerAuth
Request Body schema: application/json
required
mode
string
Enum: "off" "standard" "gentle" "custom"
Array of objects
idle_reset_seconds
integer >= 1
multiplier_cap
number [ 1 .. 3 ]

Responses

Request samples

Content type
application/json
{
  • "mode": "off",
  • "bands": [
    ],
  • "idle_reset_seconds": 1,
  • "multiplier_cap": 1
}

Account

Phase 2 Feature (ABM Required) Account-based marketing endpoints require abm_enabled: true in organization scoring settings. These endpoints return 403 Forbidden if ABM is not enabled for your organization. Contact your account manager for access.

List accounts aggregated by OU

Returns a list of accounts for the active OU by aggregating leads joined with accounts and lead scores. Fields include top_score (max lead score within the account), leads_count, owner_name (from the top-scoring lead), and surging (true if any lead in the account surged in the last 24 hours).

Authorizations:
bearerAuthbasicAuth
query Parameters
page
integer >= 1
Default: 1
limit
integer [ 1 .. 500 ]
Default: 50
range
string
Enum: "all" "today" "yesterday" "last_24h" "last_7d" "last_30d" "last_90d"

Filter accounts by created_at using a named range.

search
string

Search by account name or domain.

intent_level
string
Enum: "all" "low" "medium" "high"

Filter by intent level.

Responses

Response samples

Content type
application/json
{
  • "accounts": [
    ],
  • "total": 1,
  • "page": 1,
  • "limit": 25
}

Batch delete/unlink accounts

Unlinks leads in the active OU from the given accounts and deletes account records that are no longer referenced by any lead.

Authorizations:
bearerAuthbasicAuth
Request Body schema: application/json
required
ids
Array of strings

Responses

Request samples

Content type
application/json
{
  • "ids": [
    ]
}

Get account detail

path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "account_id": "string",
  • "org_id": "string",
  • "domain": "string",
  • "name": "string",
  • "metadata": { },
  • "top_score": 0,
  • "leads": [
    ],
  • "recent_events": [
    ]
}

List account rule sets (OU-scoped)

Authorizations:
bearerAuthbasicAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create account rule set (OU-scoped)

Authorizations:
bearerAuthbasicAuth
Request Body schema: application/json
required
name
required
string
enabled
boolean
is_primary
boolean
Default: false

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "enabled": true,
  • "is_primary": false
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "org_id": "string",
  • "name": "string",
  • "enabled": true,
  • "is_primary": true,
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z"
}

Update account rule set (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string
Request Body schema: application/json
required
name
required
string
enabled
boolean
is_primary
boolean
Default: false

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "enabled": true,
  • "is_primary": false
}

Delete account rule set (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string

Responses

List account rules in a set (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create account rule (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string
Request Body schema: application/json
required
account_property
required
string
condition
required
string
comparison_value
required
string
weight
required
integer
ui_order
integer

Responses

Request samples

Content type
application/json
{
  • "account_property": "string",
  • "condition": "string",
  • "comparison_value": "string",
  • "weight": 0,
  • "ui_order": 0
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "ruleset_id": "string",
  • "account_property": "string",
  • "condition": "string",
  • "comparison_value": "string",
  • "weight": 0,
  • "ui_order": 0,
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z"
}

Update account rule (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string
ruleId
required
string
Request Body schema: application/json
required
account_property
string
condition
string
comparison_value
string
weight
integer
ui_order
integer

Responses

Request samples

Content type
application/json
{
  • "account_property": "string",
  • "condition": "string",
  • "comparison_value": "string",
  • "weight": 0,
  • "ui_order": 0
}

Delete account rule (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string
ruleId
required
string

Responses

List distinct account metadata property keys (OU-scoped)

Authorizations:
bearerAuthbasicAuth

Responses

Response samples

Content type
application/json
[
  • "string"
]

List account field mappings (OU-scoped)

Authorizations:
bearerAuthbasicAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create account field mapping (OU-scoped)

Authorizations:
bearerAuthbasicAuth
Request Body schema: application/json
required
source_field
required
string
account_property
required
string
update_behavior
string
Default: "always_latest"
Enum: "always_latest" "set_once" "append"

Controls how this field is updated when new events arrive. For append, last 10 values are stored in "_list"

Responses

Request samples

Content type
application/json
{
  • "source_field": "string",
  • "account_property": "string",
  • "update_behavior": "always_latest"
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "source_field": "string",
  • "account_property": "string",
  • "update_behavior": "always_latest",
  • "created_at": "2019-08-24T14:15:22Z"
}

Update account field mapping (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string
Request Body schema: application/json
required
source_field
required
string
account_property
required
string
update_behavior
string
Default: "always_latest"
Enum: "always_latest" "set_once" "append"

Controls how this field is updated when new events arrive. For append, last 10 values are stored in "_list"

Responses

Request samples

Content type
application/json
{
  • "source_field": "string",
  • "account_property": "string",
  • "update_behavior": "always_latest"
}

Delete account field mapping (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string

Responses

Levels

List engagement levels (OU-scoped)

Lists configured engagement levels within the active OU.

Authorizations:
bearerAuthbasicAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create engagement level (OU-scoped)

Authorizations:
bearerAuthbasicAuth
Request Body schema: application/json
required
name
required
string
min_score
required
integer
max_score
required
integer

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "min_score": 0,
  • "max_score": 0
}

Response samples

Content type
application/json
{
  • "stage_id": "st_hot",
  • "name": "Hot",
  • "min_score": 80,
  • "max_score": 1000
}

Update engagement level (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string
Request Body schema: application/json
required
name
required
string
min_score
required
integer
max_score
required
integer

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "min_score": 0,
  • "max_score": 0
}

Delete engagement level (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string

Responses

List profile levels (OU-scoped)

Lists configured profile levels within the active OU.

Authorizations:
bearerAuthbasicAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create profile level (OU-scoped)

Authorizations:
bearerAuthbasicAuth
Request Body schema: application/json
required
name
required
string
min_score
required
integer
max_score
required
integer

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "min_score": 0,
  • "max_score": 0
}

Response samples

Content type
application/json
{
  • "level_id": "string",
  • "name": "string",
  • "min_score": 0,
  • "max_score": 0,
  • "org_id": "string",
  • "created_by": "string",
  • "updated_by": "string"
}

Update profile level (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string
Request Body schema: application/json
required
name
required
string
min_score
required
integer
max_score
required
integer

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "min_score": 0,
  • "max_score": 0
}

Delete profile level (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string

Responses

List account levels (OU-scoped)

Lists configured account levels within the active OU.

Authorizations:
bearerAuthbasicAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create account level (OU-scoped)

Authorizations:
bearerAuthbasicAuth
Request Body schema: application/json
required
name
required
string
min_score
required
integer
max_score
required
integer

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "min_score": 0,
  • "max_score": 0
}

Response samples

Content type
application/json
{
  • "level_id": "string",
  • "name": "string",
  • "min_score": 0,
  • "max_score": 0,
  • "org_id": "string",
  • "created_by": "string",
  • "updated_by": "string"
}

Update account level (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string
Request Body schema: application/json
required
name
required
string
min_score
required
integer
max_score
required
integer

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "min_score": 0,
  • "max_score": 0
}

Delete account level (OU-scoped)

Authorizations:
bearerAuthbasicAuth
path Parameters
id
required
string

Responses

Get scoring settings

Returns scoring settings (organization-wide toggles plus the effective session idle timeout for the active OU).

Responses

Response samples

Content type
application/json
{
  • "allow_negative_scores": true,
  • "abm_enabled": true,
  • "session_timeout_minutes": 0
}

Update scoring settings

Updates scoring settings (organization-wide toggles plus per-OU session idle timeout for the active OU).

Request Body schema: application/json
required
allow_negative_scores
boolean
abm_enabled
boolean
session_timeout_minutes
integer

Responses

Request samples

Content type
application/json
{
  • "allow_negative_scores": true,
  • "abm_enabled": true,
  • "session_timeout_minutes": 0
}