For the complete documentation index, see llms.txt. This page is also available as Markdown.

Sales Automations

Reusable CRM automation rules. 13 action types (task, tags, assign, add_stage, ...) and 7 trigger types (added_to_segments, after_x_days, condition, ...). Referenced by flow sales_automation nodes.

List sales-automation rules.

get

CRM rules that fire on a pipeline event β€” a stage change, a task completion, a segment entry β€” and run actions such as creating a task or moving a stage. Rules created by flow nodes are excluded by default; pass source to include them.

A legacy rule stored without a pipeline_id runs but is not shown in the dashboard's automations list. Such rules are returned as stored (pipeline_id: null) together with their workroom_id, so they can be found and bound explicitly with PATCH β€” this endpoint does not write to them.

Authorizations
AuthorizationstringRequired

The API Secret from the Gleantap dashboard under Settings β†’ API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.

Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β€” narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.

For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.

Query parameters
workroomstringOptional

Same semantics as the Gleantap-Workroom header, including that a write should never be sent without a workroom the user actually chose, and that an omitted workroom scopes a read to the account default rather than spanning the account. Prefer this on GETs so proxies and caches can key on it. Accepts name, prefixed ID, raw hex, or all.

limitinteger Β· min: 1 Β· max: 100Optional

Page size. Default 25, max 100.

Default: 25
cursorstringOptional

Opaque cursor from a prior response's next_cursor, to fetch the NEXT page (alias - after). On listContacts and listSegmentContacts, use before with a prev_cursor to page backward; other list endpoints are forward-only.

sourcestring Β· enumOptional

Filter rules by source. pipeline (default) returns standalone CRM pipeline rules; flow returns rules generated by flow nodes; all returns both.

Default: pipelinePossible values:
pipeline_idstringOptional

Filter rules by pipeline ID.

Pattern: ^pip_[0-9a-f]{24}$
statusstring Β· enumOptional

Filter rules by status.

Possible values:
Header parameters
Gleantap-VersionstringOptional

Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.

Example: 2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$
Gleantap-AccountstringOptional

Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.

A staff token MUST name an account on every request β€” there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β€” list IDs with GET /v3/accounts.

Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

Which workroom to act in. Accepts a workroom name (case-insensitive), a prefixed ID (wrm_<hex>), a raw 24-hex ID, or the literal all.

On any write, ask the user which workroom β€” do not omit this. Optional here means the server has a fallback, not that the fallback is what anyone wanted: an omitted workroom sends the write to the account's default workroom, and accounts routinely have dozens. Creating a contact, flow, campaign or segment in the wrong workroom puts it where nobody is looking, and moving it afterwards is manual.

The one case where you need not ask: the account has exactly one workroom. Call listWorkrooms to find out β€” if it returns a single row, use it; if it returns several, ask which one before writing.

Reads are scoped too. Omitting a workroom on a read does not span the account β€” it narrows to the same default workroom a write would go to, and the response carries a workroom_defaulted warning saying so. So a count, a list or a segment preview describes one workroom unless you said otherwise. Pass all to deliberately span every workroom; that is the only way to get account-wide figures, and it is never the default. listWorkrooms itself is never narrowed, since it is how you discover what to ask for.

Also settable via ?workroom= or a workroom body field (POST/PATCH only) β€” query wins over header wins over body.

Example: G Test1
Responses
200

OK

application/json
objectconst: listRequired
has_morebooleanRequired

True if additional records exist beyond this page.

next_cursorstring Β· nullableRequired

Opaque cursor for the next page. Null on the last page.

prev_cursorstring Β· nullableRequired

Cursor for the previous page. Supported on listContacts and listSegmentContacts: pass it back as ?before=... to page backward; null on the first page. On every other list endpoint paging is forward-only and this is always null.

get/sales_automations
GET /v3/sales_automations HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

OK

