{
  "info": {
    "name": "Joryio API",
    "description": "REST API collection for the Joryio Marketing Automation Platform. Authenticate every request with `Authorization: Bearer {{token}}` — set `token` to an API key (`jry_live_...` / `jry_test_...`, created in Settings > API Keys or via the API Keys folder) or to a dashboard JWT. Full reference: https://docs.joryio.com/api/overview",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://api-eu1.joryio.com/api",
      "type": "string"
    },
    {
      "key": "token",
      "value": "jry_live_your_api_key_here",
      "type": "string"
    },
    {
      "key": "organizationId",
      "value": "",
      "type": "string"
    },
    {
      "key": "workspaceId",
      "value": "",
      "type": "string"
    },
    {
      "key": "listId",
      "value": "",
      "type": "string"
    },
    {
      "key": "connectionId",
      "value": "",
      "type": "string"
    },
    {
      "key": "placementId",
      "value": ""
    },
    {
      "key": "whatsappAccountId",
      "value": ""
    }
  ],
  "item": [
    {
      "name": "Authentication",
      "description": "Dashboard account endpoints. For API integrations prefer an API key (`jry_live_...`) as the bearer token — API keys skip MFA/Turnstile and carry scoped permissions. Interactive login may additionally require MFA (`requiresMfa` + `tempToken` response) and, when Turnstile is configured, a `turnstileToken` body field.",
      "item": [
        {
          "name": "Login",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "if (pm.response.code === 200) {",
                  "    const response = pm.response.json();",
                  "    if (response.token) {",
                  "        pm.collectionVariables.set('token', response.token);",
                  "    }",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"email\": \"admin@example.com\",\n  \"password\": \"Str0ng!Passw0rd42\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/auth/login",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "auth",
                "login"
              ]
            },
            "description": "Dashboard login. On success returns { user, organization, workspaces, token } — the JWT is in `token`. Accounts with MFA enabled instead get { requiresMfa: true, tempToken }. When Turnstile is configured a `turnstileToken` body field is required, so scripted integrations should use an API key rather than this endpoint."
          }
        },
        {
          "name": "Get Profile",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/auth/profile",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "auth",
                "profile"
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Me",
      "description": "Who is calling. Works with every credential: an API key, a dashboard session, or an OAuth access token (an integration such as Zapier, or an MCP client).",
      "item": [
        {
          "name": "Who am I",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/me",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "me"
              ]
            },
            "description": "Returns the organization and workspace this credential acts in, the region and `api_base_url` to call, the principal (`type`: `user`, `api_key` or `oauth`; for OAuth also `client_kind` and `client`, e.g. `zapier`, and the person who connected it) and the permissions it carries right now. For an OAuth token the scopes are what was granted AND what the person still holds. Needs no particular permission - use it as a connection test."
          },
          "response": [
            {
              "name": "OAuth token (Zapier)",
              "originalRequest": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "Bearer {{token}}"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/me",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "me"
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"organization\": {\n    \"id\": \"8f0c2c1e-3b0a-4d2e-9a51-0f6f4d1c2b11\",\n    \"name\": \"Acme\"\n  },\n  \"workspace\": {\n    \"id\": \"1d2e3f40-5a6b-4c7d-8e9f-a0b1c2d3e4f5\",\n    \"name\": \"Production\"\n  },\n  \"region\": \"eu1\",\n  \"api_base_url\": \"https://api-eu1.joryio.com/api\",\n  \"principal\": {\n    \"type\": \"oauth\",\n    \"client_kind\": \"integration\",\n    \"client\": \"zapier\",\n    \"email\": \"dana@acme.com\",\n    \"name\": \"Dana Levi\"\n  },\n  \"scopes\": [\n    \"events:track\",\n    \"users:read\",\n    \"users:write\"\n  ]\n}"
            }
          ]
        }
      ]
    },
    {
      "name": "Users",
      "description": "User management API. Uses `userId` (your identifier) for creating users, and can reference users by either `userId` or Joryio's internal `id`.",
      "item": [
        {
          "name": "Track (attributes, events, purchases)",
          "description": "Create a new user or update existing. Uses `userId` (your identifier) as the primary key.",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"attributes\": {\n    \"externalId\": \"user-123\",\n    \"email\": \"jane@example.com\",\n    \"phone\": \"+14155550100\",\n    \"attributes\": {\n      \"firstName\": \"Jane\",\n      \"plan\": \"premium\"\n    },\n    \"subscriptions\": [\n      {\n        \"listId\": \"{{listId}}\",\n        \"channel\": \"email\",\n        \"status\": \"subscribed\"\n      }\n    ]\n  },\n  \"events\": {\n    \"externalId\": \"user-123\",\n    \"name\": \"Product Viewed\",\n    \"properties\": {\n      \"productId\": \"SKU-456\",\n      \"price\": 49.99\n    },\n    \"timestamp\": \"2026-08-19T10:00:00.000Z\"\n  },\n  \"purchases\": {\n    \"orderId\": \"ORD-2026-001\",\n    \"externalId\": \"user-123\",\n    \"total\": 89.97,\n    \"subtotal\": 99.97,\n    \"discount\": 10.0,\n    \"currency\": \"USD\",\n    \"salesChannel\": \"pos\",\n    \"storeId\": \"tlv-dizengoff\",\n    \"items\": [\n      {\n        \"productId\": \"SKU-12345\",\n        \"name\": \"Blue T-Shirt\",\n        \"quantity\": 2,\n        \"price\": 29.99,\n        \"total\": 59.98\n      }\n    ]\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/users/track",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "users",
                "track"
              ]
            },
            "description": "THE ingest door. Send who someone is (`attributes`), what they did (`events`) and what they bought (`purchases`) in ONE call. Every field takes a single object OR an array. Attributes are applied BEFORE events and purchases, so an event may reference a person created in the same request.\n\nIdentity is the same everywhere: `externalId` is YOUR identifier and the only create-or-update key; `userId` is Joryio's internal 24-hex id and is update-only; `anonymousId` is a pre-identification session.\n\nMATCHING BY EMAIL. An `attributes` element with an `email` but no `externalId` and no `userId` is matched by email (lowercased) in the workspace. Email is NOT unique: none -> a contact is created; exactly one -> it is updated; several -> exactly ONE is updated, the most recently active (latest profile change, then newest), and the others are left as they are - contacts are never merged. A list unsubscribe in the element still applies to every contact with that email; a list subscribe applies to the updated contact only. Such an element is listed in `attributes.matchedSeveral` [{ index, userId, count }] - a notice, not an error. Send `externalId` (or the internal `userId`) to update one exact contact.\n\n`purchases` takes the same shape as POST /orders and goes through the same pipeline, so the Orders page, RFM and revenue attribution all see it.\n\nNOTE: do NOT send `Order Completed` in `events` - it is emitted automatically from a purchase, and sending both double-counts revenue. The request will tell you so.\n\nFailures are reported per array BY INDEX; one bad element never fails the batch. Caps: attributes 1000, events 500, purchases 500.\n\nLIST SUBSCRIPTIONS IN THE SAME CALL. Each `attributes` element may carry `subscriptions`: [{ listId, channel? (default 'email'), status? ('subscribed' | 'unsubscribed', default 'subscribed') }], max 100 per element. They are applied after the person is created or updated. An existing opt-out is never resurrected - it is kept and reported in `attributes.subscriptions.skipped` (by element index, with a reason), as is a listId that is unknown or belongs to another workspace; re-subscribing an opted-out contact is an explicit call to POST /subscriptions/contacts/:userId/lists/:listId. A list that requires double opt-in is NOT subscribed by this call: the person gets the same confirmation email a sign-up form sends (at most one per contact in 24 hours, forms included) and joins with optInSource double_opt_in when they click it. Such an item is reported in `attributes.subscriptions.pendingConfirmation` [{ index, listId, channel, status: 'pending_confirmation' }] (present only when there is one); an already confirmed subscription is counted in `applied` and nothing is sent. Every other list is recorded directly. `attributes.subscriptions` = { applied, skipped[] } appears only when some element sent subscriptions.\n\nStore and sales channel: `salesChannel` is where the order was placed - `online`, `pos`, `app`, `phone`, `marketplace` or `other` (any letter case; any other value is a 400). Left out, a new order is `online` and an existing one keeps its channel. `storeId` (up to 100 characters) is your own id for the store the order belongs to and `storeName` (up to 255) its display name; the Orders page Store filter and the \"Bought in store\" segment condition match `storeId`. `api` is reserved for orders that name no store: a `storeId` of `api` is refused with a 400. An order id that a store connected to the workspace already holds cannot be moved to your `storeId`: that upsert is refused with a 409 (`code: order_owned_by_connected_store`) - leave `storeId` out to update the order. Order events carry them as `sales_channel` and `store_id`.\n\nPHONE NUMBERS. Send `phone` in international format (+972501234567). A number without a country code (0501234567) is read in the workspace's default country for phone numbers (Settings, opt-in); Joryio never guesses one. A phone that is not a valid number is kept, not dropped: it is stored as `phoneUnverified`, the contact's existing `phone` is not changed, it is never used for messages, and the element gets a non-fatal warning in `attributes.warnings`: { \"index\": 0, \"field\": \"phone\", \"reason\": \"Phone saved as unverified and not used for messages - the number is not valid as written. Add the country code (for example +972501234567), or set a default country for phone numbers in workspace settings.\" }. A later valid phone clears `phoneUnverified`."
          }
        },
        {
          "name": "Import push devices (bulk, from another vendor)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/users/track",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "users",
                "track"
              ]
            },
            "description": "Bulk-load push tokens exported from a previous vendor. Up to 1000 devices per request, each naming its person by externalId - the id your export actually contains, not Joryio's internal id.\n\nWHAT ACTUALLY TRANSFERS. iOS/APNs tokens are issued per (bundle id, environment) and are not vendor-specific, so they carry over. Android/FCM tokens are scoped to a Firebase SENDER: same project and they work, a new project and they were already dead. Web push subscriptions are bound to the VAPID key that created them and CANNOT transfer - those users have to be prompted again.\n\nRegistering a token never grants push consent. Same rule as file import: holding a token is not evidence of permission, suppression still applies, and granting stays a compliance action.\n\nA token already attached to someone else MOVES to the person named here - the device belongs to whoever holds it - and the previous contact's device is marked deactivatedReason='reassigned' with reassignedToUserId, so the move is visible on both sides.\n\nTokens are taken as given, not probed. A token is presumed valid until a send bounces, at which point the delivery path deactivates it.\n\n`appId` attaches each token to one of your apps. Campaign sends filter on it, so a token imported without one is excluded from every push - it is held but never used. You can omit it when the workspace has exactly one app on that platform, in which case it is resolved for you; pass it when you have several (an iOS app and an Android app each carry their own credentials). Get the ids from GET /apps.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"devices\": [\n    {\n      \"externalId\": \"user-123\",\n      \"platform\": \"ios\",\n      \"pushToken\": \"a1b2c3\\u2026\",\n      \"appId\": \"{{iosAppId}}\",\n      \"deviceInfo\": {\n        \"model\": \"iPhone15,2\",\n        \"osVersion\": \"18.2\"\n      }\n    },\n    {\n      \"externalId\": \"user-456\",\n      \"platform\": \"android\",\n      \"pushToken\": \"d4e5f6\\u2026\",\n      \"appId\": \"{{androidAppId}}\"\n    }\n  ]\n}"
            }
          },
          "response": []
        },
        {
          "name": "Identify (anonymous -> known)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/users/identify",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "users",
                "identify"
              ]
            },
            "description": "Promote an anonymous session to a known person: upserts the known user by externalId, finds the anonymous record, MERGES them and reassigns the anonymous history.\n\nThis is not the same as sending anonymousId on /users/track. That field is accepted there and does not merge anything - tracking upserts a person, identify joins two records. Use this endpoint when you learn who an anonymous visitor is.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"anonymousId\": \"anon_abc123\",\n  \"externalId\": \"user-123\",\n  \"attributes\": {\n    \"plan\": \"premium\"\n  }\n}"
            }
          },
          "response": []
        },
        {
          "name": "Track many (array bodies)",
          "description": "Create a new user or update existing. Uses `userId` (your identifier) as the primary key.",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"attributes\": [\n    {\n      \"externalId\": \"user-123\",\n      \"email\": \"jane@example.com\",\n      \"phone\": \"+14155550100\",\n      \"attributes\": {\n        \"firstName\": \"Jane\",\n        \"plan\": \"premium\"\n      },\n      \"subscriptions\": [\n        {\n          \"listId\": \"{{listId}}\",\n          \"channel\": \"email\",\n          \"status\": \"subscribed\"\n        }\n      ]\n    },\n    {\n      \"externalId\": \"user-456\",\n      \"email\": \"sam@example.com\"\n    }\n  ],\n  \"events\": [\n    {\n      \"externalId\": \"user-123\",\n      \"name\": \"Product Viewed\",\n      \"properties\": {\n        \"productId\": \"SKU-456\",\n        \"price\": 49.99\n      },\n      \"timestamp\": \"2026-08-19T10:00:00.000Z\"\n    },\n    {\n      \"externalId\": \"user-456\",\n      \"name\": \"Checkout Started\"\n    }\n  ],\n  \"purchases\": [\n    {\n      \"orderId\": \"ORD-2026-001\",\n      \"externalId\": \"user-123\",\n      \"total\": 89.97,\n      \"subtotal\": 99.97,\n      \"discount\": 10.0,\n      \"currency\": \"USD\",\n      \"items\": [\n        {\n          \"productId\": \"SKU-12345\",\n          \"name\": \"Blue T-Shirt\",\n          \"quantity\": 2,\n          \"price\": 29.99,\n          \"total\": 59.98\n        }\n      ]\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/users/track",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "users",
                "track"
              ]
            },
            "description": "The same endpoint with arrays. Each element carries its own identity, so one call can span many people. Response is a per-array summary: { attributes, events, purchases, devices } each with { processed, failed[] }, where failed itemizes by request index; `attributes` adds `warnings[]` and `subscriptions` { applied, skipped[] } when there is something to report.\n\nLIST SUBSCRIPTIONS IN THE SAME CALL. Each `attributes` element may carry `subscriptions`: [{ listId, channel? (default 'email'), status? ('subscribed' | 'unsubscribed', default 'subscribed') }], max 100 per element. They are applied after the person is created or updated. An existing opt-out is never resurrected - it is kept and reported in `attributes.subscriptions.skipped` (by element index, with a reason), as is a listId that is unknown or belongs to another workspace; re-subscribing an opted-out contact is an explicit call to POST /subscriptions/contacts/:userId/lists/:listId. A list that requires double opt-in is NOT subscribed by this call: the person gets the same confirmation email a sign-up form sends (at most one per contact in 24 hours, forms included) and joins with optInSource double_opt_in when they click it. Such an item is reported in `attributes.subscriptions.pendingConfirmation` [{ index, listId, channel, status: 'pending_confirmation' }] (present only when there is one); an already confirmed subscription is counted in `applied` and nothing is sent. Every other list is recorded directly. `attributes.subscriptions` = { applied, skipped[] } appears only when some element sent subscriptions.\n\nMATCHING BY EMAIL. An `attributes` element with an `email` but no `externalId` and no `userId` is matched by email (lowercased) in the workspace. Email is NOT unique: none -> a contact is created; exactly one -> it is updated; several -> exactly ONE is updated, the most recently active (latest profile change, then newest), and the others are left as they are - contacts are never merged. A list unsubscribe in the element still applies to every contact with that email; a list subscribe applies to the updated contact only. Such an element is listed in `attributes.matchedSeveral` [{ index, userId, count }] - a notice, not an error. Send `externalId` (or the internal `userId`) to update one exact contact.\n\nPHONE NUMBERS. Send `phone` in international format (+972501234567). A number without a country code (0501234567) is read in the workspace's default country for phone numbers (Settings, opt-in); Joryio never guesses one. A phone that is not a valid number is kept, not dropped: it is stored as `phoneUnverified`, the contact's existing `phone` is not changed, it is never used for messages, and the element gets a non-fatal warning in `attributes.warnings`: { \"index\": 0, \"field\": \"phone\", \"reason\": \"Phone saved as unverified and not used for messages - the number is not valid as written. Add the country code (for example +972501234567), or set a default country for phone numbers in workspace settings.\" }. A later valid phone clears `phoneUnverified`."
          }
        },
        {
          "name": "Get All Users",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/users?limit=50&offset=0&email=&externalId=&userId=&q=",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "users"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "50"
                },
                {
                  "key": "offset",
                  "value": "0",
                  "description": "Rows to skip, max 100,000. Ignored when after, before or last is sent - use those to page a large list: every cursor page reads only its own rows."
                },
                {
                  "key": "after",
                  "value": "",
                  "disabled": true,
                  "description": "Cursor: the page after this one - pass pagination.nextCursor from the previous response, with the same sortBy, sortOrder and filters. A cursor made under another sort returns 400. Each response carries pagination.nextCursor (null on the last page) and pagination.prevCursor (null on the first); cursor pages have no offset."
                },
                {
                  "key": "before",
                  "value": "",
                  "disabled": true,
                  "description": "Cursor: the page before this one - pass pagination.prevCursor. Send only one of after, before and last."
                },
                {
                  "key": "last",
                  "value": "true",
                  "disabled": true,
                  "description": "true returns the last page of the list; walk back from it with before."
                },
                {
                  "key": "sortBy",
                  "value": "updatedAt",
                  "disabled": true,
                  "description": "createdAt | updatedAt | email | name. Ordered across the whole list with a stable tiebreak; default updatedAt."
                },
                {
                  "key": "sortOrder",
                  "value": "desc",
                  "disabled": true,
                  "description": "asc | desc; default desc."
                },
                {
                  "key": "bots",
                  "value": "exclude",
                  "disabled": true,
                  "description": "exclude | only. exclude hides contacts marked as crawlers (attributes.isBot), only returns only them; default everyone."
                },
                {
                  "key": "identity",
                  "value": "known",
                  "disabled": true,
                  "description": "known | anonymous. known = has an email, a phone or an externalId; anonymous = none of them (a visitor known only by the SDK's anonymousId); default everyone. The live count stops at 100,000. Past it, with only bots / identity, pagination.total is the last exact count taken in the background (refreshed when older than ~10 minutes) with totalApprox: true and totalAsOf (ISO), e.g. { \"total\": 391855, \"totalApprox\": true, \"totalAsOf\": \"2026-11-19T10:00:00.000Z\" }. Before the first count, and always with q or an exact-match parameter (not cached): totalCapped: true and total 100,000. hasMore is true either way."
                },
                {
                  "key": "email",
                  "value": "",
                  "disabled": true,
                  "description": "Exact match, case-insensitive. For partial or prefix matching use GET /users/search?query="
                },
                {
                  "key": "externalId",
                  "value": "",
                  "disabled": true,
                  "description": "Exact match on your own identifier. GET /users/by-user-id/:userId returns that one record directly."
                },
                {
                  "key": "userId",
                  "value": "",
                  "disabled": true,
                  "description": "Exact match on Joryio's internal id."
                },
                {
                  "key": "q",
                  "value": "",
                  "disabled": true,
                  "description": "Partial match across email, externalId, name and phone. Ignored when an exact parameter is present. This is the recommended way to find a person - see the Find a person guide."
                }
              ]
            }
          }
        },
        {
          "name": "Get User by Joryio ID",
          "description": "Get user by Joryio's internal ID (the `id` field from API responses, a 24-character hex string)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/users/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "users",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "665f1e2a9b3c4d5e6f7a8b9c",
                  "description": "Joryio's internal user ID (24-char hex)"
                }
              ]
            },
            "description": "Returns one contact. Contacts that wrote to you on WhatsApp may carry `whatsappUserIds`: Meta's business-scoped user IDs for the person's WhatsApp account, one per business portfolio, e.g. [{\"scope\": \"business:1234567890\", \"id\": \"US.13491208655302741918\", \"username\": \"jane\", \"since\": \"2026-11-28T10:00:00.000Z\"}]. Read-only (written by the WhatsApp webhook) and present only when the contact has one - a WhatsApp username user without a phone is recognized and messaged by it."
          }
        },
        {
          "name": "Get User by Your User ID",
          "description": "Get user by your userId (the identifier you use to create/track users). This is the recommended lookup method.",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/users/by-user-id/:userId",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "users",
                "by-user-id",
                ":userId"
              ],
              "variable": [
                {
                  "key": "userId",
                  "value": "user-123",
                  "description": "Your user identifier"
                }
              ]
            },
            "description": "Returns one contact. Contacts that wrote to you on WhatsApp may carry `whatsappUserIds`: Meta's business-scoped user IDs for the person's WhatsApp account, one per business portfolio, e.g. [{\"scope\": \"business:1234567890\", \"id\": \"US.13491208655302741918\", \"username\": \"jane\", \"since\": \"2026-11-28T10:00:00.000Z\"}]. Read-only (written by the WhatsApp webhook) and present only when the contact has one - a WhatsApp username user without a phone is recognized and messaged by it."
          }
        },
        {
          "name": "Update User by Joryio ID",
          "description": "Update user by Joryio's internal ID (the `id` field from API responses). PHONE: `phone` is read like every contact write (a number without a country code in the workspace's default country for phone numbers); one that is not valid is kept as `phoneUnverified` and the current `phone` is not changed. `{\"clearPhoneUnverified\": true}` removes the unverified number and leaves `phone` as it is. CHANGING EMAIL OR PHONE: never refused (email and phone are not unique). When the value actually changes, the change is recorded in the compliance audit log (who, when, field, old and new value, this route), and on an email change the old address's bounce and invalid flags are cleared - consent and unsubscribes stay with the contact. The response then may carry non-blocking `warnings`: `suppressed: true` when the new email or phone is on this workspace's suppression list, and `duplicateOf` with the ids of up to 10 other contacts that already hold it. `warnings` is absent when there is nothing to warn about.",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"attributes\": {\n    \"plan\": \"enterprise\",\n    \"lastSeen\": \"2026-01-04T12:00:00Z\"\n  }\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/users/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "users",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "665f1e2a9b3c4d5e6f7a8b9c",
                  "description": "Joryio's internal user ID (24-char hex)"
                }
              ]
            }
          },
          "response": [
            {
              "name": "Attributes updated",
              "originalRequest": {
                "method": "PUT",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "Bearer {{token}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"attributes\": {\n    \"plan\": \"enterprise\",\n    \"lastSeen\": \"2026-01-04T12:00:00Z\"\n  }\n}"
                },
                "url": {
                  "raw": "{{baseUrl}}/users/:id",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "users",
                    ":id"
                  ],
                  "variable": [
                    {
                      "key": "id",
                      "value": "665f1e2a9b3c4d5e6f7a8b9c",
                      "description": "Joryio's internal user ID (24-char hex)"
                    }
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"id\": \"665f1e2a9b3c4d5e6f7a8b9c\",\n  \"userId\": \"665f1e2a9b3c4d5e6f7a8b9c\",\n  \"organizationId\": \"8f0c2c1e-3b0a-4d2e-9a51-0f6f4d1c2b11\",\n  \"workspaceId\": \"1d2e3f40-5a6b-4c7d-8e9f-a0b1c2d3e4f5\",\n  \"externalId\": \"user-123\",\n  \"email\": \"dana@acme.com\",\n  \"phone\": \"+972501234567\",\n  \"attributes\": {\n    \"plan\": \"enterprise\"\n  },\n  \"segments\": [],\n  \"rndBucket\": 4821,\n  \"createdVia\": \"api\",\n  \"createdAt\": \"2026-03-02T10:15:00.000Z\",\n  \"updatedAt\": \"2026-11-19T09:30:00.000Z\"\n}"
            },
            {
              "name": "Email changed - with warnings",
              "originalRequest": {
                "method": "PUT",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "Bearer {{token}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"email\": \"dana.levi@acme.com\"\n}"
                },
                "url": {
                  "raw": "{{baseUrl}}/users/:id",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "users",
                    ":id"
                  ],
                  "variable": [
                    {
                      "key": "id",
                      "value": "665f1e2a9b3c4d5e6f7a8b9c",
                      "description": "Joryio's internal user ID (24-char hex)"
                    }
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"id\": \"665f1e2a9b3c4d5e6f7a8b9c\",\n  \"userId\": \"665f1e2a9b3c4d5e6f7a8b9c\",\n  \"organizationId\": \"8f0c2c1e-3b0a-4d2e-9a51-0f6f4d1c2b11\",\n  \"workspaceId\": \"1d2e3f40-5a6b-4c7d-8e9f-a0b1c2d3e4f5\",\n  \"externalId\": \"user-123\",\n  \"email\": \"dana.levi@acme.com\",\n  \"phone\": \"+972501234567\",\n  \"attributes\": {\n    \"plan\": \"enterprise\"\n  },\n  \"segments\": [],\n  \"rndBucket\": 4821,\n  \"createdVia\": \"api\",\n  \"createdAt\": \"2026-03-02T10:15:00.000Z\",\n  \"updatedAt\": \"2026-11-19T09:30:00.000Z\",\n  \"warnings\": {\n    \"suppressed\": true,\n    \"duplicateOf\": [\n      \"665f1e2a9b3c4d5e6f7a8ba0\"\n    ]\n  }\n}"
            }
          ]
        },
        {
          "name": "Update User by Your User ID",
          "description": "Update user by your userId. This is the recommended update method. CHANGING EMAIL OR PHONE: never refused (email and phone are not unique). When the value actually changes, the change is recorded in the compliance audit log (who, when, field, old and new value, this route), and on an email change the old address's bounce and invalid flags are cleared - consent and unsubscribes stay with the contact. The response then may carry non-blocking `warnings`: `suppressed: true` when the new email or phone is on this workspace's suppression list, and `duplicateOf` with the ids of up to 10 other contacts that already hold it. `warnings` is absent when there is nothing to warn about.",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"attributes\": {\n    \"plan\": \"enterprise\",\n    \"lastSeen\": \"2026-01-04T12:00:00Z\"\n  }\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/users/by-user-id/:userId",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "users",
                "by-user-id",
                ":userId"
              ],
              "variable": [
                {
                  "key": "userId",
                  "value": "user-123",
                  "description": "Your user identifier"
                }
              ]
            }
          },
          "response": [
            {
              "name": "Attributes updated",
              "originalRequest": {
                "method": "PUT",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "Bearer {{token}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"attributes\": {\n    \"plan\": \"enterprise\",\n    \"lastSeen\": \"2026-01-04T12:00:00Z\"\n  }\n}"
                },
                "url": {
                  "raw": "{{baseUrl}}/users/by-user-id/:userId",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "users",
                    "by-user-id",
                    ":userId"
                  ],
                  "variable": [
                    {
                      "key": "userId",
                      "value": "user-123",
                      "description": "Your user identifier"
                    }
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"id\": \"665f1e2a9b3c4d5e6f7a8b9c\",\n  \"userId\": \"665f1e2a9b3c4d5e6f7a8b9c\",\n  \"organizationId\": \"8f0c2c1e-3b0a-4d2e-9a51-0f6f4d1c2b11\",\n  \"workspaceId\": \"1d2e3f40-5a6b-4c7d-8e9f-a0b1c2d3e4f5\",\n  \"externalId\": \"user-123\",\n  \"email\": \"dana@acme.com\",\n  \"phone\": \"+972501234567\",\n  \"attributes\": {\n    \"plan\": \"enterprise\"\n  },\n  \"segments\": [],\n  \"rndBucket\": 4821,\n  \"createdVia\": \"api\",\n  \"createdAt\": \"2026-03-02T10:15:00.000Z\",\n  \"updatedAt\": \"2026-11-19T09:30:00.000Z\"\n}"
            },
            {
              "name": "Email changed - with warnings",
              "originalRequest": {
                "method": "PUT",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "Bearer {{token}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"email\": \"dana.levi@acme.com\"\n}"
                },
                "url": {
                  "raw": "{{baseUrl}}/users/by-user-id/:userId",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "users",
                    "by-user-id",
                    ":userId"
                  ],
                  "variable": [
                    {
                      "key": "userId",
                      "value": "user-123",
                      "description": "Your user identifier"
                    }
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"id\": \"665f1e2a9b3c4d5e6f7a8b9c\",\n  \"userId\": \"665f1e2a9b3c4d5e6f7a8b9c\",\n  \"organizationId\": \"8f0c2c1e-3b0a-4d2e-9a51-0f6f4d1c2b11\",\n  \"workspaceId\": \"1d2e3f40-5a6b-4c7d-8e9f-a0b1c2d3e4f5\",\n  \"externalId\": \"user-123\",\n  \"email\": \"dana.levi@acme.com\",\n  \"phone\": \"+972501234567\",\n  \"attributes\": {\n    \"plan\": \"enterprise\"\n  },\n  \"segments\": [],\n  \"rndBucket\": 4821,\n  \"createdVia\": \"api\",\n  \"createdAt\": \"2026-03-02T10:15:00.000Z\",\n  \"updatedAt\": \"2026-11-19T09:30:00.000Z\",\n  \"warnings\": {\n    \"suppressed\": true,\n    \"duplicateOf\": [\n      \"665f1e2a9b3c4d5e6f7a8ba0\"\n    ]\n  }\n}"
            }
          ]
        },
        {
          "name": "Search Users",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/users/search?query=jane&limit=10",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "users",
                "search"
              ],
              "query": [
                {
                  "key": "query",
                  "value": "jane"
                },
                {
                  "key": "limit",
                  "value": "10"
                }
              ]
            }
          }
        },
        {
          "name": "Delete User",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/users/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "users",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "665f1e2a9b3c4d5e6f7a8b9c"
                }
              ]
            }
          },
          "description": "Delete a user. The user is moved to the recycle bin (archived with a who/when/why audit) and can be restored - it is not permanently erased. ClickHouse event history is retained. Pass an optional `?reason=` to record why."
        },
        {
          "name": "List Deleted Users (Recycle Bin)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/users/deleted?query=&limit=50&offset=0",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "users",
                "deleted"
              ],
              "query": [
                {
                  "key": "query",
                  "value": "",
                  "description": "Match email/externalId (prefix), phone, or original id"
                },
                {
                  "key": "limit",
                  "value": "50"
                },
                {
                  "key": "offset",
                  "value": "0"
                }
              ]
            },
            "description": "List deleted users (the recycle bin) with the delete audit - who deleted each one, when, how, and why. Deleted users are archived, not lost."
          }
        }
      ]
    },
    {
      "name": "Imports",
      "description": "Bulk-load contacts, events or entity records from a CSV/JSON file. Three calls: presign an upload, PUT the file straight to storage, then create the job. The PUT succeeding says nothing about the job - validation runs at job creation and again per row. See docs /api/imports-api.",
      "item": [
        {
          "name": "Get upload URL",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/users/import/upload-url",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "users",
                "import",
                "upload-url"
              ]
            },
            "description": "Returns a presigned uploadUrl and the fileKey that names it. The key is scoped to your org+workspace; pass it back verbatim when creating the job.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"filename\": \"customers-2026-08.csv\"\n}"
            }
          },
          "response": []
        },
        {
          "name": "Create import job",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/users/import",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "users",
                "import"
              ]
            },
            "description": "Creates the job and returns immediately (201); the file is processed in the background.\n\nOne import runs per workspace at a time. While one is pending or processing, the new job is NOT refused: it is created with status \"queued\" and a queuePosition (1 = starts next), and starts by itself, oldest first, when the ones before it end - completed or failed - with its own file, mapping and options. Up to 10 may wait per workspace; one more is a 400. A queued job can be cancelled with POST /users/import/:importJobId/cancel. Example 201 for a queued job: {\"id\": \"8d0e4c1a-...\", \"status\": \"queued\", \"queuePosition\": 1, ...}.\n\nfieldMapping holds COLUMNS ONLY - import options are separate typed fields (overrideConsent, entityName, maxBackdatingDays). A column literally named '_overrideConsent' is just a column and does not enable consent override.\n\noverrideConsent must be a JSON boolean and additionally requires compliance:write; a string like \"true\" is rejected with 400 rather than read as false.\n\nsmsAlreadyConfirmed (JSON boolean, requires compliance:write like overrideConsent): only matters when the workspace's SMS double opt-in is on. Without it, each NEW SMS opt-in in the file is stored as pending and gets one \"Reply YES\" text; with it, the importer states it holds proof the SMS opt-ins were already confirmed, and they are stored subscribed with no text. With overrideConsent, opted-out SMS contacts in the file are treated like new sign-ups (pending + one confirmation text, back to unsubscribed if unanswered); without it they are left unchanged and get no text.\n\nupdateExistingOnly (JSON boolean, users imports only - a 400 on events/entities): update contacts that already exist and never create one. Rows match exactly as in any contact import - externalId alone when the row has one, otherwise email (several contacts on the email: the most recently active one; never merged), otherwise - a row with only a phone - its phone. A row that matches no contact is skipped, counted in skippedCount and notMatchedCount, and listed in the error report as type skipped with \"No matching contact\". Matched rows are updated exactly as without the flag - same consent rules; it grants no re-subscribe power (that is still overrideConsent). Off unless sent.\n\nPhone-only rows (users imports): a row with a phone but no externalId and no email is matched by its phone, normalised to E.164 in the workspace's default country for phone numbers. No contact has it: one is created (repeats in the file create one contact). Exactly one: it is updated. Several: the row is skipped and listed in the error report as skipped with \"matches N contacts with this phone\" - never a guess. A phone that is not a valid number skips the row too. Rows with an externalId or an email are never matched by phone.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"format\": \"csv\",\n  \"fileKey\": \"imports/{{organizationId}}/{{workspaceId}}/customers-2026-08.csv\",\n  \"importType\": \"users\",\n  \"originalFilename\": \"customers-2026-08.csv\",\n  \"fieldMapping\": {\n    \"Email Address\": \"email\",\n    \"First Name\": \"firstName\",\n    \"Loyalty Tier\": \"attributes.loyaltyTier\"\n  },\n  \"smsAlreadyConfirmed\": false,\n  \"updateExistingOnly\": false\n}"
            }
          },
          "response": []
        },
        {
          "name": "List import jobs",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/users/import",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "users",
                "import"
              ]
            },
            "description": "Import history for the workspace, newest first, with status and the created/updated/skipped/failed counts (notMatchedCount: rows an updateExistingOnly import skipped because they matched no contact; errorReport.totalPhoneSkipped / totalPhoneMatchedSeveral / totalPhoneInvalid: phone-only rows skipped because several contacts have the phone or it is not a valid number). A workspace may only have one pending or processing import at a time.\n\nA queued job (waiting for the workspace's running import) carries queuePosition, 1 = starts next. Statuses: queued, pending, processing, completed, failed, expired, cancelled."
          },
          "response": []
        },
        {
          "name": "List import sources (for segments)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/users/import/sources?limit=100",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "users",
                "import",
                "sources"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "100",
                  "description": "Most imports to return (default 100, max 200)"
                },
                {
                  "key": "ids",
                  "value": "",
                  "description": "Optional. Comma-separated import ids (max 100): return exactly these, whatever their age - to name the imports a saved condition points at",
                  "disabled": true
                }
              ]
            },
            "description": "Finished contact (users) imports, newest first: id, fileName, status, createdAt, completedAt, rowCount, createdCount, updatedCount. With ids, exactly those imports. Needs users:read. Every contact a contact import creates or updates is marked with the import id, so a segment can target it with { \"type\": \"contact_import\", \"operator\": \"any_of\" | \"none_of\", \"value\": [importId] }. Contacts imported before this feature was released carry no mark."
          },
          "response": []
        },
        {
          "name": "Get import job",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/users/import/:importJobId",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "users",
                "import",
                ":importJobId"
              ],
              "variable": [
                {
                  "key": "importJobId",
                  "value": "",
                  "description": "The id returned when the job was created"
                }
              ]
            },
            "description": "One import job: status, row counts, and a bounded sample of row-level errors with their source line numbers. Poll this rather than re-posting the import. A queued job carries queuePosition (1 = starts next)."
          },
          "response": []
        },
        {
          "name": "Cancel queued import job",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/users/import/:importJobId/cancel",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "users",
                "import",
                ":importJobId",
                "cancel"
              ],
              "variable": [
                {
                  "key": "importJobId",
                  "value": "",
                  "description": "The id of a queued import job"
                }
              ]
            },
            "description": "Cancels an import that is still queued (waiting for the workspace's running import) and deletes its uploaded file. Returns the job with status \"cancelled\"; the jobs behind it move up. Needs users:write. An import that has started cannot be cancelled (409), nor one already cancelled (409); an id that is not an import of this workspace is a 404. No body."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Events",
      "description": "Event tracking API. Identify users by `userId` (your identifier), `anonymousId`, or a `userAlias` object.",
      "item": [
        {
          "name": "Query Events",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/events/query?eventName=Order Completed&startDate=2026-01-01&endDate=2026-01-31",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "events",
                "query"
              ],
              "query": [
                {
                  "key": "eventName",
                  "value": "Order Completed"
                },
                {
                  "key": "startDate",
                  "value": "2026-01-01"
                },
                {
                  "key": "endDate",
                  "value": "2026-01-31"
                }
              ]
            }
          }
        },
        {
          "name": "List Event Schemas",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/events/schema?limit=50&offset=0",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "events",
                "schema"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "50",
                  "description": "1-1000, default 50"
                },
                {
                  "key": "offset",
                  "value": "0"
                }
              ]
            },
            "description": "The workspace's events, most tracked first: name, total count, unique people, last seen and how many properties each has, with the description from the data dictionary. Properties are loaded per event with `GET /events/schema/:eventName`. Requires `events:read`."
          }
        },
        {
          "name": "Get an Event's Properties",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/events/schema/:eventName",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "events",
                "schema",
                ":eventName"
              ]
            },
            "description": "The properties one event carries, from its events of the last 365 days: name, type (declared, the platform's own, or inferred - `typeSource`), occurrences, up to five example values, the description from the data dictionary, and `pii` when the workspace marks the property as personal data (its example values are then empty unless you may view personal data). `:eventName` is URL-encoded (e.g. `Page%20Viewed`). Requires `events:read`."
          }
        },
        {
          "name": "Update an Event Schema",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"description\": \"A purchase was completed\",\n  \"properties\": [\n    { \"name\": \"coupon\", \"description\": \"Promo code applied at checkout\" }\n  ]\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/events/schema/:eventName",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "events",
                "schema",
                ":eventName"
              ]
            },
            "description": "Record an event's description and per-property descriptions in the workspace's data dictionary (the property pickers and the AI assistant read them). Events stay schema-less: nothing is validated or rejected on ingestion. `:eventName` is URL-encoded (e.g. `Order%20Completed`). Requires `event_schema:write`."
          }
        },
        {
          "name": "Declare an Event Property",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"coupon\",\n  \"type\": \"string\",\n  \"description\": \"Promo code applied at checkout\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/events/schema/:eventName/properties",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "events",
                "schema",
                ":eventName",
                "properties"
              ]
            },
            "description": "Declare an event property's type - `string`, `number`, `boolean` or `date` - and optionally its description, persisted to the data dictionary. `GET /events/schema/:eventName` then reports it with `typeSource: \"declared\"` and segment filters compare it that way. An unknown type, or a standard property whose type the platform fixes (`total`, `price`...), is refused with 400. Requires `event_schema:write`."
          }
        }
      ]
    },
    {
      "name": "Apps",
      "description": "Your workspace's apps and their ids. A push campaign needs a target app, and its id is only visible here - without it, POST /campaigns for a push campaign has nothing to aim at.\n\nThese two reads accept `apps:read`. Everything else on /apps (create, update, delete, SDK-key rotation) requires `settings:write`, which is not grantable to an API key, so those stay in the dashboard.",
      "item": [
        {
          "name": "List Apps",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/apps",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "apps"
              ]
            },
            "description": "Every app in the workspace, with `id`, `name` and `platform` (ios / android / web). Use the id as `appId` when creating a push campaign.\n\nEach app also carries `latestSdkVersion` (the newest SDK release) and `sdkVersions`: per platform (`android` / `ios` / `web`) and bridge (`wrapper`: `react-native` / `unity` / null), the `oldestActiveVersion` its devices ran in the last 7 days, `newestVersion`, `activeVersions`, `nativeVersions`, `active`, `lastSeenAt`, `updateAvailable` and `changelogUrl`. Empty until a device on an SDK that reports its version (releases after 1.3.3, via the X-Joryio-SDK / X-Joryio-SDK-Version headers) has sent a request."
          }
        },
        {
          "name": "Get App",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/apps/{{appId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "apps",
                "{{appId}}"
              ]
            },
            "description": "One app by id, with the same `sdkVersions` and `latestSdkVersion` fields as List Apps."
          }
        },
        {
          "name": "Set SDK Authentication Token Checks",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"audienceCheck\": \"strict\",\n  \"issuer\": \"https://auth.example.com\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/apps/{{appId}}/sdk-auth/claims",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "apps",
                "{{appId}}",
                "sdk-auth",
                "claims"
              ]
            },
            "description": "How the app checks the claims of its SDK Authentication tokens (`X-Joryio-Auth`). `audienceCheck`: `strict` refuses a token whose `aud` is not this app's id (401 sdk_authentication_error, reason invalid); `compat` accepts it and reports it (apps created before 2026-11-27 start in compat, newer apps are strict). `issuer`: expected `iss` - a token with any other issuer is refused; `null` or \"\" clears it. Both keys optional. Requires apps:write."
          }
        }
      ]
    },
    {
      "name": "E-Commerce - Catalog",
      "description": "Product catalog management. Uses `productId` (your SKU/product ID) for identifying products.",
      "item": [
        {
          "name": "Create Product",
          "description": "Create a new product. Uses `productId` as your unique identifier. This endpoint accepts two body forms: a single product object (this request - returns the full product) or a bare JSON array of product objects for bulk upsert (max 500; see 'Create Products (array body)').",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"productId\": \"SKU-12345\",\n  \"name\": \"Classic Blue T-Shirt\",\n  \"price\": 29.99,\n  \"compareAtPrice\": 39.99,\n  \"currency\": \"USD\",\n  \"categories\": [\"Clothing\", \"T-Shirts\"],\n  \"tags\": [\"sale\", \"bestseller\"],\n  \"brand\": \"Acme Apparel\",\n  \"imageUrl\": \"https://example.com/images/blue-tshirt.jpg\",\n  \"url\": \"https://example.com/products/blue-tshirt\",\n  \"inStock\": true,\n  \"sku\": \"BTS-001-BL\",\n  \"variants\": [\n    {\n      \"id\": \"var-s\",\n      \"name\": \"Small\",\n      \"sku\": \"BTS-001-BL-S\",\n      \"price\": 29.99,\n      \"inStock\": true,\n      \"options\": { \"size\": \"S\", \"color\": \"Blue\" }\n    },\n    {\n      \"id\": \"var-m\",\n      \"name\": \"Medium\",\n      \"sku\": \"BTS-001-BL-M\",\n      \"price\": 29.99,\n      \"inStock\": true,\n      \"options\": { \"size\": \"M\", \"color\": \"Blue\" }\n    }\n  ]\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/catalog/products",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "catalog",
                "products"
              ]
            }
          }
        },
        {
          "name": "Create Products (array body)",
          "description": "Create or update multiple products at once with a bare JSON array body.",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "[\n  {\n    \"productId\": \"SKU-001\",\n    \"name\": \"Product 1\",\n    \"price\": 19.99\n  },\n  {\n    \"productId\": \"SKU-002\",\n    \"name\": \"Product 2\",\n    \"price\": 29.99,\n    \"source\": \"shopify\"\n  }\n]"
            },
            "url": {
              "raw": "{{baseUrl}}/catalog/products",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "catalog",
                "products"
              ]
            },
            "description": "Create or update MANY products in one call: POST /catalog/products with a bare JSON array body (max 500 elements; no wrapper object). Each element follows the same format as the single-object form and is upserted by productId. Every element is fully validated; invalid elements are reported in failed[] by index while valid elements still process. Response is an aggregate summary: {processed, upserted, failed: [{index, productId?, sku?, reason}]}."
          }
        },
        {
          "name": "List Products",
          "description": "List products with filters and pagination. Each product also carries fields a connected store (WooCommerce) fills and the create/update routes do not accept: gtin (GTIN/UPC/EAN/ISBN or null), attributes (name to values, e.g. {\"Material\": [\"Linen\"]}, or null), variants[].gtin, and sourceModifiedAt (when the store last changed the product).",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/catalog/products?limit=50&offset=0",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "catalog",
                "products"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "50"
                },
                {
                  "key": "offset",
                  "value": "0"
                },
                {
                  "key": "categories",
                  "value": "T-Shirts",
                  "disabled": true
                },
                {
                  "key": "inStock",
                  "value": "true",
                  "disabled": true
                },
                {
                  "key": "brand",
                  "value": "Acme",
                  "disabled": true
                }
              ]
            }
          }
        },
        {
          "name": "Get Product by Joryio ID",
          "description": "Get product using Joryio's internal ID (returned in API responses)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/catalog/products/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "catalog",
                "products",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "665f1e2a9b3c4d5e6f7a8b9c",
                  "description": "Joryio's internal product ID (24-char hex)"
                }
              ]
            }
          }
        },
        {
          "name": "Get Product by Your Product ID",
          "description": "Get product using your productId (SKU, product ID from your e-commerce platform). This is the recommended lookup method.",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/catalog/products/by-product-id/:productId",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "catalog",
                "products",
                "by-product-id",
                ":productId"
              ],
              "variable": [
                {
                  "key": "productId",
                  "value": "SKU-12345",
                  "description": "Your product identifier"
                }
              ]
            }
          }
        },
        {
          "name": "Update Product",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"price\": 24.99,\n  \"inStock\": false,\n  \"tags\": [\"clearance\"]\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/catalog/products/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "catalog",
                "products",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "665f1e2a9b3c4d5e6f7a8b9c"
                }
              ]
            }
          }
        },
        {
          "name": "Delete Product",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/catalog/products/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "catalog",
                "products",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "665f1e2a9b3c4d5e6f7a8b9c"
                }
              ]
            }
          }
        },
        {
          "name": "Get Categories",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/catalog/categories",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "catalog",
                "categories"
              ]
            }
          }
        },
        {
          "name": "Get Brands",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/catalog/brands",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "catalog",
                "brands"
              ]
            }
          }
        },
        {
          "name": "Get Catalog Stats",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/catalog/stats",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "catalog",
                "stats"
              ]
            },
            "description": "Catalogue totals plus catalogue health, counted over EVERY product (not a page): productCount, categoryCount, brandCount, outOfStockCount, lowStockCount, unclassifiedCount (missing a category or a brand) and lowStockThreshold (the units-remaining boundary lowStockCount was computed at)."
          }
        }
      ]
    },
    {
      "name": "E-Commerce - Orders",
      "description": "Order management. Uses `orderId` (your order number) and identifies customers by `userId` (your user identifier).",
      "item": [
        {
          "name": "Create Order",
          "description": "Create an order for a user (identified by your `userId`). Set `totalRefunded` (order currency, default 0) to record refunds so revenue is netted and the refunded amount shows on the Orders page: for a partial refund send the partial amount with `status: partiallyRefunded`; for a full refund set it to `total` with `status: refunded`. Send every coupon code the order used in `coupons` (each with the discount it gave, when you know it); the single `couponCode` is still accepted and becomes a one-code list. Codes appear on the order, on the Order Completed event (`coupon_codes`, `coupon_count`) and in segment filters. Payment: `paymentStatus` is `paid` or `unpaid` - a Cash-on-delivery or bank-transfer order is `processing` and `unpaid` until the money arrives, and shows Awaiting payment on the Orders page instead of Paid. Left out, a processing / shipped / delivered order counts as paid (an existing order keeps its value). Revenue does not depend on it. Orders in responses carry `paymentStatus` (null when no store said).",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"orderId\": \"ORD-2024-001\",\n  \"orderNumber\": \"1001\",\n  \"externalId\": \"user-123\",\n  \"total\": 89.97,\n  \"subtotal\": 99.97,\n  \"discount\": 10.0,\n  \"shipping\": 5.99,\n  \"tax\": 4.99,\n  \"totalRefunded\": 0.0,\n  \"currency\": \"USD\",\n  \"status\": \"processing\",\n  \"paymentStatus\": \"unpaid\",\n  \"coupons\": [\n    { \"code\": \"SAVE10\", \"amount\": 10.0, \"type\": \"fixed_amount\" }\n  ],\n  \"items\": [\n    {\n      \"productId\": \"SKU-12345\",\n      \"name\": \"Blue T-Shirt\",\n      \"quantity\": 2,\n      \"price\": 29.99,\n      \"total\": 59.98\n    },\n    {\n      \"productId\": \"SKU-67890\",\n      \"name\": \"Black Jeans\",\n      \"quantity\": 1,\n      \"price\": 49.99,\n      \"total\": 49.99\n    }\n  ],\n  \"source\": \"email\",\n  \"salesChannel\": \"pos\",\n  \"storeId\": \"tlv-dizengoff\",\n  \"storeName\": \"Tel Aviv - Dizengoff\",\n  \"campaignId\": \"camp_xyz789\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/orders",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "orders"
              ]
            },
            "description": "Identity uses `externalId` (yours) and `userId` (Joryio's internal 24-hex), matching every /users route. This endpoint previously reversed those two names.\n\nStore and sales channel: `salesChannel` is where the order was placed - `online`, `pos`, `app`, `phone`, `marketplace` or `other` (any letter case; any other value is a 400). Left out, a new order is `online` and an existing one keeps its channel. `storeId` (up to 100 characters) is your own id for the store the order belongs to and `storeName` (up to 255) its display name; the Orders page Store filter and the \"Bought in store\" segment condition match `storeId`. `api` is reserved for orders that name no store: a `storeId` of `api` is refused with a 400. An order id that a store connected to the workspace already holds cannot be moved to your `storeId`: that upsert is refused with a 409 (`code: order_owned_by_connected_store`) - leave `storeId` out to update the order. Order events carry them as `sales_channel` and `store_id`.\n\nOrder number: `orderNumber` (optional, up to 64 characters) is the number your customers and staff see when it is not `orderId` - e.g. `1001` for an order whose id is `5123456789012`. The Orders page shows it and order responses return it as `orderNumber`; `orderId` stays the key."
          }
        },
        {
          "name": "List Orders",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/orders?limit=50&offset=0",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "orders"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "50"
                },
                {
                  "key": "offset",
                  "value": "0"
                },
                {
                  "key": "status",
                  "value": "pending",
                  "disabled": true
                },
                {
                  "key": "userId",
                  "value": "user-123",
                  "disabled": true
                },
                {
                  "key": "startDate",
                  "value": "2024-01-01",
                  "disabled": true
                },
                {
                  "key": "endDate",
                  "value": "2024-12-31",
                  "disabled": true
                }
              ]
            }
          }
        },
        {
          "name": "Get Order by Joryio ID",
          "description": "Get order using Joryio's internal ID",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/orders/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "orders",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "665f1e2a9b3c4d5e6f7a8b9c",
                  "description": "Joryio's internal order ID (24-char hex)"
                }
              ]
            }
          }
        },
        {
          "name": "Get Order by Your Order ID",
          "description": "Get order using your orderId (order number from your e-commerce platform). This is the recommended lookup method.",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/orders/by-order-id/:orderId",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "orders",
                "by-order-id",
                ":orderId"
              ],
              "variable": [
                {
                  "key": "orderId",
                  "value": "ORD-2024-001",
                  "description": "Your order identifier"
                }
              ]
            }
          }
        },
        {
          "name": "Upsert Order",
          "description": "Create the order, or update it if `orderId` already exists. Use this instead of Create Order when replaying a webhook or re-running an import - re-sending the same orderId updates that order rather than creating a second one. `coupons` replaces the order's stored codes (send [] to clear them); leave it out to keep them. Send `refunds` (each with your refund `id`, `amount`, and optionally `createdAt`, `reason`, `items`) and every NEW refund emits one `Order Refunded` event for journeys and segments; a refund already reported emits nothing again. A move to `status: cancelled` emits one `Order Cancelled`. Payment: `paymentStatus` is `paid` or `unpaid` - a Cash-on-delivery or bank-transfer order is `processing` and `unpaid` until the money arrives, and shows Awaiting payment on the Orders page instead of Paid. Left out, a processing / shipped / delivered order counts as paid (an existing order keeps its value). Revenue does not depend on it. Orders in responses carry `paymentStatus` (null when no store said).",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"orderId\": \"ORD-2024-001\",\n  \"orderNumber\": \"1001\",\n  \"externalId\": \"user-123\",\n  \"total\": 89.97,\n  \"currency\": \"USD\",\n  \"status\": \"processing\",\n  \"paymentStatus\": \"unpaid\",\n  \"placedAt\": \"2026-06-01T10:00:00.000Z\",\n  \"salesChannel\": \"online\",\n  \"storeId\": \"web-eu\",\n  \"storeName\": \"EU web store\",\n  \"coupons\": [\n    {\n      \"code\": \"SUMMER10\",\n      \"amount\": 6.0\n    },\n    {\n      \"code\": \"FREESHIP\"\n    }\n  ],\n  \"items\": [\n    {\n      \"productId\": \"SKU-12345\",\n      \"name\": \"Blue T-Shirt\",\n      \"quantity\": 2,\n      \"price\": 29.99,\n      \"total\": 59.98\n    }\n  ],\n  \"refunds\": [\n    {\n      \"id\": \"RF-1\",\n      \"amount\": 29.99,\n      \"createdAt\": \"2026-06-03T09:00:00.000Z\",\n      \"reason\": \"Wrong size\"\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/orders/upsert",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "orders",
                "upsert"
              ]
            },
            "description": "Store and sales channel: `salesChannel` is where the order was placed - `online`, `pos`, `app`, `phone`, `marketplace` or `other` (any letter case; any other value is a 400). Left out, a new order is `online` and an existing one keeps its channel. `storeId` (up to 100 characters) is your own id for the store the order belongs to and `storeName` (up to 255) its display name; the Orders page Store filter and the \"Bought in store\" segment condition match `storeId`. `api` is reserved for orders that name no store: a `storeId` of `api` is refused with a 400. An order id that a store connected to the workspace already holds cannot be moved to your `storeId`: that upsert is refused with a 409 (`code: order_owned_by_connected_store`) - leave `storeId` out to update the order. Order events carry them as `sales_channel` and `store_id`.\n\nOrder number: `orderNumber` (optional, up to 64 characters) is the number your customers and staff see when it is not `orderId` - e.g. `1001` for an order whose id is `5123456789012`. The Orders page shows it and order responses return it as `orderNumber`; `orderId` stays the key."
          }
        },
        {
          "name": "Update Order by Your Order ID",
          "description": "Update an order using YOUR order identifier - the same key Get Order by Your Order ID reads by. This is the usual operation after creating one: status changes, fulfilment, refunds. An orderId with no matching record answers 404, matching the GET.",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"status\": \"fulfilled\",\n  \"total\": 89.97,\n  \"currency\": \"USD\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/orders/by-order-id/:orderId",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "orders",
                "by-order-id",
                ":orderId"
              ],
              "variable": [
                {
                  "key": "orderId",
                  "value": "ORD-2024-001",
                  "description": "Your order identifier"
                }
              ]
            },
            "description": "Updates the order you identify by your own `orderId`. `orderNumber` (optional, up to 64 characters) is the number your customers and staff see when it is not `orderId` - e.g. `1001` for an order whose id is `5123456789012`. The Orders page shows it and order responses return it as `orderNumber`; `orderId` stays the key."
          }
        },
        {
          "name": "Get User Orders",
          "description": "Get all orders for a specific user",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/orders/user/:userId?limit=50",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "orders",
                "user",
                ":userId"
              ],
              "variable": [
                {
                  "key": "userId",
                  "value": "user-123"
                }
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "50"
                }
              ]
            }
          }
        },
        {
          "name": "Fulfill Order",
          "description": "Mark order as shipped with tracking info",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"trackingNumber\": \"1Z999AA10123456784\",\n  \"carrier\": \"UPS\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/orders/:id/fulfill",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "orders",
                ":id",
                "fulfill"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "665f1e2a9b3c4d5e6f7a8b9c"
                }
              ]
            }
          }
        },
        {
          "name": "Cancel Order",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"reason\": \"Customer requested cancellation\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/orders/:id/cancel",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "orders",
                ":id",
                "cancel"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "665f1e2a9b3c4d5e6f7a8b9c"
                }
              ]
            }
          },
          "description": "Cancel the order. Emits one `Order Cancelled` event (properties `order_id`, `total`, `currency`, `reason`, `cancelled_at`); cancelling an order that is already cancelled emits nothing."
        },
        {
          "name": "Refund Order",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"refundAmount\": 29.99,\n  \"reason\": \"Product defective\",\n  \"partial\": true\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/orders/:id/refund",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "orders",
                ":id",
                "refund"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "665f1e2a9b3c4d5e6f7a8b9c"
                }
              ]
            }
          },
          "description": "Record a refund: `refundAmount` (order currency, default the order total) is added to the order's refunded amount and nets out of revenue. Emits one `Order Refunded` event for the new amount (`total`, `refund_type` full or partial, `reason`); each call is a new refund, so for refunds made in your store prefer Upsert Order with `refunds` (keyed by your refund id)."
        },
        {
          "name": "Get Order Stats",
          "request": {
            "method": "GET",
            "description": "Revenue and order counts for a date range (a date-only value is a whole day in the workspace timezone). totalRevenue, totalOrders, averageOrderValue and customers count the same orders, revenue orders: an order sent through the Orders API counts unless it is cancelled, refunded or sent with paymentStatus: unpaid, whatever its status; an order from a connected store (Shopify, WooCommerce, Magento, PrestaShop) counts once the store reports it paid. Orders waiting for payment are reported apart in pendingOrders / pendingRevenue, cancelled and fully refunded ones in excludedOrders; ordersByStatus lists every order. Amounts are net of refunds, in currency (the workspace reporting currency).",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/orders/stats?startDate=2024-01-01&endDate=2024-01-31",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "orders",
                "stats"
              ],
              "query": [
                {
                  "key": "startDate",
                  "value": "2024-01-01"
                },
                {
                  "key": "endDate",
                  "value": "2024-01-31"
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "E-Commerce - Carts",
      "description": "Cart tracking for abandoned cart recovery campaigns.",
      "item": [
        {
          "name": "Update Cart",
          "description": "Track or update a user's cart. `value` is the cart total as you count it (it can include shipping and tax); `subtotal` (optional) is the items subtotal before shipping and tax, computed from the items when left out - it is the cart's value on E-Commerce -> Carts and in the Cart value segment filter.",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"userId\": \"user-123\",\n  \"items\": [\n    {\n      \"productId\": \"SKU-12345\",\n      \"name\": \"Blue T-Shirt\",\n      \"price\": 29.99,\n      \"quantity\": 2,\n      \"total\": 59.98,\n      \"imageUrl\": \"https://example.com/image.jpg\"\n    }\n  ],\n  \"value\": 59.98,\n  \"subtotal\": 59.98,\n  \"currency\": \"USD\",\n  \"checkoutUrl\": \"https://store.example.com/checkout?cart=abc123\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/carts",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "carts"
              ]
            }
          }
        },
        {
          "name": "Add to Cart",
          "description": "Add an item to a user's cart",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"userId\": \"user-123\",\n  \"item\": {\n    \"productId\": \"SKU-12345\",\n    \"name\": \"Blue T-Shirt\",\n    \"price\": 29.99,\n    \"quantity\": 1,\n    \"total\": 29.99\n  }\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/carts/add",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "carts",
                "add"
              ]
            }
          }
        },
        {
          "name": "Remove from Cart",
          "description": "Remove an item from a user's cart",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"userId\": \"user-123\",\n  \"productId\": \"SKU-12345\",\n  \"quantity\": 1\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/carts/remove",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "carts",
                "remove"
              ]
            }
          }
        },
        {
          "name": "Get User Cart",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/carts/user/:userId",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "carts",
                "user",
                ":userId"
              ],
              "variable": [
                {
                  "key": "userId",
                  "value": "user-123"
                }
              ]
            }
          }
        },
        {
          "name": "Clear Cart",
          "description": "Clear a user's cart (after purchase or manual clear)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"userId\": \"user-123\",\n  \"reason\": \"purchased\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/carts/clear",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "carts",
                "clear"
              ]
            }
          }
        },
        {
          "name": "Get Abandoned Carts",
          "description": "List abandoned carts for recovery campaigns",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/carts/abandoned?limit=50",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "carts",
                "abandoned"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "50"
                },
                {
                  "key": "minValue",
                  "value": "50",
                  "disabled": true
                },
                {
                  "key": "abandonedMinutesAgo",
                  "value": "60",
                  "disabled": true
                }
              ]
            }
          }
        },
        {
          "name": "Mark Cart Recovered",
          "description": "Mark abandoned cart as recovered (after purchase)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"userId\": \"user-123\",\n  \"orderId\": \"ORD-2024-001\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/carts/recovered",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "carts",
                "recovered"
              ]
            }
          }
        },
        {
          "name": "Get Cart Stats",
          "description": "Get cart and abandonment statistics",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/carts/stats",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "carts",
                "stats"
              ]
            }
          }
        }
      ]
    },
    {
      "name": "E-Commerce - RFM Analysis",
      "description": "RFM (Recency, Frequency, Monetary) customer segmentation analysis.",
      "item": [
        {
          "name": "Get User RFM Data",
          "description": "Get RFM scores and segment for a specific user",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/rfm/user/:userId",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "rfm",
                "user",
                ":userId"
              ],
              "variable": [
                {
                  "key": "userId",
                  "value": "user-123"
                }
              ]
            },
            "description": "RFM scores, segment and e-commerce attributes for one person. `:userId` is the internal user id or the external id your app identifies the person with; an unknown id returns 404."
          }
        },
        {
          "name": "Get RFM Distribution",
          "description": "Get customer distribution across RFM segments",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/rfm/distribution",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "rfm",
                "distribution"
              ]
            }
          }
        },
        {
          "name": "Get RFM Segments",
          "description": "Get list of all RFM segments with descriptions",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/rfm/segments",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "rfm",
                "segments"
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Segments",
      "item": [
        {
          "name": "Delete Segment (only if unreferenced)",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/segments/:segmentId",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "segments",
                ":segmentId"
              ],
              "variable": [
                {
                  "key": "segmentId",
                  "value": "seg_123"
                }
              ]
            },
            "description": "Hard-delete a segment that nothing references. Returns 409 naming the campaigns, journeys, in-app campaigns or other segments still using it - archive those instead. Archive remains the default: it stops the segment appearing in pickers and membership lookups while everything already pointing at it keeps working."
          }
        },
        {
          "name": "Create Segment",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Premium Users\",\n  \"description\": \"Users on premium plan with at least 3 orders in the last 90 days\",\n  \"filterGroups\": [\n    {\n      \"filters\": [\n        {\n          \"type\": \"attribute\",\n          \"field\": \"plan\",\n          \"operator\": \"equals\",\n          \"value\": \"premium\"\n        },\n        {\n          \"type\": \"ecommerce\",\n          \"operator\": \"total_orders_gte\",\n          \"value\": 3,\n          \"orderRange\": { \"kind\": \"days\", \"days\": 90 }\n        }\n      ],\n      \"operator\": \"AND\"\n    }\n  ],\n  \"groupOperator\": \"AND\",\n  \"includeCrawlers\": false\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/segments",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "segments"
              ]
            },
            "description": "Create a segment. Audience is defined by `filterGroups` (each group = { filters: [...], operator: 'AND'|'OR' }, max 20 groups of 50 filters) combined by the required `groupOperator`; optional `excludeFilterGroups` subtracts matches; `includeCrawlers` (default false) counts crawler/bot profiles as members. Filter `type` values include attribute, event, segment, subscription, entity, rfm, and more. An `ecommerce` `total_orders_<op>` / `total_spent_<op>` filter (op = gte, lte, gt, lt, eq) compares the lifetime figure, or - with `orderRange` ({ kind: 'days', days: 1-3650 } or { kind: 'between', from, to? }, ISO 8601) - only the orders placed in that range (cancelled and fully refunded orders never count; spent = paid orders net of refunds, in the reporting currency). withinDays / startDate / endDate are not read on these operators."
          }
        },
        {
          "name": "Get All Segments",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/segments",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "segments"
              ]
            }
          }
        },
        {
          "name": "Get Segment Size",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/segments/:segmentId/size",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "segments",
                ":segmentId",
                "size"
              ],
              "variable": [
                {
                  "key": "segmentId",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "List Materialized Segments (organization)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/segments/materialization/usage",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "segments",
                "materialization",
                "usage"
              ]
            },
            "description": "The organization's allowance, how much of it is spent, and which segments spent it - across every workspace, which no workspace-scoped view can show. Each row carries when its membership was last rebuilt and why the last rebuild failed, if it did."
          }
        },
        {
          "name": "Get Segment Materialization",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/segments/:segmentId/materialization",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "segments",
                ":segmentId",
                "materialization"
              ],
              "variable": [
                {
                  "key": "segmentId",
                  "value": ""
                }
              ]
            },
            "description": "Whether this segment keeps a precomputed membership, when it was last rebuilt, how many members it holds, and how much of the organization's allowance is in use."
          }
        },
        {
          "name": "Enable Segment Materialization",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/segments/:segmentId/materialization",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "segments",
                ":segmentId",
                "materialization"
              ],
              "variable": [
                {
                  "key": "segmentId",
                  "value": ""
                }
              ]
            },
            "description": "Keep this segment's membership precomputed so reports can analyse the whole segment at any size instead of a random sample of it. The first build runs immediately; after that it rebuilds nightly. Spends one of the organization's slots (default 20, shared across its workspaces); when none are free it returns 400 naming the segments already using them."
          }
        },
        {
          "name": "Disable Segment Materialization",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/segments/:segmentId/materialization",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "segments",
                ":segmentId",
                "materialization"
              ],
              "variable": [
                {
                  "key": "segmentId",
                  "value": ""
                }
              ]
            },
            "description": "Stop precomputing this segment and delete its stored membership, freeing the slot for another segment."
          }
        },
        {
          "name": "Rebuild Segment Materialization",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/segments/:segmentId/materialization/refresh",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "segments",
                ":segmentId",
                "materialization",
                "refresh"
              ],
              "variable": [
                {
                  "key": "segmentId",
                  "value": ""
                }
              ]
            },
            "description": "Rebuild this segment's membership now rather than waiting for the nightly run. Membership is recomputed whole, so people who no longer qualify are removed as well as new ones added."
          }
        }
      ]
    },
    {
      "name": "E-Commerce Integrations",
      "description": "Connect and manage a store. Shopify, WooCommerce, Magento and PrestaShop (early access) each expose the same shape: read the connection, start OAuth, change settings, trigger a sync, disconnect.",
      "item": [
        {
          "name": "Get Shopify Connection",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "The current Shopify connection for this workspace, or null. Includes storefrontTracking: the Web Pixel status, scopes the store still has to approve, whether the legacy script tag is installed, and the theme editor link for the app embed.",
            "url": {
              "raw": "{{baseUrl}}/integrations/shopify",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "integrations",
                "shopify"
              ]
            }
          }
        },
        {
          "name": "Start Shopify OAuth",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "Returns the URL to send the merchant to. Requires integrations:write.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"shopDomain\": \"example.myshopify.com\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/integrations/shopify/oauth/initiate",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "integrations",
                "shopify",
                "oauth",
                "initiate"
              ]
            }
          }
        },
        {
          "name": "Resolve Shopify App Launch",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "The dashboard's Shopify page posts the query Shopify appended when the merchant opened or installed the app (App URL). Verifies Shopify's HMAC and freshness (one hour), then says whether the store is connected to this workspace (connected_here), to another workspace of this organization (connected_elsewhere, with its workspaceId) or not at all (not_connected - offer to connect; never automatic). 400 when the query is unsigned, forged or expired. Requires integrations:read.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"query\": {\n    \"shop\": \"example.myshopify.com\",\n    \"host\": \"YWRtaW4uc2hvcGlmeS5jb20vc3RvcmUvZXhhbXBsZQ\",\n    \"timestamp\": \"1760000000\",\n    \"hmac\": \"<hex hmac from Shopify>\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/integrations/shopify/app-launch",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "integrations",
                "shopify",
                "app-launch"
              ]
            }
          }
        },
        {
          "name": "Set Store Checkout Re-subscribe",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "Turn the store connection's \"Let checkout opt-ins re-subscribe people who unsubscribed\" setting on or off (`:platform` = shopify, woocommerce, magento or prestashop). Off by default. When on, a checkout or customer-record opt-in from that store - guest checkouts included - dated after the contact's latest unsubscribe re-subscribes that contact; never past a spam complaint, hard bounce, SMS STOP (only a double opt-in confirmation), organization-wide block or another contact's opt-out. Audit-logged. Requires settings:write. The same route also takes the checkout opt-in safeguards (WooCommerce / Magento \"Record consent immediately\", PrestaShop checkout newsletter box) - see Set Store Checkout Opt-in Safeguards.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"checkoutResubscribe\": true\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/integrations/shopify/consent-settings",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "integrations",
                "shopify",
                "consent-settings"
              ]
            }
          }
        },
        {
          "name": "Set Store Checkout Opt-in Safeguards",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "WooCommerce, Magento and PrestaShop (`:platform` = woocommerce, magento or prestashop; 400 for Shopify). The \"Record consent immediately\" safeguards, and for PrestaShop (module 1.2.8+) the checkout newsletter box, which always arrives before the order (D236): `checkoutConsentConfirmEmail` - email a new guest whose checkout tick arrived before an order a double opt-in confirmation link (off by default: the address was typed at checkout and is unverified); `checkoutConsentTickLimit` - checkout opt-in ticks accepted per shopper IP, per checkout and per email address per hour, 1-100 (default 3; over it a tick is ignored). `newShopperOptIns` - \"Opt-ins from new shoppers (not yet buyers)\": `hold` (default) or `immediate`; governs every opt-in that arrives without an order from someone the workspace does not know yet (a checkout tick sent before the order, and a registration, account-page, newsletter or customer-sync opt-in). Send any of them; `checkoutResubscribe` may be sent in the same body. With `hold`, an opt-in with no order counts at once only for a known buyer or subscriber (or the store's own confirmed double opt-in); anyone else is held as pending until their order or the confirmation link. With `immediate` it counts at once (less strict - any visitor can enter any email). Unsubscribes always apply at once; the tick limit stays in force. Audit-logged. Requires settings:write.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"checkoutConsentConfirmEmail\": false,\n  \"checkoutConsentTickLimit\": 3,\n  \"newShopperOptIns\": \"hold\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/integrations/magento/consent-settings",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "integrations",
                "magento",
                "consent-settings"
              ]
            }
          }
        },
        {
          "name": "Set Shopify Visitor Identity",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "\"Recognise visitors by the email they type\" for the workspace's Shopify store (on by default). On: an email typed at checkout or in a form identifies the browser to the contact with that email (the oldest one, or a new contact) and the visitor's history joins it - anyone who types someone else's email is recognised as them in that browser. Off (strict identity): a typed email never identifies the browser; only a signed-in customer does, and a guest's email reaches Joryio with the order. Shopify only (`:platform` = shopify): WooCommerce, Magento and PrestaShop set it in their plugin and report it (400 here); every store's current value is `visitorIdentity` on GET /integrations/:platform. Audit-logged. Requires settings:write.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"identifyByTypedEmail\": false\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/integrations/shopify/visitor-identity",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "integrations",
                "shopify",
                "visitor-identity"
              ]
            }
          }
        },
        {
          "name": "Get Storefront Identity Requirement",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "\"Require the storefront identity token\" for the workspace (off by default). A signed-in store customer's browser carries a short-lived identity token Joryio signs from the store's verified customer proof (WordPress plugin 1.6.42, Magento 1.4.30, PrestaShop 1.2.23). On: an anonymous SDK request whose visitor id resolves to a store customer's contact counts as that customer only with a valid token - without one, an in-app form is handled as a new visitor's and a re-subscribe after an opt-out is refused. Plain anonymous tracking and every withdrawal or unsubscribe are never blocked. `tokensAvailable` is false when this server has no signing key (turning it on would leave every customer unverified). Requires settings:read.",
            "url": {
              "raw": "{{baseUrl}}/integrations/storefront-identity",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "integrations",
                "storefront-identity"
              ]
            }
          }
        },
        {
          "name": "Set Storefront Identity Requirement",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "\"Require the storefront identity token\" for the workspace (off by default). A signed-in store customer's browser carries a short-lived identity token Joryio signs from the store's verified customer proof (WordPress plugin 1.6.42, Magento 1.4.30, PrestaShop 1.2.23). On: an anonymous SDK request whose visitor id resolves to a store customer's contact counts as that customer only with a valid token - without one, an in-app form is handled as a new visitor's and a re-subscribe after an opt-out is refused. Plain anonymous tracking and every withdrawal or unsubscribe are never blocked. `tokensAvailable` is false when this server has no signing key (turning it on would leave every customer unverified). Audit-logged. Requires settings:write.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"required\": true\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/integrations/storefront-identity",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "integrations",
                "storefront-identity"
              ]
            }
          }
        },
        {
          "name": "Update Shopify Settings",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "Change what is synced and how.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"syncCustomers\": true,\n  \"syncOrders\": true\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/integrations/shopify/settings",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "integrations",
                "shopify",
                "settings"
              ]
            }
          }
        },
        {
          "name": "Trigger Shopify Sync",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "Kick off a sync run now rather than waiting for the schedule.",
            "url": {
              "raw": "{{baseUrl}}/integrations/shopify/sync",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "integrations",
                "shopify",
                "sync"
              ]
            }
          }
        },
        {
          "name": "Re-register Shopify Storefront Tracking",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "Activates (or refreshes) the Joryio Web Pixel on the store - storefront and checkout events - and writes the settings the Joryio theme app embed reads; removes the legacy script tag once the pixel is active. Idempotent. Requires integrations:write. Returns the storefront tracking state: pixel.status is active, needs_scopes (the store must approve write_pixels and read_customer_events by running Start Shopify OAuth again), error (pixel.error says why) or not_registered; also missingScopes, legacyScriptTag and appEmbed.themeEditorUrl. The same object is returned as storefrontTracking by Get Shopify Connection.",
            "url": {
              "raw": "{{baseUrl}}/integrations/shopify/storefront-tracking",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "integrations",
                "shopify",
                "storefront-tracking"
              ]
            }
          }
        },
        {
          "name": "Disconnect Shopify",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "Removes the connection. Syncs that read through it are disabled - they are not silently left pointing at nothing.",
            "url": {
              "raw": "{{baseUrl}}/integrations/shopify",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "integrations",
                "shopify"
              ]
            }
          }
        },
        {
          "name": "Get PrestaShop Connection",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "The workspace's PrestaShop connection (early access, stage 1): connected, status, storeName, storeUrl, shopId (the PrestaShop id_shop), workspaceId, prestashopVersion, moduleVersion, syncSettings, syncStats, lastSyncAt, checkoutResubscribe. One shop per workspace - a multistore install connects each shop to its own workspace. Never returns the module key or the Webservice key. Requires integrations:read.",
            "url": {
              "raw": "{{baseUrl}}/integrations/prestashop",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "integrations",
                "prestashop"
              ]
            }
          }
        },
        {
          "name": "Get PrestaShop Module Key",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "The workspace's jry_ps_ key (created on first call) that the merchant pastes into the Joryio PrestaShop module. Refused for a demo organization unless staff opened it. Requires integrations:write.",
            "url": {
              "raw": "{{baseUrl}}/integrations/prestashop/api-key",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "integrations",
                "prestashop",
                "api-key"
              ]
            }
          }
        },
        {
          "name": "Update PrestaShop Settings",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "Change what is synced (syncProducts, syncCustomers, syncOrders, syncCarts, historicalDays). Requires integrations:write.",
            "url": {
              "raw": "{{baseUrl}}/integrations/prestashop/settings",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "integrations",
                "prestashop",
                "settings"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"syncCarts\": true,\n  \"historicalDays\": 180\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Trigger PrestaShop Sync",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "Start a sync through the PrestaShop Webservice now. type: full (default), delta (products, customers and orders changed since the last clean sync), products, customers, orders or carts (open carts of the last 24 hours). Returns immediately; progress shows in syncStats. Requires integrations:write.",
            "url": {
              "raw": "{{baseUrl}}/integrations/prestashop/sync",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "integrations",
                "prestashop",
                "sync"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"type\": \"delta\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Disconnect PrestaShop",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "Disconnects the shop: the module key is revoked (the module stops sending on its next 401) and the Webservice key Joryio held is dropped. The module deletes its Webservice key in PrestaShop when the merchant clicks Disconnect there or uninstalls it. Requires integrations:write.",
            "url": {
              "raw": "{{baseUrl}}/integrations/prestashop",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "integrations",
                "prestashop"
              ]
            }
          }
        },
        {
          "name": "List WordPress Connections",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "Every WordPress connection of the workspace, main one first: id, label, language, kind (site/store), isPrimary, status, store URL, the site's appId, whether it has a key, and when its last event arrived. Several WordPress sites can connect to one workspace (BACKLOG D381); the routes without an id act on the main connection. Never returns a key.",
            "url": {
              "raw": "{{baseUrl}}/integrations/woocommerce/connections",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "integrations",
                "woocommerce",
                "connections"
              ]
            }
          }
        },
        {
          "name": "Add WordPress Site",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "description": "Add another WordPress site to the workspace: a new connection with its own plugin key, returned in full this once (`apiKey`, `isNew: true`). label and language (a code such as he or en) are optional. The workspace's first connection becomes its main one; later ones connect without WooCommerce (one store per workspace). Up to 50 per workspace. Requires integrations:write.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"label\": \"English site\",\n  \"language\": \"en\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/integrations/woocommerce/connections",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "integrations",
                "woocommerce",
                "connections"
              ]
            }
          }
        },
        {
          "name": "Get WordPress Connection",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "One connection of the workspace with its settings (syncSettings, checkoutResubscribe, visitorIdentity, checkout opt-in safeguards). 404 for an id that is not this workspace's, 400 for a malformed one.",
            "url": {
              "raw": "{{baseUrl}}/integrations/woocommerce/connections/{{connectionId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "integrations",
                "woocommerce",
                "connections",
                "{{connectionId}}"
              ]
            }
          }
        },
        {
          "name": "Update WordPress Connection",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "description": "Rename a connection or set its language. Requires integrations:write.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"label\": \"Hebrew site 2\",\n  \"language\": \"he\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/integrations/woocommerce/connections/{{connectionId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "integrations",
                "woocommerce",
                "connections",
                "{{connectionId}}"
              ]
            }
          }
        },
        {
          "name": "Get WordPress Connection API Key",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "The connection's plugin key (jry_wc_...) - the same key every time until a disconnect revokes it, then a new one. Requires integrations:write.",
            "url": {
              "raw": "{{baseUrl}}/integrations/woocommerce/connections/{{connectionId}}/api-key",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "integrations",
                "woocommerce",
                "connections",
                "{{connectionId}}",
                "api-key"
              ]
            }
          }
        },
        {
          "name": "Disconnect WordPress Connection",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "Disconnect ONE site and revoke its key; the workspace's other sites stay connected. Requires integrations:write.",
            "url": {
              "raw": "{{baseUrl}}/integrations/woocommerce/connections/{{connectionId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "integrations",
                "woocommerce",
                "connections",
                "{{connectionId}}"
              ]
            }
          }
        },
        {
          "name": "Update WordPress Connection Sync Settings",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "description": "Sync settings of one connection (a store's; a site without WooCommerce has nothing to sync). Requires integrations:write.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"syncProducts\": true,\n  \"historicalDays\": 90\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/integrations/woocommerce/connections/{{connectionId}}/settings",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "integrations",
                "woocommerce",
                "connections",
                "{{connectionId}}",
                "settings"
              ]
            }
          }
        },
        {
          "name": "Set WordPress Connection Consent Settings",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "description": "Checkout consent settings of one connection - the same fields as Set Store Checkout Re-subscribe. Consent and unsubscribes stay workspace-wide. Audit-logged. Requires settings:write.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"checkoutResubscribe\": false,\n  \"newShopperOptIns\": \"hold\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/integrations/woocommerce/connections/{{connectionId}}/consent-settings",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "integrations",
                "woocommerce",
                "connections",
                "{{connectionId}}",
                "consent-settings"
              ]
            }
          }
        },
        {
          "name": "Trigger WordPress Connection Sync",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "description": "Start a sync of one store connection (type: full, products, orders or customers). A site without WooCommerce gets 400. Requires integrations:write.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"type\": \"full\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/integrations/woocommerce/connections/{{connectionId}}/sync",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "integrations",
                "woocommerce",
                "connections",
                "{{connectionId}}",
                "sync"
              ]
            }
          }
        },
        {
          "name": "Remove WordPress Connection",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "Remove a DISCONNECTED added WordPress site for good (the row and its revoked key). The main connection, or a site still holding a key, gets 400 - disconnect it first with Disconnect WordPress Connection. Audit-logged. Requires integrations:write.",
            "url": {
              "raw": "{{baseUrl}}/integrations/woocommerce/connections/{{connectionId}}/remove",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "integrations",
                "woocommerce",
                "connections",
                "{{connectionId}}",
                "remove"
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Integrations",
      "item": [
        {
          "name": "Get Integration Status",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "Every integration on the Integrations page with its live status for the API key's workspace - the same status the dashboard cards show, resolved on the server with the same rule as everywhere Joryio reports connected channels and stores. Read-only; requires the `integrations:read` permission.\n\nEach entry: `id` (the integration, e.g. `whatsapp`, `meta_ads`, `shopify`, `snowflake`), `status` (`connected` | `not_connected` | `action_needed` | `error` | `coming_soon`), `connected` (at least one live connection - a store whose last sync failed is still connected, with `status` `error`) `count` (connected accounts / data streams / stores, where countable; absent for WhatsApp), and for the stores (Shopify, WooCommerce, Magento, PrestaShop) `syncing` (`true` while a full sync runs - the first one after a connect, a reconnect or a manual sync; `status` stays `connected`, and the dashboard card reads \"Connected - syncing\") with `syncProgress` (`products` / `customers` / `orders` imported so far in that sync, each present once its step has finished). No credentials, account names, numbers or error texts.",
            "url": {
              "raw": "{{baseUrl}}/integrations-hub/status",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "integrations-hub",
                "status"
              ]
            }
          },
          "response": [
            {
              "name": "200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [
                  {
                    "key": "Authorization",
                    "value": "Bearer {{token}}"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/integrations-hub/status",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "integrations-hub",
                    "status"
                  ]
                }
              },
              "status": "OK",
              "code": 200,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"integrations\": [\n    {\n      \"id\": \"whatsapp\",\n      \"status\": \"connected\",\n      \"connected\": true\n    },\n    {\n      \"id\": \"delivyr\",\n      \"status\": \"not_connected\",\n      \"connected\": false,\n      \"count\": 0\n    },\n    {\n      \"id\": \"meta_ads\",\n      \"status\": \"error\",\n      \"connected\": true,\n      \"count\": 2\n    },\n    {\n      \"id\": \"shopify\",\n      \"status\": \"connected\",\n      \"connected\": true,\n      \"count\": 1,\n      \"syncing\": true,\n      \"syncProgress\": {\n        \"products\": 120,\n        \"customers\": 45\n      }\n    },\n    {\n      \"id\": \"snowflake\",\n      \"status\": \"connected\",\n      \"connected\": true,\n      \"count\": 1\n    },\n    {\n      \"id\": \"segment\",\n      \"status\": \"coming_soon\",\n      \"connected\": false\n    }\n  ]\n}"
            }
          ]
        }
      ]
    },
    {
      "name": "WhatsApp",
      "description": "WhatsApp Business accounts, their senders, and the message templates Meta must approve before you can send them.",
      "item": [
        {
          "name": "List Accounts",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "Every connected WhatsApp Business account in this workspace.",
            "url": {
              "raw": "{{baseUrl}}/whatsapp/accounts",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "whatsapp",
                "accounts"
              ]
            }
          }
        },
        {
          "name": "Get Account",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "One account, including which senders it carries.",
            "url": {
              "raw": "{{baseUrl}}/whatsapp/accounts/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "whatsapp",
                "accounts",
                ":id"
              ]
            }
          }
        },
        {
          "name": "Update Account",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "description": "Update a connected WhatsApp account: name, display name, default flag, provider credentials, or `markInboundRead` - mark the person's message as read and show \"typing...\" before a journey's session reply (off by default; Meta Cloud, and Infobip read receipts only). `optInKeywords` sets the keywords a wa.me opt-in link / QR code prefills (replaces the list; at most 20, up to 40 characters, never a STOP / START word), each with an optional `note` on where you use it (up to 80 characters, e.g. \"Instagram bio\"), kept with the consent evidence. The older `source` (`wa_link` / `qr`) is still accepted and becomes the note \"Link\" / \"QR code\" when no note is sent; it is not stored.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Main WABA\",\n  \"markInboundRead\": true,\n  \"optInKeywords\": [\n    { \"keyword\": \"JOIN SUMMER\", \"note\": \"Store poster\" },\n    { \"keyword\": \"JOIN BIO\", \"note\": \"Instagram bio\" }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/whatsapp/accounts/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "whatsapp",
                "accounts",
                ":id"
              ]
            }
          }
        },
        {
          "name": "Opt-in Link and QR Code",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "A wa.me link and its QR code (SVG + PNG data URL) for one of the account's opt-in keywords (`optInKeywords`, set with PUT /whatsapp/accounts/:id). The response carries the keyword's `note`. When a person sends the keyword, WhatsApp opt-in consent is recorded for them (source whatsapp_link_keyword - a QR code is the same link - with the keyword, its note and the time), scoped to the receiving number's subscription group. 400 for a keyword that is not set. Optional senderId picks one of the account's numbers.",
            "url": {
              "raw": "{{baseUrl}}/whatsapp/accounts/:id/opt-in-link?keyword=JOIN%20SUMMER",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "whatsapp",
                "accounts",
                ":id",
                "opt-in-link"
              ],
              "query": [
                {
                  "key": "keyword",
                  "value": "JOIN%20SUMMER"
                },
                {
                  "key": "senderId",
                  "value": "",
                  "disabled": true
                }
              ],
              "variable": [
                {
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "Account Token Health",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "Whether the stored access token still works. A silently expired token looks identical to a quiet audience.",
            "url": {
              "raw": "{{baseUrl}}/whatsapp/accounts/:id/token-health",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "whatsapp",
                "accounts",
                ":id",
                "token-health"
              ]
            }
          }
        },
        {
          "name": "Create Account",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "Connect an account by credentials.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Main WABA\",\n  \"phoneNumberId\": \"\",\n  \"wabaId\": \"\",\n  \"accessToken\": \"\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/whatsapp/accounts",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "whatsapp",
                "accounts"
              ]
            }
          }
        },
        {
          "name": "Delete Account",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "Disconnect. Campaigns using its senders stop rather than silently falling back to another account.",
            "url": {
              "raw": "{{baseUrl}}/whatsapp/accounts/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "whatsapp",
                "accounts",
                ":id"
              ]
            }
          }
        },
        {
          "name": "Get Catalog Setup",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "How a WhatsApp account gets its Meta catalog: `{ enabled, link }`. `link` is null when none is set up; otherwise it has the `mode` ('existing' = the business's own catalog, read and never written; 'managed' = Joryio pushes the workspace's products), the Meta `catalogId`, `status`, `lastError`, `lastSyncAt` and `counts` (managed: synced / pending / errors / skipped; existing: matched / unmatched / productsMatched, out of `products`). Needs `whatsapp:read`. Needs a WhatsApp account connected through the Meta Cloud API and Meta's `catalog_management` permission on its token. While the catalog is not enabled for your organization (it is in beta and available on request) every catalog route answers 404 `whatsapp_catalog_disabled` (except Get Catalog Setup, which answers `enabled: false`).",
            "url": {
              "raw": "{{baseUrl}}/whatsapp/catalog?accountId=<whatsapp account id>",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "whatsapp",
                "catalog"
              ],
              "query": [
                {
                  "key": "accountId",
                  "value": "<whatsapp account id>"
                }
              ]
            }
          }
        },
        {
          "name": "List Available Catalogs",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "The Meta catalogs the account's business owns or was given (`access`: owned / client), with `productCount`, `feedCount` and whether the WhatsApp account already uses it (`connectedToAccount`). `suggestedMode` is 'existing' when one of them has products - a store that already feeds Meta should not be synced again. Needs `whatsapp:read`. Needs a WhatsApp account connected through the Meta Cloud API and Meta's `catalog_management` permission on its token. While the catalog is not enabled for your organization (it is in beta and available on request) every catalog route answers 404 `whatsapp_catalog_disabled` (except Get Catalog Setup, which answers `enabled: false`).",
            "url": {
              "raw": "{{baseUrl}}/whatsapp/catalog/available?accountId=<whatsapp account id>",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "whatsapp",
                "catalog",
                "available"
              ],
              "query": [
                {
                  "key": "accountId",
                  "value": "<whatsapp account id>"
                }
              ]
            }
          }
        },
        {
          "name": "Set Up Catalog",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "description": "Choose how the WhatsApp account gets its catalog. `mode: existing` + `catalogId`: connect that catalog to the WhatsApp Business Account (if it is not) and read it; Joryio never writes items to it, and maps each item's retailer id to a product (by our product id, the store's product / variant id, SKU, known store-channel formats, product URL, GTIN). `mode: managed` + `catalogId` or `createName`: Joryio pushes every product of the workspace (variants grouped). A catalog that already has items from another source is refused with 409 `catalog_fed_by_other_source` unless `confirmOtherSource: true`. An account that already has a setup answers 409 `catalog_already_set_up` unless `replaceExisting: true` (switching mode is explicit; one mode per account). Needs `whatsapp:write`. Needs a WhatsApp account connected through the Meta Cloud API and Meta's `catalog_management` permission on its token. While the catalog is not enabled for your organization (it is in beta and available on request) every catalog route answers 404 `whatsapp_catalog_disabled` (except Get Catalog Setup, which answers `enabled: false`).",
            "url": {
              "raw": "{{baseUrl}}/whatsapp/catalog",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "whatsapp",
                "catalog"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"accountId\": \"<whatsapp account id>\",\n  \"mode\": \"existing\",\n  \"catalogId\": \"123456789012345\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Sync Catalog Now",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "description": "Queue a full pass now: managed sends every changed product (`retryErrors: true` also resends the items Meta refused); existing reads the whole catalog again and re-matches it. Changes to products are also synced on their own within about a minute, and every catalog is reconciled every 6 hours. Needs `whatsapp:write`. Needs a WhatsApp account connected through the Meta Cloud API and Meta's `catalog_management` permission on its token. While the catalog is not enabled for your organization (it is in beta and available on request) every catalog route answers 404 `whatsapp_catalog_disabled` (except Get Catalog Setup, which answers `enabled: false`).",
            "url": {
              "raw": "{{baseUrl}}/whatsapp/catalog/:id/sync",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "whatsapp",
                "catalog",
                ":id",
                "sync"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "<catalog setup id>"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"retryErrors\": false\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "List Catalog Items",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "The catalog's items, 50 a page (`limit` 1-200, `cursor` = the previous page's `nextCursor`). `filter`: 'unmatched' / 'matched' (existing mode) or 'error' / 'skipped' / 'pending' / 'synced' (managed). Each item has its `retailerId`, `productId` / `variantId` (the product it maps to), `matchRule`, `status` and, for errors and skips, `errorCode` / `errorMessage` (Meta's own words for a refused item). Needs `whatsapp:read`. Needs a WhatsApp account connected through the Meta Cloud API and Meta's `catalog_management` permission on its token. While the catalog is not enabled for your organization (it is in beta and available on request) every catalog route answers 404 `whatsapp_catalog_disabled` (except Get Catalog Setup, which answers `enabled: false`).",
            "url": {
              "raw": "{{baseUrl}}/whatsapp/catalog/:id/items?filter=unmatched&limit=50",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "whatsapp",
                "catalog",
                ":id",
                "items"
              ],
              "query": [
                {
                  "key": "filter",
                  "value": "unmatched"
                },
                {
                  "key": "limit",
                  "value": "50"
                }
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "<catalog setup id>"
                }
              ]
            }
          }
        },
        {
          "name": "Remove Catalog Setup",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "Stop using the catalog. Nothing is deleted in Meta: items Joryio pushed stay, and the catalog stays connected to the WhatsApp Business Account (disconnect it in WhatsApp Manager if it should go). Needs `whatsapp:write`. Needs a WhatsApp account connected through the Meta Cloud API and Meta's `catalog_management` permission on its token. While the catalog is not enabled for your organization (it is in beta and available on request) every catalog route answers 404 `whatsapp_catalog_disabled` (except Get Catalog Setup, which answers `enabled: false`).",
            "url": {
              "raw": "{{baseUrl}}/whatsapp/catalog/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "whatsapp",
                "catalog",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "<catalog setup id>"
                }
              ]
            }
          }
        },
        {
          "name": "Unpause Template",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "Ask Meta to lift a template pause. A template paused by template pacing stays paused until it is unpaused; a quality pause ends by itself (3 hours, then 6) and Meta may refuse to lift it early - its message is returned as a 400. Only a template whose status is `paused`. Returns the template, status `approved` once Meta accepts.",
            "url": {
              "raw": "{{baseUrl}}/whatsapp/templates/:id/unpause",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "whatsapp",
                "templates",
                ":id",
                "unpause"
              ]
            }
          }
        },
        {
          "name": "List Flows",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "WhatsApp Flows (static, no data endpoint) of the active workspace's WhatsApp accounts, newest first. Optional `accountId` narrows to one account. Each Flow carries its Meta id, status (`draft`, `published`, `deprecated`, `blocked`, `throttled`), Meta's `validationErrors` and `jsonVersion`, its `fields` (with the Joryio mapping of each answer) and `stats`: `sent`, `read` (WhatsApp read receipts - Meta reports no \"Flow opened\" for static Flows) and `completed`.",
            "url": {
              "raw": "{{baseUrl}}/whatsapp/flows?accountId={{whatsappAccountId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "whatsapp",
                "flows"
              ],
              "query": [
                {
                  "key": "accountId",
                  "value": "{{whatsappAccountId}}"
                }
              ]
            }
          }
        },
        {
          "name": "Flow Starters",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "The four starter Flows - `sign_up`, `preference_centre` (offers this workspace's public subscription lists that include WhatsApp), `lead_form`, `nps` - each a ready `definition` and Meta category to edit and send to Create Flow.",
            "url": {
              "raw": "{{baseUrl}}/whatsapp/flows/starters",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "whatsapp",
                "flows",
                "starters"
              ]
            }
          }
        },
        {
          "name": "Get Flow",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "One Flow with its fields, counts and Meta's preview link (`previewUrl`, when Meta returns one).",
            "url": {
              "raw": "{{baseUrl}}/whatsapp/flows/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "whatsapp",
                "flows",
                ":id"
              ]
            }
          }
        },
        {
          "name": "Create Flow",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "description": "Create a Flow on a Meta Cloud API WhatsApp account: Joryio creates it at Meta (`POST /{waba}/flows`), uploads the Flow JSON built from `definition` (Flow JSON 7.3) and returns the Flow with Meta's `validationErrors` (empty = valid). Send either `definition` (the builder: screens of fields - text, email, phone, number, textarea, dropdown, radio, checkbox, opt_in, date - each optionally mapped with `mapTo`: `{\"kind\":\"attribute\",\"key\":\"firstName\"}`, `{\"kind\":\"email\"}` (fills an empty contact email only), `{\"kind\":\"consent\",\"channels\":[\"whatsapp\"]}` on an opt_in (a ticked box subscribes with its label as the wording) or `{\"kind\":\"lists\"}` on a checkbox whose option ids are subscription list ids) or `flowJson` (Import Flow JSON: a static Flow, version 5.1-7.3) with `fieldMappings` keyed by the answer keys of its complete action. `categories`: SIGN_UP, SIGN_IN, APPOINTMENT_BOOKING, LEAD_GENERATION, CONTACT_US, CUSTOMER_SUPPORT, SURVEY, OTHER. Twilio and Infobip accounts have no Flows (400).",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"accountId\": \"{{whatsappAccountId}}\",\n  \"name\": \"Sign up\",\n  \"categories\": [\n    \"SIGN_UP\"\n  ],\n  \"starter\": \"sign_up\",\n  \"definition\": {\n    \"screens\": [\n      {\n        \"id\": \"SIGN_UP\",\n        \"title\": \"Join us\",\n        \"intro\": \"Get offers and news on WhatsApp.\",\n        \"submitLabel\": \"Sign up\",\n        \"fields\": [\n          {\n            \"name\": \"first_name\",\n            \"type\": \"text\",\n            \"label\": \"First name\",\n            \"required\": true,\n            \"mapTo\": {\n              \"kind\": \"attribute\",\n              \"key\": \"firstName\"\n            }\n          },\n          {\n            \"name\": \"email\",\n            \"type\": \"email\",\n            \"label\": \"Email\",\n            \"mapTo\": {\n              \"kind\": \"email\"\n            }\n          },\n          {\n            \"name\": \"marketing_opt_in\",\n            \"type\": \"opt_in\",\n            \"label\": \"Yes, send me offers and news on WhatsApp. I can reply STOP at any time.\",\n            \"required\": true,\n            \"mapTo\": {\n              \"kind\": \"consent\",\n              \"channels\": [\n                \"whatsapp\"\n              ]\n            }\n          }\n        ]\n      }\n    ]\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/whatsapp/flows",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "whatsapp",
                "flows"
              ]
            }
          }
        },
        {
          "name": "Update Flow",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "description": "Change a draft Flow: `name`, `categories`, `definition` or `flowJson` (re-uploaded; Meta's `validationErrors` returned). A published Flow cannot change at Meta; only an imported Flow's `fieldMappings` can still change.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Sign up - spring\",\n  \"categories\": [\n    \"SIGN_UP\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/whatsapp/flows/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "whatsapp",
                "flows",
                ":id"
              ]
            }
          }
        },
        {
          "name": "Publish Flow",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "Publish a draft Flow at Meta. Refused while Meta reports validation errors. Only a published Flow can be sent (a session Flow message or a template's FLOW button).",
            "url": {
              "raw": "{{baseUrl}}/whatsapp/flows/:id/publish",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "whatsapp",
                "flows",
                ":id",
                "publish"
              ]
            }
          }
        },
        {
          "name": "Deprecate Flow",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "Deprecate a published Flow at Meta: it can no longer be sent; answers to messages already sent still arrive.",
            "url": {
              "raw": "{{baseUrl}}/whatsapp/flows/:id/deprecate",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "whatsapp",
                "flows",
                ":id",
                "deprecate"
              ]
            }
          }
        },
        {
          "name": "Sync Flows from Meta",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "description": "Pull the account's Flows from Meta: refresh status and name, and add a row (with its Flow JSON when Meta offers a download) for each Flow made in Meta's tools, so its answers can be mapped with Update Flow `fieldMappings`.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"accountId\": \"{{whatsappAccountId}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/whatsapp/flows/sync",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "whatsapp",
                "flows",
                "sync"
              ]
            }
          }
        },
        {
          "name": "Delete Flow",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "Delete a draft Flow (at Meta too), or remove a deprecated one from Joryio (Meta keeps it). A published Flow must be deprecated first.",
            "url": {
              "raw": "{{baseUrl}}/whatsapp/flows/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "whatsapp",
                "flows",
                ":id"
              ]
            }
          }
        },
        {
          "name": "Send Template Message",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "description": "Send one approved WhatsApp template to one number - the only message you can send outside an open 24-hour conversation window. Needs `campaigns:send`. Each message is charged to the messaging wallet before it is sent; an empty wallet answers 402 and nothing is sent, and a message the provider refuses is refunded. Send an `idempotencyKey` (or an `Idempotency-Key` header): a retry with the same key returns the first answer instead of sending and charging again (kept 24 hours). In a demo workspace only workspace members receive real messages; others are simulated. Limited to 10 a minute per account. `to` must be international (+ or 00 and the country code); anything else is refused with 400. Template buttons and offers: `couponCode` fills a copy code button (up to 20 characters; 15 on a limited-time offer), and `offerExpiresAt` (ISO date-time or Unix time) sets a limited-time offer's countdown end. Authentication templates take `otpCode` (up to 15 characters) instead of `bodyVariables` - it is sent as the code in the text and the code button, and is never logged. `otpCode` on any other template, or a value the template cannot take, answers 400.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"to\": \"+306912345678\",\n  \"templateId\": \"<approved template id>\",\n  \"bodyVariables\": [\n    \"Alex\",\n    \"GR-40921\"\n  ],\n  \"idempotencyKey\": \"order-shipped\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/whatsapp/send/template",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "whatsapp",
                "send",
                "template"
              ]
            }
          }
        },
        {
          "name": "Send One-Time Code",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "description": "Send a one-time code (OTP) through an approved WhatsApp authentication template (copy code, one-tap or zero-tap). Your backend generates and checks the code; Joryio sends it as the template's code and code button parameter and never logs or stores it. `otpCode` is at most 15 characters. Charged at the authentication rate to the messaging wallet before it is sent (402 on an empty wallet; refunded when the provider refuses). Send an `idempotencyKey` so a retry does not send a second code. Needs `campaigns:send`; limited to 10 a minute per account. A contact who uses WhatsApp with a username and no phone number cannot receive an authentication template.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"to\": \"+306912345678\",\n  \"templateId\": \"<approved authentication template id>\",\n  \"otpCode\": \"482913\",\n  \"idempotencyKey\": \"login-482913-u1029\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/whatsapp/send/template",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "whatsapp",
                "send",
                "template"
              ]
            }
          }
        },
        {
          "name": "Send Text Message",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "description": "Send free-form text to one number. WhatsApp delivers it only inside an open 24-hour window (24 hours since that person's last message to you); outside it, send a template. Needs `campaigns:send`. Each message is charged to the messaging wallet before it is sent; an empty wallet answers 402 and nothing is sent, and a message the provider refuses is refunded. Send an `idempotencyKey` (or an `Idempotency-Key` header): a retry with the same key returns the first answer instead of sending and charging again (kept 24 hours). In a demo workspace only workspace members receive real messages; others are simulated. Limited to 10 a minute per account. `to` must be international (+ or 00 and the country code); anything else is refused with 400.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"to\": \"+306912345678\",\n  \"text\": \"Your order is out for delivery.\",\n  \"idempotencyKey\": \"order-out\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/whatsapp/send/text",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "whatsapp",
                "send",
                "text"
              ]
            }
          }
        },
        {
          "name": "Get Ads & Carts Settings",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "Click-to-WhatsApp ad conversions to Meta for this workspace (BACKLOG D532). A WhatsApp cart is answered by a journey on the `whatsapp.cart.received` trigger (\"WhatsApp inbound → Cart (from the catalog)\" in the journey editor), not by a setting. `conversions.enabled` is false until a person turns it on in the dashboard and accepts the consent text; `currentConsentVersion` is the text version to accept. `last30Days` counts conversions sent, waiting and failed. Needs `whatsapp:read`.",
            "url": {
              "raw": "{{baseUrl}}/whatsapp/commerce-settings",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "whatsapp",
                "commerce-settings"
              ]
            }
          }
        },
        {
          "name": "Update Ads & Carts Settings",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "description": "Change the WhatsApp ads and carts settings. `conversions.enabled: true` shares conversion data with Meta, so it is refused for an API key (403) and needs `acceptConsent: true` with `consentVersion` = the current version from a signed-in person; turning it off (`enabled: false`), the event switches (`events.purchase` / `events.lead`) and the per-account Meta `datasets` (WhatsApp account id -> dataset id, digits) work with a key too. Conversions always use each WhatsApp account's own connected token; there is no workspace token, and an `accessToken` key is a 400 like any unknown key. Unknown keys are a 400 (a WhatsApp cart is answered by a journey on `whatsapp.cart.received`, so there is no `cartReply`). Needs `whatsapp:write`.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"conversions\": {\n    \"events\": {\n      \"purchase\": true,\n      \"lead\": false\n    }\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/whatsapp/commerce-settings",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "whatsapp",
                "commerce-settings"
              ]
            }
          }
        },
        {
          "name": "Check Conversions Connection",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "For each connected Meta WhatsApp account of the workspace, find (or create) its Meta dataset with the account's own token, and return the dataset id or the error to fix (for example an account whose token lacks the whatsapp_business_manage_events permission: reconnect it). Needs `whatsapp:write`.",
            "url": {
              "raw": "{{baseUrl}}/whatsapp/commerce-settings/conversions/check",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "whatsapp",
                "commerce-settings",
                "conversions",
                "check"
              ]
            }
          }
        },
        {
          "name": "Click-to-WhatsApp Ads Performance",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "Per ad, over the last `days` (1-365, default 30): chats the ad started, different people, chats with a click id, and the orders (and net revenue per reporting currency) stamped with the ad as the buyer's paid touch. Optional `accountId` narrows it to one WhatsApp account. Needs `whatsapp:read`.",
            "url": {
              "raw": "{{baseUrl}}/whatsapp/ads/performance?days=30",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "whatsapp",
                "ads",
                "performance"
              ],
              "query": [
                {
                  "key": "days",
                  "value": "30"
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Journey Approvals",
      "description": "Submitting a journey for review. Approving and rejecting are human review steps done in the dashboard: an API key cannot hold canvas:approve.",
      "item": [
        {
          "name": "List Journeys Awaiting Approval",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "Journeys submitted for review and not yet approved, oldest first. Requires canvas:read.",
            "url": {
              "raw": "{{baseUrl}}/journeys/pending-approval",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "journeys",
                "pending-approval"
              ]
            }
          }
        },
        {
          "name": "Submit Journey for Approval",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "Move a draft journey to pending_approval so a reviewer can sign it off. Requires canvas:write.",
            "url": {
              "raw": "{{baseUrl}}/journeys/:canvasId/submit-for-approval",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "journeys",
                ":canvasId",
                "submit-for-approval"
              ],
              "variable": [
                {
                  "key": "canvasId",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "Approve Journey",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "description": "Sign off a journey awaiting approval. Body is optional: `section` (`content`, `audience` or `delivery`) signs off that section only, and the journey is approved once all three are; omit it (or send `{}`) to sign off all three at once. Unknown keys are refused. A signed-in user is required (an API key cannot approve), and the submitter cannot approve their own journey unless the workspace allows it. Permission: `canvas:approve`.",
            "url": {
              "raw": "{{baseUrl}}/journeys/:canvasId/approve",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "journeys",
                ":canvasId",
                "approve"
              ],
              "variable": [
                {
                  "key": "canvasId",
                  "value": ""
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"section\": \"content\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "Coupons",
      "description": "Coupon programs: personal codes created in the connected store (or by Joryio alone), shown in messages with {{ coupons.<slug>.code }}, tracked to redemption from the order sync. See the Coupons API page in the docs.",
      "item": [
        {
          "name": "List Coupon Programs",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/coupons/programs?status=&includeArchived=false",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "coupons",
                "programs"
              ]
            },
            "description": "List the workspace's coupon programs with store, status and stats (issued, redeemed, revenue in the reporting currency). ?status=draft|active|paused|archived filters; archived programs are left out unless ?includeArchived=true. Requires campaigns:read."
          }
        },
        {
          "name": "Create Coupon Program",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/coupons/programs",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "coupons",
                "programs"
              ]
            },
            "description": "Create a coupon program - the recipe a message issues codes from with {{ coupons.<slug>.code }}. integrationId is a connected WooCommerce, Shopify or Magento store, or null (Joryio generates and tracks the codes, no store). slug: [a-z0-9_], unique per workspace. rules.discountType percent|fixed_cart|fixed_product|free_shipping; rules.scope kind all|products (WooCommerce, Shopify)|categories (WooCommerce, Magento)|collections (Shopify) with store ids; rules.expiry mode none|fixed (date)|relative (amount + unit hours|days, endOfDay). fallback.policy skip|shared_code (needs sharedCode)|send_without. lockToPerson is accepted on WooCommerce and Magento only - 400 on Shopify (Shopify sets who can use a discount per discount, not per code). Requires campaigns:write. source: personal (default - one code per person, created when a message needs it) | bank (codes created in the store ahead of time; needs integrationId; sourceConfig {\"bankTargetSize\": 5000} keeps that many unused codes ready) | uploaded (codes you upload with POST /coupons/programs/:id/codes; integrationId optional; never created in a store; lockToPerson not allowed) | shared (one code for everyone; sourceConfig {\"sharedCode\": \"SUMMER10\", \"createInStore\": true} - createInStore needs integrationId, false only registers an existing code). lowStock {\"threshold\": 500, \"percent\": null} - bank / uploaded: alert when fewer unused codes (or percent of all loaded) remain. The source cannot change once the program has codes.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Welcome 10%\",\n  \"slug\": \"welcome10\",\n  \"description\": \"10% off the first order\",\n  \"integrationId\": \"{{integrationId}}\",\n  \"status\": \"draft\",\n  \"source\": \"personal\",\n  \"sourceConfig\": {},\n  \"rules\": {\n    \"discountType\": \"percent\",\n    \"amount\": 10,\n    \"currency\": null,\n    \"minimumSubtotal\": 50,\n    \"minimumQuantity\": null,\n    \"scope\": {\n      \"kind\": \"all\"\n    },\n    \"excludeSaleItems\": false,\n    \"usageLimit\": 1,\n    \"oncePerCustomer\": true,\n    \"combinable\": false,\n    \"expiry\": {\n      \"mode\": \"relative\",\n      \"amount\": 14,\n      \"unit\": \"days\",\n      \"endOfDay\": true\n    }\n  },\n  \"codeFormat\": {\n    \"length\": 10,\n    \"charset\": \"unambiguous\",\n    \"prefix\": \"WELCOME-\",\n    \"suffix\": \"\",\n    \"separatorEvery\": null\n  },\n  \"fallback\": {\n    \"policy\": \"skip\",\n    \"sharedCode\": null\n  },\n  \"reuseOpenCode\": true,\n  \"lockToPerson\": false,\n  \"lowStock\": {\n    \"threshold\": 500,\n    \"percent\": null\n  }\n}"
            }
          }
        },
        {
          "name": "Get Coupon Program",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/coupons/programs/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "coupons",
                "programs",
                ":id"
              ]
            },
            "description": "One program in full: rules, code format, fallback, live (has issued real codes), sampleCode (what a preview shows), storeError and stats. Requires campaigns:read."
          }
        },
        {
          "name": "Update Coupon Program",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/coupons/programs/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "coupons",
                "programs",
                ":id"
              ]
            },
            "description": "Change any field of the create body, or status draft|active|paused|archived. A live program (one that has issued real codes) also needs settings:write - 403 otherwise; codes already issued keep the rules they were created with (a rules change starts a new rules version). Requires campaigns:write.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"status\": \"active\",\n  \"rules\": {\n    \"discountType\": \"percent\",\n    \"amount\": 15,\n    \"scope\": {\n      \"kind\": \"all\"\n    },\n    \"usageLimit\": 1,\n    \"oncePerCustomer\": true,\n    \"combinable\": false,\n    \"expiry\": {\n      \"mode\": \"relative\",\n      \"amount\": 7,\n      \"unit\": \"days\"\n    }\n  }\n}"
            }
          }
        },
        {
          "name": "Delete Coupon Program",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/coupons/programs/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "coupons",
                "programs",
                ":id"
              ]
            },
            "description": "Delete a program that never issued a real code (204). A live program answers 409 - archive it instead (PATCH status archived). Requires campaigns:write."
          }
        },
        {
          "name": "Get Coupon Program Report",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/coupons/programs/:id/report",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "coupons",
                "programs",
                ":id",
                "report"
              ]
            },
            "description": "Totals (issued, redeemed, redemptionRate, revenue, discount, currency, expired, failed, redeemedBySomeoneElse), a breakdown by campaign / journey / API (bySource) and daily issued and redeemed counts. Test codes are not counted. Requires campaigns:read."
          }
        },
        {
          "name": "Issue Coupon Code",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/coupons/programs/:id/issue",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "coupons",
                "programs",
                ":id",
                "issue"
              ]
            },
            "description": "Issue a code from an active program to one contact, for partners who show the code in their own channel. Identify the contact with contactId (internal id), externalId or email. issueKey (optional) makes the call idempotent: the same issueKey always returns the same code. With the program's reuse setting on, the person's still-open code is returned instead of a new one (reused: true). Response { issued, issue, applyUrl } or { issued: false, reason } (program_paused, store_error, store_permission_missing, ...). Requires campaigns:write.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"externalId\": \"customer-123\",\n  \"issueKey\": \"partner-order-confirmation-9876\"\n}"
            }
          }
        },
        {
          "name": "List Coupon Issues",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/coupons/issues?contactId=&programId=&status=&limit=50&offset=0",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "coupons",
                "issues"
              ]
            },
            "description": "Issued codes, newest first: { items, total }. Each item carries the code, status (pending|issued|failed|redeemed|expired|revoked), the issuing campaign / journey node, issuedAt, expiresAt, redeemedAt, redeemedOrderId and redeemedRevenue. Filter with ?contactId=, ?programId=, ?status=; ?limit= (max 200), ?offset=. Codes belong to people, so this requires users:read."
          }
        },
        {
          "name": "List Coupon Stores",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/coupons/stores",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "coupons",
                "stores"
              ]
            },
            "description": "Connected stores a program can issue codes in, each with its capabilities (lockToPerson, perCodeExpiry, percentCap, scopes) and missingPermission - e.g. write_discounts when a Shopify store must approve the new permission first. Requires campaigns:read."
          }
        },
        {
          "name": "Get Coupon Program Stock",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/coupons/programs/:id/stock",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "coupons",
                "programs",
                ":id",
                "stock"
              ]
            },
            "description": "Codes left in an uploaded list or code bank: available (unused, unexpired), total (every code loaded), used, level ok|low|empty against the program's lowStock, and for a bank the top-up status (targetSize, filling, lastRunAt, lastAdded, lastError). tracked is false for personal and shared programs. Requires campaigns:read."
          }
        },
        {
          "name": "Upload Coupon Codes (pasted text)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/coupons/programs/:id/codes?dryRun=true",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "coupons",
                "programs",
                ":id",
                "codes"
              ],
              "query": [
                {
                  "key": "dryRun",
                  "value": "true"
                }
              ]
            },
            "description": "Add codes to an uploaded-list program (source: uploaded). text is CSV or one code per line: columns code (required, 3-64 characters: letters, digits and - _ . # / +), expires_at (optional, YYYY-MM-DD = the end of that day UTC, or ISO date-time), value (optional, up to 100 characters, shown as {{ coupons.<slug>.value }}). Header optional; comma, semicolon or tab. dryRun=true validates and returns the report without storing (the preview); remove it (or set false) to store. Each upload appends. Limits: 100,000 rows and 10 MB per upload, 2,000,000 codes per program. Response: uploadId, totalRows, accepted, rejected, duplicates, truncated, preview (first 10 accepted), rejectedRows (first 500: line, code, reason, message). Reasons: missing_code, invalid_code, invalid_expiry, expired, value_too_long, duplicate_in_file, already_in_program, already_exists, over_limit. Requires campaigns:write.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"text\": \"code,expires_at,value\\nSUMMER-001,2026-12-31,10%\\nSUMMER-002,2026-12-31,10%\",\n  \"fileName\": \"summer.csv\"\n}"
            }
          }
        },
        {
          "name": "Upload Coupon Codes (CSV file)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/coupons/programs/:id/codes?dryRun=false",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "coupons",
                "programs",
                ":id",
                "codes"
              ],
              "query": [
                {
                  "key": "dryRun",
                  "value": "false"
                }
              ]
            },
            "description": "The same upload as a multipart CSV file in the field file (up to 10 MB). Use dryRun=true first to preview the report. Requires campaigns:write.",
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "file",
                  "type": "file",
                  "src": "codes.csv"
                }
              ]
            }
          }
        },
        {
          "name": "List Coupon Code Uploads",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/coupons/programs/:id/uploads",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "coupons",
                "programs",
                ":id",
                "uploads"
              ]
            },
            "description": "The last 100 uploads of a program, newest first, with counts and the rejected-rows report of each. Requires campaigns:read."
          }
        },
        {
          "name": "Generate Coupon Bank Codes",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/coupons/programs/:id/bank/generate",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "coupons",
                "programs",
                ":id",
                "bank",
                "generate"
              ]
            },
            "description": "Create count (1-100,000) new codes in the store for a code-bank program (source: bank): Shopify adds them to the program's discount, WooCommerce creates one coupon per code, Magento generates them under the program's cart price rule. Runs in the background: answers 202 with {\"started\": true, \"requested\": n}; follow it with Get Coupon Program Stock. 400 while a top-up is already running. Requires campaigns:write.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"count\": 5000\n}"
            }
          }
        }
      ]
    },
    {
      "name": "Feature Flags",
      "description": "Feature flags and remote config: typed values (boolean, string, number, JSON) with variants, segment and attribute targeting, percentage rollout and a kill switch, per workspace. Apps read them with the SDKs (getFlag, getBoolFlag, getStringFlag, getNumberFlag, getJsonFlag, getAllFlags). See the Feature Flags API page in the docs. Switched on per organization by Joryio: until then these requests answer 403 FEATURE_NOT_ENABLED, and the SDK endpoints answer an empty set of flags.",
      "item": [
        {
          "name": "List Feature Flags",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/flags?status=active",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "flags"
              ]
            },
            "description": "The workspace's feature flags (environments are workspaces), sorted by key. ?status=active (default)|archived|all. Requires flags:read."
          }
        },
        {
          "name": "Feature Flags Overview (list with reach)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/flags/overview?state=current&q=&page=1&limit=25&sortBy=editedAt&sortOrder=desc&days=30",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "flags",
                "overview"
              ],
              "query": [
                {
                  "key": "state",
                  "value": "current",
                  "description": "current (default: on and off) | on | off | archived | all"
                },
                {
                  "key": "q",
                  "value": "",
                  "description": "Matches the name or the key"
                },
                {
                  "key": "page",
                  "value": "1"
                },
                {
                  "key": "limit",
                  "value": "25",
                  "description": "1-100"
                },
                {
                  "key": "sortBy",
                  "value": "editedAt",
                  "description": "name | status | createdAt | editedAt"
                },
                {
                  "key": "sortOrder",
                  "value": "desc"
                },
                {
                  "key": "days",
                  "value": "30",
                  "description": "Window for people exposed, 1-90"
                }
              ]
            },
            "description": "One page of the workspace's flags as the Campaigns list shows them: state (on / off / archived), number of variants and the everyone-else split, and exposure.people - unique people exposed in the last `days` (1-90, default 30). Exposures of flags outside an experiment can be sampled (sampledPercent below 100): those are scaled back up and exposure.estimated is true. experiment is the running Feature flag experiment's goal result (exposed, converted, rate) - only with campaigns:read as well, and for a campaign the caller may see; experimentRunning says one runs either way. Paginated: { data, pagination: { total, page, limit, totalPages, ... }, days, sampledPercent }. Optional createdBy / editedBy: comma-separated user ids. Requires flags:read."
          }
        },
        {
          "name": "Create Feature Flag",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/flags",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "flags"
              ]
            },
            "description": "Create a flag. It starts OFF (enabled false: everyone gets offVariant) unless enabled is sent. key: lowercase letters, digits, _ and -, unique per workspace. valueType boolean|string|number|json (never changes). variants: 2-10 {key, name, value}, each value of valueType (JSON up to 16 KB); a boolean flag defaults to on/off. rules are tried in order - the first whose audience matches decides: segmentIds (any of them, the live segment engine; never matches an anonymous visitor) and/or conditions (attribute groups, the in-app targeting shape) with a rollout. defaultRollout serves everyone else. Rollout weights are percent with two decimals and add up to 100; people are bucketed by sha256(flagKey:subject), so the same person keeps the same variant. Requires flags:write. A rule's audience is the campaign audience shape: `segmentIds` (any of), `conditions` (include groups of any filter kind - attribute, event, behavioral, segment...), `conditionOperator` and `excludeConditions` (exclude groups). Visitors who are not identified match attribute conditions only.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"key\": \"new_checkout\",\n  \"name\": \"New checkout\",\n  \"description\": \"The one-page checkout\",\n  \"valueType\": \"boolean\",\n  \"rules\": [\n    {\n      \"id\": \"beta\",\n      \"name\": \"Beta testers\",\n      \"segmentIds\": [\n        \"<segment-uuid>\"\n      ],\n      \"rollout\": [\n        {\n          \"variant\": \"on\",\n          \"weight\": 100\n        }\n      ]\n    },\n    {\n      \"id\": \"mobile_he\",\n      \"name\": \"Hebrew on iOS\",\n      \"conditions\": [\n        {\n          \"operator\": \"AND\",\n          \"filters\": [\n            {\n              \"type\": \"attribute\",\n              \"field\": \"language\",\n              \"operator\": \"equals\",\n              \"value\": \"he\"\n            }\n          ]\n        }\n      ],\n      \"rollout\": [\n        {\n          \"variant\": \"on\",\n          \"weight\": 50\n        },\n        {\n          \"variant\": \"off\",\n          \"weight\": 50\n        }\n      ]\n    },\n    {\n      \"id\": \"recent_buyers\",\n      \"name\": \"Bought in the last 30 days, not staff\",\n      \"conditions\": [\n        {\n          \"operator\": \"AND\",\n          \"filters\": [\n            {\n              \"type\": \"event\",\n              \"eventName\": \"purchase\",\n              \"operator\": \"performed_in_last_days\",\n              \"value\": 30\n            }\n          ]\n        }\n      ],\n      \"conditionOperator\": \"AND\",\n      \"excludeConditions\": [\n        {\n          \"operator\": \"AND\",\n          \"filters\": [\n            {\n              \"type\": \"attribute\",\n              \"field\": \"staff\",\n              \"operator\": \"equals\",\n              \"value\": \"true\"\n            }\n          ]\n        }\n      ],\n      \"rollout\": [\n        {\n          \"variant\": \"on\",\n          \"weight\": 100\n        }\n      ]\n    }\n  ],\n  \"defaultRollout\": [\n    {\n      \"variant\": \"on\",\n      \"weight\": 10\n    },\n    {\n      \"variant\": \"off\",\n      \"weight\": 90\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Get Feature Flag",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/flags/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "flags",
                ":id"
              ]
            },
            "description": "One flag with its variants, rules, rollout, kill switch, experiment and version. Requires flags:read."
          }
        },
        {
          "name": "Get Feature Flag History",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/flags/:id/history?limit=50&offset=0",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "flags",
                ":id",
                "history"
              ]
            },
            "description": "Every change to the flag, newest first: who, when, the action (create, update, enabled, disabled, archive), the fields changed and the state before and after. ?limit (max 200) &offset. Requires flags:read."
          }
        },
        {
          "name": "Get Feature Flag Report",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/flags/:id/report?days=14",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "flags",
                ":id",
                "report"
              ]
            },
            "description": "People exposed per day (workspace timezone) and variant over the last days (1-90, default 14), and for an experiment each arm (variants + holdout) with people exposed, converted (goal event after their first exposure in the run), rate, 95% interval and pBest (Bayesian probability of being best); activeOverrides is the number of people a journey Feature flag step has set this flag for, not yet expired. Requires flags:read."
          }
        },
        {
          "name": "Get Flag Experiment Results",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/flags/experiments/:campaignId/report",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "flags",
                "experiments",
                ":campaignId",
                "report"
              ]
            },
            "description": "Results of a \"Feature flag experiment\" campaign (an in-app campaign with channelConfig.type flag_experiment and channelConfig.flagId; each non-control variant names the flag variant it serves in flagVariant, the control group is the holdout). Per variant: people exposed (their first flag.exposure of the run), converted (the campaign's conversion goal within its window of that first exposure), rate with a 95% interval, pBest, and vsBaseline / vsHoldout (relative difference, two-proportion z-test p-value, isSignificant at 1 - the campaign's confidence level, 95% by default). 404 when the campaign is not a flag experiment of this workspace or not visible to the caller (team visibility, as GET /campaigns/:id). Requires flags:read and campaigns:read."
          }
        },
        {
          "name": "Update Feature Flag",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/flags/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "flags",
                ":id"
              ]
            },
            "description": "Change any of name, description, variants, offVariant, rules, defaultRollout, enabled. The key can change only before the flag was ever turned on (409 after); valueType never changes (400); variants cannot be added or removed while an experiment runs (409). Every change bumps version and is in the history. Requires flags:write.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"defaultRollout\": [\n    {\n      \"variant\": \"on\",\n      \"weight\": 25\n    },\n    {\n      \"variant\": \"off\",\n      \"weight\": 75\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Turn Feature Flag On or Off (kill switch)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/flags/:id/enabled",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "flags",
                ":id",
                "enabled"
              ]
            },
            "description": "enabled false serves offVariant to everyone at once, without evaluating rules; apps pick it up on their next refresh (start, foreground, identify, or the silent push jry_sync \"flags\"). Requires flags:write.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"enabled\": false\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Start Flag Experiment (retired)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/flags/:id/experiment/start",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "flags",
                ":id",
                "experiment",
                "start"
              ]
            },
            "description": "Retired: answers 409. Experiments on a flag run as \"Feature flag experiment\" campaigns - create one with POST /campaigns (channel in_app, channelConfig { type: flag_experiment, flagId }, variants with flagVariant, the control group as the holdout, conversionTracking for the goal) and read its results with GET /flags/experiments/:campaignId/report. An experiment already running on a flag keeps running until stopped, and its results stay in GET /flags/:id/report. Requires flags:write.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"goalEvent\": \"purchase\",\n  \"holdoutPercent\": 5\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Stop Flag Experiment",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/flags/:id/experiment/stop",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "flags",
                ":id",
                "experiment",
                "stop"
              ]
            },
            "description": "Stop the running experiment; rules and rollout keep serving as configured. Requires flags:write."
          }
        },
        {
          "name": "Archive Feature Flag",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/flags/:id/archive",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "flags",
                ":id",
                "archive"
              ]
            },
            "description": "Archive (never delete): the flag is turned off, its experiment stopped, and the key is free for a new flag. The history stays. Requires flags:write."
          }
        }
      ]
    },
    {
      "name": "Campaigns",
      "item": [
        {
          "name": "Create Campaign",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Welcome Email\",\n  \"description\": \"Welcome email for new users\",\n  \"channel\": \"email\",\n  \"sendType\": \"immediate\",\n  \"variants\": [\n    {\n      \"id\": \"variant-a\",\n      \"name\": \"Variant A\",\n      \"weight\": 100,\n      \"message\": {\n        \"subject\": \"Welcome to My Company!\",\n        \"preheader\": \"Your first week, planned\",\n        \"preheaderWhitespace\": true,\n        \"from\": \"hello@example.com\",\n        \"fromName\": \"My Company\",\n        \"html\": \"<h1>Hi {{ user.firstName }}, welcome aboard!</h1>\"\n      }\n    }\n  ],\n  \"targeting\": {\n    \"filterGroups\": [\n      {\n        \"filters\": [\n          {\n            \"type\": \"attribute\",\n            \"field\": \"plan\",\n            \"operator\": \"equals\",\n            \"value\": \"premium\"\n          }\n        ],\n        \"operator\": \"AND\"\n      }\n    ]\n  }\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/campaigns",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns"
              ]
            },
            "description": "Create a campaign. Message content lives in `variants` (required for every channel except in_app): each variant has id, name, weight, and a channel-shaped `message` (email: subject/from/fromName + html or templateId, optional preheader and preheaderWhitespace - true pads the preview text with invisible whitespace so the inbox preview does not run on into the body (with no preheader it gives an empty inbox preview), absent = off; sms: body; viber: body/imageUrl/buttonCaption/buttonUrl + optional ttlSeconds and smsFallbackEnabled/smsFallbackBody; push: title/body; whatsapp: templateId/variableMapping - for an image, video or document header template, variableMapping.media is the header media URL, else the template's saved media is sent and a template with none is a Launch Review blocker; or a session reply inside the 24-hour window - messageType reply with replyText (+ optional whatsappAttachment or sessionCarousel) or messageType interactive with interactive, see Create WhatsApp Campaign (Session reply)). Audience is `targeting` with userIds and/or filterGroups (same filter shape as Segments) - there is no `segmentId` field. sendType: immediate|scheduled|triggered|intelligent|recurring|ai_optimized."
          }
        },
        {
          "name": "Create SMS Campaign (Delivyr template)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Weekend offer (US)\",\n  \"channel\": \"sms\",\n  \"sendType\": \"immediate\",\n  \"status\": \"draft\",\n  \"variants\": [\n    {\n      \"id\": \"variant-a\",\n      \"name\": \"Variant A\",\n      \"weight\": 100,\n      \"message\": {\n        \"smsTemplateId\": \":smsTemplateId\",\n        \"variableMapping\": {\n          \"first_name\": \"{{ user.first_name | default: 'there' }}\",\n          \"link\": \"https://shop.example.com/weekend\"\n        }\n      }\n    }\n  ],\n  \"targeting\": {\n    \"filterGroups\": []\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/campaigns",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns"
              ]
            },
            "description": "DELIVYR ONLY - an SMS campaign on a workspace whose SMS number is linked to a Delivyr account (approved templates only, US and Canada numbers). Give smsTemplateId (an approved template from GET /sms/templates) and one value per template variable in variableMapping - plain text or Liquid. A `link` value's URL is sent as Joryio's tracked short link. A free-text `body` on a Delivyr account is refused with 400."
          }
        },
        {
          "name": "Create WhatsApp Campaign (Session reply)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Order follow-up (reply buttons)\",\n  \"channel\": \"whatsapp\",\n  \"sendType\": \"immediate\",\n  \"variants\": [\n    {\n      \"id\": \"variant-a\",\n      \"name\": \"Variant A\",\n      \"weight\": 100,\n      \"message\": {\n        \"messageType\": \"interactive\",\n        \"wabaId\": \"<your WhatsApp Business Account id>\",\n        \"shortenLinks\": true,\n        \"interactive\": {\n          \"kind\": \"buttons\",\n          \"body\": \"Hi {{ user.firstName }}, did your order arrive in good shape?\",\n          \"footer\": \"Tap a button to answer\",\n          \"buttons\": [\n            {\n              \"id\": \"arrived_ok\",\n              \"title\": \"Yes, all good\"\n            },\n            {\n              \"id\": \"arrived_issue\",\n              \"title\": \"There is a problem\"\n            }\n          ]\n        }\n      }\n    }\n  ],\n  \"targeting\": {\n    \"filterGroups\": [\n      {\n        \"filters\": [\n          {\n            \"type\": \"attribute\",\n            \"field\": \"plan\",\n            \"operator\": \"equals\",\n            \"value\": \"premium\"\n          }\n        ],\n        \"operator\": \"AND\"\n      }\n    ]\n  }\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/campaigns",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns"
              ]
            },
            "description": "Create a WhatsApp campaign that sends a session reply instead of a template - delivered only to people who messaged the business in the last 24 hours (everyone else is not sent it: no_active_session), priced as service. The variant message takes the journey WhatsApp step's fields. messageType reply: replyText (up to 4096 characters, Liquid allowed), plus either whatsappAttachment (an https asset-library link: JPEG/PNG up to 5 MB, MP4/3GPP, or PDF) or sessionCarousel { cards: [ { mediaType: image|video, mediaUrl, body, buttonText + url, or quickReplies: [ { id, title } ] } ] } with 2-10 cards. messageType interactive: interactive { kind: buttons|list|cta_url|location_request, body, header?: { type: text, text }, footer?, buttons: [ { id, title } ] (1-3), listButtonText + sections: [ { title, rows: [ { id, title, description? } ] } ] (up to 10 rows), cta: { displayText, url } }. Button / row ids come back on the person's reply (interactive.button_reply.id / list_reply.id), which is recorded on the contact and linked to the campaign. Unknown fields, an unknown kind or more options than WhatsApp allows answer 400; a message that breaks Meta's limits once personalized is skipped for that person (interactive_invalid). The example sends reply buttons."
          }
        },
        {
          "name": "Get All Campaigns",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "Paged list of the workspace's campaigns: { data, pagination }. Filters: ?status= (comma-separated; archived only when asked for), ?channel=, ?inAppType= (narrows the in-app campaigns by kind, comma-separated: overlay = the classic modal / banner / slide-up / fullscreen / custom messages, placement, card, page_edit, flag_experiment; other channels are not affected; an unknown value is a 400), ?tags=, ?q=, ?createdBy= / ?editedBy= (comma-separated user ids), ?createdFrom= (ISO date). ?page=, ?limit= (max 100). Ordering across the whole list: ?sortBy=name|status|createdAt|editedAt|scheduledAt|sent|delivered|opened|clicked, ?sortOrder=asc|desc (default createdAt desc). Each campaign carries editedAt - the last edit a person or an API key made (sends, stats and other automatic updates do not move it; updatedAt moves on every change) - and who made that edit: editedByKind = user (updatedBy is the person) or api_key (updatedByApiKey, with editedByApiKeyName - null once the key is deleted). An API key's edit names the key, not the last person; an AI agent or connector acts as the person who connected it. Each in-app campaign also carries its kind as inAppType. ?stats= names the figures to compute per campaign (sent, delivered, queued, failed, opened, clicked, recipients, bounced, unsubscribed, spamreport, or none): each campaign's stats then carries only those, without rates, and a figure nobody asked for is not computed; omitted = every figure and rate. In the list, delivered is the delivery count capped at sent.",
            "url": {
              "raw": "{{baseUrl}}/campaigns",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns"
              ],
              "query": [
                {
                  "key": "channel",
                  "value": "in_app",
                  "disabled": true
                },
                {
                  "key": "inAppType",
                  "value": "page_edit,placement",
                  "disabled": true
                },
                {
                  "key": "stats",
                  "value": "sent,delivered,opened,clicked",
                  "description": "The figures to compute for each campaign (comma-separated): sent, delivered, queued, failed, opened, clicked, recipients, bounced, unsubscribed, spamreport - or none. Each campaign's stats then carries only those figures, without rates. Omitted: every figure and rate. An unknown value is a 400.",
                  "disabled": true
                },
                {
                  "key": "warmupProgramEmails",
                  "value": "include",
                  "disabled": true,
                  "description": "Sending warm-up program emails are left out of the list unless this is `include` (or `q` searches for them)."
                },
                {
                  "key": "warmupProgramId",
                  "value": "",
                  "disabled": true,
                  "description": "List only this sending warm-up program's emails."
                }
              ]
            }
          }
        },
        {
          "name": "List Campaigns Awaiting Approval",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "Campaigns submitted for review and not yet approved, oldest first. Requires campaigns:read - an author can see that their own submission is still waiting, not only approvers.",
            "url": {
              "raw": "{{baseUrl}}/campaigns/pending-approval",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns",
                "pending-approval"
              ]
            }
          }
        },
        {
          "name": "Campaign Performance (ranked uplift)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "Per-campaign causal uplift for the workspace, ranked by INCREMENTAL CONVERSIONS on each campaign's OWN conversion goal (`conversionGoal` on the row, e.g. `email_clicked`) - the same uplift the campaign page shows: both groups are asked whether the person reached the goal within the campaign's conversion window after they were sent (or would have been), with no attribution model because the control group has no message to credit. `incrementalRevenue` is a separate figure from ORDERS (purchase revenue in each group's window), whatever the goal. Until 2026-10-14 incrementalConversions, conversionRateLift and significance counted buyers for every campaign. Both groups count people only: since 2026-11-24 an event flagged `$is_bot` reaches no goal and no order, on every goal; a store order (no bot flag) always counts.\n\nOnly campaigns whose measurement cleared the significance floor appear in `ranked`. Campaigns still gathering data are returned separately in `stillCollecting`: they have no verdict, and placing them below the losers would say they lost. Campaigns with no control group are counted in `noHoldout`, and campaigns with a control group but no conversion goal in `noGoal`, rather than listed.\n\nThere is deliberately NO total. Per-campaign incremental figures do not sum to the value of marketing - each campaign's control received everything except that campaign, so the effects overlap and a total would overstate the result while looking authoritative. Requires campaigns:read. `couldNotMeasure` counts campaigns whose measurement query failed - not measured, never dropped silently; a row whose revenue query failed has `incrementalRevenue: null` and `revenueUnavailable: true` (added November 2026).",
            "url": {
              "raw": "{{baseUrl}}/campaigns/performance?sinceDays=90",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns",
                "performance"
              ],
              "query": [
                {
                  "key": "sinceDays",
                  "value": "90",
                  "description": "Look-back window for which campaigns to include. Default 90."
                }
              ]
            }
          }
        },
        {
          "name": "Submit Campaign for Approval",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "Move a draft campaign to pending_approval so a reviewer can sign it off. Requires campaigns:write - the point of the workflow is that whoever cannot send can still start the review. Approving and rejecting are human review steps done in the dashboard: an API key cannot hold campaigns:approve.",
            "url": {
              "raw": "{{baseUrl}}/campaigns/:campaignId/submit-for-approval",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns",
                ":campaignId",
                "submit-for-approval"
              ],
              "variable": [
                {
                  "key": "campaignId",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "Preview Campaign Launch",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/campaigns/:campaignId/preview-launch",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns",
                ":campaignId",
                "preview-launch"
              ],
              "variable": [
                {
                  "key": "campaignId",
                  "value": ""
                }
              ]
            },
            "description": "Pre-launch summary without sending: audience (total, willReceive, willSkip and skipReasons), warnings, and the launch cost for SMS / WhatsApp / Viber. A draft, scheduled or paused campaign only. For an in-app campaign other than a feature flag experiment the answer also has `onsite`: kind (message, page_edit, placement or card), everyone (no segment, user list or filter - anonymous visitors see it too; always false for an inbox card, which reaches known people only), pageRules (shows on matching pages only), visitors7d - unique visitors, anonymous and known, of the workspace over the last 7 days (null when not asked for or not available), and knownVisitors7d - how many of those visitors were signed in, from the same count (never more than visitors7d). Requires campaigns:send."
          }
        },
        {
          "name": "Get Launch Review",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/campaigns/{{campaignId}}/launch-review",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns",
                "{{campaignId}}",
                "launch-review"
              ]
            },
            "description": "Launch Review (pre-send checks): blockers (missing unsubscribe, broken merge field, unverified or missing sender, unusable or broken link on a measured send) and recommendations (long subject, promotions-tab words, no plain-text part, a link that could not be confirmed, no link on a measured send, audience overlap with a campaign or journey - shared segment, identical audience, or same trigger and audience - frequency holds, quiet hours ignored, consent bypassed), each with a fix action. This route also fetches the send's links (up to 25, 15 s, verdicts cached for an hour); the send gate reads that cache only. With requireClean (default) and blockers, send answers 409 launch_review_blocked unless the send carries launchReviewOverride."
          }
        },
        {
          "name": "Preview Update User Custom JSON",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/journeys/preview-user-update-json",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "journeys",
                "preview-user-update-json"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"json\": \"{\\n  \\\"attributes\\\": { \\\"firstName\\\": \\\"{{ event.properties.name }}\\\" },\\n  \\\"subscriptions\\\": [ { \\\"listId\\\": \\\"<list id>\\\", \\\"channel\\\": \\\"email\\\", \\\"status\\\": \\\"subscribed\\\" } ],\\n  \\\"events\\\": [ { \\\"name\\\": \\\"Free Gift Requested\\\", \\\"properties\\\": { \\\"source\\\": \\\"landing-page\\\" } } ]\\n}\",\n  \"sample\": {\n    \"user\": {\n      \"firstName\": \"Dana\",\n      \"attributes\": {}\n    },\n    \"trigger\": {\n      \"properties\": {\n        \"name\": \"Dana\"\n      }\n    }\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Dry run of an Update user node's Custom JSON: validates the template (only attributes / subscriptions / events, no identifiers, at most 100 subscriptions and 25 events), renders Liquid against the posted sample, and checks literal list ids belong to this workspace. Returns { errors, preview: { errors, result } } - errors block saving or activating, preview is the sample render. Writes nothing. Requires canvas:read."
          }
        },
        {
          "name": "Send Campaign",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/campaigns/:campaignId/send",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns",
                ":campaignId",
                "send"
              ],
              "variable": [
                {
                  "key": "campaignId",
                  "value": ""
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"launchReviewOverride\": {\n    \"reason\": \"Order confirmation - transactional, no unsubscribe line by design\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Send (or schedule) the campaign. Launch Review runs inside: with requireClean (default) and blockers it answers 409 launch_review_blocked. Body is optional; `launchReviewOverride.reason` (3-300 chars) sends past the blockers on purpose - recorded on the campaign with its content hash (an edit voids it for a scheduled send) and in the audit log as launch_review_overridden."
          }
        },
        {
          "name": "Pause Campaign",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/campaigns/:campaignId/pause",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns",
                ":campaignId",
                "pause"
              ],
              "variable": [
                {
                  "key": "campaignId",
                  "value": ""
                }
              ]
            },
            "description": "Pause a sending campaign, or a recurring campaign between occurrences (no new occurrence starts until it is resumed). Every message not yet handed to a provider is held - not sent and not refunded - until Resume. A paused campaign never cancels itself. Trigger events that arrive while paused are not queued for later. Requires campaigns:send."
          }
        },
        {
          "name": "Get Campaign Pending Work",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/campaigns/:campaignId/pending-work",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns",
                ":campaignId",
                "pending-work"
              ],
              "variable": [
                {
                  "key": "campaignId",
                  "value": ""
                }
              ]
            },
            "description": "What is waiting, in flight and stopped for this campaign: `waiting` (messages held since the pause), `notQueued` (people of a paused send not queued yet), `inFlight` (queued, not yet handed to a provider), `toStop` (what Cancel would stop now = waiting + notQueued + inFlight), `stoppedByCancel` (report), `pausedAt`. Requires campaigns:read."
          }
        },
        {
          "name": "Resume Campaign",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/campaigns/:campaignId/resume",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns",
                ":campaignId",
                "resume"
              ],
              "variable": [
                {
                  "key": "campaignId",
                  "value": ""
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"pending\": \"send\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Resume a paused campaign. When messages are waiting (`waiting + notQueued > 0`) the body must say what to do with them: `pending: \"send\"` sends the waiting messages first and then continues queueing where it stopped (nobody sent or charged twice); `pending: \"cancel\"` ends the campaign exactly like Cancel. A resume with pending work and no `pending` answers 409 `{ code: \"RESUME_CHOICE_REQUIRED\", waiting, notQueued, pausedAt }`. With nothing waiting the body may be omitted. Requires campaigns:send."
          }
        },
        {
          "name": "Cancel Campaign",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/campaigns/:campaignId/cancel",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns",
                ":campaignId",
                "cancel"
              ],
              "variable": [
                {
                  "key": "campaignId",
                  "value": ""
                }
              ]
            },
            "description": "Cancel a sending, paused or scheduled campaign. Everything not yet handed to a provider is stopped (queued and held messages are dropped, nothing more is queued) and each stopped SMS / WhatsApp / Viber message that was charged is credited back once - a retried cancel credits nothing more. Messages already handed to the provider can't be recalled. Requires campaigns:send."
          }
        },
        {
          "name": "Send Test Viber Message",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"phone\": \"+306912345678\",\n  \"userData\": {\n    \"firstName\": \"Maria\"\n  }\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/campaigns/:campaignId/send-test-viber",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns",
                ":campaignId",
                "send-test-viber"
              ],
              "variable": [
                {
                  "key": "campaignId",
                  "value": ""
                }
              ]
            },
            "description": "Send a test Viber message for a viber campaign to a single phone number (no audience send). Renders the first variant (body/imageUrl/buttonCaption/buttonUrl + optional smsFallbackBody) with the optional `userData` as the personalization context. The recipient must not have opted out of Viber. Requires a Viber-capable provider account (Apifon) with a registered Viber sender."
          }
        },
        {
          "name": "Render In-App for a Contact",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"userId\": \"665f1b2c9a4e3d0012ab34cd\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/campaigns/:campaignId/render-for-contact",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns",
                ":campaignId",
                "render-for-contact"
              ],
              "variable": [
                {
                  "key": "campaignId",
                  "value": ""
                }
              ]
            },
            "description": "Render an in-app campaign for ONE contact and get the markup back as { html, css }. This SENDS NOTHING: in-app is pull-based, so a message reaches a device only when that app next syncs - there is nothing to deliver to at this point. Useful for automated checks (render campaign X for contact Y, assert the copy). Needs campaigns:test; a caller without campaigns:send may only target their own contact record. Formerly POST /campaigns/:campaignId/send-test-in-app, which still answers as a deprecated alias."
          }
        },
        {
          "name": "Publish Campaign Changes",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/campaigns/:campaignId/publish",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns",
                ":campaignId",
                "publish"
              ],
              "variable": [
                {
                  "key": "campaignId",
                  "value": ""
                }
              ]
            },
            "description": "Apply buffered edits made to a live (active) campaign onto the running campaign atomically, so subsequent sends use the new content. Returns 400 if there are no unpublished changes."
          }
        },
        {
          "name": "Duplicate Campaign",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/campaigns/:campaignId/duplicate",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns",
                ":campaignId",
                "duplicate"
              ],
              "variable": [
                {
                  "key": "campaignId",
                  "value": ""
                }
              ]
            },
            "description": "Copy a campaign as a new draft named \"<name> (Copy)\". Everything that describes the campaign is copied - content and variants, audience, channel settings, the email sender (emailConfigId), send type, the schedule's time zone, the recurring schedule (occurrence count back to 0), the trigger, A/B settings (without the source test's winner or deadline), send-time optimization, limits, UTM tags and tags. Run state is reset: status draft, no scheduledAt (a one-time date would be in the past), stats, approvals, archive and failure state. The response is the new campaign; its duplicatedFrom holds { campaignId, name, scheduledAt, scheduledTimezone, scheduledLocalAt } of the source, so a client can show the original send. Requires campaigns:write. POST /campaigns/bulk-duplicate with { \"ids\": [...] } applies the same copy to each."
          }
        },
        {
          "name": "Discard Campaign Changes",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/campaigns/:campaignId/discard-draft",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns",
                ":campaignId",
                "discard-draft"
              ],
              "variable": [
                {
                  "key": "campaignId",
                  "value": ""
                }
              ]
            },
            "description": "Discard buffered edits to a live campaign so it reverts to its currently-published content. No-op if nothing is buffered."
          }
        },
        {
          "name": "Re-send Campaign (Send again)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/campaigns/:campaignId/resend",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns",
                ":campaignId",
                "resend"
              ],
              "variable": [
                {
                  "key": "campaignId",
                  "value": ""
                }
              ]
            },
            "description": "Re-send a completed one-time/scheduled campaign per its resendPolicy: only_new (skip prior recipients), everyone (include them), or cooldown (everyone except those messaged in the last resendCooldownDays days). Consent + suppression always enforced; frequency caps follow ignoreTouchingRules. 400 for triggered/recurring/in-app/ai_optimized or a campaign that hasn't finished sending."
          }
        },
        {
          "name": "Get Campaign Stats",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/campaigns/:campaignId/stats",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns",
                ":campaignId",
                "stats"
              ],
              "variable": [
                {
                  "key": "campaignId",
                  "value": ""
                }
              ]
            },
            "description": "Delivery, engagement and conversion figures for one campaign. `stats.openRate` / `stats.clickRate` are unique people (bots excluded) as a share of delivered - of sent for push or when nothing was reported delivered - and `stats.rateOf` names the base; the same rate the dashboard shows. `conversionStats` counts the campaign's OWN conversion goal (primaryConversion) with its conversion window and attribution model, people only - an event flagged `$is_bot` converts no one on any goal since 2026-11-24, and a store order (no bot flag) always counts; orders and revenue are a separate figure (`revenue`) - a purchase can be credited to a campaign whose goal is not a purchase. `stats.hardBounced` / `softBounced` / `otherBounced` split `stats.bounced`; `stats.autoReplied` counts messages answered by an automatic (out-of-office) reply, never a bounce, and is `null` (not measured) when returned-mail handling is off and the campaign has none. `unavailable` lists the parts whose query failed (`conversions`, `revenue`, `uplift`); each is `null` and means \"could not load\", not \"none yet\". A failure of the delivery stats themselves is a 503, never zeros (added November 2026). `stats.delivered` counts each sent message at most once (duplicate delivery events, or a delivery with no matching send, are not counted), so it never exceeds `stats.sent`; `stats.firstSentAt` / `stats.lastSentAt` are the first and latest send of the range. `maturity` says whether the send is old enough to compare with an average: opens and clicks accrue for `maturity.windowHours` (email 24, SMS and push 6, WhatsApp and Viber 12, in-app 24) after the send finished; until `maturity.mature` is true - `maturity.matureAt`, or never while `maturity.stillSending` - do not judge it above or below average. `null` when nothing was sent."
          }
        },
        {
          "name": "List Campaign Recovered Carts",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/campaigns/:campaignId/recovered-carts?startDate=2026-10-01&endDate=2026-10-31&limit=25&offset=0",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns",
                ":campaignId",
                "recovered-carts"
              ],
              "query": [
                {
                  "key": "startDate",
                  "value": "2026-10-01",
                  "description": "Optional. Carts recovered on or after this day (or instant)"
                },
                {
                  "key": "endDate",
                  "value": "2026-10-31",
                  "description": "Optional. Carts recovered up to this day, inclusive (or before this instant)"
                },
                {
                  "key": "limit",
                  "value": "25",
                  "description": "Rows per page, 1-100"
                },
                {
                  "key": "offset",
                  "value": "0",
                  "description": "Rows to skip"
                }
              ],
              "variable": [
                {
                  "key": "campaignId",
                  "value": ""
                }
              ]
            },
            "description": "The abandoned carts this campaign recovered - the list behind the recovered-carts figure. Requires `campaigns:read`. Paginated (`limit` 1-100, default 25; `offset`), newest recovery first. `total` is the same number as `revenue.recoveredCarts` on /stats for the same `startDate` / `endDate` (carts recovered in the range; a date-only end includes the whole day, in the workspace timezone) - the list and the count come from one query. Each row: `orderNumber` (the store's), `placedAt`, `recoveredAt`, `match` (`recovery_link` = checked out from the recovery link, `order` = the same cart was checked out, `reported` = the store reported it), `cartValue` / `cartCurrency`, `creditedRevenue` / `creditedCurrency` (net of refunds), `contact` (the cart's owner) and `buyer` (only when the order was stored under someone else). Contact names follow the pii:view rule: masked for a caller without it."
          }
        },
        {
          "name": "Get Campaign Link Stats",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/campaigns/:campaignId/links?startDate=&endDate=",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns",
                ":campaignId",
                "links"
              ],
              "query": [
                {
                  "key": "startDate",
                  "value": "",
                  "description": "Optional, ISO 8601 date",
                  "disabled": true
                },
                {
                  "key": "endDate",
                  "value": "",
                  "description": "Optional, ISO 8601 date",
                  "disabled": true
                }
              ],
              "variable": [
                {
                  "key": "campaignId",
                  "value": ""
                }
              ]
            },
            "description": "Link click stats for a campaign. Requires campaigns:read. Returns { campaignId, summary, links, linksByVariant, peopleByVariant, subscriptionLinks, subscriptionLinksByVariant }. Each link: url, totalClicks, uniqueClicks, humanClicks, uniqueHumanClicks (unique people, bots excluded), botClicks, firstClickAt, lastClickAt, and - for emails sent from 2026-11-24 - an optional elements list, one entry per element the URL sits on: { position (the link's number in the email, document order), element (img | button | text), totalClicks, humanClicks, uniqueHumanClicks, botClicks }. A URL's uniqueHumanClicks is unique people across its elements, never their sum. summary.clickers / summary.openers (and peopleByVariant[variantId]) are the unique people who clicked any tracked link / who opened, bots excluded - the denominators of the click map's share. In-app campaigns return the message's named clicks (action) per variant instead."
          }
        },
        {
          "name": "Get Campaign Failure Reasons",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/campaigns/:campaignId/failure-reasons",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns",
                ":campaignId",
                "failure-reasons"
              ],
              "variable": [
                {
                  "key": "campaignId",
                  "value": ""
                }
              ]
            },
            "description": "Delivery-failure breakdown for a campaign: message.failed events grouped by provider DLR error code, most common first. Returns [{ code, reason, count }] (reason is a best-effort humanized label; code is the raw provider code)."
          }
        },
        {
          "name": "Get Campaign Recipients",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/campaigns/:campaignId/recipients?limit=50&offset=0",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns",
                ":campaignId",
                "recipients"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "50",
                  "description": "Page size; default 50, max 200."
                },
                {
                  "key": "offset",
                  "value": "0",
                  "description": "Rows to skip; default 0."
                },
                {
                  "key": "status",
                  "value": "opened",
                  "disabled": true,
                  "description": "Only people who reached this status on any of their events: sent | delivered | opened | clicked | failed | bounced | unsubscribed | skipped (skipped people are hidden unless asked for)."
                },
                {
                  "key": "skipReason",
                  "value": "control_group",
                  "disabled": true,
                  "description": "Only people whose latest skip had this reason. Implies status=skipped."
                },
                {
                  "key": "sortBy",
                  "value": "reached",
                  "disabled": true,
                  "description": "reached (furthest stage) | lastActivity | events. Any other value keeps the default order: first event, newest first. Every order ends in the person's id, so pages never repeat or skip anyone."
                },
                {
                  "key": "sortOrder",
                  "value": "desc",
                  "disabled": true,
                  "description": "asc | desc; default desc."
                },
                {
                  "key": "includeBots",
                  "value": "false",
                  "disabled": true,
                  "description": "Default false: bot, scanner and machine opens / clicks are not a stage the person reached and are not counted in eventCount - the same rule as the campaign's open and click rates."
                }
              ],
              "variable": [
                {
                  "key": "campaignId",
                  "value": ""
                }
              ]
            },
            "description": "The people a campaign messaged, one row per person: { data: [{ userId, email, phone, name, furthestStatus, statuses, machineOnly, eventCount, firstEventAt, lastEventAt, failureReason, skipReason, simulated }], pagination }. furthestStatus is the furthest stage reached, on the ladder skipped < served < queued < sent < delivered < displayed < undelivered < failed < bounced < opened < dismissed < clicked < converted; converted is reached on every channel when the campaign has a primary goal and its attribution credits the person (the same engine as the conversion figures in GET /stats); unsubscribed is not a stage and shows only in statuses. status=converted lists them. convertedUnavailable: true means that step failed and nobody is shown as converted - not zero. Names and contact details are masked for a caller without pii:view."
          }
        },
        {
          "name": "List Campaign Conversions",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/campaigns/:campaignId/conversions?limit=25",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns",
                ":campaignId",
                "conversions"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "25",
                  "description": "Rows per page; default 25, max 100."
                },
                {
                  "key": "goal",
                  "value": "primary",
                  "disabled": true,
                  "description": "primary | secondary:<eventName>. Omitted: every goal of the campaign, newest conversion first."
                },
                {
                  "key": "variantId",
                  "value": "",
                  "disabled": true,
                  "description": "Only conversions credited to this variant's message (the A/B table's split)."
                },
                {
                  "key": "startDate",
                  "value": "2026-11-01",
                  "disabled": true,
                  "description": "Start of the SEND range, as for GET /stats (date or ISO instant). Ignored without endDate."
                },
                {
                  "key": "endDate",
                  "value": "2026-11-07",
                  "disabled": true,
                  "description": "End of the SEND range, as for GET /stats. Ignored without startDate."
                },
                {
                  "key": "cursor",
                  "value": "",
                  "disabled": true,
                  "description": "nextCursor from the previous page."
                }
              ],
              "variable": [
                {
                  "key": "campaignId",
                  "value": ""
                }
              ]
            },
            "description": "The campaign's attributed conversions, one row per person and goal: { configured, attributionModel, windowHours, goals: [{ key, kind, eventName, label, windowHours, conversions }], total, data: [{ userId, name, email, phone, externalId, goalKey, goalKind, goalLabel, eventName, convertedAt, messageAt, minutesToConvert, credit, variantId, variantName, channel, order: { orderNumber, amount, currency } | null }], nextCursor, failed? }. Rows come from the same attribution as the conversion figures in GET /stats (goal, conditions, window, model, send range, people only, never the control group), so total - sent on the first page only - equals that count for the same goal(s), variant and range; under the linear model each row's credit is its share and the credits add up to the count. Newest first; page with nextCursor. configured=false: the campaign has no conversion goal. failed=true: the query failed - not zero. Names and contact details are masked for a caller without pii:view, as for recipients. Requires campaigns:read."
          }
        },
        {
          "name": "Get Recipient Timeline",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/campaigns/:campaignId/recipients/:userId",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns",
                ":campaignId",
                "recipients",
                ":userId"
              ],
              "variable": [
                {
                  "key": "campaignId",
                  "value": ""
                },
                {
                  "key": "userId",
                  "value": ""
                }
              ]
            },
            "description": "Per-user message event timeline for one campaign: { timeline: [{ eventId, eventName, timestamp, properties, channel }] }, or { status: 'unknown', reason, timeline: [] } when nothing was recorded. For a webhook campaign it also returns webhookResponse { status, contentType, body, truncated, at } when the latest FAILED call to this person (non-2xx) has a stored response: values that look like secrets are masked, the body is cut to its first 2 KB, and it is kept 30 days. A successful response body and the request headers are never stored. Returned only to a caller who may see personal data (pii:view; an API key only with that scope). Absent when nothing is stored or Joryio staff turned response storage off for the organization."
          }
        },
        {
          "name": "Get Campaign Unsubscribe Reasons",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/campaigns/:campaignId/unsubscribe-reasons",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns",
                ":campaignId",
                "unsubscribe-reasons"
              ],
              "variable": [
                {
                  "key": "campaignId",
                  "value": ""
                }
              ]
            },
            "description": "Unsubscribes by reason for a campaign: one row per person who unsubscribed through the campaign's links (message.unsubscribed), by the reason on their latest unsubscribe, trimmed and lower-cased. Returns { total, reasons: [{ reason, count }], others } - the top 8 reasons, the rest summed in others; reason null = no reason given (also every unsubscribe recorded before the reason was stored on the analytics event, October 2026). Requires campaigns:read."
          }
        },
        {
          "name": "Get Campaign Skip Reasons (Not sent)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/campaigns/:campaignId/skip-reasons",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns",
                ":campaignId",
                "skip-reasons"
              ],
              "variable": [
                {
                  "key": "campaignId",
                  "value": ""
                }
              ]
            },
            "description": "The \"Not sent\" breakdown: people in the audience the campaign deliberately did not message, one row per person by the reason on their latest message.skipped event, most common first. Returns { total, reasons: [{ reason, count }] }. Reasons include control_group (held out to measure impact - intentional), global_control, frequency_cap, suppression_list, category_unsubscribed, channel_unsubscribed, email_address_suppressed, sender_group_unsubscribed, quiet_time, volume_cap, missing_contact, duplicate_recipient, consent_recheck_opted_out and coupon_unavailable. To list the people behind one reason: GET /campaigns/:campaignId/recipients?skipReason=<reason>."
          }
        },
        {
          "name": "Get Campaign Send Occurrences",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/campaigns/:campaignId/send-occurrences",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns",
                ":campaignId",
                "send-occurrences"
              ],
              "variable": [
                {
                  "key": "campaignId",
                  "value": ""
                }
              ]
            },
            "description": "Per-send breakdown for a recurring campaign - the 'is this decaying?' view. Rows are keyed on SEND DATE, derived from the events themselves, so it covers campaigns that already ran. A campaign that sends more than once in a day has those sends combined in one row; `occurrence` is null while rows are date-derived (`derivedFromDates: true`). Engagement is attributed to the send that preceded it, bounded by that recipient's next send, so opens are never credited to the wrong send. Bots excluded. Rates use delivered as the denominator, falling back to sent when delivery is untracked."
          }
        },
        {
          "name": "Get Campaign Time to Engage",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/campaigns/:campaignId/time-to-engage?startDate=2026-01-01&endDate=2026-01-31",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns",
                ":campaignId",
                "time-to-engage"
              ],
              "query": [
                {
                  "key": "startDate",
                  "value": "2026-01-01",
                  "description": "Optional ISO date (inclusive)"
                },
                {
                  "key": "endDate",
                  "value": "2026-01-31",
                  "description": "Optional ISO date (inclusive)"
                }
              ],
              "variable": [
                {
                  "key": "campaignId",
                  "value": ""
                }
              ]
            },
            "description": "Distribution of how long recipients took to first open or click, measured PER RECIPIENT from their own send time - so it is meaningful for triggered campaigns, where every person has a different send moment. Bot engagements are excluded. Returns { buckets: [{ label, users, share, cumulative }], medianMinutes, engagers }; medianMinutes is interpolated from the bucket a cumulative 50% falls in, and is null when nobody has engaged."
          }
        },
        {
          "name": "Get Campaign Conversion Timing",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/campaigns/:campaignId/conversion-timing?granularity=day&startDate=2026-01-01&endDate=2026-01-31",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns",
                ":campaignId",
                "conversion-timing"
              ],
              "query": [
                {
                  "key": "granularity",
                  "value": "day",
                  "description": "Optional: day (default) or hour"
                },
                {
                  "key": "startDate",
                  "value": "2026-01-01",
                  "description": "Optional ISO date - gates the SEND, as for /stats"
                },
                {
                  "key": "endDate",
                  "value": "2026-01-31",
                  "description": "Optional ISO date - gates the SEND, as for /stats"
                }
              ],
              "variable": [
                {
                  "key": "campaignId",
                  "value": ""
                }
              ]
            },
            "description": "When the campaign's attributed conversions happened. Uses the campaign's conversion tracking (primary goal, property conditions, window, attribution model) and the same query as conversionStats on /stats, split into buckets by the conversion's calendar day (or hour) in the workspace time zone - the buckets the engagement-over-time chart uses for opens and clicks. The buckets add up to the conversion count /stats returns for the same range. Returns { configured, granularity, total, buckets: [{ date, conversions }], majorityWithinHours }; majorityWithinHours is the smallest number of hours from the credited send within which more than half of the conversions arrived. configured is false (and nothing else is set) when the campaign has no conversion goal."
          }
        },
        {
          "name": "Get Campaign Engagement Timing",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/campaigns/:campaignId/engagement-timing?granularity=hour&startDate=2026-01-01&endDate=2026-01-02&count=people&includeBots=false",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns",
                ":campaignId",
                "engagement-timing"
              ],
              "query": [
                {
                  "key": "granularity",
                  "value": "hour",
                  "description": "Optional: day (default) or hour"
                },
                {
                  "key": "startDate",
                  "value": "2026-01-01",
                  "description": "Optional YYYY-MM-DD - start of the event range, as for /stats"
                },
                {
                  "key": "endDate",
                  "value": "2026-01-02",
                  "description": "Optional YYYY-MM-DD - end of the event range, as for /stats"
                },
                {
                  "key": "count",
                  "value": "people",
                  "description": "Optional: people (default) - each person once, in the bucket of their first open / click; events - every open and click"
                },
                {
                  "key": "includeBots",
                  "value": "false",
                  "description": "Optional: true counts bot and scanner opens / clicks too (default false)"
                }
              ],
              "variable": [
                {
                  "key": "campaignId",
                  "value": ""
                }
              ]
            },
            "description": "Sends, opens and clicks per hour or day in the workspace time zone, counted with the same rules as /stats: with count=people the opened / clicked buckets add up to the unique (human, unless includeBots) opened / clicked for the same range; with count=events, to the totals. Bucket keys match conversion-timing, so the two series line up. Returns { granularity, count, includeBots, buckets: [{ date, sent, opened, clicked }], totals: { sent, opened, clicked } }."
          }
        },
        {
          "name": "Send Transactional Message",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"userId\": \"user-123\",\n  \"channel\": \"email\",\n  \"message\": {\n    \"subject\": \"Your order confirmation\",\n    \"html\": \"<p>Thank you for your order, {{ user.firstName }}!</p>\"\n  },\n  \"triggerData\": {\n    \"name\": \"Order Completed\",\n    \"properties\": {\n      \"orderId\": \"ORD-2024-001\",\n      \"total\": 99.99\n    }\n  },\n  \"idempotencyKey\": \"order-ORD-2024-001-confirmation\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/campaigns/transactional/send",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns",
                "transactional",
                "send"
              ]
            },
            "description": "Send a one-off message to a single user without creating a campaign. channel: email|sms|push|viber. `message` carries subject (email subject / push title), body (plain text / sms / push body), html (email). Transactional Viber requires `viberTemplateId` — an APPROVED template from the Viber template registry (Rakuten Viber mandates pre-approved templates for transactional/OTP messages since 2026-07-01); the template body IS the message (`message` may be {}), and optional `variables` fill its dynamic fields. Optional `triggerData` ({ type, name, properties, metadata }) is available to personalization; optional `idempotencyKey` dedupes retries. When the template runs `{% skip_message %}` for this user (or the email is too large to send), nothing is sent or charged and the call answers 422 with `code: \"message_skipped\"`, `reason` (`skipped_by_template` | `email_too_large`) and the template's `detail` - a deliberate outcome, not an error to retry."
          }
        }
      ]
    },
    {
      "name": "Canvas",
      "item": [
        {
          "name": "Create Canvas",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Onboarding Flow\",\n  \"description\": \"Multi-step onboarding journey\",\n  \"sendType\": \"trigger\",\n  \"entryTrigger\": {\n    \"type\": \"event\",\n    \"config\": {\n      \"eventName\": \"user_signed_up\"\n    }\n  },\n  \"nodes\": [\n    {\n      \"id\": \"start\",\n      \"type\": \"trigger\",\n      \"config\": {\n        \"type\": \"event\",\n        \"eventName\": \"user_signed_up\"\n      },\n      \"position\": {\n        \"x\": 0,\n        \"y\": 0\n      }\n    },\n    {\n      \"id\": \"delay1\",\n      \"type\": \"delay\",\n      \"config\": {\n        \"delayType\": \"duration\",\n        \"value\": 1,\n        \"unit\": \"days\"\n      },\n      \"position\": {\n        \"x\": 200,\n        \"y\": 0\n      }\n    },\n    {\n      \"id\": \"email1\",\n      \"type\": \"email\",\n      \"config\": {\n        \"subject\": \"Welcome!\",\n        \"html\": \"<p>Thanks for signing up, {{ user.firstName }}</p>\"\n      },\n      \"position\": {\n        \"x\": 400,\n        \"y\": 0\n      }\n    }\n  ],\n  \"edges\": [\n    {\n      \"id\": \"e1\",\n      \"source\": \"start\",\n      \"target\": \"delay1\"\n    },\n    {\n      \"id\": \"e2\",\n      \"source\": \"delay1\",\n      \"target\": \"email1\"\n    }\n  ]\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/journeys",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "journeys"
              ]
            },
            "description": "Create a journey (canvas). Each node is { id, type, config, position? } - node settings live in `config`, and `entryTrigger` is { type, config } (e.g. type 'event' with config.eventName). Valid entryTrigger types: event, api, entity_change, whatsapp_inbound, sms_inbound, viber_inbound, attribute_change, subscription_status, schedule. Segment Entry is not a trigger. For entries caused by something the person did, use an Event trigger with a filter; for entries caused by time passing, use a recurring journey over the segment. Created journeys start as drafts - activate to go live. A journey has exactly one node of type `trigger` (a second one is refused with 400); it is stored with the id `wizard-trigger` and locked, and edges and variants that named its old id follow it - whatever id you sent."
          }
        },
        {
          "name": "Get All Canvases",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "List the workspace's journeys (archived ones only with `status=archived`). Optional filters: `status`, `q` (name), `tags`, `createdBy`, `editedBy`, `sortBy` / `sortOrder`, `page` / `limit` (1-100), and `triggerEvent` - only journeys whose entry trigger is that event, e.g. `whatsapp.cart.received` (\"WhatsApp cart received\"). Needs `canvas:read`.",
            "url": {
              "raw": "{{baseUrl}}/journeys",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "journeys"
              ],
              "query": [
                {
                  "key": "triggerEvent",
                  "value": "whatsapp.cart.received",
                  "description": "Only journeys whose entry trigger is this event.",
                  "disabled": true
                }
              ]
            }
          }
        },
        {
          "name": "List Enterable Journeys",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/journeys/enterable?q=",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "journeys",
                "enterable"
              ],
              "query": [
                {
                  "key": "q",
                  "value": "",
                  "description": "Optional: part of the journey name"
                }
              ]
            },
            "description": "The live (active) journeys a person can be added to with POST /journeys/:canvasId/enter/:userId, as { data: [{ id, name, activatedAt }] }, sorted by name, at most 100. Requires canvas:enter (or canvas:read) - a picker for integrations that may add people to journeys without reading them."
          }
        },
        {
          "name": "Enter a User into a Journey",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"context\": {\n    \"source\": \"crm-sync\"\n  }\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/journeys/:canvasId/enter/:userId",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "journeys",
                ":canvasId",
                "enter",
                ":userId"
              ],
              "variable": [
                {
                  "key": "canvasId",
                  "value": "{{canvasId}}"
                },
                {
                  "key": "userId",
                  "value": "{{userId}}"
                }
              ]
            },
            "description": "Add one contact to a live journey (the API entry path). userId is the contact's Joryio id. Optional body context is readable in the journey as context variables. The journey's re-entry policy applies; a skipped entry returns null. Requires canvas:enter (carried by canvas:activate)."
          }
        },
        {
          "name": "Get Canvas by ID",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/journeys/:canvasId",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "journeys",
                ":canvasId"
              ],
              "variable": [
                {
                  "key": "canvasId",
                  "value": "{{canvasId}}"
                }
              ]
            },
            "description": "One journey in full: trigger, nodes (messages with their content, waits, branches, conditions, exits), edges, status, versions and settings. Requires canvas:read."
          }
        },
        {
          "name": "Update Journey",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/journeys/:canvasId",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "journeys",
                ":canvasId"
              ],
              "variable": [
                {
                  "key": "canvasId",
                  "value": "{{canvasId}}"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Welcome journey v3\",\n  \"settings\": {\n    \"timezone\": \"Europe/Athens\"\n  },\n  \"expectedRevision\": 12\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Update a journey's draft. Every field is optional; only the fields sent change. `settings` is merged into what is stored (only the keys sent change, a key sent as null is removed); the personalized-variants progress the platform keeps is never taken from a request. Send the `revision` you read as `expectedRevision`: if the journey was updated since, the update is refused with 409 `canvas_changed_elsewhere` (and the current `revision`) instead of overwriting that change. A live journey's edits - steps, connections, entry trigger and variants - reach people when published (Publish Journey); until then Discard Journey Draft throws them away or, for a paused journey, when it resumes. Permission: `canvas:write`."
          }
        },
        {
          "name": "Discard Journey Draft",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "description": "Throw away a journey's unpublished edits: its draft steps, connections, entry trigger and variants are restored from the published version, and its `revision` moves on (a save made against the discarded draft is refused with 409). A live journey runs its published version - edits saved with Update Journey change nothing that runs until it is published. No-op for a journey that was never published. Returns the journey. Permission: `canvas:write`.",
            "url": {
              "raw": "{{baseUrl}}/journeys/:canvasId/discard-draft",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "journeys",
                ":canvasId",
                "discard-draft"
              ],
              "variable": [
                {
                  "key": "canvasId",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "Activate Canvas",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/journeys/:canvasId/activate",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "journeys",
                ":canvasId",
                "activate"
              ],
              "variable": [
                {
                  "key": "canvasId",
                  "value": ""
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"launchReviewOverride\": {\n    \"reason\": \"Transactional journey - no unsubscribe line by design\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Body is optional; `launchReviewOverride.reason` (3-300 chars) activates past Launch Review blockers on purpose, recorded on the journey and in the audit log. The publish route accepts the same field. On a PAUSED journey, activate = resume, and the body may also carry `resumePolicy` (see Resume Journey). When resuming a journey whose draft was edited while paused, the edits publish as a new version first; optional `userTransition` (`keep_on_version` default, `migrate_to_new`, `force_exit`) decides what happens to people already in the journey, as on publish."
          }
        },
        {
          "name": "Resume Journey",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/journeys/:canvasId/resume",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "journeys",
                ":canvasId",
                "resume"
              ],
              "variable": [
                {
                  "key": "canvasId",
                  "value": ""
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"resumePolicy\": {\n    \"maxHeldDays\": 7,\n    \"action\": \"exit\"\n  },\n  \"userTransition\": \"keep_on_version\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Resume a paused journey. Body is optional. While paused, delays keep counting and people whose delay ended wait at their next step; on resume they all move on at once. `resumePolicy` changes that for people held at the paused step for longer than `maxHeldDays` (1-365): `action: \"exit\"` exits them (exitReason `resume_expired`), `action: \"goto\"` with `targetNodeId` continues them from that step instead. People still inside a delay are not affected. Omit the body to continue everyone. If the journey's draft was edited while paused (steps, connections, entry trigger or variants), resuming first publishes it as a new version, and `userTransition` (`keep_on_version` default, `migrate_to_new`, `force_exit`) decides what happens to people already in the journey - the same choice as publish. Permission: `canvas:activate`."
          }
        },
        {
          "name": "Exit All Contacts",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/journeys/:canvasId/exit-all",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "journeys",
                ":canvasId",
                "exit-all"
              ],
              "variable": [
                {
                  "key": "canvasId",
                  "value": ""
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"confirmName\": \"Win-back\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Exit everyone currently in an active or paused journey (in a delay, waiting or held) with exitReason `manual_exit_all`; no messages are sent. `confirmName` must equal the journey name. Returns 202 `{ status: \"started\" | \"already_running\", contacts }` and runs in the background; idempotent (one run per journey at a time, re-running exits whoever is left). Audit-logged. Permission: `canvas:activate`."
          }
        },
        {
          "name": "Get Journey In-Flight Counts",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/journeys/:canvasId/in-flight?heldOverDays=7",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "journeys",
                ":canvasId",
                "in-flight"
              ],
              "variable": [
                {
                  "key": "canvasId",
                  "value": ""
                }
              ],
              "query": [
                {
                  "key": "heldOverDays",
                  "value": "7"
                }
              ]
            },
            "description": "Who is in the journey now: `{ total, inDelay, held, waitingOther, active, heldOver }`. `held` = waiting at a paused step (their delay or wait ended); `heldOver` (only with `heldOverDays`) = about how many have been held longer than that. Permission: `canvas:read`."
          }
        },
        {
          "name": "Get Launch Review",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/journeys/{{canvasId}}/launch-review",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "journeys",
                "{{canvasId}}",
                "launch-review"
              ]
            },
            "description": "Launch Review for a journey: the campaign checks over every message node plus node_unreachable. Activation and publish run the same review and answer 409 launch_review_blocked when blockers stand and the workspace requires a clean list."
          }
        },
        {
          "name": "Get Journey Execution",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/journeys/{{canvasId}}/executions/:executionId",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "journeys",
                "{{canvasId}}",
                "executions",
                ":executionId"
              ],
              "variable": [
                {
                  "key": "executionId",
                  "value": ""
                }
              ]
            },
            "description": "One journey execution (one person's run) with its step history. Each webhook step in history carries webhook { delivered, status, ok, durationMs, attempts, error, savedFields, responseBodyStored }; a failed call (non-2xx) adds webhook.response { status, contentType, body, truncated } - values that look like secrets masked, the first 2 KB of the body, kept 30 days - returned only to a caller with pii:view (an API key only with that scope); others get webhook.responseHidden: true. A successful response body and the request headers are never stored. `deliveryStatusUnavailable: true` when the final delivery outcomes could not be read - a step without `finalStatus` is then unknown, not healthy (added November 2026)."
          }
        },
        {
          "name": "Get Canvas Stats",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/journeys/:canvasId/stats",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "journeys",
                ":canvasId",
                "stats"
              ],
              "variable": [
                {
                  "key": "canvasId",
                  "value": ""
                }
              ]
            },
            "description": "Journey-level stats for the range (`startDate`, `endDate`): entries, active, completed, exited, `conversionStats`, `revenue`, `uplift` - conversions, revenue and both uplift groups count people only (an event flagged `$is_bot` converts no one on any goal since 2026-11-24; a store order, with no bot flag, always counts). `unavailable` lists the parts whose query failed (`conversions`, `revenue`, `uplift`); each is `null` and means \"could not load\", not \"none\" (added November 2026)."
          }
        },
        {
          "name": "List Journey Recovered Carts",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/journeys/:canvasId/recovered-carts?startDate=2026-10-01&endDate=2026-10-31&limit=25&offset=0",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "journeys",
                ":canvasId",
                "recovered-carts"
              ],
              "query": [
                {
                  "key": "startDate",
                  "value": "2026-10-01",
                  "description": "Optional. Carts recovered on or after this day (or instant)"
                },
                {
                  "key": "endDate",
                  "value": "2026-10-31",
                  "description": "Optional. Carts recovered up to this day, inclusive (or before this instant)"
                },
                {
                  "key": "limit",
                  "value": "25",
                  "description": "Rows per page, 1-100"
                },
                {
                  "key": "offset",
                  "value": "0",
                  "description": "Rows to skip"
                }
              ],
              "variable": [
                {
                  "key": "canvasId",
                  "value": ""
                }
              ]
            },
            "description": "The abandoned carts this journey recovered - the list behind the recovered-carts figure. Requires `canvas:read`. Paginated (`limit` 1-100, default 25; `offset`), newest recovery first. `total` is the same number as `revenue.recoveredCarts` on /stats for the same `startDate` / `endDate` (carts recovered in the range; a date-only end includes the whole day, in the workspace timezone) - the list and the count come from one query. Each row: `orderNumber` (the store's), `placedAt`, `recoveredAt`, `match` (`recovery_link` = checked out from the recovery link, `order` = the same cart was checked out, `reported` = the store reported it), `cartValue` / `cartCurrency`, `creditedRevenue` / `creditedCurrency` (net of refunds), `contact` (the cart's owner) and `buyer` (only when the order was stored under someone else). Contact names follow the pii:view rule: masked for a caller without it."
          }
        },
        {
          "name": "Get Journey Audience Sync Results",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/journeys/:canvasId/audience-sync",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "journeys",
                ":canvasId",
                "audience-sync"
              ],
              "variable": [
                {
                  "key": "canvasId",
                  "value": ""
                }
              ]
            },
            "description": "Audience Sync results per step of the journey (added November 2026). Requires `canvas:read`. `steps` has one row per Audience Sync step and integration it has synced to: `nodeId`, `integrationId`, `connectorId`, `platform` (\"Meta\", \"Google Ads\", \"TikTok\", \"LinkedIn\", \"Criteo\"), `action` (`add_to_audience` / `remove_from_audience`), and running totals since the step first ran - `sent` (people the step sent), `accepted` (the platform took them), `notMatched` (invalid entries the platform reported, e.g. Meta's `num_invalid_entries`), `failed` (gave up after retries). `lastSync` is the latest upload with this step's people - `at`, `status` (`ok` / `failed`), `sent`, `accepted`, `notMatched`, and `error` (the platform's message, made readable) - or `null` before the first. The platforms report per upload, not per person, so there is no per-person \"accepted\"; a person the platform cannot match (no email or phone it accepts) is skipped before sending and is in none of these numbers."
          }
        },
        {
          "name": "Test Webhook",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"url\": \"https://api.example.com/users/{{ user.id }}\",\n  \"method\": \"POST\",\n  \"headers\": {\n    \"Content-Type\": \"application/json\"\n  },\n  \"bodyType\": \"json\",\n  \"body\": \"{\\\"email\\\": \\\"{{ user.email }}\\\", \\\"firstName\\\": \\\"{{ user.firstName }}\\\"}\",\n  \"auth\": {\n    \"type\": \"bearer\",\n    \"token\": \"your-endpoint-token\"\n  },\n  \"user\": {\n    \"userId\": \"65f0a1b2c3d4e5f6a7b8c9d0\"\n  },\n  \"context\": \"campaign\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/journeys/webhook/test",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "journeys",
                "webhook",
                "test"
              ]
            },
            "description": "Fire a webhook request once - the Send test of the journey Webhook node and the campaign webhook editor - and return the live response. Requires canvas:write; rate limited to 10 per minute. `user` is the Test contact: a real contact carries its internal id as `user.userId` and is loaded from your workspace and rendered exactly as a live send renders it (an id outside the workspace is a 404); a made-up contact (no id) has its fields merged over sample placeholders. `context` is 'journey' (default; adds the X-Joryio-Canvas-Id / Execution-Id / Node-Id headers with test values) or 'campaign' (omits them, as a campaign send does). The response carries ok, status, headers, body (capped; `truncated` when cut), durationMs, error, and `request` {method, url, headers, body} - the request actually sent, with credentials masked. SSRF-checked, no redirects."
          }
        }
      ]
    },
    {
      "name": "Landing Pages",
      "description": "Customer-built public pages with forms. A page is authored with the shared editor (drag & drop or HTML), published into a frozen document served at <pages host>/<workspace handle>/<slug>, and its form writes attributes, list subscriptions and the events 'Landing Page Viewed' / 'Landing Page Form Submitted'. Permissions: landing_pages:read, landing_pages:write, landing_pages:publish. The public routes (GET /p/:handle/:slug, POST /p/:id/view, POST /p/:id/submit) need no auth - the published page signs its own posts.",
      "item": [
        {
          "name": "List Landing Pages",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/landing-pages?status=&q=&tags=&createdBy=&editedBy=&sortBy=editedAt&sortOrder=desc&limit=25&offset=0",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "landing-pages"
              ]
            },
            "description": "Paged list of the workspace's pages with status, stats (views, submissions), createdBy/updatedBy and public URL: { data, pagination: { total, limit, offset, hasMore } }. ?templates=true lists the workspace's own templates followed by the built-in ones. Filters: ?status=draft,published,archived (comma-separated), ?q= name search, ?tags= comma-separated tag names, ?createdBy= / ?editedBy= comma-separated user ids. Ordering across the whole list: ?sortBy=name|status|views|submissions|createdAt|editedAt|publishedAt (default editedAt), ?sortOrder=asc|desc (default desc). ?limit= (default 100, max 100), ?offset=. Requires landing_pages:read."
          }
        },
        {
          "name": "Create Landing Page",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/landing-pages",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "landing-pages"
              ]
            },
            "description": "Create a page as a draft. mode dnd (html + css + grapejsData) or html. `form` is the field schema the public submit validates against: types email|phone|text|number|date|dropdown|radio|checkbox|checkbox_group|subscriptions|hidden; each field writes the attribute named by `attribute` (default: its key); email/phone identify the person; `lists` on a checkbox or subscriptions field subscribe to lists; hidden fields take a fixed value or utm_source|utm_medium|utm_campaign|utm_content|utm_term|referrer|page. `submit.action` message|redirect. Slug is unique per workspace and derived from the name when omitted. Requires landing_pages:write. `sdkEnabled` (default false) loads the workspace's Web SDK on the live page - needs an active Web app; visitors are tracked and identified on submit. `personalized` (default false) renders the page's Liquid for visitors arriving with a person token (?jp=), uncached.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Spring sale\",\n  \"slug\": \"spring-sale\",\n  \"mode\": \"html\",\n  \"html\": \"<h1>Spring sale</h1><form><input name=\\\"email\\\" type=\\\"email\\\" required placeholder=\\\"Email\\\"><input name=\\\"first_name\\\" placeholder=\\\"First name\\\"><label><input type=\\\"checkbox\\\" name=\\\"marketing\\\"> Email me offers</label><button type=\\\"submit\\\">Sign up</button></form>\",\n  \"form\": {\n    \"fields\": [\n      {\n        \"key\": \"email\",\n        \"type\": \"email\",\n        \"label\": \"Email\",\n        \"required\": true\n      },\n      {\n        \"key\": \"first_name\",\n        \"type\": \"text\",\n        \"label\": \"First name\",\n        \"attribute\": \"firstName\"\n      },\n      {\n        \"key\": \"marketing\",\n        \"type\": \"checkbox\",\n        \"label\": \"Email me offers\",\n        \"lists\": [\n          \"{{listId}}\"\n        ]\n      }\n    ],\n    \"submit\": {\n      \"action\": \"message\",\n      \"message\": \"Thanks - check your inbox.\"\n    },\n    \"identity\": \"email\"\n  },\n  \"seo\": {\n    \"title\": \"Spring sale\",\n    \"description\": \"20% off this week\"\n  },\n  \"language\": \"en\",\n  \"dir\": \"ltr\"\n}"
            }
          }
        },
        {
          "name": "Get Landing Page",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/landing-pages/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "landing-pages",
                ":id"
              ]
            },
            "description": "One page in full, with publicUrl (when published) and previewUrl. Requires landing_pages:read."
          }
        },
        {
          "name": "Landing Page History",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/landing-pages/:id/history?limit=50",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "landing-pages",
                ":id",
                "history"
              ]
            },
            "description": "Audit history of one page, newest first: create, update, publish, take-down (an update with status published -> draft) and delete, each with the actor (a user id or api_key:<id>). ?limit= 1-200 (default 50). Requires landing_pages:read."
          }
        },
        {
          "name": "Update Landing Page",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/landing-pages/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "landing-pages",
                ":id"
              ]
            },
            "description": "Update any of the create fields. The live page changes only on the next publish. Requires landing_pages:write.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Spring sale - week 2\",\n  \"seo\": {\n    \"title\": \"Spring sale, week 2\"\n  }\n}"
            }
          }
        },
        {
          "name": "Delete Landing Page",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/landing-pages/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "landing-pages",
                ":id"
              ]
            },
            "description": "Delete a draft (unpublish a live page first). Requires landing_pages:write."
          }
        },
        {
          "name": "Duplicate Landing Page",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/landing-pages/:id/duplicate",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "landing-pages",
                ":id",
                "duplicate"
              ]
            },
            "description": "Copy a page, or create a page from a template (a built-in or the workspace's own). {\"asTemplate\": true} saves the copy as a workspace template. Requires landing_pages:write.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"asTemplate\": false\n}"
            }
          }
        },
        {
          "name": "Publish Landing Page",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/landing-pages/:id/publish",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "landing-pages",
                ":id",
                "publish"
              ]
            },
            "description": "Freeze the sanitized document and serve it at the public URL. Fails when the form schema has problems or the markup has no <form> while fields are defined. Requires landing_pages:publish."
          }
        },
        {
          "name": "Unpublish Landing Page",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/landing-pages/:id/unpublish",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "landing-pages",
                ":id",
                "unpublish"
              ]
            },
            "description": "Take the page down; the public URL answers 404 and the page's signing token rotates. Requires landing_pages:publish."
          }
        },
        {
          "name": "Preview Landing Page",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/landing-pages/:id/preview",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "landing-pages",
                ":id",
                "preview"
              ]
            },
            "description": "The draft rendered as the live page would be (text/html); its form posts are acknowledged and discarded. Requires landing_pages:read."
          }
        },
        {
          "name": "Landing Page Submissions CSV",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/landing-pages/:id/submissions.csv",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "landing-pages",
                ":id",
                "submissions.csv"
              ]
            },
            "description": "Every submission of the page as a streamed CSV (text/csv, oldest first): submitted_at, one column per form field (every answer, mapped to an attribute or not), person_id, identified_by, lists_subscribed, referrer and the utm_* values. Personal data is masked without pii:view. Requires landing_pages:read."
          }
        },
        {
          "name": "Landing Page Submissions",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/landing-pages/:id/submissions?limit=50",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "landing-pages",
                ":id",
                "submissions"
              ]
            },
            "description": "The submissions ledger, newest first: fields, the person it was written to, referrer and UTM, lists subscribed. Personal data is masked unless the caller holds pii:view. ?limit= (max 200), ?before=<ISO date> to page. Requires landing_pages:read."
          }
        },
        {
          "name": "Landing Page Report",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/landing-pages/:id/report?days=30",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "landing-pages",
                ":id",
                "report"
              ],
              "query": [
                {
                  "key": "days",
                  "value": "30"
                }
              ]
            },
            "description": "Views, first-time views and submissions per UTC day over the last ?days= days (1-365, default 30), the totals and conversion rate for the range, and the lifetime counters. Requires landing_pages:read."
          }
        },
        {
          "name": "Landing Page Review",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/landing-pages/:id/review",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "landing-pages",
                ":id",
                "review"
              ]
            },
            "description": "Launch Review for the page: findings in the shared shape (code, severity blocker|recommendation, scope, params). Blockers stop a publish (POST .../publish answers 400 with the same findings); recommendations never block. Requires landing_pages:read."
          }
        },
        {
          "name": "Landing Pages Capabilities",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/landing-pages/capabilities",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "landing-pages",
                "capabilities"
              ]
            },
            "description": "What the server can add to a form: { botCheck } is true when Cloudflare Turnstile is configured, so a form may set botCheck: true. Requires landing_pages:read."
          }
        },
        {
          "name": "Get Pages Address",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/landing-pages/handle",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "landing-pages",
                "handle"
              ]
            },
            "description": "The workspace's pages address: { handle, host, example, customHost }. The handle is the workspace's own id, the first label of every page URL (https://<workspace id>.eu1.jrypages.com/<slug>) - opaque, permanent, never chosen or renamed. customHost is the workspace's own active domain, when it has one (page URLs then use it). Requires landing_pages:read."
          }
        },
        {
          "name": "Get Your Domain",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/landing-pages/domain",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "landing-pages",
                "domain"
              ]
            },
            "description": "The workspace's own landing-pages domain (pages.yourbrand.com), or null: { domain: { id, hostname, status (pending | active | failed), verifiedAt, target, records: [{ type, name, value, note }], providerConfigured, lastError? }, limit, used, pagesHost }. `records` are the DNS records to add at your DNS provider (a CNAME to the target and the certificate validation records); `limit` is how many landing-page domains your organization may have (1 by default - ask us to raise it) and `used` how many it has across its workspaces; `pagesHost` is the pages-domain host pages keep serving on. Requires landing_pages:publish."
          }
        },
        {
          "name": "Add Your Domain",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"hostname\": \"pages.yourbrand.com\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/landing-pages/domain",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "landing-pages",
                "domain"
              ]
            },
            "description": "Add the workspace's own domain for landing pages. A subdomain you own (pages.yourbrand.com - not a root domain, never a Joryio domain). Answers the domain with status `pending` and the DNS records to set; page URLs switch to it once it is `active`. 409 when the workspace already has a domain or the organization is at its limit (the message names the limit - ask us to raise it); 400 for an invalid hostname; 409 when another organization has claimed it. Requires landing_pages:publish."
          }
        },
        {
          "name": "Verify Your Domain",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/landing-pages/domain/:id/verify",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "landing-pages",
                "domain",
                ":id",
                "verify"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "<domain id>"
                }
              ]
            },
            "description": "Re-check the DNS records and the certificate at the edge and persist the result: the domain answers with its current status (`active` once the CNAME resolves and the certificate is issued, usually a few minutes after the records are in place; `failed` with `lastError` when validation timed out). Pending domains are also re-checked every five minutes on their own. Requires landing_pages:publish."
          }
        },
        {
          "name": "Remove Your Domain",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/landing-pages/domain/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "landing-pages",
                "domain",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "<domain id>"
                }
              ]
            },
            "description": "Remove the workspace's domain: the hostname is retired at the edge and page URLs revert to the pages domain at once; the pages themselves stay published. Answers { ok: true }. Requires landing_pages:publish."
          }
        }
      ]
    },
    {
      "name": "Custom Entities",
      "item": [
        {
          "name": "Create Entity Definition",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"products\",\n  \"displayName\": \"Products\",\n  \"description\": \"Product catalog\",\n  \"fields\": [\n    {\n      \"name\": \"name\",\n      \"displayName\": \"Product Name\",\n      \"fieldType\": \"string\",\n      \"indexed\": true\n    },\n    {\n      \"name\": \"price\",\n      \"displayName\": \"Price\",\n      \"fieldType\": \"number\"\n    }\n  ]\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/entities",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "entities"
              ]
            }
          }
        },
        {
          "name": "Create Entity Record",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"data\": {\n    \"name\": \"Premium Widget\",\n    \"price\": 99.99,\n    \"sku\": \"WIDGET-001\"\n  }\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/entities/:entityId/records",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "entities",
                ":entityId",
                "records"
              ],
              "variable": [
                {
                  "key": "entityId",
                  "value": ""
                }
              ]
            },
            "description": "Create a single record (object body, `{ \"data\": { ... } }` envelope). This endpoint accepts two body forms: a single record object (this request - returns the full record) or a bare JSON array of record objects for bulk create (max 1000; see 'Create Entity Records (array body)')."
          }
        },
        {
          "name": "Create Entity Records (array body)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "[\n  {\n    \"data\": {\n      \"name\": \"Premium Widget\",\n      \"price\": 99.99,\n      \"sku\": \"WIDGET-001\"\n    }\n  },\n  {\n    \"data\": {\n      \"name\": \"Deluxe Widget\",\n      \"price\": 149.99,\n      \"sku\": \"WIDGET-002\"\n    }\n  }\n]"
            },
            "url": {
              "raw": "{{baseUrl}}/entities/:entityId/records?triggerAlerts=false",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "entities",
                ":entityId",
                "records"
              ],
              "query": [
                {
                  "key": "triggerAlerts",
                  "value": "false",
                  "description": "Set to true to fire relationship alerts (restock etc.) for records that transition in this import"
                }
              ],
              "variable": [
                {
                  "key": "entityId",
                  "value": ""
                }
              ]
            },
            "description": "Create MANY records in one call: POST /entities/:entityId/records with a bare JSON array body (max 1000 elements; no wrapper object). Each element uses the same `{ \"data\": { ... } }` envelope as the single-object form. Every element is validated; invalid elements are reported in failed[] by index while valid elements still process (field-definition validation applies to the whole batch). Response is an aggregate summary: {processed, inserted, insertedIds, failed: [{index, reason}]}."
          }
        },
        {
          "name": "Get Product Selection Match Count",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/entities/product-selections/:selectionId/match-count",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "entities",
                "product-selections",
                ":selectionId",
                "match-count"
              ],
              "variable": [
                {
                  "key": "selectionId",
                  "value": ""
                }
              ]
            },
            "description": "The true number of products a selection matches right now, with the preview cap: `{ matchCount, cap }`. The preview endpoint returns at most `cap` rows (the selection limit, max 50), so it cannot tell you the size of the match."
          }
        },
        {
          "name": "Get Entity Records",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/entities/:entityId/records?limit=50",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "entities",
                ":entityId",
                "records"
              ],
              "variable": [
                {
                  "key": "entityId",
                  "value": ""
                }
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "50"
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Warehouse Syncs",
      "description": "Scheduled imports from BigQuery, Snowflake or Redshift into the same write paths a file import uses. The source is a TABLE OR VIEW plus a watermark column, not free SQL: the query is generated each run so it can carry the incremental predicate. `columnMapping` maps a warehouse column to a target field path - `email`, `externalId`, `phone`, `attributes.<key>`, `subscriptions.<channel>`, or `subscriptions.list.<listId>.<channel>`. Setting `overrideConsent` requires compliance:write, and means more here than on a file import: a sync re-applies it every cycle.",
      "item": [
        {
          "name": "List Warehouse Syncs",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/warehouse-syncs",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "warehouse-syncs"
              ]
            },
            "description": "All configured syncs for the workspace, including each one's last run stats and current watermark."
          }
        },
        {
          "name": "Get Warehouse Sync",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/warehouse-syncs/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "warehouse-syncs",
                ":id"
              ]
            },
            "description": "One sync, with `lastRunStats` (rows read/created/updated/skipped/failed and a bounded error sample) and `watermark`. Also returns `cadence`: what the schedule means in practice. A run that outlasts its interval is refused rather than queued, so a 5-minute schedule on a 7-minute sync really runs every 7 - `cadence.throttled` says when that is happening."
          }
        },
        {
          "name": "List Sync Runs",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/warehouse-syncs/:id/runs?limit=50",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "warehouse-syncs",
                ":id",
                "runs"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "50"
                }
              ]
            },
            "description": "Recent runs, newest first. Each row carries the counters (rows read, created, updated, skipped, failed), the watermark it started from and ended at, a bounded sample of row-level errors, and a run-level error if the run itself failed. The sync object tells you whether it is working NOW; this tells you when it started failing. Kept to the 50 most recent runs per sync."
          }
        },
        {
          "name": "Preview Source Rows",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"integrationId\": \"{{warehouseIntegrationId}}\",\n  \"sourceTable\": \"analytics.public.contacts\",\n  \"limit\": 20\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/warehouse-syncs/preview",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "warehouse-syncs",
                "preview"
              ]
            },
            "description": "A bounded read of the source as it stands - no watermark, no incremental predicate - so a column mapping can be built against real column names. Send exactly one of sourceTable or sourceQuery. Runs inline and is hard-capped at 100 rows."
          }
        },
        {
          "name": "Create Warehouse Sync",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"integrationId\": \"{{warehouseIntegrationId}}\",\n  \"connectorId\": \"snowflake\",\n  \"name\": \"Contacts sync\",\n  \"syncType\": \"users\",\n  \"sourceTable\": \"analytics.public.contacts\",\n  \"watermarkColumn\": \"updated_at\",\n  \"keyColumn\": \"id\",\n  \"schedule\": \"hourly\",\n  \"enabled\": true,\n  \"columnMapping\": {\n    \"EMAIL\": \"email\",\n    \"CUSTOMER_ID\": \"externalId\",\n    \"PLAN\": \"attributes.plan\",\n    \"EMAIL_CONSENT\": \"subscriptions.email\"\n  }\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/warehouse-syncs",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "warehouse-syncs"
              ]
            },
            "description": "Create a sync. `sourceTable` and `watermarkColumn` must be plain identifiers (`table`, `schema.table`, `db.schema.table`) - anything else is rejected, because they are interpolated into generated SQL. Omit `watermarkColumn` for a full refresh every run. `syncType` is `users`, `events` or `deletions`. A `deletions` sync names people to erase: it creates erasure requests on the normal compliance path (the same one the DSR API uses) rather than deleting anything itself, and never queues a second erasure for someone already being erased. `schedule` is one of manual, every_5_min, every_15_min, hourly, every_6_hours, daily, weekly, monthly. `monthly` keeps the day of month you started on, clamped for short months - a sync anchored on the 31st runs on Feb 28 and returns to Mar 31 rather than migrating to the 28th. All schedule arithmetic is UTC. `keyColumn` is optional and recommended: a unique, orderable column (an auto-increment id or a ULID) used as the tiebreaker within one timestamp. With it the cursor becomes (watermarkColumn, keyColumn) and rows sharing a timestamp are read exactly once - neither lost nor re-read. It must be MONOTONIC for late arrivals; a content hash is stable but randomly ordered, so a row added later at the same instant would sort before the cursor and never be read. Provide exactly ONE of sourceTable or sourceQuery. A sourceQuery is a saved read-only SELECT, checked by the same guard at save time; the incremental predicate is applied by wrapping it, so the query MUST output the watermark column (and keyColumn, if set). Only client-settable fields are accepted: name, integrationId, syncType, sourceTable, sourceQuery, watermarkColumn, keyColumn, columnMapping, schedule, enabled, overrideConsent. Any other field (id, organizationId, workspaceId, status, watermark, run counters) is rejected with 400. integrationId must be a warehouse connection in the same workspace, otherwise 404. connectorId is optional and taken from the connection; if sent it must match."
          }
        },
        {
          "name": "Update Warehouse Sync",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"schedule\": \"weekly\",\n  \"enabled\": true\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/warehouse-syncs/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "warehouse-syncs",
                ":id"
              ]
            },
            "description": "Update a sync. Changing `schedule` or `enabled` recomputes when it next comes due. Only client-settable fields are accepted: name, integrationId, syncType, sourceTable, sourceQuery, watermarkColumn, keyColumn, columnMapping, schedule, enabled, overrideConsent. Any other field (id, organizationId, workspaceId, status, watermark, run counters) is rejected with 400. integrationId must be a warehouse connection in the same workspace, otherwise 404. connectorId is optional and taken from the connection; if sent it must match."
          }
        },
        {
          "name": "Run Warehouse Sync Now",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/warehouse-syncs/:id/run",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "warehouse-syncs",
                ":id",
                "run"
              ]
            },
            "description": "Enqueue a run immediately. Returns `queued: false` if the sync is already queued or running - a sync that overlaps itself re-reads the same rows and doubles the warehouse bill for no new data."
          }
        },
        {
          "name": "Rewind Warehouse Sync",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/warehouse-syncs/:id/rewind",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "warehouse-syncs",
                ":id",
                "rewind"
              ]
            },
            "description": "Clear the watermark so the next run re-reads the table from the beginning. Safe: every write is an idempotent upsert. This is the remediation when a column mapping was wrong - fix the mapping, rewind, run."
          }
        },
        {
          "name": "Delete Warehouse Sync",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/warehouse-syncs/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "warehouse-syncs",
                ":id"
              ]
            },
            "description": "Delete the sync configuration. Data already imported is untouched."
          }
        }
      ]
    },
    {
      "name": "In-App Campaigns",
      "item": [
        {
          "name": "Create In-App Campaign (Event Trigger)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Reward Modal on Purchase\",\n  \"channel\": \"in_app\",\n  \"sendType\": \"triggered\",\n  \"channelConfig\": {\n    \"type\": \"modal\",\n    \"triggers\": [\n      {\n        \"type\": \"event\",\n        \"event\": \"Order Completed\"\n      }\n    ],\n    \"frequencyCap\": {\n      \"maxImpressions\": 1,\n      \"timeWindow\": \"day\"\n    },\n    \"priority\": 5,\n    \"liquidEnabled\": true\n  }\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/campaigns",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns"
              ]
            },
            "description": "Create an in-app campaign shown when the user performs an event. channelConfig.type: modal|banner|slideup|fullscreen|custom. Trigger types: immediate|event|attribute_change|attribute_threshold|push_notification_tap. frequencyCap.timeWindow: once|session|day|week|month|lifetime."
          }
        },
        {
          "name": "Create In-App Campaign (Immediate)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Welcome Banner\",\n  \"channel\": \"in_app\",\n  \"sendType\": \"triggered\",\n  \"channelConfig\": {\n    \"type\": \"banner\",\n    \"triggers\": [\n      {\n        \"type\": \"immediate\"\n      }\n    ],\n    \"frequencyCap\": {\n      \"maxImpressions\": 3,\n      \"timeWindow\": \"week\"\n    }\n  },\n  \"targeting\": {\n    \"filterGroups\": [\n      {\n        \"filters\": [\n          {\n            \"type\": \"attribute\",\n            \"field\": \"plan\",\n            \"operator\": \"equals\",\n            \"value\": \"free\"\n          }\n        ],\n        \"operator\": \"AND\"\n      }\n    ]\n  }\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/campaigns",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns"
              ]
            },
            "description": "Create an in-app banner shown on the next eligible session. Audience is the standard campaign `targeting` object (filterGroups / userIds)."
          }
        },
        {
          "name": "Create Placement Campaign (Show when)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Cart upsell after Add to cart\",\n  \"channel\": \"in_app\",\n  \"sendType\": \"triggered\",\n  \"channelConfig\": {\n    \"type\": \"placement\",\n    \"placementId\": \"3f6b2a54-0c1e-4b7a-9d55-1a2b3c4d5e6f\",\n    \"triggers\": [],\n    \"priority\": 8,\n    \"showWhen\": {\n      \"kind\": \"event\",\n      \"event\": \"Added to Cart\"\n    }\n  },\n  \"variants\": [\n    {\n      \"id\": \"v1\",\n      \"name\": \"A\",\n      \"weight\": 100,\n      \"customContent\": {\n        \"mode\": \"data\",\n        \"data\": {\n          \"headline\": \"Free shipping on this order\",\n          \"cta_url\": \"https://shop.example/cart\"\n        }\n      }\n    }\n  ]\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/campaigns",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns"
              ]
            },
            "description": "Create a placement campaign whose item is revealed at a moment in the page view or screen instead of on load: `channelConfig.showWhen`. Kinds: `{ \"kind\": \"load\" }` (default; same as leaving it out), `{ \"kind\": \"seconds\", \"seconds\": 1-3600 }` (web + apps), `{ \"kind\": \"scroll\", \"percent\": 1-100 }` (web only), `{ \"kind\": \"exit\" }` (exit intent, web only, desktop) and `{ \"kind\": \"event\", \"event\": \"<name, 1-255 chars>\" }` (once that event is tracked in this visit; web + apps). Placement (`placement`) and Web personalization (`page_edit`) campaigns only - any other kind than `load` on another campaign is a `400`, as is an unknown kind or a value out of range (checked on every save, a draft included). Every SDK gets the campaign's `showWhen`; web and app SDKs 1.4.0-beta.9 or later honour it, an earlier 1.4.0 beta shows the content on load. `scroll` / `exit` are never served to apps, and `POST /v1/placements/decide` serves only `load` campaigns. The same field works on Update (`PUT /campaigns/:campaignId`). See https://docs.joryio.com/api/campaigns-api#show-when"
          }
        },
        {
          "name": "Get All In-App Campaigns",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/campaigns?channel=in_app&status=active",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns"
              ],
              "query": [
                {
                  "key": "channel",
                  "value": "in_app"
                },
                {
                  "key": "status",
                  "value": "active"
                },
                {
                  "key": "page",
                  "value": "1",
                  "disabled": true
                },
                {
                  "key": "limit",
                  "value": "20",
                  "disabled": true
                }
              ]
            },
            "description": "List in-app campaigns via the unified campaigns list, filtered by channel."
          }
        },
        {
          "name": "Get In-App Campaign by ID",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/campaigns/:campaignId",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns",
                ":campaignId"
              ],
              "variable": [
                {
                  "key": "campaignId",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "Update In-App Campaign",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"status\": \"active\",\n  \"channelConfig\": {\n    \"type\": \"modal\",\n    \"triggers\": [\n      {\n        \"type\": \"event\",\n        \"event\": \"Order Completed\"\n      }\n    ],\n    \"priority\": 8\n  }\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/campaigns/:campaignId",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns",
                ":campaignId"
              ],
              "variable": [
                {
                  "key": "campaignId",
                  "value": ""
                }
              ]
            },
            "description": "Partial update via the unified campaigns API. In-app-specific settings (priority, triggers, frequency cap) are updated inside `channelConfig`."
          }
        },
        {
          "name": "Get In-App Campaign Stats",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/campaigns/:campaignId/in-app-stats",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns",
                ":campaignId",
                "in-app-stats"
              ],
              "variable": [
                {
                  "key": "campaignId",
                  "value": ""
                }
              ]
            },
            "description": "In-app impression/click/conversion stats for one campaign. `headlessReport` is the last 7 days of `POST /v1/placements/decide` answers that returned this campaign against the views reported for them: `{ windowDays, decides, displays, notice }` - `notice` is `strong` (at least 20 decides, views under 5% of them), `soft` (under 25%) or `none`; the dashboard shows it as a notice on the campaign. `unavailable` lists `byVariant` / `displayFrequency` / `byPlacement` / `headlessReport` when that part's query failed - missing, not zero (added November 2026)."
          }
        }
      ],
      "description": "In-app messages are standard campaigns with `channel: \"in_app\"`, managed through the unified /campaigns API. In-app-specific settings (message type, triggers, frequency cap, priority) live in `channelConfig`; content comes from `templateId` or `channelConfig` rather than `variants`."
    },
    {
      "name": "Placements",
      "description": "Placements: named spots inside your app or website (home_hero, cart_upsell) that Joryio fills per person from in-app campaigns and journeys. Define them here; the SDKs fetch their content. See the Placements API page in the docs.",
      "item": [
        {
          "name": "List Placements",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/placements?status=active",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "placements"
              ],
              "query": [
                {
                  "key": "status",
                  "value": "active"
                }
              ]
            },
            "description": "List the workspace's placements with how many campaigns and journeys use each (usage.campaigns, usage.journeys). ?status=active (default) | archived | all. ?include=campaigns adds campaigns: [{ id, name, status }] per placement (its campaigns that are not archived, by name). Requires campaigns:read."
          }
        },
        {
          "name": "Create Placement",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/placements",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "placements"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"key\": \"home_hero\",\n  \"name\": \"Home hero\",\n  \"description\": \"The banner at the top of the home screen\",\n  \"appIds\": null,\n  \"fields\": [\n    {\n      \"key\": \"headline\",\n      \"label\": \"Headline\",\n      \"type\": \"text\",\n      \"required\": true\n    },\n    {\n      \"key\": \"image_url\",\n      \"label\": \"Image\",\n      \"type\": \"image_url\"\n    },\n    {\n      \"key\": \"cta_url\",\n      \"label\": \"Button link\",\n      \"type\": \"url\"\n    }\n  ],\n  \"allowedContent\": [\n    \"native\",\n    \"data\"\n  ],\n  \"emptyBehavior\": \"collapse\",\n  \"maxItems\": 1,\n  \"replacement\": \"higher_priority_only\",\n  \"frequencyCap\": {\n    \"maxImpressions\": 3,\n    \"window\": \"1d\"\n  },\n  \"dismissal\": \"days\",\n  \"dismissalDays\": 7,\n  \"holdoutPercent\": 5,\n  \"cacheTtlSeconds\": 300,\n  \"sizeHint\": {\n    \"aspect\": \"16:9\"\n  }\n}"
            },
            "description": "Define a placement: the key the app's code asks for (home_hero), its data fields, allowed content (native, html, data), empty behavior, max items (1-10), replacement rule, per-person frequency cap, dismissal rule, holdout percent (0-50, default 5) and device cache TTL (60-3600 s). 409 when the key is already used in the workspace. Requires settings:write."
          }
        },
        {
          "name": "Get Placement",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/placements/{{placementId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "placements",
                "{{placementId}}"
              ]
            },
            "description": "One placement, with its usage counts. Requires campaigns:read."
          }
        },
        {
          "name": "Update Placement",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/placements/{{placementId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "placements",
                "{{placementId}}"
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Home hero banner\",\n  \"holdoutPercent\": 10,\n  \"maxItems\": 3\n}"
            },
            "description": "Change any setting. The key is refused (409) once a campaign or journey using the placement went live, because the app asks for it by name - create a new placement instead. An archived placement cannot be edited. Requires settings:write."
          }
        },
        {
          "name": "Archive Placement",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/placements/{{placementId}}/archive",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "placements",
                "{{placementId}}",
                "archive"
              ]
            },
            "description": "Archive (never delete - reports keep resolving it). Refused with 409, naming them, while an active, scheduled or paused campaign or an active or paused journey uses it. Archiving frees the key for a new placement. Requires settings:write."
          }
        },
        {
          "name": "Get Placement Report",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/placements/{{placementId}}/stats?startDate=2026-11-01&endDate=2026-11-21",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "placements",
                "{{placementId}}",
                "stats"
              ],
              "query": [
                {
                  "key": "startDate",
                  "value": "2026-11-01",
                  "description": "First day, YYYY-MM-DD in the workspace reporting time zone (default: 29 days before endDate)"
                },
                {
                  "key": "endDate",
                  "value": "2026-11-21",
                  "description": "Last day, included (default: today). At most 400 days per report."
                }
              ]
            },
            "description": "The placement's report: requests, filled and held-out serves, fill rate, viewable impressions, unique viewers, clicks, CTR, dismissals, conversions, control exposures, revenue from viewers, and uplift against the placement holdout (with a p-value) on the conversion goal of the campaigns and journeys that showed in it - their own conversionTracking goal and window, purchase within 7 days when none is set. goal names it (uplift.reason is mixed_goals when the campaigns here count different goals). uplift is the placement vs nothing - only while the optional placement holdout is on (placementHoldoutPercent). Daily buckets for the whole range, and one row per campaign or journey step (byCampaign) with its own goal, vsNext (its viewers against the people in its A/B control group, who saw the next item instead), vsNothing (against the placement holdout people who would have seen it), holdoutSees (next, or nothing only for control exposures recorded before 2026-11-23, when a placement campaign could leave its slot empty; vsNext is then null) and fallthroughImpressions (views it got only because the control group of a campaign above it saw it instead). Placement campaigns have no holdout of their own: channelConfig.holdoutPercent / holdoutSees are no longer read. headlessReport: the last 7 days of POST /v1/placements/decide answers that returned an item in this placement against the views reported for them - { windowDays, decides, displays, notice } with notice strong (at least 20 decides, views under 5%), soft (under 25%) or none; null when it could not be read (unavailable then names headlessReport). Requires campaigns:read."
          }
        },
        {
          "name": "Decide Placements (server)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"placements\": [\n    \"home_hero\",\n    \"cart_upsell\"\n  ],\n  \"externalId\": \"customer-42\",\n  \"trackingConsent\": \"granted\",\n  \"sessionId\": \"checkout-7f3a\",\n  \"context\": {\n    \"productId\": \"sku-123\"\n  }\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/v1/placements/decide",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "placements",
                "decide"
              ]
            },
            "description": "Headless decision API: the items to show in up to ten placements for one person - exactly one of externalId (your customer id), userId (the Joryio contact id, 24 hex characters - a customer id there is a 400) or anonymousId (a visitor); none or several is a 400 - with the same arbitration, caps, holdout, AI ranking and recommended products as the SDKs. Use a SECRET API key with users:read - never the public SDK key. trackingConsent is required (denied = generic content only). 20 requests per minute per person, then 429. Report views and clicks with each item's deliveryToken to POST /v1/in-app/track (SDK key) from the page that draws it."
          }
        },
        {
          "name": "Decide Placements (with Show when)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"placements\": [\n    \"home_hero\",\n    \"cart_upsell\"\n  ],\n  \"externalId\": \"customer-42\",\n  \"trackingConsent\": \"granted\",\n  \"sessionId\": \"checkout-7f3a\",\n  \"includeShowWhen\": true\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/v1/placements/decide",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "placements",
                "decide"
              ]
            },
            "description": "Opt in to Show when on the headless decision API: with includeShowWhen true (body boolean, or ?includeShowWhen=true|false in the query - any other query value is a 400 \"includeShowWhen must be true or false\", a non-boolean body value a 400 validation error) the answer also returns campaigns whose Show when is seconds, scroll, exit or event. Each such item carries showWhen ({kind, seconds | percent | event}); your page does the timing and reports the view with the item's deliveryToken only when it actually shows the item. A placement may carry recheckOn (event names): after your page has tracked such an event, call decide again. A control answer (isControl true) may carry showWhen: report control_viewed with its controlToken to POST /v1/in-app/track only once that moment has come and the spot was in view. A filled answer may carry deferredControls [{controlToken, showWhen}]: report each once, the same way, at its moment when the spot was in view. Absent or false: only campaigns that show on load, as before. Same auth, consent and limits as Decide Placements (server). See https://docs.joryio.com/api/placements-api#decide-show-when"
          }
        },
        {
          "name": "List Placement Offers",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/placement-offers?status=active",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "placement-offers"
              ],
              "query": [
                {
                  "key": "status",
                  "value": "active",
                  "description": "active (default), archived or all"
                }
              ]
            },
            "description": "Reusable content blocks and coupons for placements. Requires campaigns:read. Each offer carries placementIds (at least one). An offer created before placementIds existed returns null: it is never served, and Launch Review blocks a campaign that uses it."
          }
        },
        {
          "name": "Create Placement Offer",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Ten off this week\",\n  \"placementIds\": [\n    \"8e1a7fa9-5b6d-4a2f-8cab-6f708192a3b4\"\n  ],\n  \"kind\": \"coupon\",\n  \"couponCode\": \"SAVE10\",\n  \"data\": {\n    \"headline\": \"10% off this week\",\n    \"cta_url\": \"https://shop.example/sale\"\n  },\n  \"eligibility\": {\n    \"segmentIds\": [\n      \"3f6b2a54-0c1e-4b7a-9d55-1a2b3c4d5e6f\"\n    ]\n  },\n  \"startsAt\": \"2026-11-23T00:00:00Z\",\n  \"endsAt\": \"2026-11-30T00:00:00Z\",\n  \"fallbackOfferId\": null\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/placement-offers",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "placement-offers"
              ]
            },
            "description": "A content block (kind content) or a coupon (kind coupon) with exactly one code source: couponCode (one static code for everyone) or couponProgramId (a coupon program of this workspace - each verified contact is issued their own code, the same one on every view; when the program cannot give a code, its fallback applies). With eligibility (segmentIds, filterGroups), an optional startsAt / endsAt window and a fallbackOfferId shown when the person is not eligible (same workspace, at most 3 steps, no circle). Requires campaigns:write. placementIds (required, 1-20 - missing, [] or null is refused): the placements of this workspace the offer is for (GET /placements); data is exactly their Data fields, typed - number, yes/no (true/false), colour (hex), link and image (a URL, an app link or a /path); Liquid allowed. A required field is enforced only when every chosen placement has it. Keys no chosen placement has are dropped on save."
          }
        },
        {
          "name": "Create Placement Offer (code per person from a coupon program)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Welcome code\",\n  \"placementIds\": [\n    \"8e1a7fa9-5b6d-4a2f-8cab-6f708192a3b4\"\n  ],\n  \"kind\": \"coupon\",\n  \"couponProgramId\": \"5b8d4c76-2e3a-4d9c-9f77-3c4d5e6f7081\",\n  \"data\": {\n    \"headline\": \"Your personal 15% code\",\n    \"cta_url\": \"https://shop.example/\"\n  },\n  \"fallbackOfferId\": null\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/placement-offers",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "placement-offers"
              ]
            },
            "description": "A coupon offer whose codes come from a coupon program (GET /coupons/programs): each VERIFIED contact who sees it (SDK Authentication on the app, a verified storefront identity, or this server-key decision) is issued their own code (data.coupon_code, plus coupon_expires_at / coupon_apply_url when the code has them), the same code on every later view, never one code for two people; redemptions are credited to the placement campaign like any other coupon use. Unverified visitors (including an external id sent with SDK Authentication off), an empty code bank or a paused program get the program's fallback (shared code, no code, or skip - the offer's fallbackOfferId, else the next campaign). Requires campaigns:write. placementIds (required, 1-20 - missing, [] or null is refused): the placements of this workspace the offer is for (GET /placements); data is exactly their Data fields, typed - number, yes/no (true/false), colour (hex), link and image (a URL, an app link or a /path); Liquid allowed. A required field is enforced only when every chosen placement has it. Keys no chosen placement has are dropped on save."
          }
        },
        {
          "name": "Get Placement Offer",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/placement-offers/{{offerId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "placement-offers",
                "{{offerId}}"
              ]
            },
            "description": "One offer. Requires campaigns:read."
          }
        },
        {
          "name": "Update Placement Offer",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"endsAt\": \"2026-12-07T00:00:00Z\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/placement-offers/{{offerId}}",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "placement-offers",
                "{{offerId}}"
              ]
            },
            "description": "Change any field. Requires campaigns:write. placementIds is optional here (omitted = unchanged; [] or null is refused); setting it, or changing data or kind, checks the content against those placements and drops keys none of them has. An offer with no placements (created before placementIds existed) is refused every change until placementIds is set. A placement archived later stays on the offer."
          }
        },
        {
          "name": "Archive Placement Offer",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/placement-offers/{{offerId}}/archive",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "placement-offers",
                "{{offerId}}",
                "archive"
              ]
            },
            "description": "Archive (never delete): campaigns that select it show its fallback, or the next campaign. Requires campaigns:write."
          }
        }
      ]
    },
    {
      "name": "Push Notifications",
      "item": [
        {
          "name": "Register Device Token",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"platform\": \"ios\",\n  \"pushToken\": \"device_token_from_apns_or_fcm\",\n  \"appId\": \"{{iosAppId}}\",\n  \"deviceInfo\": {\n    \"appVersion\": \"1.0.0\",\n    \"osVersion\": \"17.2\",\n    \"model\": \"iPhone 15 Pro\"\n  }\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/users/:userId/devices",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "users",
                ":userId",
                "devices"
              ],
              "variable": [
                {
                  "key": "userId",
                  "value": "665f1e2a9b3c4d5e6f7a8b9c",
                  "description": "Joryio's internal user ID (24-char hex)"
                }
              ]
            },
            "description": "Register a device push token for a user. platform: ios|android|web; `deviceInfo` is a free-form object."
          }
        },
        {
          "name": "List Device Tokens",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/users/:userId/devices",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "users",
                ":userId",
                "devices"
              ],
              "variable": [
                {
                  "key": "userId",
                  "value": "665f1e2a9b3c4d5e6f7a8b9c"
                }
              ]
            },
            "description": "List a user's registered devices."
          }
        },
        {
          "name": "Remove Device Token",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/users/:userId/devices/:deviceId",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "users",
                ":userId",
                "devices",
                ":deviceId"
              ],
              "variable": [
                {
                  "key": "userId",
                  "value": "665f1e2a9b3c4d5e6f7a8b9c"
                },
                {
                  "key": "deviceId",
                  "value": ""
                }
              ]
            },
            "description": "Remove a registered device (e.g. when the user logs out)."
          }
        },
        {
          "name": "Send Transactional Push",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"userId\": \"user-123\",\n  \"channel\": \"push\",\n  \"message\": {\n    \"subject\": \"Your order has shipped!\",\n    \"body\": \"Track your package in real-time\"\n  },\n  \"idempotencyKey\": \"order-ORD-2024-001-shipped\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/campaigns/transactional/send",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns",
                "transactional",
                "send"
              ]
            },
            "description": "One-off push to a single user via the transactional send endpoint. For push, `message.subject` becomes the notification title and `message.body` the notification body. Requires a configured push app and a registered device token for the user."
          }
        },
        {
          "name": "Create Push Campaign",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Feature Announcement\",\n  \"channel\": \"push\",\n  \"sendType\": \"immediate\",\n  \"variants\": [\n    {\n      \"id\": \"variant-a\",\n      \"name\": \"Variant A\",\n      \"weight\": 100,\n      \"message\": {\n        \"title\": \"Exclusive Premium Feature\",\n        \"body\": \"Check out our new feature just for you!\"\n      }\n    }\n  ],\n  \"targeting\": {\n    \"filterGroups\": [\n      {\n        \"filters\": [\n          {\n            \"type\": \"attribute\",\n            \"field\": \"plan\",\n            \"operator\": \"equals\",\n            \"value\": \"premium\"\n          }\n        ],\n        \"operator\": \"AND\"\n      }\n    ]\n  }\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/campaigns",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "campaigns"
              ]
            },
            "description": "Send push to an audience via a standard campaign with channel push. Variant message: { title, body, icon?, image?, data? }."
          }
        }
      ],
      "description": "Push delivery runs through the standard campaign pipeline: create a campaign with `channel: \"push\"` (or use POST /campaigns/transactional/send with channel push) after registering device tokens against a user. Push provider (APNS/FCM) credentials are configured per app in the dashboard (Settings > Apps), not via this API."
    },
    {
      "name": "API Keys",
      "item": [
        {
          "name": "Create API Key",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Production API Key\",\n  \"description\": \"Key for production environment\",\n  \"permissions\": [\"users:read\", \"users:write\", \"events:track\"]\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/api-keys",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api-keys"
              ]
            }
          }
        },
        {
          "name": "List API Keys",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api-keys",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api-keys"
              ]
            }
          }
        },
        {
          "name": "Rotate API Key",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"gracePeriodHours\": 24\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/api-keys/{{apiKeyId}}/rotate",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api-keys",
                "{{apiKeyId}}",
                "rotate"
              ]
            },
            "description": "Issue a new secret for the key, keeping its id, name and scopes. The new value is returned once in `key`. The OLD secret keeps authenticating for `gracePeriodHours` (optional, 0-168, default 24; fractions allowed) so callers can switch without downtime - `previousKey` in the response gives its prefix and `expiresAt`. Send `0` to refuse the old secret immediately (a leaked key). Rotating again during a grace period ends the older secret at once. Requires api_keys:write and every scope the key holds."
          }
        },
        {
          "name": "End Previous API Key",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api-keys/{{apiKeyId}}/end-previous-key",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api-keys",
                "{{apiKeyId}}",
                "end-previous-key"
              ]
            },
            "description": "End a rotation grace period now: the key's previous secret stops authenticating immediately, on every server. No body. Idempotent - a key with no previous secret is returned unchanged (`previousKey: null`). Requires api_keys:write."
          }
        }
      ]
    },
    {
      "name": "Subscriptions",
      "description": "Per-contact consent state: channel opt-in/out, list membership, bounce clearing, and the audit history. Contact-scoped (userId = internal contact id). Reads require compliance:read, writes compliance:write.",
      "item": [
        {
          "name": "Get Contact Subscriptions",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/subscriptions/contacts/:userId",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "subscriptions",
                "contacts",
                ":userId"
              ]
            },
            "description": "Return the full subscription state (all channels + lists) for a contact."
          }
        },
        {
          "name": "Update Channel Subscription",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"channel\": \"email\",\n  \"status\": \"unsubscribed\",\n  \"source\": \"api\",\n  \"consentText\": \"User unsubscribed via preference center\",\n  \"reason\": \"manual update\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/subscriptions/contacts/:userId/channels/:channel",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "subscriptions",
                "contacts",
                ":userId",
                "channels",
                ":channel"
              ]
            },
            "description": "Set a contact's status on one channel. channel path param must be one of email|sms|whatsapp|push and overrides the body channel. status is optedIn|subscribed|unsubscribed. Re-subscribing (status subscribed/optedIn) applies to THIS contact only: other contacts in the workspace with the same email/phone stay unsubscribed. An unsubscribe applies to every contact sharing the email/phone (each gets a history entry, source shared_identifier). Recorded with source api and the API key id in metadata.principal; a body source ending in _keyword or equal to shared_identifier / complaint_webhook / staff is recorded as api. A STOP-keyword opt-out (SMS, WhatsApp, Viber) CAN be overridden by this update for this contact only (history records overrodeStop and the API key); a START reply still works. SMS only: 200 OK with a non-error warnings field: [{ code: sms_stop_provider_block, channel: sms, message: \"This contact opted out by texting STOP. Your SMS provider may keep blocking messages until they text START.\" }] - the SMS provider may keep its own block. A send the SMS provider then rejects for its own STOP block (e.g. Twilio 21610, Delivyr code 1) is recorded as blocked by provider (opted out), not a failure, and the opt-out is re-applied (history: provider still blocks: re-opted out). 409 { code, message } when a re-subscribe cannot lift the block: deliverability (hard bounce or spam complaint - only Joryio support can lift it), organization_block. SMS double opt-in (workspace setting \"SMS double opt-in\" on): a NEW SMS opt-in (status subscribed/optedIn for a contact with no SMS status) is stored as status pending and the contact gets ONE confirmation text (\"<Brand>: Reply YES to receive texts. Msg & data rates may apply. Reply STOP to opt out.\"); the response shows channels.sms.status pending and channels.sms.confirmation { requestedAt, sentAt, expiresAt }. The contact becomes subscribed (optInSource double_opt_in) only by replying YES/START; a pending contact receives no campaign or journey SMS. Asking again while pending is a no-op (no second text). A contact or number that opted out (STOP or any SMS opt-out) is treated the same way: pending + ONE confirmation text, subscribed only after YES, back to unsubscribed if unanswered (no reminder); a contact who had texted STOP also gets the sms_stop_provider_block warning, and a provider STOP rejection of the text unsubscribes them again. Not applied when the workspace's SMS number is on a Delivyr account (Delivyr runs its own double opt-in)."
          }
        },
        {
          "name": "Clear Bounce Status",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"reason\": \"verified new mailbox\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/subscriptions/contacts/:userId/clear-bounce",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "subscriptions",
                "contacts",
                ":userId",
                "clear-bounce"
              ]
            },
            "description": "Clear a contact's soft-bounce state. reason is optional and stored in the audit log. Clears a SOFT bounce only. A hard bounce or spam complaint is lifted only by Joryio support: 403 with code deliverability."
          }
        },
        {
          "name": "Get List Subscriptions",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/subscriptions/contacts/:userId/lists",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "subscriptions",
                "contacts",
                ":userId",
                "lists"
              ]
            },
            "description": "Return the list/group memberships for a contact."
          }
        },
        {
          "name": "Subscribe Contact to List",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"channel\": \"email\",\n  \"source\": \"api\",\n  \"consentText\": \"Signed up via website form\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/subscriptions/contacts/:userId/lists/:listId",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "subscriptions",
                "contacts",
                ":userId",
                "lists",
                ":listId"
              ]
            },
            "description": "Add a contact to a list on a given channel. channel is required; source/consentText optional (defaults source=api). Applies to this contact only (other contacts with the same email/phone stay unsubscribed from the list). Over a STOP-keyword opt-out the subscribe succeeds for this contact only (recorded as overriding a STOP); for an SMS list the 200 response carries warnings: [{ code: sms_stop_provider_block, channel: sms, message: \"This contact opted out by texting STOP. Your SMS provider may keep blocking messages until they text START.\" }]."
          }
        },
        {
          "name": "Unsubscribe Contact from List",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"channel\": \"email\",\n  \"source\": \"api\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/subscriptions/contacts/:userId/lists/:listId",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "subscriptions",
                "contacts",
                ":userId",
                "lists",
                ":listId"
              ]
            },
            "description": "Remove a contact from a list. Body optional; channel defaults to email. The list unsubscribe also applies to every contact in the workspace with the same email/phone."
          }
        },
        {
          "name": "Get Subscription History",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/subscriptions/contacts/:userId/history?limit=50&offset=0",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "subscriptions",
                "contacts",
                ":userId",
                "history"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "50"
                },
                {
                  "key": "offset",
                  "value": "0"
                }
              ]
            },
            "description": "Paginated audit log of subscription changes for a contact. Non-numeric limit/offset fall back to defaults (50/0). Every unsubscribe entry since 2026-10-15 carries metadata.unsubscribeSource (header_one_click = the mail app's RFC 8058 button, page_button = a person pressing Unsubscribe on the hosted page, preferences_page, page_everything, api, admin, sdk, import, keyword, complaint, esp_unsubscribe, store_sync, other) and, where the message is known, metadata.sinceSendMs. userAgent is stored sanitized (max 256 chars). Entries with metadata.pageMode 'auto' were made by the hosted page without a click (2026-10-11 to 2026-10-15). Consent proof (since 2026-11-02): every entry also carries changeKind/changeLabel (subscribed, resubscribed, unsubscribed, pending_order, pending_confirmation, withdrawn, confirmed_by_order, confirmed, confirmation_expired, bounce, complaint, import, updated), sourceKind/sourceLabel/sourcePlatform (e.g. store_checkout + woocommerce, landing_page, api, admin, import, unsubscribe_link, bounce, complaint, keyword_stop) page (where stored), location (where on the store: checkout, block_checkout, registration, customer_record, newsletter) and collectedAt (when collected, ISO-8601; null when not recorded); consentText is the exact wording shown. ipAddress is personal data: without pii:view (an API key only with that scope) it is null with ipHidden: true. Example item: { \"action\": \"subscribe\", \"previousStatus\": null, \"newStatus\": \"pending\", \"source\": \"woocommerce_checkout\", \"consentText\": \"Yes, send me news and offers by email.\", \"ipAddress\": null, \"ipHidden\": true, \"changeKind\": \"pending_order\", \"changeLabel\": \"Consent pending - awaiting order or confirmation\", \"sourceKind\": \"store_checkout\", \"sourceLabel\": \"WooCommerce checkout\", \"sourcePlatform\": \"woocommerce\", \"page\": \"https://shop.example.com\", \"createdAt\": \"2026-11-01T10:00:00.000Z\" }."
          }
        },
        {
          "name": "List Recent Unsubscribe Reasons",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/subscriptions/unsubscribe-reasons?limit=50&offset=0&days=90",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "subscriptions",
                "unsubscribe-reasons"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "50",
                  "description": "Rows per page (max 100)"
                },
                {
                  "key": "offset",
                  "value": "0"
                },
                {
                  "key": "days",
                  "value": "90",
                  "description": "How far back to look (max 365)"
                },
                {
                  "key": "flagged",
                  "value": "true",
                  "description": "Only unsubscribes flagged as possibly automatic",
                  "disabled": true
                }
              ]
            },
            "description": "Workspace-wide recent unsubscribes that carry a reason or were flagged as possibly automatic, newest first, one row per unsubscribe action (channels grouped). Returns { items: [{ at, contactId, email, name, channels, listId, reason, campaignId, source, suspectedAutomatic, suspectedAutomaticReasons }], total }. name is masked for callers without pii:view. Requires compliance:read."
          }
        },
        {
          "name": "Check Channel Subscription Status",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/subscriptions/contacts/:userId/channels/:channel/status",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "subscriptions",
                "contacts",
                ":userId",
                "channels",
                ":channel",
                "status"
              ]
            },
            "description": "Returns { subscribed: boolean } for the contact on one channel (email|sms|whatsapp|push)."
          }
        },
        {
          "name": "Check Email Valid",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/subscriptions/contacts/:userId/email-valid",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "subscriptions",
                "contacts",
                ":userId",
                "email-valid"
              ]
            },
            "description": "Returns { valid: boolean } indicating whether the contact's email is deliverable (not bounced)."
          }
        }
      ]
    },
    {
      "name": "Suppressions",
      "description": "Address/number-keyed suppression ledger (channel_suppressions), scoped per workspace. On add/import, reason is clamped to manual|unsubscribe — only POST /suppressions/hard-bounce may assert a hard bounce. Suppression follows the email address or phone number itself (not a specific contact) across the workspace, and hard_bounce/complaint entries survive re-subscribe. API keys need the channel-precise scope: email_suppression:* for email, sms_suppression:* for sms/whatsapp (read for GETs, write for POST/DELETE).",
      "item": [
        {
          "name": "List Suppressions",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/suppressions?channel=email&reason=&limit=100&offset=0",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "suppressions"
              ],
              "query": [
                {
                  "key": "channel",
                  "value": "email"
                },
                {
                  "key": "reason",
                  "value": ""
                },
                {
                  "key": "limit",
                  "value": "100"
                },
                {
                  "key": "offset",
                  "value": "0"
                }
              ]
            },
            "description": "List suppressed identifiers (paginated). Optional filters: channel (email|sms|whatsapp), reason (unsubscribe|hard_bounce|complaint|manual). limit 1-1000 (default 100), offset >= 0."
          }
        },
        {
          "name": "Check Suppression",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/suppressions/:identifier?channel=email",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "suppressions",
                ":identifier"
              ],
              "query": [
                {
                  "key": "channel",
                  "value": "email"
                }
              ]
            },
            "description": "Check whether a single identifier (email/phone) is suppressed on a channel. channel defaults to email."
          }
        },
        {
          "name": "Add Suppression",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"channel\": \"email\",\n  \"identifier\": \"user@example.com\",\n  \"reason\": \"manual\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/suppressions",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "suppressions"
              ]
            },
            "description": "Add a manual/consent suppression. reason is clamped to manual|unsubscribe by the service - this path can NEVER assert a hard bounce. scope global|group; listId required when scope=group. With reason unsubscribe, every contact in the workspace with that email/phone is also set to unsubscribed on the channel (or on the list for scope group)."
          }
        },
        {
          "name": "Add Hard Bounce",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"identifier\": \"dead@example.com\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/suppressions/hard-bounce",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "suppressions",
                "hard-bounce"
              ]
            },
            "description": "The ONLY API path that asserts a hard bounce. Email only; recorded with source=api. A hard_bounce entry survives re-subscribe."
          }
        },
        {
          "name": "Import Suppressions",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"channel\": \"email\",\n  \"entries\": [\n    {\n      \"identifier\": \"a@example.com\"\n    },\n    {\n      \"identifier\": \"b@example.com\",\n      \"reason\": \"unsubscribe\"\n    }\n  ]\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/suppressions/import",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "suppressions",
                "import"
              ]
            },
            "description": "Bulk import (ESP migration). Up to 5000 entries. Per-entry reason optional (manual|unsubscribe); no entry may assert a hard bounce."
          }
        },
        {
          "name": "Remove Suppression (Unsuppress)",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/suppressions/:identifier?channel=email",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "suppressions",
                ":identifier"
              ],
              "query": [
                {
                  "key": "channel",
                  "value": "email"
                }
              ]
            },
            "description": "Remove the consent suppression rows (unsubscribe, manual) for this workspace for an identifier on a channel. channel defaults to email. Never removes a STOP-keyword opt-out (removing it would lift the number for every contact sharing it - re-subscribe the one contact through the Subscriptions API, or the person texts START) or a hard_bounce / complaint row (only Joryio support lifts those); they are counted in the response: { identifier, removed, kept?: { stop_keyword?, deliverability? } }."
          }
        }
      ]
    },
    {
      "name": "AI Agents",
      "description": "Generate-only AI agents (ai_agents table): reusable objects that READ a bounded, opt-in context and EMIT validated structured output for journeys and catalog jobs to act on. An agent has NO tools/actions — it never sends, branches, or writes on its own. modelMode managed (hosted Claude, 1 credit/run) or byo (your provider key, small flat fee/run). Every run resolves to one outcome: success|fallback|timeout|rate_limited|invalid_config|budget_exceeded. API keys need ai_agents:read for GETs and ai_agents:write for writes; dashboard sessions may use settings:read/settings:write.",
      "item": [
        {
          "name": "Create Agent",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Cart subject-line writer\",\n  \"instructions\": \"Write a short, upbeat email subject line for the abandoned cart. Max 60 characters.\",\n  \"modelMode\": \"managed\",\n  \"contextSelectors\": {\n    \"attributeKeys\": [\n      \"first_name\",\n      \"cart_total\"\n    ],\n    \"includeBrandVoice\": true\n  },\n  \"outputSchema\": {\n    \"type\": \"json\",\n    \"fields\": [\n      {\n        \"name\": \"subject\",\n        \"type\": \"string\"\n      }\n    ],\n    \"includeExplanation\": true\n  },\n  \"fallbackValue\": {\n    \"subject\": \"You left something behind\"\n  },\n  \"dailyCap\": 50000,\n  \"guardrails\": {\n    \"timeoutMs\": 20000,\n    \"retryOnTransient\": true\n  },\n  \"task\": \"write\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/ai-agents",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "ai-agents"
              ]
            },
            "description": "Create a generate-only AI agent. Required: name, instructions. modelMode managed|byo (default managed); provider joryio|anthropic|openai|google|azure|bedrock. outputSchema type string|number|boolean|json (json carries a fields[] list). contextSelectors is opt-in. dailyCap default 250000. Needs ai_agents:write (or settings:write). Set task to 'classify' with classification: { labels: [{ name, description }], unsureBelow } to build a Classify agent - one label from the list, one journey branch per label plus 'unsure'; ids are assigned on save."
          }
        },
        {
          "name": "List Agents",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/ai-agents?status=active",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "ai-agents"
              ],
              "query": [
                {
                  "key": "status",
                  "value": "active"
                }
              ]
            },
            "description": "List the workspace's AI agents (newest-updated first). Optional status filter: active|archived. Needs ai_agents:read (or settings:read)."
          }
        },
        {
          "name": "Get Run Pricing",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/ai-agents/pricing",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "ai-agents",
                "pricing"
              ]
            },
            "description": "Price per run in micros (1,000,000 micros = 1 USD) for each task (write, classify) and hosting mode (managed, byo), from the price list with the runner's fallbacks. The builder shows it as 'about X per 1,000 runs'."
          }
        },
        {
          "name": "List Provider Keys",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/ai-agents/provider-keys",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "ai-agents",
                "provider-keys"
              ]
            },
            "description": "List registered BYO provider keys for the workspace. Credential values are NEVER returned (credentials is always {}). Needs ai_agents:read (or settings:read)."
          }
        },
        {
          "name": "Upsert Provider Key",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"credentials\": {\n    \"apiKey\": \"sk-your-openai-key\"\n  },\n  \"label\": \"Production OpenAI\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/ai-agents/provider-keys/:provider",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "ai-agents",
                "provider-keys",
                ":provider"
              ]
            },
            "description": "Create or replace the BYO key for one provider (path :provider = anthropic|openai|google|azure|bedrock; 'joryio' is rejected). credentials is provider-specific ({ apiKey } etc), encrypted at rest and never returned. One key per (workspace, provider). Needs ai_agents:write (or settings:write)."
          }
        },
        {
          "name": "Use Provider Key for Assistant",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"enabled\": true\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/ai-agents/provider-keys/:provider/assistant",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "ai-agents",
                "provider-keys",
                ":provider",
                "assistant"
              ]
            },
            "description": "Route this workspace's AI assistant and content generation through the BYO key of :provider (anthropic|openai|google|azure|bedrock) with { enabled: true }, or back to the Joryio platform key with { enabled: false }. One key per workspace at most; enabling a second key moves the flag. Runs on your key are billed a small platform fee per use (price list: ai_agent / byo / generation and assistant_turn) instead of the token cost. The assistant only runs on an Anthropic key; with another provider it stays on the platform key and only generation is routed. Returns the key row (credentials stripped) with useForAssistant. 404 when no key is saved for the provider; 400 when the key is disabled or the provider is joryio. Needs ai_agents:write (or settings:write)."
          }
        },
        {
          "name": "Delete Provider Key",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/ai-agents/provider-keys/:provider",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "ai-agents",
                "provider-keys",
                ":provider"
              ]
            },
            "description": "Delete the BYO key for the given provider (path :provider = anthropic|openai|google|azure|bedrock). Returns { success: true }. Needs ai_agents:write (or settings:write)."
          }
        },
        {
          "name": "Get Agent",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/ai-agents/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "ai-agents",
                ":id"
              ]
            },
            "description": "Fetch one AI agent by id (workspace-scoped; 404 otherwise). Needs ai_agents:read (or settings:read)."
          }
        },
        {
          "name": "Update Agent",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"dailyCap\": 100000,\n  \"guardrails\": {\n    \"timeoutMs\": 15000,\n    \"retryOnTransient\": false\n  }\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/ai-agents/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "ai-agents",
                ":id"
              ]
            },
            "description": "Partial update of an agent (send only changed fields). Accepts all create fields plus status (active|archived). Needs ai_agents:write (or settings:write)."
          }
        },
        {
          "name": "Archive Agent",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": ""
            },
            "url": {
              "raw": "{{baseUrl}}/ai-agents/:id/archive",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "ai-agents",
                ":id",
                "archive"
              ]
            },
            "description": "Soft-archive an agent: status becomes archived (halts use, keeps run history). Needs ai_agents:write (or settings:write)."
          }
        },
        {
          "name": "Delete Agent",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/ai-agents/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "ai-agents",
                ":id"
              ]
            },
            "description": "Delete an agent. Returns { success: true }. Needs ai_agents:write (or settings:write)."
          }
        },
        {
          "name": "Test Agent (Preview)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"attributes\": {\n    \"first_name\": \"Dana\",\n    \"cart_total\": 249.9\n  },\n  \"segmentMemberships\": [\n    \"vip\"\n  ]\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/ai-agents/:id/test",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "ai-agents",
                ":id",
                "test"
              ]
            },
            "description": "Dry-run the agent against a SAMPLE context (attributes, segmentMemberships, catalogRecord, engagement). Uses a fresh run key and never counts against a real journey. Returns { outcome, output, explanation }. outcome is success|fallback|timeout|rate_limited|invalid_config|budget_exceeded. Needs ai_agents:write (or settings:write)."
          }
        },
        {
          "name": "List Agent Runs",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/ai-agents/:id/runs?limit=50",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "ai-agents",
                ":id",
                "runs"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "50"
                }
              ]
            },
            "description": "Recent run traces for one agent (newest first). limit 1-200 (default 50). Trace stores input REFERENCES + output + explanation only, never the raw prompt text. Needs ai_agents:read (or settings:read)."
          }
        },
        {
          "name": "Run Catalog Enrichment",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"agentId\": \"8f0e2b3a-1c4d-4e5f-9a0b-1c2d3e4f5a6b\",\n  \"entityDefinitionId\": \"product\",\n  \"targetField\": \"ai_description\",\n  \"filter\": {\n    \"category\": \"shoes\"\n  },\n  \"limit\": 200\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/ai-agents/enrichment/run",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "ai-agents",
                "enrichment",
                "run"
              ]
            },
            "description": "Run a generate-only agent over a custom-entity's records and write each output into targetField. Required: agentId (active agent), entityDefinitionId, targetField. Optional filter (Mongo-style) and limit (up to 100k, hard-capped). ASYNC/QUEUED: this ENQUEUES a job and returns immediately with the queued job — a large catalog processes off the request path. Idempotent per record (runKey = jobId:recordId), so a retried job never re-charges an already-enriched record. Returns { jobId, status: 'queued', counts: { total, processed, succeeded, failed, skipped }, ... }; poll 'Get Enrichment Job' for progress. Needs ai_agents:write (or settings:write)."
          }
        },
        {
          "name": "Get Enrichment Job",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/ai-agents/enrichment/jobs/:jobId",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "ai-agents",
                "enrichment",
                "jobs",
                ":jobId"
              ],
              "variable": [
                {
                  "key": "jobId",
                  "value": "job_9a8b7c",
                  "description": "The enrichment job id returned by Run Catalog Enrichment."
                }
              ]
            },
            "description": "Poll one enrichment job's status + counts. Returns { jobId, status: 'queued'|'running'|'completed'|'failed', counts: { total, processed, succeeded, failed, skipped }, error?, ... }. 404 if the job is not in this workspace. Needs ai_agents:read (or settings:read)."
          }
        },
        {
          "name": "List Enrichment Jobs",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/ai-agents/enrichment/jobs?limit=20",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "ai-agents",
                "enrichment",
                "jobs"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "20"
                }
              ]
            },
            "description": "List recent enrichment jobs (newest first) for progress/history. Optional limit (default 20). Each row is the same shape as Get Enrichment Job. Needs ai_agents:read (or settings:read)."
          }
        }
      ]
    },
    {
      "name": "Attributes",
      "description": "Custom contact-attribute dictionary (data dictionary). GET is open to any authenticated caller (used by pickers); create/update/delete require users:write.",
      "item": [
        {
          "name": "List Attributes",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/attributes?q=&limit=50&offset=0",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "attributes"
              ],
              "query": [
                {
                  "key": "q",
                  "value": ""
                },
                {
                  "key": "limit",
                  "value": "50"
                },
                {
                  "key": "offset",
                  "value": "0"
                }
              ]
            },
            "description": "List custom attribute definitions. With no params returns the full pool; passing q/limit/offset returns a paginated envelope."
          }
        },
        {
          "name": "Create Attribute",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"loyalty_tier\",\n  \"type\": \"string\",\n  \"description\": \"Customer loyalty tier\",\n  \"defaultValue\": \"bronze\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/attributes",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "attributes"
              ]
            },
            "description": "Define a new custom contact attribute. name (<=255) and type (<=50) required; description/defaultValue optional."
          }
        },
        {
          "name": "Update Attribute",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"description\": \"Updated description\",\n  \"type\": \"string\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/attributes/:name",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "attributes",
                ":name"
              ]
            },
            "description": "Update an attribute's description/type by name."
          }
        },
        {
          "name": "Delete Attribute",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/attributes/:name",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "attributes",
                ":name"
              ]
            },
            "description": "Delete a custom attribute definition by name."
          }
        },
        {
          "name": "Rescan Attribute Types",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"eventName\": \"Order Completed\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/attributes/rescan-types",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "attributes",
                "rescan-types"
              ]
            },
            "description": "Throw away the KEPT (frozen) attribute-type decisions so they are detected again from current data. Types are decided once and kept so a segment means the same thing today as yesterday; call this only when a property's meaning has genuinely changed at the source. Optional body `eventName` scopes the rescan to that event's properties; omitted, the workspace's contact attributes are rescanned. Types your team has SET are never touched, and standard fields (price, total, lastEventTime) are typed by the platform and unaffected."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Analytics",
      "description": "Read/reporting API over the event warehouse: event explorer, funnels, retention (including per-segment comparison), path analysis, and realtime. All routes require analytics:read.",
      "item": [
        {
          "name": "List Events",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/analytics/events?limit=50&offset=0",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "analytics",
                "events"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "50"
                },
                {
                  "key": "offset",
                  "value": "0"
                },
                {
                  "key": "channels",
                  "value": "email,sms,push,whatsapp,viber,in_app",
                  "description": "Optional comma list of channels. `channels=` (empty) = no message events.",
                  "disabled": true
                }
              ]
            },
            "description": "List raw events with filtering and pagination (event explorer). Optional `channels`: show message (`message.*`) and in-app (`in_app.*`) events only on these channels - email, sms, whatsapp, push, viber, webhook, wallet, in_app, connector. Events with no channel (purchases, sessions, custom events) are always counted. Omit it for no filter; an unknown channel is a 400. When `channels` is sent the response also carries `hiddenByChannel` - `[{ channel, count }]`, the message events the filter left out, per channel (e.g. webhook calls)."
          }
        },
        {
          "name": "Query Events",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"eventName\": \"Order Completed\",\n  \"startDate\": \"2026-01-01\",\n  \"endDate\": \"2026-01-31\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/analytics/events/query",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "analytics",
                "events",
                "query"
              ]
            },
            "description": "Run a custom aggregated event query. Optional `channels`: show message (`message.*`) and in-app (`in_app.*`) events only on these channels - email, sms, whatsapp, push, viber, webhook, wallet, in_app, connector. Events with no channel (purchases, sessions, custom events) are always counted. Omit it for no filter; an unknown channel is a 400. Send it as a JSON array, e.g. `\"channels\": [\"email\", \"sms\"]`."
          }
        },
        {
          "name": "Event Trend",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"eventName\": \"Order Completed\",\n  \"startDate\": \"2026-01-01\",\n  \"endDate\": \"2026-01-31\",\n  \"timeGranularity\": \"day\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/analytics/events/trend",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "analytics",
                "events",
                "trend"
              ]
            },
            "description": "Get an event count trend over time. timeGranularity: hour|day|week|month. Optional `channels`: show message (`message.*`) and in-app (`in_app.*`) events only on these channels - email, sms, whatsapp, push, viber, webhook, wallet, in_app, connector. Events with no channel (purchases, sessions, custom events) are always counted. Omit it for no filter; an unknown channel is a 400. Send it as a JSON array, e.g. `\"channels\": [\"email\", \"sms\"]`."
          }
        },
        {
          "name": "Get Event Properties",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/analytics/events/:eventName/properties?startDate=2026-01-01&endDate=2026-01-31",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "analytics",
                "events",
                ":eventName",
                "properties"
              ],
              "query": [
                {
                  "key": "startDate",
                  "value": "2026-01-01"
                },
                {
                  "key": "endDate",
                  "value": "2026-01-31"
                }
              ]
            },
            "description": "List the property keys seen on a given event type over a date range."
          }
        },
        {
          "name": "Property Breakdown",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"eventName\": \"Page Viewed\",\n  \"property\": \"url\",\n  \"startDate\": \"2026-01-01\",\n  \"endDate\": \"2026-01-31\",\n  \"includeUniqueUsers\": true,\n  \"urlGrouping\": \"path\",\n  \"includeBots\": false\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/analytics/events/property-breakdown",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "analytics",
                "events",
                "property-breakdown"
              ]
            },
            "description": "Break down an event by the distinct values of one property. Optional: limit (1-50), filters, includeUniqueUsers to also return uniqueUsers (distinct people) per value, urlGrouping for a URL-like property (path = group by page with the query string and fragment dropped, the default; full = raw URL), and includeBots to also count bot-flagged events (default: human only). The response total is the denominator of every percentage (all occurrences of the event in the period); urlGrouping echoes the grouping applied (null for a non-URL property)."
          }
        },
        {
          "name": "List Funnels",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/analytics/funnels",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "analytics",
                "funnels"
              ]
            },
            "description": "List saved funnel definitions."
          }
        },
        {
          "name": "Create Funnel",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"Purchase funnel\",\n  \"steps\": [\n    {\n      \"id\": \"step-1\",\n      \"order\": 0,\n      \"eventName\": \"Product Viewed\"\n    },\n    {\n      \"id\": \"step-2\",\n      \"order\": 1,\n      \"eventName\": \"Product Added\"\n    },\n    {\n      \"id\": \"step-3\",\n      \"order\": 2,\n      \"eventName\": \"Order Completed\"\n    }\n  ],\n  \"conversionWindowDays\": 7\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/analytics/funnels",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "analytics",
                "funnels"
              ]
            },
            "description": "Create a saved funnel definition. Each step requires id, order (0-based), and eventName; optional label and property filters."
          }
        },
        {
          "name": "Quick Funnel Analysis",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"steps\": [\n    {\n      \"id\": \"step-1\",\n      \"order\": 0,\n      \"eventName\": \"Product Viewed\"\n    },\n    {\n      \"id\": \"step-2\",\n      \"order\": 1,\n      \"eventName\": \"Order Completed\"\n    }\n  ],\n  \"startDate\": \"2026-01-01\",\n  \"endDate\": \"2026-01-31\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/analytics/funnels/quick-analysis",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "analytics",
                "funnels",
                "quick-analysis"
              ]
            },
            "description": "Run an ad-hoc funnel analysis without saving it (rate-limited)."
          }
        },
        {
          "name": "Retention Analysis",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"startEvent\": \"signup_completed\",\n  \"returnEvent\": \"Order Completed\",\n  \"startDate\": \"2026-01-01\",\n  \"endDate\": \"2026-01-31\",\n  \"timeUnit\": \"week\",\n  \"periods\": 8\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/analytics/retention/analyze",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "analytics",
                "retention",
                "analyze"
              ]
            },
            "description": "Compute a retention grid: one row per start-date bucket, one column per period. timeUnit: day|week|month; periods 1-30."
          }
        },
        {
          "name": "Path Analysis",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"startDate\": \"2026-01-01\",\n  \"endDate\": \"2026-01-31\",\n  \"endEvent\": \"Order Completed\",\n  \"direction\": \"backward\",\n  \"maxSteps\": 5,\n  \"minPathCount\": 10,\n  \"minPathPercent\": 0.5,\n  \"maxBranchesPerStep\": 5\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/analytics/paths/analyze",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "analytics",
                "paths",
                "analyze"
              ]
            },
            "description": "Analyze common user paths. Anchor on startEvent with direction \"forward\" (what users do next) or endEvent with direction \"backward\" (how users got there). Optional maxSteps (2-10), includeEvents/excludeEvents. Frequency threshold (a path/step must clear the LARGER of the two): minPathCount (absolute users, default 1) and minPathPercent (percent of qualifying users 0-100, portable across traffic levels). maxBranchesPerStep (1-50, default 8) caps the flow diagram to the top-N next events per step so it stays readable at any volume."
          }
        },
        {
          "name": "Compare Retention Across Segments",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"segmentIds\": [\n    \"11111111-1111-1111-1111-111111111111\",\n    \"22222222-2222-2222-2222-222222222222\"\n  ],\n  \"startDate\": \"2026-01-01\",\n  \"endDate\": \"2026-01-31\",\n  \"entryEvent\": \"signup_completed\",\n  \"returnEvent\": \"Order Completed\",\n  \"timeUnit\": \"week\",\n  \"periods\": 8\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/analytics/retention/compare-segments",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "analytics",
                "retention",
                "compare-segments"
              ]
            },
            "description": "Run one retention grid per segment and return them side by side. segmentIds: 1-10 saved segment ids (duplicates are ignored). Each segment's audience is resolved by the segment engine itself - the same rules the Segments API applies - and the retention scan is restricted to those contacts. entryEvent and returnEvent are each optional: give one and the other defaults to it (same-event retention); omit both and the request is rejected. timeUnit: day|week|month; periods 1-30. Every row carries resolvedUsers (how many people are in the segment), analyzedUsers (how many of them the curve was computed from) and truncated. A segment over the 50,000-contact analysis cap is measured on a RANDOM sample of its members - deterministic, so the same segment and window return the same curve on a reload - and the row then reads as \"measured on a random 50,000 of 480,000 members\", never as the whole segment. A segment that cannot be resolved comes back as a row with an `error` string and an empty grid - never as 0% retention."
          }
        },
        {
          "name": "Lifecycle Migration",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"mode\": \"compare\",\n  \"fromDate\": \"2026-09-30\",\n  \"toDate\": \"2026-10-31\",\n  \"activeDays\": 30,\n  \"churnDays\": 90,\n  \"newDays\": 30,\n  \"countMessageEngagement\": true\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/analytics/lifecycle-migration/analyze",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "analytics",
                "lifecycle-migration",
                "analyze"
              ]
            },
            "description": "Of the people in each lifecycle stage on fromDate, how many are in each stage on toDate. mode: compare (fromDate -> toDate, YYYY-MM-DD, toDate not after today) or monthly (months: 1-12 - the last day of each of the last N months, then today; one matrix per consecutive pair). Needs analytics:read. Each step returns population (everyone seen by its from date), matrix[from][to] (people), rowTotals and arrivals (people first seen after the from date, by their stage on the to date - outside the matrix). Every matrix sums to its population; counts are exact, never sampled or truncated. Stages, per person, as of each date (a whole day in the workspace time zone): new = first activity ever within the New window; reactivated = active now, inactive in the active window before, seen before that; active = activity within the Active window; dormant = last activity older than the Active window but within the Churn window; churned = last activity older than the Churn window. Activity = the person's own events (not message.*, in_app.*, pass.*, canvas.*, campaign.*, recommendation.served, flag.exposure) plus, with countMessageEngagement (boolean, default true; send the same value to People, Export and Save as segment), their human actions on messages: message.opened, message.clicked (email/SMS/WhatsApp/Viber links, push opens), in_app.clicked (a button or link in an in-app message, placement or Inbox card), in_app.dismissed, in_app.card_read, in_app.converted. Sends, deliveries, displays (every other in_app.* event: displayed, served, control_viewed), recommendation.served, flag.exposure, bounces, unsubscribes, machine opens (Apple Mail Privacy Protection, scanners) and bots never count - the same definition as the dashboard's Active users. countMessageEngagement: false counts the person's own events only (no message or in-app events). Windows: activeDays (default 30), churnDays (default 90, longer than activeDays), newDays (default 30), each 1-365."
          }
        },
        {
          "name": "Lifecycle Migration - People in a Cell",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"fromDate\": \"2026-09-30\",\n  \"toDate\": \"2026-10-31\",\n  \"fromStage\": \"active\",\n  \"toStage\": \"dormant\",\n  \"activeDays\": 30,\n  \"churnDays\": 90,\n  \"newDays\": 30,\n  \"countMessageEngagement\": true,\n  \"pageSize\": 50\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/analytics/lifecycle-migration/people",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "analytics",
                "lifecycle-migration",
                "people"
              ]
            },
            "description": "One page of the people in one cell (fromStage on fromDate, toStage on toDate). Pass the response's nextCursor as `after` for the next page; pageSize 1-100. Needs users:read AND analytics:read. Contact fields follow the caller's pii:view, as every contact list does; an id with activity but no live contact (deleted, or merged into another) comes back with exists: false."
          }
        },
        {
          "name": "Lifecycle Migration - Export a Cell (CSV)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"fromDate\": \"2026-09-30\",\n  \"toDate\": \"2026-10-31\",\n  \"fromStage\": \"active\",\n  \"toStage\": \"dormant\",\n  \"activeDays\": 30,\n  \"churnDays\": 90,\n  \"newDays\": 30,\n  \"countMessageEngagement\": true\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/analytics/lifecycle-migration/export",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "analytics",
                "lifecycle-migration",
                "export"
              ]
            },
            "description": "The people in one cell as CSV (id, externalId, email, phone, firstName, lastName, the two stages, contactExists), at most 100,000 rows; the X-Export-Truncated header says when the cap cut the file. Needs users:export AND analytics:read."
          }
        },
        {
          "name": "Lifecycle Migration - Save a Cell as a Segment",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"fromDate\": \"2026-09-30\",\n  \"toDate\": \"2026-10-31\",\n  \"fromStage\": \"active\",\n  \"toStage\": \"dormant\",\n  \"activeDays\": 30,\n  \"churnDays\": 90,\n  \"newDays\": 30,\n  \"countMessageEngagement\": true,\n  \"name\": \"Active in September, dormant in October\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/analytics/lifecycle-migration/segment",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "analytics",
                "lifecycle-migration",
                "segment"
              ]
            },
            "description": "Save the people in one cell as a segment - a fixed list that does not change as their activity does. The contacts are stamped with a record id (shown as a lifecycle-migration entry in Import history) and the segment has one condition, contact_import any_of [that id], so it works everywhere a segment does. At most 500,000 people (above that: 400, never cut). Returns { segmentId, segmentName, people, notSaved } - notSaved = ids with activity but no live contact. Needs segments:write AND analytics:read."
          }
        },
        {
          "name": "Segment Migration - Segments with History",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/analytics/segment-migration/segments",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "analytics",
                "segment-migration",
                "segments"
              ]
            },
            "description": "The segments the segment migration report can compare: this workspace's materialized segments (history is kept for materialized segments only, from their first nightly rebuild), each with firstDay (where its history starts; null = turned on, first rebuild not recorded yet) and days (every recorded day, YYYY-MM-DD in the workspace time zone). Also quota and used (the organization's materialized-segment allowance) and timezone. Needs analytics:read."
          }
        },
        {
          "name": "Segment Migration",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/analytics/segment-migration/analyze",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "analytics",
                "segment-migration",
                "analyze"
              ]
            },
            "description": "Of the people in each chosen segment on one recorded day, which chosen segment they are in on a later one. segmentIds: 2-8 materialized segments in priority order - a person in several counts in the first one listed. mode: compare (default; fromDate and toDate, YYYY-MM-DD, both recorded days of every chosen segment - see Segments with History - else 400 naming the segment and where its history starts) or monthly with months 1-12 (the month-ends of the last N months in the workspace time zone that every chosen segment recorded, then the latest recorded day; one step per consecutive pair, one query; fewer than 2 recorded month-ends = 400 saying where history starts and when the first comparison is available). Returns mode, dates, skippedMonthEnds, groups (the segments, then \"other\" = in none of them) and steps: one per consecutive pair of dates, each with from, to, matrix[from][to] (people), rowTotals, colTotals and population (people in at least one chosen segment on either day). other -> other is everyone else and is always 0. groups ends with no_longer_contact (destinationOnly): people in a chosen segment on a step's from date who are deleted or merged contacts now count there instead of other; its row is always 0. Needs analytics:read.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"segmentIds\": [\n    \"<segment-id-1>\",\n    \"<segment-id-2>\",\n    \"<segment-id-3>\"\n  ],\n  \"mode\": \"monthly\",\n  \"months\": 6\n}"
            }
          }
        },
        {
          "name": "Segment Migration - People in a Cell",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/analytics/segment-migration/people",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "analytics",
                "segment-migration",
                "people"
              ]
            },
            "description": "The people in one cell: in fromGroup on fromDate and toGroup on toDate (a chosen segment id or \"other\"; toGroup may also be \"no_longer_contact\" - people in a chosen segment on fromDate who are deleted or merged contacts now; other -> other is refused). Keyset pages: pass nextCursor as after. Contacts with PII per the caller's pii:view; exists: false = recorded while a contact, no longer a contact (deleted or merged). Needs users:read and analytics:read.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"segmentIds\": [\n    \"<segment-id-1>\",\n    \"<segment-id-2>\"\n  ],\n  \"fromDate\": \"2026-11-01\",\n  \"toDate\": \"2026-11-25\",\n  \"fromGroup\": \"<segment-id-1>\",\n  \"toGroup\": \"other\",\n  \"pageSize\": 50\n}"
            }
          }
        },
        {
          "name": "Segment Migration - Export a Cell (CSV)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/analytics/segment-migration/export",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "analytics",
                "segment-migration",
                "export"
              ]
            },
            "description": "One cell as CSV (id, externalId, email, phone, firstName, lastName, groupOn<fromDate>, groupOn<toDate>, contactExists), at most 100,000 rows; X-Export-Truncated: true when the cap cut it. Needs users:export and analytics:read.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"segmentIds\": [\n    \"<segment-id-1>\",\n    \"<segment-id-2>\"\n  ],\n  \"fromDate\": \"2026-11-01\",\n  \"toDate\": \"2026-11-25\",\n  \"fromGroup\": \"<segment-id-1>\",\n  \"toGroup\": \"other\"\n}"
            }
          }
        },
        {
          "name": "Segment Migration - Save a Cell as a Segment",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/analytics/segment-migration/segment",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "analytics",
                "segment-migration",
                "segment"
              ]
            },
            "description": "Save one cell as a fixed-list segment (it does not change as their segments do). Refused above 500,000 people. Returns segmentId, segmentName, people (saved) and notSaved (no longer a contact). Needs segments:write and analytics:read. toGroup \"no_longer_contact\" is refused (400): nobody in it is a contact any more.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"segmentIds\": [\n    \"<segment-id-1>\",\n    \"<segment-id-2>\"\n  ],\n  \"fromDate\": \"2026-11-01\",\n  \"toDate\": \"2026-11-25\",\n  \"fromGroup\": \"<segment-id-1>\",\n  \"toGroup\": \"other\",\n  \"name\": \"VIP who left\"\n}"
            }
          }
        },
        {
          "name": "Realtime Active Users",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/analytics/realtime/active-users",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "analytics",
                "realtime",
                "active-users"
              ]
            },
            "description": "Current count of active users in the live window. A failed query is an error response (since November 2026), never zeros that read as \"nobody is active\"."
          }
        },
        {
          "name": "Global Holdout Uplift",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/analytics/global-holdout?startDate=2026-01-01&endDate=2026-01-31",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "analytics",
                "global-holdout"
              ],
              "query": [
                {
                  "key": "startDate",
                  "value": "2026-01-01"
                },
                {
                  "key": "endDate",
                  "value": "2026-01-31"
                }
              ]
            },
            "description": "Conversion and revenue for everyone who received marketing in the period, against the randomly held-back global control group. Both groups count people only: a purchase flagged `$is_bot` is left out of each group alike since 2026-11-24; a store order (no bot flag) always counts. Response is an envelope: { uplift: { treatmentRecipients, treatmentConverters, treatmentRevenue, treatmentRevenuePerRecipient, controlRecipients, controlConverters, controlRevenue, controlRevenuePerRecipient, incrementalRevenue, upliftPct, significance: { controlRate, treatmentRate, pValue, significant, controlInterval, treatmentInterval, reason, minConvertersPerArm } | null, currency, mixedCurrency, windowHours } }. { uplift: null } when no global control group is running - there is nothing to compare against, and an unmeasured result is not a zero. significance.significant tests the conversion RATE, not revenue. If the measurement itself fails the request returns an error rather than `{ \"uplift\": null }`, so a failure is never read as \"no holdout running\" (since November 2026)."
          }
        },
        {
          "name": "Message Frequency Curve",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/analytics/message-frequency?startDate=2026-01-01&endDate=2026-01-31",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "analytics",
                "message-frequency"
              ],
              "query": [
                {
                  "key": "startDate",
                  "value": "2026-01-01"
                },
                {
                  "key": "endDate",
                  "value": "2026-01-31"
                }
              ]
            },
            "description": "Purchases by number of messages received, split by whether the person was already engaged before the period. `buyers` / `purchaseRate` are an ORDERS figure, not a goal conversion: the curve covers the whole workspace, so there is no campaign or journey goal to count (`converters` / `conversionRate` are the same numbers under their old names). anchored tells you whether the zero point is real: without a global control group there is no 0 bucket at all, because people who happened to receive nothing got nothing for reasons that also predict buying."
          }
        },
        {
          "name": "Content Performance",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/analytics/content-performance?startDate=2026-01-01&endDate=2026-01-31&channel=email",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "analytics",
                "content-performance"
              ],
              "query": [
                {
                  "key": "startDate",
                  "value": "2026-01-01"
                },
                {
                  "key": "endDate",
                  "value": "2026-01-31"
                },
                {
                  "key": "channel",
                  "value": "email",
                  "description": "Optional: email, sms, push, whatsapp, viber, in_app"
                }
              ]
            },
            "description": "Open, click, goal-conversion and purchase rates by what the message is - tone, offer type, call to action, length, personalization, imagery, topic - across every template, campaign variant and journey message. Rates count unique people, bots excluded; openRate / clickRate are a share of people delivered (push: of reached, in-app: of displayed), the same rule as campaign stats; null below minReached people or on a channel that cannot measure the rate. conversionRate / converted are each message's OWN conversion goal (its campaign or journey goal, window and attribution model, credited to the variant or journey message), over goalReached - the people reached by messages that have a goal; null where no message in the row has one. purchaseRate / bought are the ORDERS figure: a purchase by the same person within conversionWindowHours after the send (a plain window, whatever the goal). Until 2026-10-14 conversionRate was that purchase rate. totals.unlabelledSent is traffic whose content has no label yet; totals.noGoalSent is traffic with no goal."
          }
        },
        {
          "name": "Campaign Widget Data",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"metric\": \"views\",\n  \"metrics\": [\n    \"views\",\n    \"view_conversion_rate\",\n    \"clicked\"\n  ],\n  \"kinds\": [\n    \"placement\",\n    \"card\"\n  ],\n  \"groupBy\": \"name\",\n  \"startDate\": \"2026-01-01\",\n  \"endDate\": \"2026-01-31\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/analytics/campaigns/widget-data",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "analytics",
                "campaigns",
                "widget-data"
              ]
            },
            "description": "Data for a dashboard Campaign widget (analytics:read). `kinds` (optional) narrows the in-app part to campaign types: overlay (In-app message), placement, card (Inbox card), page_edit (Web personalization); with no `channels`, only those kinds are counted, with `in_app` among the channels the other channels are counted as before. `views` = unique people shown the campaign (bots excluded), `view_conversion_rate` = people who converted / people who viewed; both null on a message channel. With only page_edit, opens and clicks are null and listed in `notTracked`."
          }
        },
        {
          "name": "Experiment Grid Widget Data",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"source\": \"all\",\n  \"status\": \"all\",\n  \"pathType\": \"all\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/analytics/experiment/widget-data",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "analytics",
                "experiment",
                "widget-data"
              ]
            },
            "description": "One row per experiment for the dashboard Experiment grid (analytics:read): journey Experiment nodes and feature flag experiments, each with `source` (journey / flag). `source` filters them. Flag rows need flags:read and campaigns:read and follow the caller's team visibility; a canvasId or a journey-only pathType returns journeys only."
          }
        },
        {
          "name": "Placement Slot Widget Data",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"placementKey\": \"home_hero\",\n  \"metric\": \"views\",\n  \"startDate\": \"2026-01-01\",\n  \"endDate\": \"2026-01-31\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/analytics/placements/widget-data",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "analytics",
                "placements",
                "widget-data"
              ]
            },
            "description": "One row per placement slot (analytics:read): views, conversions (unique people, bots excluded), conversion_rate, topCampaign (by conversions, among campaigns the caller may see), and holdout_lift - the slot's lift vs its holdout in %, only when significant; otherwise null with holdout_lift_state (inconclusive, no_control, no_conversions, mixed_goals, failed, over_cap). `placementKey` optional (empty = every slot); `metric` sets `value` for a bar chart. featureDisabled: true when placements are off for the organization."
          }
        },
        {
          "name": "Feature Flag Widget Data",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"flagKey\": \"checkout\",\n  \"groupBy\": \"date\",\n  \"timeGranularity\": \"day\",\n  \"startDate\": \"2026-01-01\",\n  \"endDate\": \"2026-01-31\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/analytics/flags/widget-data",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "analytics",
                "flags",
                "widget-data"
              ]
            },
            "description": "People exposed per feature flag variant (needs flags:read and analytics:read): from flag.exposure events, unique people, bots excluded. groupBy date = per time bucket, variant = in total over the range. Exposures sampled outside experiments are scaled up (`estimated: true`, `sampledPercent`). `flagKey` optional (empty = every flag)."
          }
        }
      ]
    },
    {
      "name": "Wallet Passes",
      "item": [
        {
          "name": "Record Pass Scan / Redemption",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"serialNumber\": \"a1b2c3d4-e5f6-4789-abcd-1234567890ab\",\n  \"properties\": {\n    \"storeId\": \"store_42\",\n    \"amount\": 19.90,\n    \"currency\": \"EUR\"\n  }\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/wallet-passes/scan",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "wallet-passes",
                "scan"
              ]
            },
            "description": "Record a wallet pass scan/redemption at the point of sale (POS / merchant integration). `serialNumber` is the pass's unique id, read from its barcode/QR. `properties` is an optional free-form object of redemption metadata (store, amount, cashier...) stored on the resulting `pass.scanned` event and available in Wallet analytics. Requires the `wallet:write` permission. Returns `{ \"recorded\": true }`, or `{ \"recorded\": false }` if no pass with that serial exists in your organization. Counting is idempotent per pass: re-scanning the same serial still counts as one distinct scanned pass."
          }
        }
      ]
    },
    {
      "name": "Messages",
      "description": "Read API for the messages a contact received from you (campaign and journey sends) and sent to you (replies), across channels. Requires users:read.",
      "item": [
        {
          "name": "List Contact Messages",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/messages?userId=:userId&direction=&channel=&limit=50&offset=0",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "messages"
              ],
              "query": [
                {
                  "key": "userId",
                  "value": ":userId"
                },
                {
                  "key": "direction",
                  "value": ""
                },
                {
                  "key": "channel",
                  "value": ""
                },
                {
                  "key": "limit",
                  "value": "50"
                },
                {
                  "key": "offset",
                  "value": "0"
                }
              ]
            },
            "description": "List the messages sent to a contact (`message.sent` from campaigns AND journeys, with the campaign / journey, email subject and the furthest outcome: sent, delivered, opened, clicked, failed or bounced) and the replies it sent, newest first, from the last 12 months. userId required (internal id or externalId); direction optional (`outbound` = sends, `inbound` = replies; omit for both); channel optional (e.g. email, sms, whatsapp, push). limit default 50 (1-200), offset at most 5000. Example response: {\"data\":[{\"direction\":\"outbound\",\"channel\":\"email\",\"eventName\":\"message.sent\",\"timestamp\":\"2026-10-28 10:00:00.000\",\"subject\":\"Your cart is still here\",\"messageId\":\"0100019a...\",\"source\":{\"kind\":\"journey\",\"id\":\"<canvasId>\",\"name\":\"Cart recovery\"},\"status\":\"opened\",\"body\":null,\"from\":null,\"toNumber\":null,\"account\":null,\"messageType\":null}],\"total\":1}"
          }
        },
        {
          "name": "List Inbound Messages",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/messages/inbound?userId=:userId&channel=&limit=50&offset=0",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "messages",
                "inbound"
              ],
              "query": [
                {
                  "key": "userId",
                  "value": ":userId"
                },
                {
                  "key": "channel",
                  "value": ""
                },
                {
                  "key": "limit",
                  "value": "50"
                },
                {
                  "key": "offset",
                  "value": "0"
                }
              ]
            },
            "description": "List a contact's inbound messages across all channels (newest-first). userId required; optional channel filter (e.g. sms, whatsapp). limit default 50 (1-200)."
          }
        },
        {
          "name": "List Inbound SMS",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/sms/messages?userId=:userId&limit=50",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sms",
                "messages"
              ],
              "query": [
                {
                  "key": "userId",
                  "value": ":userId"
                },
                {
                  "key": "limit",
                  "value": "50"
                }
              ]
            },
            "description": "List a contact's inbound SMS messages (profile timeline, newest-first). userId required."
          }
        }
      ]
    },
    {
      "name": "SMS Templates (Delivyr only)",
      "description": "Templates of a Delivyr SMS account. DELIVYR ONLY: works only for a workspace whose SMS number is linked to a Delivyr account (Delivyr sends only templates it approved, to US and Canada numbers). Every request except List Delivyr Accounts answers 403 with code delivyr_account_required for any other workspace. Requires templates:read / templates:write.",
      "item": [
        {
          "name": "List Delivyr Accounts",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/sms/templates/accounts",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sms",
                "templates",
                "accounts"
              ]
            },
            "description": "DELIVYR ONLY - The Delivyr accounts this workspace sends SMS through (a workspace can have several, e.g. one per brand). Returns [] when there are none - check this first. `key` is the accountKey the other requests take; `name` is the account's name in Joryio. Every template carries the accountKey of the account it belongs to, and a template is sent only through its own account."
          }
        },
        {
          "name": "List SMS Templates",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/sms/templates?status=approved",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sms",
                "templates"
              ],
              "query": [
                {
                  "key": "status",
                  "value": "approved"
                }
              ]
            },
            "description": "DELIVYR ONLY - Templates of the workspace's Delivyr account(s): synced from the Delivyr portal, created in Joryio, and Delivyr system templates. Only approved and system templates can be sent. Optional filters: status (pending, approved, rejected, system), accountKey (one account's templates only). Each template's accountKey says which Delivyr account it belongs to."
          }
        },
        {
          "name": "Refresh SMS Templates from Delivyr",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/sms/templates/sync",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sms",
                "templates",
                "sync"
              ]
            },
            "description": "DELIVYR ONLY - Pull the account's templates from Delivyr now and update their review status (Joryio also refreshes every 30 minutes). accountKey is optional.",
            "body": {
              "mode": "raw",
              "raw": "{}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Get SMS Template",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/sms/templates/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sms",
                "templates",
                ":id"
              ]
            },
            "description": "DELIVYR ONLY - One template by its Joryio id."
          }
        },
        {
          "name": "Create SMS Template",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/sms/templates",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sms",
                "templates"
              ]
            },
            "description": "DELIVYR ONLY - Create a template and submit it to Delivyr's review; it starts as pending. Use {{name}} placeholders; {{link}} is filled with Joryio's tracked short link at send time. accountKey is needed only when the workspace has more than one Delivyr account. Approved text cannot be changed - create a new template instead.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"title\": \"Weekend offer\",\n  \"body\": \"Hi {{first_name}}, your weekend offer is ready: {{link}} Reply STOP to opt out.\",\n  \"tags\": [\n    \"promo\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Delete SMS Template",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{token}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/sms/templates/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "sms",
                "templates",
                ":id"
              ]
            },
            "description": "DELIVYR ONLY - Delete the template in Delivyr and in Joryio. Delivyr system templates cannot be deleted."
          }
        }
      ]
    }
  ]
}