{
  "object": "text",
  "data": [
    {
      "id": "text",
      "object": "sales_automation",
      "name": "text",
      "flow_id": "flw_01H8XKV...",
      "flow_node_id": "text",
      "pipeline_id": "text",
      "workroom_id": "wrm_5ace370fd2a57d74d0548fb2",
      "status": "active",
      "paused": true,
      "broken": true,
      "execute_on": "ongoing",
      "processed_count": 1,
      "trigger": {
        "type": "added_to_segments",
        "segment_ids": [
          "seg_01H8XKE..."
        ],
        "days": 1,
        "conditions": [
          {
            "segment": "Attributes",
            "data": "text",
            "event": "text",
            "operator": "=",
            "value": null,
            "value2": null,
            "operator2": "text",
            "value2_id": [
              "text"
            ],
            "data_type": "String",
            "dataAlias": "text",
            "ANY_ADDITIONAL_PROPERTY": "anything"
          }
        ],
        "stage": "text"
      },
      "action": {
        "type": "tags",
        "tag_names": [
          "text"
        ],
        "task_name": "text",
        "description": "text",
        "due_at": "2026-05-27T14:23:11.482Z",
        "due_in_days": 1,
        "assignee_staff_id": "text",
        "assignee_staff_ids": [
          "text"
        ],
        "assignee_mode": "Owner",
        "task_type": "text",
        "stage_id": "text",
        "staff_ids": [
          "text"
        ],
        "distribution": "All",
        "reassign": false,
        "value": "text",
        "note": "text",
        "flow_id": "text",
        "applies_to": "All"
      },
      "actions": [
        {
          "type": "tags",
          "tag_names": [
            "text"
          ],
          "task_name": "text",
          "description": "text",
          "due_at": "2026-05-27T14:23:11.482Z",
          "due_in_days": 1,
          "assignee_staff_id": "text",
          "assignee_staff_ids": [
            "text"
          ],
          "assignee_mode": "Owner",
          "task_type": "text",
          "stage_id": "text",
          "staff_ids": [
            "text"
          ],
          "distribution": "All",
          "reassign": false,
          "value": "text",
          "note": "text",
          "flow_id": "text",
          "applies_to": "All"
        }
      ],
      "created_by": "text",
      "updated_by": "text",
      "created_at": "2026-05-27T14:23:11.482Z",
      "last_processed_at": "2026-05-27T14:23:11.482Z"
    }
  ],
  "has_more": true,
  "next_cursor": "text",
  "prev_cursor": "text"
}

Create a reusable CRM automation rule.

post

13 action types, 7 trigger types. Also referenceable from flow sales_automation nodes via salesautomation_id, OR passed inline on the flow node itself. The full action and trigger catalog, with examples, is returned by describeFlowSchema.

A rule lives under a pipeline. The dashboard's CRM automations list filters on pipeline_id, so a rule without one runs but never appears in the UI. Omit pipeline_id and the workroom's default pipeline is used β€” the response says which, via a pipeline_defaulted:… warning. Pass it explicitly when the rule belongs to a specific pipeline.

added_to_segments segments are verified. Each ID must be a real segment in this rule's workroom (compare Segment.workroom_id with the rule's workroom_id); an unknown or sibling-workroom ID is rejected with 422, because such a rule would show a blank trigger in the editor and match nobody. Always read the response's warnings[] β€” it names any reference that was dropped or defaulted (unknown_stage_id:…, task_missing_assignee, …).

With trigger added_to_segments the rule fires on one specific segment, identified by ID. Segment names are not unique and often similar β€” "test entry" and "Tag: test" are unrelated segments β€” so a name match is not a reliable identifier. listSegments returns the available segments with their IDs.

Requires the trigger, the stage it applies to and what the action(s) should do. Optional fields fall back to a server-side default when omitted. That includes the workroom: an omitted workroom resolves to the account default, and a record created in the wrong workroom is invisible where it was expected. Half-specified records are created successfully and then have to be hunted down and fixed by hand.

Authorizations
AuthorizationstringRequired

The API Secret from the Gleantap dashboard under Settings β†’ API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.

Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β€” narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.

For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.

Header parameters
Gleantap-VersionstringOptional

Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.

Example: 2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$
Gleantap-AccountstringOptional

Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.

A staff token MUST name an account on every request β€” there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β€” list IDs with GET /v3/accounts.

Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

Which workroom to act in. Accepts a workroom name (case-insensitive), a prefixed ID (wrm_<hex>), a raw 24-hex ID, or the literal all.

On any write, ask the user which workroom β€” do not omit this. Optional here means the server has a fallback, not that the fallback is what anyone wanted: an omitted workroom sends the write to the account's default workroom, and accounts routinely have dozens. Creating a contact, flow, campaign or segment in the wrong workroom puts it where nobody is looking, and moving it afterwards is manual.

The one case where you need not ask: the account has exactly one workroom. Call listWorkrooms to find out β€” if it returns a single row, use it; if it returns several, ask which one before writing.

Reads are scoped too. Omitting a workroom on a read does not span the account β€” it narrows to the same default workroom a write would go to, and the response carries a workroom_defaulted warning saying so. So a count, a list or a segment preview describes one workroom unless you said otherwise. Pass all to deliberately span every workroom; that is the only way to get account-wide figures, and it is never the default. listWorkrooms itself is never narrowed, since it is how you discover what to ask for.

Also settable via ?workroom= or a workroom body field (POST/PATCH only) β€” query wins over header wins over body.

Example: G Test1
Body
anyOptional
or
anyOptional
Responses
201

Created.

application/json
idstringOptionalPattern: ^saut_[0-9a-f]{24}$
objectstring Β· enumOptionalPossible values:
namestringOptional
flow_idstringOptionalExample: flw_01H8XKV...Pattern: ^flw_[0-9A-HJKMNP-TV-Z]{26}$
flow_node_idstring Β· nullableOptional

The specific flow node this rule is attached to. Null for a free-standing rule.

pipeline_idstring Β· nullableOptional

The pipeline the rule is listed under. A null here means the rule runs but is invisible in the dashboard's CRM automations list, which filters on it.

Pattern: ^pip_[0-9a-f]{24}$
workroom_idstring Β· nullableOptional

The workroom this rule lives in. An added_to_segments trigger can only reference segments from the same workroom.

Example: wrm_5ace370fd2a57d74d0548fb2Pattern: ^wrm_[0-9a-f]{24}$
statusstring Β· enumOptional

Status of the automation: active (runs on trigger), paused (temporarily disabled, does not fire), inactive (staged, not live), or completed. Defaults to active.

Default: activePossible values:
pausedbooleanOptional

True when the rule is paused or auto-disabled. A paused rule does not run until resumed with status: active.

brokenbooleanOptional

True when the rule is missing required references (e.g. its trigger segment was deleted) and cannot fire.

execute_onstring Β· enumOptionalPossible values:
processed_countintegerOptional
created_bystring Β· nullableOptional

A staff user (from the legacy users collection). Used for owner_id, responsible_id, created_by, assigned_to, etc.

Pattern: ^usr_[0-9a-f]{24}$
updated_bystring Β· nullableOptional

A staff user (from the legacy users collection). Used for owner_id, responsible_id, created_by, assigned_to, etc.

Pattern: ^usr_[0-9a-f]{24}$
created_atstring Β· date-timeOptional

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
last_processed_atstring Β· date-time Β· nullableOptional

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
post/sales_automations
POST /v3/sales_automations HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 1131

{
  "name": "text",
  "pipeline_id": "text",
  "execute_on": "ongoing",
  "status": "active",
  "paused": false,
  "trigger": {
    "type": "added_to_segments",
    "segment_ids": [
      "seg_01H8XKE..."
    ],
    "days": 1,
    "conditions": [
      {
        "segment": "Attributes",
        "data": "text",
        "event": "text",
        "operator": "=",
        "value": null,
        "value2": null,
        "operator2": "text",
        "value2_id": [
          "text"
        ],
        "data_type": "String",
        "dataAlias": "text",
        "ANY_ADDITIONAL_PROPERTY": "anything"
      }
    ],
    "stage": "text"
  },
  "actions": [
    {
      "type": "tags",
      "tag_names": [
        "text"
      ],
      "task_name": "text",
      "description": "text",
      "due_at": "2026-05-27T14:23:11.482Z",
      "due_in_days": 1,
      "assignee_staff_id": "text",
      "assignee_staff_ids": [
        "text"
      ],
      "task_type": "text",
      "stage_id": "text",
      "staff_ids": [
        "text"
      ],
      "distribution": "All",
      "reassign": false,
      "value": "text",
      "note": "text",
      "flow_id": "text",
      "applies_to": "All"
    }
  ],
  "action": {
    "type": "tags",
    "tag_names": [
      "text"
    ],
    "task_name": "text",
    "description": "text",
    "due_at": "2026-05-27T14:23:11.482Z",
    "due_in_days": 1,
    "assignee_staff_id": "text",
    "assignee_staff_ids": [
      "text"
    ],
    "task_type": "text",
    "stage_id": "text",
    "staff_ids": [
      "text"
    ],
    "distribution": "All",
    "reassign": false,
    "value": "text",
    "note": "text",
    "flow_id": "text",
    "applies_to": "All"
  }
}
201

Created.

{
  "id": "text",
  "object": "sales_automation",
  "name": "text",
  "flow_id": "flw_01H8XKV...",
  "flow_node_id": "text",
  "pipeline_id": "text",
  "workroom_id": "wrm_5ace370fd2a57d74d0548fb2",
  "status": "active",
  "paused": true,
  "broken": true,
  "execute_on": "ongoing",
  "processed_count": 1,
  "trigger": {
    "type": "added_to_segments",
    "segment_ids": [
      "seg_01H8XKE..."
    ],
    "days": 1,
    "conditions": [
      {
        "segment": "Attributes",
        "data": "text",
        "event": "text",
        "operator": "=",
        "value": null,
        "value2": null,
        "operator2": "text",
        "value2_id": [
          "text"
        ],
        "data_type": "String",
        "dataAlias": "text",
        "ANY_ADDITIONAL_PROPERTY": "anything"
      }
    ],
    "stage": "text"
  },
  "action": {
    "type": "tags",
    "tag_names": [
      "text"
    ],
    "task_name": "text",
    "description": "text",
    "due_at": "2026-05-27T14:23:11.482Z",
    "due_in_days": 1,
    "assignee_staff_id": "text",
    "assignee_staff_ids": [
      "text"
    ],
    "assignee_mode": "Owner",
    "task_type": "text",
    "stage_id": "text",
    "staff_ids": [
      "text"
    ],
    "distribution": "All",
    "reassign": false,
    "value": "text",
    "note": "text",
    "flow_id": "text",
    "applies_to": "All"
  },
  "actions": [
    {
      "type": "tags",
      "tag_names": [
        "text"
      ],
      "task_name": "text",
      "description": "text",
      "due_at": "2026-05-27T14:23:11.482Z",
      "due_in_days": 1,
      "assignee_staff_id": "text",
      "assignee_staff_ids": [
        "text"
      ],
      "assignee_mode": "Owner",
      "task_type": "text",
      "stage_id": "text",
      "staff_ids": [
        "text"
      ],
      "distribution": "All",
      "reassign": false,
      "value": "text",
      "note": "text",
      "flow_id": "text",
      "applies_to": "All"
    }
  ],
  "created_by": "text",
  "updated_by": "text",
  "created_at": "2026-05-27T14:23:11.482Z",
  "last_processed_at": "2026-05-27T14:23:11.482Z"
}

Retrieve one sales-automation rule.

get

Its trigger, the stage it applies to, and every action it runs. Actions come back as actions[]; action repeats the first for compatibility.

Authorizations
AuthorizationstringRequired

The API Secret from the Gleantap dashboard under Settings β†’ API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.

Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β€” narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.

For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.

Path parameters
idstringRequiredPattern: ^saut_[0-9a-f]{24}$
Header parameters
Gleantap-VersionstringOptional

Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.

Example: 2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$
Gleantap-AccountstringOptional

Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.

A staff token MUST name an account on every request β€” there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β€” list IDs with GET /v3/accounts.

Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

Which workroom to act in. Accepts a workroom name (case-insensitive), a prefixed ID (wrm_<hex>), a raw 24-hex ID, or the literal all.

On any write, ask the user which workroom β€” do not omit this. Optional here means the server has a fallback, not that the fallback is what anyone wanted: an omitted workroom sends the write to the account's default workroom, and accounts routinely have dozens. Creating a contact, flow, campaign or segment in the wrong workroom puts it where nobody is looking, and moving it afterwards is manual.

The one case where you need not ask: the account has exactly one workroom. Call listWorkrooms to find out β€” if it returns a single row, use it; if it returns several, ask which one before writing.

Reads are scoped too. Omitting a workroom on a read does not span the account β€” it narrows to the same default workroom a write would go to, and the response carries a workroom_defaulted warning saying so. So a count, a list or a segment preview describes one workroom unless you said otherwise. Pass all to deliberately span every workroom; that is the only way to get account-wide figures, and it is never the default. listWorkrooms itself is never narrowed, since it is how you discover what to ask for.

Also settable via ?workroom= or a workroom body field (POST/PATCH only) β€” query wins over header wins over body.

Example: G Test1
Responses
200

OK

application/json
idstringOptionalPattern: ^saut_[0-9a-f]{24}$
objectstring Β· enumOptionalPossible values:
namestringOptional
flow_idstringOptionalExample: flw_01H8XKV...Pattern: ^flw_[0-9A-HJKMNP-TV-Z]{26}$
flow_node_idstring Β· nullableOptional

The specific flow node this rule is attached to. Null for a free-standing rule.

pipeline_idstring Β· nullableOptional

The pipeline the rule is listed under. A null here means the rule runs but is invisible in the dashboard's CRM automations list, which filters on it.

Pattern: ^pip_[0-9a-f]{24}$
workroom_idstring Β· nullableOptional

The workroom this rule lives in. An added_to_segments trigger can only reference segments from the same workroom.

Example: wrm_5ace370fd2a57d74d0548fb2Pattern: ^wrm_[0-9a-f]{24}$
statusstring Β· enumOptional

Status of the automation: active (runs on trigger), paused (temporarily disabled, does not fire), inactive (staged, not live), or completed. Defaults to active.

Default: activePossible values:
pausedbooleanOptional

True when the rule is paused or auto-disabled. A paused rule does not run until resumed with status: active.

brokenbooleanOptional

True when the rule is missing required references (e.g. its trigger segment was deleted) and cannot fire.

execute_onstring Β· enumOptionalPossible values:
processed_countintegerOptional
created_bystring Β· nullableOptional

A staff user (from the legacy users collection). Used for owner_id, responsible_id, created_by, assigned_to, etc.

Pattern: ^usr_[0-9a-f]{24}$
updated_bystring Β· nullableOptional

A staff user (from the legacy users collection). Used for owner_id, responsible_id, created_by, assigned_to, etc.

Pattern: ^usr_[0-9a-f]{24}$
created_atstring Β· date-timeOptional

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
last_processed_atstring Β· date-time Β· nullableOptional

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
get/sales_automations/{id}
GET /v3/sales_automations/{id} HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

OK

{
  "id": "text",
  "object": "sales_automation",
  "name": "text",
  "flow_id": "flw_01H8XKV...",
  "flow_node_id": "text",
  "pipeline_id": "text",
  "workroom_id": "wrm_5ace370fd2a57d74d0548fb2",
  "status": "active",
  "paused": true,
  "broken": true,
  "execute_on": "ongoing",
  "processed_count": 1,
  "trigger": {
    "type": "added_to_segments",
    "segment_ids": [
      "seg_01H8XKE..."
    ],
    "days": 1,
    "conditions": [
      {
        "segment": "Attributes",
        "data": "text",
        "event": "text",
        "operator": "=",
        "value": null,
        "value2": null,
        "operator2": "text",
        "value2_id": [
          "text"
        ],
        "data_type": "String",
        "dataAlias": "text",
        "ANY_ADDITIONAL_PROPERTY": "anything"
      }
    ],
    "stage": "text"
  },
  "action": {
    "type": "tags",
    "tag_names": [
      "text"
    ],
    "task_name": "text",
    "description": "text",
    "due_at": "2026-05-27T14:23:11.482Z",
    "due_in_days": 1,
    "assignee_staff_id": "text",
    "assignee_staff_ids": [
      "text"
    ],
    "assignee_mode": "Owner",
    "task_type": "text",
    "stage_id": "text",
    "staff_ids": [
      "text"
    ],
    "distribution": "All",
    "reassign": false,
    "value": "text",
    "note": "text",
    "flow_id": "text",
    "applies_to": "All"
  },
  "actions": [
    {
      "type": "tags",
      "tag_names": [
        "text"
      ],
      "task_name": "text",
      "description": "text",
      "due_at": "2026-05-27T14:23:11.482Z",
      "due_in_days": 1,
      "assignee_staff_id": "text",
      "assignee_staff_ids": [
        "text"
      ],
      "assignee_mode": "Owner",
      "task_type": "text",
      "stage_id": "text",
      "staff_ids": [
        "text"
      ],
      "distribution": "All",
      "reassign": false,
      "value": "text",
      "note": "text",
      "flow_id": "text",
      "applies_to": "All"
    }
  ],
  "created_by": "text",
  "updated_by": "text",
  "created_at": "2026-05-27T14:23:11.482Z",
  "last_processed_at": "2026-05-27T14:23:11.482Z"
}

Update a sales-automation rule.

patch

Patches the trigger, trigger stage or actions. Passing actions[] replaces the whole action list; omitted fields are left unchanged. An action the worker cannot run (stage action without a valid stage, enroll_in_flow without flows, assign without staff) returns 422 invalid_action. Setting status: 1 also clears paused, as the dashboard's Resume does.

Authorizations
AuthorizationstringRequired

The API Secret from the Gleantap dashboard under Settings β†’ API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.

Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β€” narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.

For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.

Path parameters
idstringRequiredPattern: ^saut_[0-9a-f]{24}$
Header parameters
Gleantap-VersionstringOptional

Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.

Example: 2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$
Gleantap-AccountstringOptional

Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.

A staff token MUST name an account on every request β€” there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β€” list IDs with GET /v3/accounts.

Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

Which workroom to act in. Accepts a workroom name (case-insensitive), a prefixed ID (wrm_<hex>), a raw 24-hex ID, or the literal all.

On any write, ask the user which workroom β€” do not omit this. Optional here means the server has a fallback, not that the fallback is what anyone wanted: an omitted workroom sends the write to the account's default workroom, and accounts routinely have dozens. Creating a contact, flow, campaign or segment in the wrong workroom puts it where nobody is looking, and moving it afterwards is manual.

The one case where you need not ask: the account has exactly one workroom. Call listWorkrooms to find out β€” if it returns a single row, use it; if it returns several, ask which one before writing.

Reads are scoped too. Omitting a workroom on a read does not span the account β€” it narrows to the same default workroom a write would go to, and the response carries a workroom_defaulted warning saying so. So a count, a list or a segment preview describes one workroom unless you said otherwise. Pass all to deliberately span every workroom; that is the only way to get account-wide figures, and it is never the default. listWorkrooms itself is never narrowed, since it is how you discover what to ask for.

Also settable via ?workroom= or a workroom body field (POST/PATCH only) β€” query wins over header wins over body.

Example: G Test1
Body
anyOptional
or
anyOptional
Responses
200

OK

application/json
idstringOptionalPattern: ^saut_[0-9a-f]{24}$
objectstring Β· enumOptionalPossible values:
namestringOptional
flow_idstringOptionalExample: flw_01H8XKV...Pattern: ^flw_[0-9A-HJKMNP-TV-Z]{26}$
flow_node_idstring Β· nullableOptional

The specific flow node this rule is attached to. Null for a free-standing rule.

pipeline_idstring Β· nullableOptional

The pipeline the rule is listed under. A null here means the rule runs but is invisible in the dashboard's CRM automations list, which filters on it.

Pattern: ^pip_[0-9a-f]{24}$
workroom_idstring Β· nullableOptional

The workroom this rule lives in. An added_to_segments trigger can only reference segments from the same workroom.

Example: wrm_5ace370fd2a57d74d0548fb2Pattern: ^wrm_[0-9a-f]{24}$
statusstring Β· enumOptional

Status of the automation: active (runs on trigger), paused (temporarily disabled, does not fire), inactive (staged, not live), or completed. Defaults to active.

Default: activePossible values:
pausedbooleanOptional

True when the rule is paused or auto-disabled. A paused rule does not run until resumed with status: active.

brokenbooleanOptional

True when the rule is missing required references (e.g. its trigger segment was deleted) and cannot fire.

execute_onstring Β· enumOptionalPossible values:
processed_countintegerOptional
created_bystring Β· nullableOptional

A staff user (from the legacy users collection). Used for owner_id, responsible_id, created_by, assigned_to, etc.

Pattern: ^usr_[0-9a-f]{24}$
updated_bystring Β· nullableOptional

A staff user (from the legacy users collection). Used for owner_id, responsible_id, created_by, assigned_to, etc.

Pattern: ^usr_[0-9a-f]{24}$
created_atstring Β· date-timeOptional

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
last_processed_atstring Β· date-time Β· nullableOptional

RFC 3339 timestamp, always UTC, millisecond precision.

Example: 2026-05-27T14:23:11.482Z
patch/sales_automations/{id}
PATCH /v3/sales_automations/{id} HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 1131

{
  "name": "text",
  "pipeline_id": "text",
  "execute_on": "ongoing",
  "status": "active",
  "paused": false,
  "trigger": {
    "type": "added_to_segments",
    "segment_ids": [
      "seg_01H8XKE..."
    ],
    "days": 1,
    "conditions": [
      {
        "segment": "Attributes",
        "data": "text",
        "event": "text",
        "operator": "=",
        "value": null,
        "value2": null,
        "operator2": "text",
        "value2_id": [
          "text"
        ],
        "data_type": "String",
        "dataAlias": "text",
        "ANY_ADDITIONAL_PROPERTY": "anything"
      }
    ],
    "stage": "text"
  },
  "actions": [
    {
      "type": "tags",
      "tag_names": [
        "text"
      ],
      "task_name": "text",
      "description": "text",
      "due_at": "2026-05-27T14:23:11.482Z",
      "due_in_days": 1,
      "assignee_staff_id": "text",
      "assignee_staff_ids": [
        "text"
      ],
      "task_type": "text",
      "stage_id": "text",
      "staff_ids": [
        "text"
      ],
      "distribution": "All",
      "reassign": false,
      "value": "text",
      "note": "text",
      "flow_id": "text",
      "applies_to": "All"
    }
  ],
  "action": {
    "type": "tags",
    "tag_names": [
      "text"
    ],
    "task_name": "text",
    "description": "text",
    "due_at": "2026-05-27T14:23:11.482Z",
    "due_in_days": 1,
    "assignee_staff_id": "text",
    "assignee_staff_ids": [
      "text"
    ],
    "task_type": "text",
    "stage_id": "text",
    "staff_ids": [
      "text"
    ],
    "distribution": "All",
    "reassign": false,
    "value": "text",
    "note": "text",
    "flow_id": "text",
    "applies_to": "All"
  }
}
200

OK

{
  "id": "text",
  "object": "sales_automation",
  "name": "text",
  "flow_id": "flw_01H8XKV...",
  "flow_node_id": "text",
  "pipeline_id": "text",
  "workroom_id": "wrm_5ace370fd2a57d74d0548fb2",
  "status": "active",
  "paused": true,
  "broken": true,
  "execute_on": "ongoing",
  "processed_count": 1,
  "trigger": {
    "type": "added_to_segments",
    "segment_ids": [
      "seg_01H8XKE..."
    ],
    "days": 1,
    "conditions": [
      {
        "segment": "Attributes",
        "data": "text",
        "event": "text",
        "operator": "=",
        "value": null,
        "value2": null,
        "operator2": "text",
        "value2_id": [
          "text"
        ],
        "data_type": "String",
        "dataAlias": "text",
        "ANY_ADDITIONAL_PROPERTY": "anything"
      }
    ],
    "stage": "text"
  },
  "action": {
    "type": "tags",
    "tag_names": [
      "text"
    ],
    "task_name": "text",
    "description": "text",
    "due_at": "2026-05-27T14:23:11.482Z",
    "due_in_days": 1,
    "assignee_staff_id": "text",
    "assignee_staff_ids": [
      "text"
    ],
    "assignee_mode": "Owner",
    "task_type": "text",
    "stage_id": "text",
    "staff_ids": [
      "text"
    ],
    "distribution": "All",
    "reassign": false,
    "value": "text",
    "note": "text",
    "flow_id": "text",
    "applies_to": "All"
  },
  "actions": [
    {
      "type": "tags",
      "tag_names": [
        "text"
      ],
      "task_name": "text",
      "description": "text",
      "due_at": "2026-05-27T14:23:11.482Z",
      "due_in_days": 1,
      "assignee_staff_id": "text",
      "assignee_staff_ids": [
        "text"
      ],
      "assignee_mode": "Owner",
      "task_type": "text",
      "stage_id": "text",
      "staff_ids": [
        "text"
      ],
      "distribution": "All",
      "reassign": false,
      "value": "text",
      "note": "text",
      "flow_id": "text",
      "applies_to": "All"
    }
  ],
  "created_by": "text",
  "updated_by": "text",
  "created_at": "2026-05-27T14:23:11.482Z",
  "last_processed_at": "2026-05-27T14:23:11.482Z"
}
delete

Permanent. There is no undo and no trash to restore from. Anything that references the deleted record is affected too.

Authorizations
AuthorizationstringRequired

The API Secret from the Gleantap dashboard under Settings β†’ API (Generate New Key if none exists). Send it bare (40 hex characters) or prefixed as gltp_sk_live_<40-hex>. There is no sandbox: every key acts on the live account.

Keys are account-scoped and carry all permissions on that account (no per-key scope selection). Cross-workroom reads are unrestricted by default β€” narrow with ?workroom= / Gleantap-Workroom on each request. Revoke via the dashboard.

For per-user consent, per-workroom scoping, and short-lived tokens, use OAuth 2.1 instead.

Path parameters
idstringRequiredPattern: ^saut_[0-9a-f]{24}$
Header parameters
Gleantap-VersionstringOptional

Minor version to run the request under (date-based). Older dates remain supported for at least 24 months. If omitted, the account's default pinned version is used.

Example: 2026-05-27Pattern: ^\d{4}-\d{2}-\d{2}$
Gleantap-AccountstringOptional

Target customer account, as acc_<24-hex> or a bare 24-hex ID. Only for Gleantap staff (CSM) tokens, which authenticate against the internal staff directory and are bound to no account; for a normal customer token the account is fixed by the token and this header is ignored.

A staff token MUST name an account on every request β€” there is no default, and omitting it returns 400 admin_account_required rather than falling back to some first account. Switching accounts is just a different value here; no re-authorization. Account names are rejected (400 admin_account_invalid) because they are neither unique nor stable β€” list IDs with GET /v3/accounts.

Every impersonated response carries an impersonation block naming the account actually acted on, so an account switch mid-session is always visible. Also settable via ?account=.

Example: acc_59fca1e3d2a57d28a10b0442
Gleantap-WorkroomstringOptional

Which workroom to act in. Accepts a workroom name (case-insensitive), a prefixed ID (wrm_<hex>), a raw 24-hex ID, or the literal all.

On any write, ask the user which workroom β€” do not omit this. Optional here means the server has a fallback, not that the fallback is what anyone wanted: an omitted workroom sends the write to the account's default workroom, and accounts routinely have dozens. Creating a contact, flow, campaign or segment in the wrong workroom puts it where nobody is looking, and moving it afterwards is manual.

The one case where you need not ask: the account has exactly one workroom. Call listWorkrooms to find out β€” if it returns a single row, use it; if it returns several, ask which one before writing.

Reads are scoped too. Omitting a workroom on a read does not span the account β€” it narrows to the same default workroom a write would go to, and the response carries a workroom_defaulted warning saying so. So a count, a list or a segment preview describes one workroom unless you said otherwise. Pass all to deliberately span every workroom; that is the only way to get account-wide figures, and it is never the default. listWorkrooms itself is never narrowed, since it is how you discover what to ask for.

Also settable via ?workroom= or a workroom body field (POST/PATCH only) β€” query wins over header wins over body.

Example: G Test1
Responses
204

Deleted.

No content

delete/sales_automations/{id}
DELETE /v3/sales_automations/{id} HTTP/1.1
Host: api.gleantap.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
204

Deleted.

No content