# GENERATED FILE. Do not edit.
#
# Projected from the Zod MCP tool registry in product/mcp/gs.mcp.
# Regenerate:  cd product/mcp/gs.mcp && pnpm openapi:public
# Verify:      cd product/mcp/gs.mcp && pnpm openapi:public:check
openapi: 3.0.3
info:
  title: "GetSales public contract: gs.service.id"
  description: |-
    The identity service: the signed-in account, its workspaces and their members, the sessions and the gtm-api workspaces a team reaches; the API keys, OAuth clients and standing consents; the Paddle billing of the pool a buyer holds (catalog, subscriptions, transactions, payment methods); the partner's surface (white label brands, their clients, the shares handed to workspaces, the certificates behind the brand domains); and the notification feed.

    GENERATED. This document is projected from the Zod MCP tool registry in `product/mcp/gs.mcp` (one tool per public endpoint, 1:1). Do not edit it by hand; edit the tool definition and regenerate with `pnpm openapi:public`.

    Surface: the public `/api` contract of `gs.service.id`, 88 operations. This is the only OpenAPI document the platform publishes. Internal (`/internal`) and health endpoints are deliberately absent: they are not part of any contract, they can change without notice, and the service source is their only description.

    Conventions:
    - Auth is a bearer JWT, optionally narrowed by the `Team-SID` header.
    - Every success body is an MCP envelope: `success: true` plus one typed `operation` shape (`search`, `get`, `create`, `update`, `delete`, `metrics`, `group_by`, `action`), and a `meta` block with `trace_id` for support.
    - Every failure is the same `McpError` envelope with a code from a fixed 16-code taxonomy, so a client maps errors once.
    - Lists page with `page_size` (0 to 500, default 50) plus an opaque forward `cursor`; `page_size: 0` returns counts only.
    - On `GET` and `DELETE`, object-valued query parameters (`filter`, `sort`) travel as JSON text and array-valued ones repeat as `name[]=value`.
    - The MCP-only `_meta` field (usage analytics) never reaches the backend and is not part of this contract.
  version: "1.0"
  contact:
    name: GetSales
    url: https://getsales.io
    email: support@getsales.io
  license:
    name: Proprietary
    url: https://getsales.io/terms
servers:
  - url: https://beta.getsales.io/id/v1
    description: Production (the gateway path on the beta ring; the origin is provisioned per DEPLOY_MAP.md)
security:
  - BearerJwt: []
    TeamSid: []
tags:
  - name: api_keys
    description: Registry package `mcp.id/api_keys`, served on MCP mount `id.access`.
  - name: billing_payment_methods
    description: Registry package `mcp.id/billing_payment_methods`, served on MCP mount `id.billing`.
  - name: billing_products
    description: Registry package `mcp.id/billing_products`, served on MCP mount `id.billing`.
  - name: billing_subscriptions
    description: Registry package `mcp.id/billing_subscriptions`, served on MCP mount `id.billing`.
  - name: billing_transactions
    description: Registry package `mcp.id/billing_transactions`, served on MCP mount `id.billing`.
  - name: credit_lots
    description: Registry package `mcp.id/credit_lots`, served on MCP mount `id.billing`.
  - name: credit_transactions
    description: Registry package `mcp.id/credit_transactions`, served on MCP mount `id.billing`.
  - name: gtm_connections
    description: Registry package `mcp.id/gtm_connections`, served on MCP mount `id.identity`.
  - name: notifications
    description: Registry package `mcp.id/notifications`, served on MCP mount `id.notifications`.
  - name: oauth_authorizations
    description: Registry package `mcp.id/oauth_authorizations`, served on MCP mount `id.access`.
  - name: oauth_clients
    description: Registry package `mcp.id/oauth_clients`, served on MCP mount `id.access`.
  - name: sessions
    description: Registry package `mcp.id/sessions`, served on MCP mount `id.identity`.
  - name: ssl_certificates
    description: Registry package `mcp.id/ssl_certificates`, served on MCP mount `id.partner`.
  - name: subscription_allocations
    description: Registry package `mcp.id/subscription_allocations`, served on MCP mount `id.partner`.
  - name: team_members
    description: Registry package `mcp.id/team_members`, served on MCP mount `id.identity`.
  - name: teams
    description: Registry package `mcp.id/teams`, served on MCP mount `id.identity`.
  - name: user_profiles
    description: Registry package `mcp.id/user_profiles`, served on MCP mount `id.identity`.
  - name: users
    description: Registry package `mcp.id/users`, served on MCP mount `id.identity`.
  - name: whitelabel_clients
    description: Registry package `mcp.id/whitelabel_clients`, served on MCP mount `id.partner`.
  - name: whitelabels
    description: Registry package `mcp.id/whitelabels`, served on MCP mount `id.partner`.
  - name: workspace_profiles
    description: Registry package `mcp.id/workspace_profiles`, served on MCP mount `id.identity`.
paths:
  /api/api-keys:
    post:
      operationId: create_api_key
      summary: Create API key
      description: |-
        Mint an API key and return the secret beside the item as the envelope's plaintext_token EXACTLY ONCE: hand it to the user at once, never log or echo it; if lost, rotate. permissions must sit inside the issuer's own grant (403 grant_exceeds_ceiling; * only from an unrestricted issuer). expires_at omitted = three years, null = perpetual. Natural key (team, name) among live keys (an expired or revoked key frees its name): a duplicate answers already_exists with the existing key and NO secret.

        Contract:
        - MCP tool `create_api_key`, registry package `mcp.id/api_keys`, mount `id.access`.
        - Operation `create`, response envelope `create`.
        - Flags: dangerous: the MCP layer gates it behind a preview/commit token, and the effect cannot be undone through this API.
      tags:
        - api_keys
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateApiKeyRequest"
      responses:
        "200":
          description: "`create` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateApiKeyResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: create_api_key
      x-gs-mcp-mount: id.access
      x-gs-entity: api_keys
      x-gs-operation: create
      x-gs-envelope: create
      x-gs-availability: ga
      x-gs-dangerous: true
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/api-keys/metrics:
    post:
      operationId: get_api_keys_metrics
      summary: API key metrics
      description: |-
        Period-bound counts of the team's keys: by status, plus how many were minted and how many expired inside the window (created_in_period, expired_in_period). period {from, to} is required; filter narrows the set. The status split always rides aggregated.counts.groups.status: group_by is accepted and builds no groups[]. Counts key rows, not the traffic made with them.

        Contract:
        - MCP tool `get_api_keys_metrics`, registry package `mcp.id/api_keys`, mount `id.access`.
        - Operation `metrics`, response envelope `metrics`.
        - Flags: read only.
      tags:
        - api_keys
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/GetApiKeysMetricsRequest"
      responses:
        "200":
          description: "`metrics` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetApiKeysMetricsResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: get_api_keys_metrics
      x-gs-mcp-mount: id.access
      x-gs-entity: api_keys
      x-gs-operation: metrics
      x-gs-envelope: metrics
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/api-keys/search:
    post:
      operationId: search_api_keys
      summary: Search API keys
      description: |-
        The team's API keys for an access audit: what each may do, its status, last_used_at and expires_at. status for live vs dead keys, last_used_at.lt for stale keys to revoke at offboarding, expires_at for the ones expiring soon, created_by_actor_sid for what one teammate issued. The secret is never returned (token_prefix and token_last4 only). page_size 0 returns the counts only.

        Contract:
        - MCP tool `search_api_keys`, registry package `mcp.id/api_keys`, mount `id.access`.
        - Operation `search`, response envelope `search`.
        - Flags: read only.
      tags:
        - api_keys
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SearchApiKeysRequest"
      responses:
        "200":
          description: "`search` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SearchApiKeysResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: search_api_keys
      x-gs-mcp-mount: id.access
      x-gs-entity: api_keys
      x-gs-operation: search
      x-gs-envelope: search
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/api-keys/{sid}:
    get:
      operationId: get_api_key
      summary: Get API key
      description: |-
        One API key by sid: name, permissions, status, expiry, last use, with token_prefix and token_last4 for display. The secret is unrecoverable (rotate_api_key mints a new one).

        Contract:
        - MCP tool `get_api_key`, registry package `mcp.id/api_keys`, mount `id.access`.
        - Operation `get`, response envelope `get`.
        - Flags: read only.
      tags:
        - api_keys
      parameters:
        - name: sid
          in: path
          required: true
          description: API key sid (id_ak_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^id_ak_
            description: API key sid (id_ak_...).
      responses:
        "200":
          description: "`get` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetApiKeyResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: get_api_key
      x-gs-mcp-mount: id.access
      x-gs-entity: api_keys
      x-gs-operation: get
      x-gs-envelope: get
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: trivial
    patch:
      operationId: update_api_key
      summary: Update API key
      description: |-
        Rename a key or replace its permissions (a full replacement, inside the issuer's grant: 403 grant_exceeds_ceiling). The identity and the secret are untouched (rotate_api_key changes the secret). At least one field. The change binds here at once; a peer that cached the key's verdict keeps the old set for up to 300 seconds.

        Contract:
        - MCP tool `update_api_key`, registry package `mcp.id/api_keys`, mount `id.access`.
        - Operation `update`, response envelope `update`.
        - Flags: none.
      tags:
        - api_keys
      parameters:
        - name: sid
          in: path
          required: true
          description: API key sid (id_ak_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^id_ak_
            description: API key sid (id_ak_...).
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateApiKeyRequest"
      responses:
        "200":
          description: "`update` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UpdateApiKeyResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: update_api_key
      x-gs-mcp-mount: id.access
      x-gs-entity: api_keys
      x-gs-operation: update
      x-gs-envelope: update
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
    delete:
      operationId: delete_api_key
      summary: Revoke API key
      description: |-
        Revoke a key: status revoked, deleted_at set, refused here at once and on a peer within 300 seconds. Irreversible (issue a fresh one). Idempotent: re-deleting answers already_deleted.

        Contract:
        - MCP tool `delete_api_key`, registry package `mcp.id/api_keys`, mount `id.access`.
        - Operation `delete`, response envelope `delete_simple`.
        - Flags: dangerous: the MCP layer gates it behind a preview/commit token, and the effect cannot be undone through this API.
      tags:
        - api_keys
      parameters:
        - name: sid
          in: path
          required: true
          description: The id_ak_* sid of the row to delete.
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^id_ak_
            description: The id_ak_* sid of the row to delete.
      responses:
        "200":
          description: "`delete_simple` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DeleteApiKeyResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: delete_api_key
      x-gs-mcp-mount: id.access
      x-gs-entity: api_keys
      x-gs-operation: delete
      x-gs-envelope: delete_simple
      x-gs-availability: ga
      x-gs-dangerous: true
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: trivial
  /api/api-keys/{sid}/rotate:
    post:
      operationId: rotate_api_key
      summary: Rotate API key
      description: |-
        Swap the key's secret IN PLACE and return the new plaintext in result.plaintext_token EXACTLY ONCE: hand it to the user, never log it, unrecoverable. Sid, name, permissions and expiry are unchanged. The previous secret stays valid until result.previous_token_expires_at (now plus grace_seconds, 24 hours by default; 0 = immediate cutover), so a config can be updated without downtime. Use when a secret leaks or before an offboarding. NOT idempotent: every call mints a brand-new secret. A revoked or expired key answers 409.

        Contract:
        - MCP tool `rotate_api_key`, registry package `mcp.id/api_keys`, mount `id.access`.
        - Operation `action`, response envelope `action`.
        - Flags: dangerous: the MCP layer gates it behind a preview/commit token, and the effect cannot be undone through this API.
      tags:
        - api_keys
      parameters:
        - name: sid
          in: path
          required: true
          description: API key sid (id_ak_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^id_ak_
            description: API key sid (id_ak_...).
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RotateApiKeyRequest"
      responses:
        "200":
          description: "`action` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RotateApiKeyResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: rotate_api_key
      x-gs-mcp-mount: id.access
      x-gs-entity: api_keys
      x-gs-operation: action
      x-gs-envelope: action
      x-gs-availability: ga
      x-gs-dangerous: true
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: complex
  /api/billing-payment-methods:
    get:
      operationId: list_billing_payment_methods
      summary: List payment methods
      description: |-
        The saved cards, PayPal and wallets of the user paying for the workspace's subscription, live from Paddle, the billing card first (is_default true: the card that last billed the plan). The whole set in one page, no counts block. Brand, last four and expiry only. Empty when the payer has no Paddle customer yet.

        Contract:
        - MCP tool `list_billing_payment_methods`, registry package `mcp.id/billing_payment_methods`, mount `id.billing`.
        - Operation `search`, response envelope `search`.
        - Flags: read only.
      tags:
        - billing_payment_methods
      responses:
        "200":
          description: "`search` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListBillingPaymentMethodsResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: list_billing_payment_methods
      x-gs-mcp-mount: id.billing
      x-gs-entity: billing_payment_methods
      x-gs-operation: search
      x-gs-envelope: search
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/billing-payment-methods/get-add-link:
    post:
      operationId: get_billing_payment_method_add_link
      summary: Get add-card link
      description: |-
        A temporary Paddle Customer Portal link to add or replace the card of the workspace's subscription: the ONLY way to add a card (the person types it on Paddle's page, never here). Minted fresh each call. no_billing_account when the workspace draws from no subscription.

        Contract:
        - MCP tool `get_billing_payment_method_add_link`, registry package `mcp.id/billing_payment_methods`, mount `id.billing`.
        - Operation `action`, response envelope `action`.
        - Flags: none.
      tags:
        - billing_payment_methods
      responses:
        "200":
          description: "`action` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetBillingPaymentMethodAddLinkResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: get_billing_payment_method_add_link
      x-gs-mcp-mount: id.billing
      x-gs-entity: billing_payment_methods
      x-gs-operation: action
      x-gs-envelope: action
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/billing-payment-methods/{sid}:
    delete:
      operationId: delete_billing_payment_method
      summary: Delete payment method
      description: |-
        Remove a saved payment method from the payer's list at Paddle. The card a live plan bills on is refused (409 payment_method_in_use) until the plan is moved to another card with get_billing_payment_method_add_link; so is a card another subscription of the same payer uses. Idempotent: a method Paddle no longer holds answers already_deleted. The item is {sid, name}, a neutral label with no card data; soft_deleted false (Paddle removes it).

        Contract:
        - MCP tool `delete_billing_payment_method`, registry package `mcp.id/billing_payment_methods`, mount `id.billing`.
        - Operation `delete`, response envelope `delete_simple`.
        - Flags: dangerous: the MCP layer gates it behind a preview/commit token, and the effect cannot be undone through this API.
      tags:
        - billing_payment_methods
      parameters:
        - name: sid
          in: path
          required: true
          description: "Paddle payment method id (paymtd_...): a raw Paddle id, not an 18-char platform sid."
          schema:
            type: string
            pattern: ^paymtd_
            description: "Paddle payment method id (paymtd_...): a raw Paddle id, not an 18-char platform sid."
      responses:
        "200":
          description: "`delete_simple` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DeleteBillingPaymentMethodResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: delete_billing_payment_method
      x-gs-mcp-mount: id.billing
      x-gs-entity: billing_payment_methods
      x-gs-operation: delete
      x-gs-envelope: delete_simple
      x-gs-availability: ga
      x-gs-dangerous: true
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/billing-products/search:
    post:
      operationId: search_billing_products
      summary: Search billing products
      description: |-
        The billing catalog: three products, data-credits (credits_pack), linkedin-sender-profiles (plan) and email-inboxes (addon), which the lines of an order hang under; nothing is priced here (quote_billing_subscription_order prices an order, the server shapes each line's price at checkout), so include prices answers no rows and limits are 0. is_active true is what is sold; the archived seats catalog stays inactive. Read-only: the catalog is authored in Paddle. page_size 0 returns the counts only.

        Contract:
        - MCP tool `search_billing_products`, registry package `mcp.id/billing_products`, mount `id.billing`.
        - Operation `search`, response envelope `search`.
        - Flags: read only.
      tags:
        - billing_products
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SearchBillingProductsRequest"
      responses:
        "200":
          description: "`search` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SearchBillingProductsResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: search_billing_products
      x-gs-mcp-mount: id.billing
      x-gs-entity: billing_products
      x-gs-operation: search
      x-gs-envelope: search
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/billing-subscriptions/create-checkout:
    post:
      operationId: create_billing_subscription_checkout
      summary: Create subscription checkout
      description: |-
        Start a self-serve purchase of an order (quote_billing_subscription_order first: the same body). DANGEROUS (charges money): a Paddle transaction is pre-created with one item per line and result carries the checkout the buyer pays in the Paddle overlay (the SPA opens it with client_side_token and paddle_environment). The recurring lines become one subscription with one renewal date; one-time credits ride this first payment only, and alone they make no subscription. team_sid names the workspace that gets the WHOLE pool on activation (its trial is released); omit it to buy floating and allocate by hand. A workspace already on a live paid subscription is refused (409 team_already_covered: change that subscription instead), unless the order is one-time credits alone. The row is born on the activated webhook: poll search afterwards. Owner only.

        Contract:
        - MCP tool `create_billing_subscription_checkout`, registry package `mcp.id/billing_subscriptions`, mount `id.billing`.
        - Operation `action`, response envelope `action`.
        - Flags: dangerous: the MCP layer gates it behind a preview/commit token, and the effect cannot be undone through this API.
      tags:
        - billing_subscriptions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateBillingSubscriptionCheckoutRequest"
      responses:
        "200":
          description: "`action` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateBillingSubscriptionCheckoutResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: create_billing_subscription_checkout
      x-gs-mcp-mount: id.billing
      x-gs-entity: billing_subscriptions
      x-gs-operation: action
      x-gs-envelope: action
      x-gs-availability: ga
      x-gs-dangerous: true
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: complex
  /api/billing-subscriptions/quote:
    post:
      operationId: quote_billing_subscription_order
      summary: Quote a billing order
      description: |-
        Price an order before buying: data credits (0 or from 1,000, every month or one time), LinkedIn accounts and inbox packages, in USD, EUR or GBP, monthly or as 12 + 2 months (12 monthly amounts paid, 14 months of service). Answers the server's figures in minor units: each line, the monthly sum, the invoice, what is due now, the service level and the next LinkedIn tier. No side effects, nothing charged; the same order then goes to create_billing_subscription_checkout.

        Contract:
        - MCP tool `quote_billing_subscription_order`, registry package `mcp.id/billing_subscriptions`, mount `id.billing`.
        - Operation `action`, response envelope `action`.
        - Flags: read only.
      tags:
        - billing_subscriptions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/QuoteBillingSubscriptionOrderRequest"
      responses:
        "200":
          description: "`action` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/QuoteBillingSubscriptionOrderResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: quote_billing_subscription_order
      x-gs-mcp-mount: id.billing
      x-gs-entity: billing_subscriptions
      x-gs-operation: action
      x-gs-envelope: action
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/billing-subscriptions/search:
    post:
      operationId: search_billing_subscriptions
      summary: Search billing subscriptions
      description: |-
        The caller's subscriptions, the orders they bought. status for dunning or canceled ones, paddle_subscription_id.is_null true for the trial sentinel, current_period_ends_at for expiry windows. include lines for what each holds (accounts, inbox packages, credits a month, amounts), price, product, latest_transactions; team is always null here. The split across workspaces is search_subscription_allocations (/mcp/id/partner). page_size 0 returns the counts only.

        Contract:
        - MCP tool `search_billing_subscriptions`, registry package `mcp.id/billing_subscriptions`, mount `id.billing`.
        - Operation `search`, response envelope `search`.
        - Flags: read only.
      tags:
        - billing_subscriptions
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SearchBillingSubscriptionsRequest"
      responses:
        "200":
          description: "`search` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SearchBillingSubscriptionsResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: search_billing_subscriptions
      x-gs-mcp-mount: id.billing
      x-gs-entity: billing_subscriptions
      x-gs-operation: search
      x-gs-envelope: search
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/billing-subscriptions/{sid}:
    get:
      operationId: get_billing_subscription
      summary: Get billing subscription
      description: |-
        One subscription by sid, with optional includes (lines for what it holds and the amounts, price, product, latest_transactions; team is always null here, a subscription floats).

        Contract:
        - MCP tool `get_billing_subscription`, registry package `mcp.id/billing_subscriptions`, mount `id.billing`.
        - Operation `get`, response envelope `get`.
        - Flags: read only.
      tags:
        - billing_subscriptions
      parameters:
        - name: sid
          in: path
          required: true
          description: Billing subscription sid (bl_sb_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^bl_sb_
            description: Billing subscription sid (bl_sb_...).
        - name: include[]
          in: query
          required: false
          description: lines, price, product, latest_transactions; team is accepted and always null here.
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
            description: lines, price, product, latest_transactions; team is accepted and always null here.
      responses:
        "200":
          description: "`get` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetBillingSubscriptionResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: get_billing_subscription
      x-gs-mcp-mount: id.billing
      x-gs-entity: billing_subscriptions
      x-gs-operation: get
      x-gs-envelope: get
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: trivial
  /api/billing-subscriptions/{sid}/cancel:
    post:
      operationId: cancel_billing_subscription
      summary: Cancel subscription
      description: |-
        Cancel at the end of the current period (terminal): the workspaces drawing from it lose their coverage then, are suspended and their data retention clock arms; no immediate charge or refund. DANGEROUS. There is no delete verb; cancel is the termination, undo_cancel_billing_subscription takes it back before the period ends. Owner only.

        Contract:
        - MCP tool `cancel_billing_subscription`, registry package `mcp.id/billing_subscriptions`, mount `id.billing`.
        - Operation `action`, response envelope `action`.
        - Flags: dangerous: the MCP layer gates it behind a preview/commit token, and the effect cannot be undone through this API.
      tags:
        - billing_subscriptions
      parameters:
        - name: sid
          in: path
          required: true
          description: Billing subscription sid (bl_sb_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^bl_sb_
            description: Billing subscription sid (bl_sb_...).
      responses:
        "200":
          description: "`action` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CancelBillingSubscriptionResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: cancel_billing_subscription
      x-gs-mcp-mount: id.billing
      x-gs-entity: billing_subscriptions
      x-gs-operation: action
      x-gs-envelope: action
      x-gs-availability: ga
      x-gs-dangerous: true
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/billing-subscriptions/{sid}/change:
    post:
      operationId: change_billing_subscription
      summary: Change subscription
      description: |-
        Commit a change of the composition: the LinkedIn accounts, the inbox packages, the credits a month, each part the whole new value (an omitted part stays). DANGEROUS: up to three Paddle calls, the decreases and free restorations first (nothing billed), then the credits top-up (a one-time charge), then the prorated LinkedIn and added packages, so a refused card stops only the last step (409 payment_declined). Call preview_billing_subscription_change first. Removing every line is a cancel (409 use_cancel); a pool below the sum of its shares is refused (409 allocated_exceeds_pool: lower the shares first; a standard account's one share follows the plan down); a credits change while a top-up is unpaid is 409 change_pending; an invoiced subscription is not re-priced here. The renewal date never moves. Owner only.

        Contract:
        - MCP tool `change_billing_subscription`, registry package `mcp.id/billing_subscriptions`, mount `id.billing`.
        - Operation `action`, response envelope `action`.
        - Flags: dangerous: the MCP layer gates it behind a preview/commit token, and the effect cannot be undone through this API.
      tags:
        - billing_subscriptions
      parameters:
        - name: sid
          in: path
          required: true
          description: Billing subscription sid (bl_sb_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^bl_sb_
            description: Billing subscription sid (bl_sb_...).
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ChangeBillingSubscriptionRequest"
      responses:
        "200":
          description: "`action` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ChangeBillingSubscriptionResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: change_billing_subscription
      x-gs-mcp-mount: id.billing
      x-gs-entity: billing_subscriptions
      x-gs-operation: action
      x-gs-envelope: action
      x-gs-availability: ga
      x-gs-dangerous: true
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: complex
  /api/billing-subscriptions/{sid}/get-update-payment-method-link:
    post:
      operationId: get_billing_subscription_update_payment_method_link
      summary: Get update-payment-method link
      description: |-
        A short-lived Paddle portal link to update the card this subscription bills on: the past_due recovery path. No charge. Owner only; an invoiced one has no card (422 manual_subscription_no_card_portal).

        Contract:
        - MCP tool `get_billing_subscription_update_payment_method_link`, registry package `mcp.id/billing_subscriptions`, mount `id.billing`.
        - Operation `action`, response envelope `action`.
        - Flags: none.
      tags:
        - billing_subscriptions
      parameters:
        - name: sid
          in: path
          required: true
          description: Billing subscription sid (bl_sb_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^bl_sb_
            description: Billing subscription sid (bl_sb_...).
      responses:
        "200":
          description: "`action` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetBillingSubscriptionUpdatePaymentMethodLinkResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: get_billing_subscription_update_payment_method_link
      x-gs-mcp-mount: id.billing
      x-gs-entity: billing_subscriptions
      x-gs-operation: action
      x-gs-envelope: action
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: trivial
  /api/billing-subscriptions/{sid}/pause:
    post:
      operationId: pause_billing_subscription
      summary: Pause subscription
      description: |-
        Pause the subscription at the next billing period: billing stops, every workspace drawing from it is held (automation paused, data kept). DANGEROUS state change; no charge. The committed status arrives by webhook. resume_billing_subscription undoes it. Owner only.

        Contract:
        - MCP tool `pause_billing_subscription`, registry package `mcp.id/billing_subscriptions`, mount `id.billing`.
        - Operation `action`, response envelope `action`.
        - Flags: dangerous: the MCP layer gates it behind a preview/commit token, and the effect cannot be undone through this API.
      tags:
        - billing_subscriptions
      parameters:
        - name: sid
          in: path
          required: true
          description: Billing subscription sid (bl_sb_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^bl_sb_
            description: Billing subscription sid (bl_sb_...).
      responses:
        "200":
          description: "`action` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PauseBillingSubscriptionResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: pause_billing_subscription
      x-gs-mcp-mount: id.billing
      x-gs-entity: billing_subscriptions
      x-gs-operation: action
      x-gs-envelope: action
      x-gs-availability: ga
      x-gs-dangerous: true
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/billing-subscriptions/{sid}/preview-change:
    post:
      operationId: preview_billing_subscription_change
      summary: Preview subscription change
      description: |-
        Read-only preview of a change of the composition before committing: the steps it runs as (LinkedIn prorated now both ways; an added inbox package prorated now, a removed one leaving at the period's end; credits raised now against a top-up charge, lowered from the next period), what is due now, the next payment and the pool after. Each part named is the whole new value; an omitted part stays. No state change, no charge: show it before change_billing_subscription.

        Contract:
        - MCP tool `preview_billing_subscription_change`, registry package `mcp.id/billing_subscriptions`, mount `id.billing`.
        - Operation `action`, response envelope `action`.
        - Flags: read only.
      tags:
        - billing_subscriptions
      parameters:
        - name: sid
          in: path
          required: true
          description: Billing subscription sid (bl_sb_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^bl_sb_
            description: Billing subscription sid (bl_sb_...).
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PreviewBillingSubscriptionChangeRequest"
      responses:
        "200":
          description: "`action` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PreviewBillingSubscriptionChangeResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: preview_billing_subscription_change
      x-gs-mcp-mount: id.billing
      x-gs-entity: billing_subscriptions
      x-gs-operation: action
      x-gs-envelope: action
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/billing-subscriptions/{sid}/resume:
    post:
      operationId: resume_billing_subscription
      summary: Resume subscription
      description: |-
        Resume a paused subscription, or one whose pause is still scheduled: billing continues from the next period and the workspaces drawing from it are released. DANGEROUS state change; no charge. The committed status arrives by webhook: await billing-subscriptions.activated (the event the transition emits here) or poll get until status is active. One neither paused nor pause-scheduled answers resumed false, nothing changed. Owner only.

        Contract:
        - MCP tool `resume_billing_subscription`, registry package `mcp.id/billing_subscriptions`, mount `id.billing`.
        - Operation `action`, response envelope `action`.
        - Flags: dangerous: the MCP layer gates it behind a preview/commit token, and the effect cannot be undone through this API.
      tags:
        - billing_subscriptions
      parameters:
        - name: sid
          in: path
          required: true
          description: Billing subscription sid (bl_sb_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^bl_sb_
            description: Billing subscription sid (bl_sb_...).
      responses:
        "200":
          description: "`action` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResumeBillingSubscriptionResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: resume_billing_subscription
      x-gs-mcp-mount: id.billing
      x-gs-entity: billing_subscriptions
      x-gs-operation: action
      x-gs-envelope: action
      x-gs-availability: ga
      x-gs-dangerous: true
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/billing-subscriptions/{sid}/undo-cancel:
    post:
      operationId: undo_cancel_billing_subscription
      summary: Undo scheduled cancel
      description: |-
        Drop a scheduled cancel before it takes effect; billing continues as if never asked. Decided on the live Paddle state: nothing pending is a no-op (cleared false), a scheduled pause or resume is refused (409 scheduled_change_is_not_cancel), an already canceled subscription is too late. Synchronous, no charge; not gated, since it keeps money flowing. Owner only.

        Contract:
        - MCP tool `undo_cancel_billing_subscription`, registry package `mcp.id/billing_subscriptions`, mount `id.billing`.
        - Operation `action`, response envelope `action`.
        - Flags: none.
      tags:
        - billing_subscriptions
      parameters:
        - name: sid
          in: path
          required: true
          description: Billing subscription sid (bl_sb_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^bl_sb_
            description: Billing subscription sid (bl_sb_...).
      responses:
        "200":
          description: "`action` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UndoCancelBillingSubscriptionResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: undo_cancel_billing_subscription
      x-gs-mcp-mount: id.billing
      x-gs-entity: billing_subscriptions
      x-gs-operation: action
      x-gs-envelope: action
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/billing-transactions/metrics:
    post:
      operationId: get_billing_transactions_metrics
      summary: Billing transaction metrics
      description: |-
        Period-bound money sums over the buyer's transactions, per currency (by_currency keyed by ISO 4217, never summed across): how much was paid and taxed in the window. period {from, to} is required; filter is the search filter and every axis applies, though billed_at and created_at scope the counts only (period is the sums' one window). Gross sums: refunds are not modeled.

        Contract:
        - MCP tool `get_billing_transactions_metrics`, registry package `mcp.id/billing_transactions`, mount `id.billing`.
        - Operation `metrics`, response envelope `metrics`.
        - Flags: read only.
      tags:
        - billing_transactions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/GetBillingTransactionsMetricsRequest"
      responses:
        "200":
          description: "`metrics` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetBillingTransactionsMetricsResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: get_billing_transactions_metrics
      x-gs-mcp-mount: id.billing
      x-gs-entity: billing_transactions
      x-gs-operation: metrics
      x-gs-envelope: metrics
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/billing-transactions/search:
    post:
      operationId: search_billing_transactions
      summary: Search billing transactions
      description: |-
        The buyer's invoices and charges: one row per Paddle transaction, newest first, wherever their workspaces are. Filter by status, origin, collection_mode, currency or a billed_at window; locate one by invoice_number. include subscription / owner / team. Read-only, append-only. page_size 0 returns the counts only.

        Contract:
        - MCP tool `search_billing_transactions`, registry package `mcp.id/billing_transactions`, mount `id.billing`.
        - Operation `search`, response envelope `search`.
        - Flags: read only.
      tags:
        - billing_transactions
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SearchBillingTransactionsRequest"
      responses:
        "200":
          description: "`search` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SearchBillingTransactionsResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: search_billing_transactions
      x-gs-mcp-mount: id.billing
      x-gs-entity: billing_transactions
      x-gs-operation: search
      x-gs-envelope: search
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/billing-transactions/{sid}:
    get:
      operationId: get_billing_transaction
      summary: Get billing transaction
      description: |-
        One transaction by sid with its frozen line items, and optional includes (subscription, owner, team).

        Contract:
        - MCP tool `get_billing_transaction`, registry package `mcp.id/billing_transactions`, mount `id.billing`.
        - Operation `get`, response envelope `get`.
        - Flags: read only.
      tags:
        - billing_transactions
      parameters:
        - name: sid
          in: path
          required: true
          description: Billing transaction sid (bl_tx_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^bl_tx_
            description: Billing transaction sid (bl_tx_...).
        - name: include[]
          in: query
          required: false
          description: subscription, owner, team.
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
            description: subscription, owner, team.
      responses:
        "200":
          description: "`get` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetBillingTransactionResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: get_billing_transaction
      x-gs-mcp-mount: id.billing
      x-gs-entity: billing_transactions
      x-gs-operation: get
      x-gs-envelope: get
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: trivial
  /api/billing-transactions/{sid}/get-invoice:
    post:
      operationId: get_billing_transaction_invoice
      summary: Get transaction invoice
      description: |-
        A temporary link (about an hour) to this transaction's invoice PDF at Paddle; nothing is stored here. invoice_not_ready before the transaction is billed; invoice_not_available when Paddle issued no invoice (a zero charge, a canceled checkout): the rows with a PDF carry invoice_number. Read-only.

        Contract:
        - MCP tool `get_billing_transaction_invoice`, registry package `mcp.id/billing_transactions`, mount `id.billing`.
        - Operation `action`, response envelope `action`.
        - Flags: read only.
      tags:
        - billing_transactions
      parameters:
        - name: sid
          in: path
          required: true
          description: Billing transaction sid (bl_tx_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^bl_tx_
            description: Billing transaction sid (bl_tx_...).
      responses:
        "200":
          description: "`action` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetBillingTransactionInvoiceResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: get_billing_transaction_invoice
      x-gs-mcp-mount: id.billing
      x-gs-entity: billing_transactions
      x-gs-operation: action
      x-gs-envelope: action
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/credit-lots/metrics:
    post:
      operationId: get_credit_lots_metrics
      summary: Credit wallet balance
      description: |-
        The workspace's credit wallet, open to every member: available (spendable now), held (reserved by running work), granted and remaining over the active lots, next_expiry_at with next_expiry_amount (the dated lots alone; the plan's credits live with the plan), next_grant_at (the next monthly grant); counts.total_count is the active lots. One US dollar is 25 credits. A run's cost is its estimate (/mcp/playtables/columns); what was spent is the credit ledger (/mcp/playtables/sources).

        Contract:
        - MCP tool `get_credit_lots_metrics`, registry package `mcp.id/credit_lots`, mount `id.billing`.
        - Operation `metrics`, response envelope `metrics`.
        - Flags: read only.
      tags:
        - credit_lots
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/GetCreditLotsMetricsRequest"
      responses:
        "200":
          description: "`metrics` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetCreditLotsMetricsResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: get_credit_lots_metrics
      x-gs-mcp-mount: id.billing
      x-gs-entity: credit_lots
      x-gs-operation: metrics
      x-gs-envelope: metrics
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/credit-transactions/metrics:
    post:
      operationId: get_credit_transactions_metrics
      summary: Credit spend by day
      description: |-
        The workspace's credit spend over a REQUIRED period: spent (the confirmed debits), charged (their count, the units of work), granted and expired, counted by type, status, operation, day, product, feature, thing, container, person and starter. group_by created_date is the burn per day; filter.product with group_by container_sid reads a product by its tables or sender profiles, object_sid a table by its columns, actor_sid the people. The balance now is get_credit_lots_metrics.

        Contract:
        - MCP tool `get_credit_transactions_metrics`, registry package `mcp.id/credit_transactions`, mount `id.billing`.
        - Operation `metrics`, response envelope `metrics`.
        - Flags: read only.
      tags:
        - credit_transactions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/GetCreditTransactionsMetricsRequest"
      responses:
        "200":
          description: "`metrics` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetCreditTransactionsMetricsResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: get_credit_transactions_metrics
      x-gs-mcp-mount: id.billing
      x-gs-entity: credit_transactions
      x-gs-operation: metrics
      x-gs-envelope: metrics
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/gtm-connections/complete-link:
    post:
      operationId: complete_gtm_connection_link
      summary: Complete gtm workspace link
      description: |-
        Finish the link with the code and state the consent redirect carried: one active linked row for the consented gtm workspace, its accounts attachable to sender profiles from then on. A re-consent by the same gtm user refreshes its sibling rows instead of doubling them. A spent or refused code is 409 (gtm_link_unconfirmed, gtm_link_refused): start the link again.

        Contract:
        - MCP tool `complete_gtm_connection_link`, registry package `mcp.id/gtm_connections`, mount `id.identity`.
        - Operation `action`, response envelope `action`.
        - Flags: none.
      tags:
        - gtm_connections
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CompleteGtmConnectionLinkRequest"
      responses:
        "200":
          description: "`action` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CompleteGtmConnectionLinkResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: complete_gtm_connection_link
      x-gs-mcp-mount: id.identity
      x-gs-entity: gtm_connections
      x-gs-operation: action
      x-gs-envelope: action
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/gtm-connections/search:
    post:
      operationId: search_gtm_connections
      summary: Search gtm connections
      description: |-
        The gtm-api workspaces this team reaches: the managed one first, then every linked one, with its status, who connected it and the accounts in use through it. No filter: a team holds a handful.

        Contract:
        - MCP tool `search_gtm_connections`, registry package `mcp.id/gtm_connections`, mount `id.identity`.
        - Operation `search`, response envelope `search`.
        - Flags: read only.
      tags:
        - gtm_connections
      responses:
        "200":
          description: "`search` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SearchGtmConnectionsResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: search_gtm_connections
      x-gs-mcp-mount: id.identity
      x-gs-entity: gtm_connections
      x-gs-operation: search
      x-gs-envelope: search
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: trivial
  /api/gtm-connections/start-link:
    post:
      operationId: start_gtm_connection_link
      summary: Start gtm workspace link
      description: |-
        Start connecting the person's own gtm-api workspace: answers the consent URL to open and the state the browser brings back (valid 15 minutes). Nothing is written until complete_gtm_connection_link. The managed workspace needs no link: it exists on demand. 501 while the gtm client is unregistered on this plane.

        Contract:
        - MCP tool `start_gtm_connection_link`, registry package `mcp.id/gtm_connections`, mount `id.identity`.
        - Operation `action`, response envelope `action`.
        - Flags: none.
      tags:
        - gtm_connections
      responses:
        "200":
          description: "`action` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StartGtmConnectionLinkResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: start_gtm_connection_link
      x-gs-mcp-mount: id.identity
      x-gs-entity: gtm_connections
      x-gs-operation: action
      x-gs-envelope: action
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/gtm-connections/{sid}/revoke:
    post:
      operationId: revoke_gtm_connection
      summary: Revoke gtm connection
      description: |-
        Disconnect a linked gtm-api workspace (scope workspace, the default) or the whole consent it came from (scope consent: every sibling row of the same grant). The sender profiles that ran on it read disconnected, their work holds; nothing is deleted. The managed row is platform-owned and refuses (409).

        Contract:
        - MCP tool `revoke_gtm_connection`, registry package `mcp.id/gtm_connections`, mount `id.identity`.
        - Operation `action`, response envelope `action`.
        - Flags: dangerous: the MCP layer gates it behind a preview/commit token, and the effect cannot be undone through this API.
      tags:
        - gtm_connections
      parameters:
        - name: sid
          in: path
          required: true
          description: Gtm connection sid (gt_cn_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^gt_cn_
            description: Gtm connection sid (gt_cn_...).
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RevokeGtmConnectionRequest"
      responses:
        "200":
          description: "`action` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RevokeGtmConnectionResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: revoke_gtm_connection
      x-gs-mcp-mount: id.identity
      x-gs-entity: gtm_connections
      x-gs-operation: action
      x-gs-envelope: action
      x-gs-availability: ga
      x-gs-dangerous: true
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/notifications/mark-all-read:
    post:
      operationId: mark_all_notifications_read
      summary: Mark all notifications read
      description: |-
        Stamp read_at on every unread in_app notification of the caller; result.marked_read counts them. Call it on the person's word, never after reading the feed for them.

        Contract:
        - MCP tool `mark_all_notifications_read`, registry package `mcp.id/notifications`, mount `id.notifications`.
        - Operation `action`, response envelope `action`.
        - Flags: none.
      tags:
        - notifications
      responses:
        "200":
          description: "`action` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MarkAllNotificationsReadResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: mark_all_notifications_read
      x-gs-mcp-mount: id.notifications
      x-gs-entity: notifications
      x-gs-operation: action
      x-gs-envelope: action
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: trivial
  /api/notifications/search:
    post:
      operationId: search_notifications
      summary: Search notifications
      description: |-
        The notifications of the workspace: the bell feed (channel.eq in_app, read_at.is_null true for the unread), the email audit (what the system mailed whom), or failure triage (status.eq failed). Rows carry no body; get_notification does. page_size 0 returns the counts (status, event_name, channel).

        Contract:
        - MCP tool `search_notifications`, registry package `mcp.id/notifications`, mount `id.notifications`.
        - Operation `search`, response envelope `search`.
        - Flags: read only.
      tags:
        - notifications
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SearchNotificationsRequest"
      responses:
        "200":
          description: "`search` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SearchNotificationsResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: search_notifications
      x-gs-mcp-mount: id.notifications
      x-gs-entity: notifications
      x-gs-operation: search
      x-gs-envelope: search
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/notifications/{sid}:
    get:
      operationId: get_notification
      summary: Get notification
      description: |-
        One notification by sid with its rendered subject and bodies, delivery state and failure reason. Another workspace's row is 403 wrong_team.

        Contract:
        - MCP tool `get_notification`, registry package `mcp.id/notifications`, mount `id.notifications`.
        - Operation `get`, response envelope `get`.
        - Flags: read only.
      tags:
        - notifications
      parameters:
        - name: sid
          in: path
          required: true
          description: Notification sid (id_nt_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^id_nt_
            description: Notification sid (id_nt_...).
      responses:
        "200":
          description: "`get` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetNotificationResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: get_notification
      x-gs-mcp-mount: id.notifications
      x-gs-entity: notifications
      x-gs-operation: get
      x-gs-envelope: get
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: trivial
    delete:
      operationId: delete_notification
      summary: Dismiss notification
      description: |-
        Dismiss a notification (a soft-delete, the audit row stays; a delivery in flight is not canceled). An in_app row only by its recipient (403 not_the_notification_recipient). Idempotent.

        Contract:
        - MCP tool `delete_notification`, registry package `mcp.id/notifications`, mount `id.notifications`.
        - Operation `delete`, response envelope `delete_simple`.
        - Flags: dangerous: the MCP layer gates it behind a preview/commit token, and the effect cannot be undone through this API.
      tags:
        - notifications
      parameters:
        - name: sid
          in: path
          required: true
          description: The id_nt_* sid of the row to delete.
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^id_nt_
            description: The id_nt_* sid of the row to delete.
      responses:
        "200":
          description: "`delete_simple` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DeleteNotificationResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: delete_notification
      x-gs-mcp-mount: id.notifications
      x-gs-entity: notifications
      x-gs-operation: delete
      x-gs-envelope: delete_simple
      x-gs-availability: ga
      x-gs-dangerous: true
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: trivial
  /api/notifications/{sid}/mark-read:
    post:
      operationId: mark_notification_read
      summary: Mark notification read
      description: |-
        Stamp read_at on one in_app notification of the caller. An email row is refused (422 validation_failed on sid), another recipient's row too (403 not_the_notification_recipient).

        Contract:
        - MCP tool `mark_notification_read`, registry package `mcp.id/notifications`, mount `id.notifications`.
        - Operation `action`, response envelope `action`.
        - Flags: none.
      tags:
        - notifications
      parameters:
        - name: sid
          in: path
          required: true
          description: Notification sid (id_nt_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^id_nt_
            description: Notification sid (id_nt_...).
      responses:
        "200":
          description: "`action` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MarkNotificationReadResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: mark_notification_read
      x-gs-mcp-mount: id.notifications
      x-gs-entity: notifications
      x-gs-operation: action
      x-gs-envelope: action
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: trivial
  /api/oauth-authorizations/search:
    post:
      operationId: search_oauth_authorizations
      summary: Search connected apps
      description: |-
        The caller's connected apps and agents: the standing OAuth consents, their own and never another user's. Filter by status (active vs revoked history), oauth_client_sid or team_scope_mode; include client (name and ceiling), teams (the selected workspaces; [] on an all_my_teams grant) and active_sessions (the live installation tokens). counts is the unfiltered active / revoked split, pagination.total_count the filtered count. page_size 0 returns the counts only.

        Contract:
        - MCP tool `search_oauth_authorizations`, registry package `mcp.id/oauth_authorizations`, mount `id.access`.
        - Operation `search`, response envelope `search`.
        - Flags: read only.
      tags:
        - oauth_authorizations
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SearchOauthAuthorizationsRequest"
      responses:
        "200":
          description: "`search` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SearchOauthAuthorizationsResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: search_oauth_authorizations
      x-gs-mcp-mount: id.access
      x-gs-entity: oauth_authorizations
      x-gs-operation: search
      x-gs-envelope: search
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/oauth-authorizations/{sid}:
    patch:
      operationId: update_oauth_authorization
      summary: Edit connected app
      description: |-
        Edit the caller's own grant without a new consent: team_scope_mode, consented_team_sids (a full replacement, non-empty under selected, each a live membership: 403 not_a_member) and permissions (a full replacement inside the client's ceiling). An empty team set or a token over the ceiling is 422 validation_failed (empty_team_scope, scope_exceeds_ceiling). Live tokens keep their frozen claims until their short TTL: revoke for an immediate cut. At least one field. 404 when not the caller's grant.

        Contract:
        - MCP tool `update_oauth_authorization`, registry package `mcp.id/oauth_authorizations`, mount `id.access`.
        - Operation `update`, response envelope `update`.
        - Flags: none.
      tags:
        - oauth_authorizations
      parameters:
        - name: sid
          in: path
          required: true
          description: OAuth authorization (grant) sid (id_oa_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^id_oa_
            description: OAuth authorization (grant) sid (id_oa_...).
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateOauthAuthorizationRequest"
      responses:
        "200":
          description: "`update` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UpdateOauthAuthorizationResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: update_oauth_authorization
      x-gs-mcp-mount: id.access
      x-gs-entity: oauth_authorizations
      x-gs-operation: update
      x-gs-envelope: update
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/oauth-authorizations/{sid}/revoke:
    post:
      operationId: revoke_oauth_authorization
      summary: Disconnect app (revoke grant)
      description: |-
        Disconnect an app or agent: the grant goes revoked, its refresh credential is cleared and every installation token in every workspace is revoked in one transaction, so it is cut off at once. The item is the revoked grant; result.revoked_sessions counts the tokens cut. Idempotent (already_revoked true, 0 sessions). 404 when the sid is not the caller's own grant.

        Contract:
        - MCP tool `revoke_oauth_authorization`, registry package `mcp.id/oauth_authorizations`, mount `id.access`.
        - Operation `action`, response envelope `action`.
        - Flags: dangerous: the MCP layer gates it behind a preview/commit token, and the effect cannot be undone through this API.
      tags:
        - oauth_authorizations
      parameters:
        - name: sid
          in: path
          required: true
          description: OAuth authorization (grant) sid (id_oa_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^id_oa_
            description: OAuth authorization (grant) sid (id_oa_...).
      responses:
        "200":
          description: "`action` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RevokeOauthAuthorizationResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: revoke_oauth_authorization
      x-gs-mcp-mount: id.access
      x-gs-entity: oauth_authorizations
      x-gs-operation: action
      x-gs-envelope: action
      x-gs-availability: ga
      x-gs-dangerous: true
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/oauth-clients:
    post:
      operationId: create_oauth_client
      summary: Create OAuth client
      description: |-
        Register an OAuth application: the server mints client_id; public PKCE clients, no secret. permissions is the ceiling a grant may request, inside the caller's own (403 scope_missing); redirect_uris the exact-match https allow-list. actor_kind: integration (default) or agent. platform true registers a platform client (no owning team, writable by a system actor only afterwards): leave it to provisioning. A name already live in the team is 409 duplicate_rejected, never already_exists.

        Contract:
        - MCP tool `create_oauth_client`, registry package `mcp.id/oauth_clients`, mount `id.access`.
        - Operation `create`, response envelope `create`.
        - Flags: dangerous: the MCP layer gates it behind a preview/commit token, and the effect cannot be undone through this API.
      tags:
        - oauth_clients
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateOauthClientRequest"
      responses:
        "200":
          description: "`create` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateOauthClientResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: create_oauth_client
      x-gs-mcp-mount: id.access
      x-gs-entity: oauth_clients
      x-gs-operation: create
      x-gs-envelope: create
      x-gs-availability: ga
      x-gs-dangerous: true
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/oauth-clients/search:
    post:
      operationId: search_oauth_clients
      summary: Search OAuth clients
      description: |-
        The OAuth applications registered by the caller's team, plus the platform ones (team_sid.is_null true): which apps and agents may ask for access. Filter by status, client_id, actor_kind, registration_kind, is_confidential; include active_sessions to see who is connected through each. No full text: name.eq or client_id.eq. page_size 0 returns the counts only.

        Contract:
        - MCP tool `search_oauth_clients`, registry package `mcp.id/oauth_clients`, mount `id.access`.
        - Operation `search`, response envelope `search`.
        - Flags: read only.
      tags:
        - oauth_clients
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SearchOauthClientsRequest"
      responses:
        "200":
          description: "`search` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SearchOauthClientsResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: search_oauth_clients
      x-gs-mcp-mount: id.access
      x-gs-entity: oauth_clients
      x-gs-operation: search
      x-gs-envelope: search
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/oauth-clients/{sid}:
    get:
      operationId: get_oauth_client
      summary: Get OAuth client
      description: |-
        One OAuth client by sid. include active_sessions lists the agents and apps connected through it. client_secret is never returned on a read.

        Contract:
        - MCP tool `get_oauth_client`, registry package `mcp.id/oauth_clients`, mount `id.access`.
        - Operation `get`, response envelope `get`.
        - Flags: read only.
      tags:
        - oauth_clients
      parameters:
        - name: sid
          in: path
          required: true
          description: The id_oc_* sid of the row to read.
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^id_oc_
            description: The id_oc_* sid of the row to read.
        - name: include[]
          in: query
          required: false
          description: Relations to attach to the row; omit for the bare row.
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
              enum:
                - active_sessions
            description: Relations to attach to the row; omit for the bare row.
      responses:
        "200":
          description: "`get` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetOauthClientResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: get_oauth_client
      x-gs-mcp-mount: id.access
      x-gs-entity: oauth_clients
      x-gs-operation: get
      x-gs-envelope: get
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: trivial
    patch:
      operationId: update_oauth_client
      summary: Update OAuth client
      description: |-
        Edit a client: name, redirect_uris, permissions, grant_types (full replacements) and actor_kind (only tokens minted afterwards carry the new kind). Tightening permissions touches future mints only; live tokens keep their frozen set, so cut access with disable_oauth_client. status moves by disable / enable, client_id and is_confidential never. At least one field.

        Contract:
        - MCP tool `update_oauth_client`, registry package `mcp.id/oauth_clients`, mount `id.access`.
        - Operation `update`, response envelope `update`.
        - Flags: none.
      tags:
        - oauth_clients
      parameters:
        - name: sid
          in: path
          required: true
          description: OAuth client sid (id_oc_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^id_oc_
            description: OAuth client sid (id_oc_...).
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateOauthClientRequest"
      responses:
        "200":
          description: "`update` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UpdateOauthClientResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: update_oauth_client
      x-gs-mcp-mount: id.access
      x-gs-entity: oauth_clients
      x-gs-operation: update
      x-gs-envelope: update
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
    delete:
      operationId: delete_oauth_client
      summary: Delete OAuth client
      description: |-
        Soft-delete the client and revoke every grant and session it issued: every app and agent connected through it is cut off at once, and the public flow refuses it. DESTRUCTIVE. Idempotent: re-deleting answers already_deleted; the sessions survive as revoked rows.

        Contract:
        - MCP tool `delete_oauth_client`, registry package `mcp.id/oauth_clients`, mount `id.access`.
        - Operation `delete`, response envelope `delete_simple`.
        - Flags: dangerous: the MCP layer gates it behind a preview/commit token, and the effect cannot be undone through this API.
      tags:
        - oauth_clients
      parameters:
        - name: sid
          in: path
          required: true
          description: The id_oc_* sid of the row to delete.
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^id_oc_
            description: The id_oc_* sid of the row to delete.
      responses:
        "200":
          description: "`delete_simple` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DeleteOauthClientResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: delete_oauth_client
      x-gs-mcp-mount: id.access
      x-gs-entity: oauth_clients
      x-gs-operation: delete
      x-gs-envelope: delete_simple
      x-gs-availability: ga
      x-gs-dangerous: true
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/oauth-clients/{sid}/disable:
    post:
      operationId: disable_oauth_client
      summary: Disable OAuth client
      description: |-
        Switch a client off: status disabled, its grants and the installation tokens it issued revoked at once (result.revoked_sessions_count), the flow refuses it until enable_oauth_client. The reversible cut; delete_oauth_client is the final one. Idempotent: already_disabled true the second time.

        Contract:
        - MCP tool `disable_oauth_client`, registry package `mcp.id/oauth_clients`, mount `id.access`.
        - Operation `action`, response envelope `action`.
        - Flags: dangerous: the MCP layer gates it behind a preview/commit token, and the effect cannot be undone through this API.
      tags:
        - oauth_clients
      parameters:
        - name: sid
          in: path
          required: true
          description: OAuth client sid (id_oc_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^id_oc_
            description: OAuth client sid (id_oc_...).
      responses:
        "200":
          description: "`action` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DisableOauthClientResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: disable_oauth_client
      x-gs-mcp-mount: id.access
      x-gs-entity: oauth_clients
      x-gs-operation: action
      x-gs-envelope: action
      x-gs-availability: ga
      x-gs-dangerous: true
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/oauth-clients/{sid}/enable:
    post:
      operationId: enable_oauth_client
      summary: Enable OAuth client
      description: |-
        Switch a disabled client back on: the flow accepts it again. The grants the disable revoked stay revoked: every holder consents again.

        Contract:
        - MCP tool `enable_oauth_client`, registry package `mcp.id/oauth_clients`, mount `id.access`.
        - Operation `action`, response envelope `action`.
        - Flags: none.
      tags:
        - oauth_clients
      parameters:
        - name: sid
          in: path
          required: true
          description: OAuth client sid (id_oc_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^id_oc_
            description: OAuth client sid (id_oc_...).
      responses:
        "200":
          description: "`action` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EnableOauthClientResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: enable_oauth_client
      x-gs-mcp-mount: id.access
      x-gs-entity: oauth_clients
      x-gs-operation: action
      x-gs-envelope: action
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: trivial
  /api/sessions/search:
    post:
      operationId: search_sessions
      summary: Search sessions
      description: |-
        The signed-in sessions: the caller's own active ones by default (Active sessions), kind.eq oauth for the connected apps and agents, status for revoked or expired history. is_current marks the row behind the calling token, so "sign out everywhere else" skips it. page_size 0 returns the counts only.

        Contract:
        - MCP tool `search_sessions`, registry package `mcp.id/sessions`, mount `id.identity`.
        - Operation `search`, response envelope `search`.
        - Flags: read only.
      tags:
        - sessions
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SearchSessionsRequest"
      responses:
        "200":
          description: "`search` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SearchSessionsResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: search_sessions
      x-gs-mcp-mount: id.identity
      x-gs-entity: sessions
      x-gs-operation: search
      x-gs-envelope: search
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/sessions/{sid}/revoke:
    post:
      operationId: revoke_session
      summary: Revoke session
      description: |-
        End a session: active to revoked, the token refused from the next request here and within five minutes on the other services. The canonical delete of this entity (there is no delete tool). Idempotent: an already revoked or expired session answers result.already_revoked true.

        Contract:
        - MCP tool `revoke_session`, registry package `mcp.id/sessions`, mount `id.identity`.
        - Operation `action`, response envelope `action`.
        - Flags: dangerous: the MCP layer gates it behind a preview/commit token, and the effect cannot be undone through this API.
      tags:
        - sessions
      parameters:
        - name: sid
          in: path
          required: true
          description: Session sid (id_se_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^id_se_
            description: Session sid (id_se_...).
      responses:
        "200":
          description: "`action` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RevokeSessionResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: revoke_session
      x-gs-mcp-mount: id.identity
      x-gs-entity: sessions
      x-gs-operation: action
      x-gs-envelope: action
      x-gs-availability: ga
      x-gs-dangerous: true
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/ssl-certificates/search:
    post:
      operationId: search_ssl_certificates
      summary: Search SSL certificates
      description: |-
        The team's TLS certificates for its white label domains: each domain's status, issuer, issued_at, expires_at and the last_error token of a failure. status for live vs failed, expires_at.lte for the ones expiring soon, domain.eq for one host. The body and the key are never returned. page_size 0 returns the counts only.

        Contract:
        - MCP tool `search_ssl_certificates`, registry package `mcp.id/ssl_certificates`, mount `id.partner`.
        - Operation `search`, response envelope `search`.
        - Flags: read only.
      tags:
        - ssl_certificates
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SearchSslCertificatesRequest"
      responses:
        "200":
          description: "`search` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SearchSslCertificatesResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: search_ssl_certificates
      x-gs-mcp-mount: id.partner
      x-gs-entity: ssl_certificates
      x-gs-operation: search
      x-gs-envelope: search
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/ssl-certificates/{sid}:
    get:
      operationId: get_ssl_certificate
      summary: Get SSL certificate
      description: |-
        One certificate by sid: status, issuer, validity, the last_error token, and the HTTP-01 challenge while an attempt is in flight. Poll it after issue or renew until challenge is null.

        Contract:
        - MCP tool `get_ssl_certificate`, registry package `mcp.id/ssl_certificates`, mount `id.partner`.
        - Operation `get`, response envelope `get`.
        - Flags: read only.
      tags:
        - ssl_certificates
      parameters:
        - name: sid
          in: path
          required: true
          description: SSL certificate sid (id_sc_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^id_sc_
            description: SSL certificate sid (id_sc_...).
      responses:
        "200":
          description: "`get` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetSslCertificateResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: get_ssl_certificate
      x-gs-mcp-mount: id.partner
      x-gs-entity: ssl_certificates
      x-gs-operation: get
      x-gs-envelope: get
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: trivial
    delete:
      operationId: delete_ssl_certificate
      summary: Delete SSL certificate
      description: |-
        Remove a domain's certificate: the row is soft-deleted, and after the commit a job revokes it at the CA and removes the serving files. DESTRUCTIVE, no recovery: the brand's activate registers and issues anew. A brand delete does this itself.

        Contract:
        - MCP tool `delete_ssl_certificate`, registry package `mcp.id/ssl_certificates`, mount `id.partner`.
        - Operation `delete`, response envelope `delete_simple`.
        - Flags: dangerous: the MCP layer gates it behind a preview/commit token, and the effect cannot be undone through this API.
      tags:
        - ssl_certificates
      parameters:
        - name: sid
          in: path
          required: true
          description: The id_sc_* sid of the row to delete.
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^id_sc_
            description: The id_sc_* sid of the row to delete.
      responses:
        "200":
          description: "`delete_simple` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DeleteSslCertificateResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: delete_ssl_certificate
      x-gs-mcp-mount: id.partner
      x-gs-entity: ssl_certificates
      x-gs-operation: delete
      x-gs-envelope: delete_simple
      x-gs-availability: ga
      x-gs-dangerous: true
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/ssl-certificates/{sid}/issue:
    post:
      operationId: issue_ssl_certificate
      summary: Issue SSL certificate
      description: |-
        Start the ACME HTTP-01 issuance for a registered domain, by hand (activate_whitelabel does it on its own). ASYNC: the authorization is requested, the challenge stored, status goes challenge, and the platform self-checks, validates and flips the row active in the background; poll get_ssl_certificate until challenge is null (active, or failed with a last_error token: domain_not_pointed means the CNAME is not there yet). Not idempotent: each call requests a fresh authorization. 409 conflict: domain_already_active (renew instead), issuance_already_in_progress (an attempt is in flight, whatever the status), cannot_issue_deleted_certificate, acme_unreachable (the CA could not be asked; the row then carries issuance_unavailable).

        Contract:
        - MCP tool `issue_ssl_certificate`, registry package `mcp.id/ssl_certificates`, mount `id.partner`.
        - Operation `action`, response envelope `action_async`.
        - Flags: dangerous: the MCP layer gates it behind a preview/commit token, and the effect cannot be undone through this API.
      tags:
        - ssl_certificates
      parameters:
        - name: sid
          in: path
          required: true
          description: SSL certificate sid (id_sc_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^id_sc_
            description: SSL certificate sid (id_sc_...).
      responses:
        "200":
          description: "`action_async` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/IssueSslCertificateResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: issue_ssl_certificate
      x-gs-mcp-mount: id.partner
      x-gs-entity: ssl_certificates
      x-gs-operation: action
      x-gs-envelope: action_async
      x-gs-availability: ga
      x-gs-dangerous: true
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: complex
  /api/ssl-certificates/{sid}/renew:
    post:
      operationId: renew_ssl_certificate
      summary: Renew SSL certificate
      description: |-
        Force a re-issue of an existing certificate, ignoring the 30-day renewal window. ASYNC, the same HTTP-01 path as issue on the same row. An active certificate STAYS active and keeps serving while challenge carries the attempt: on success the certificate is replaced and re-stamped, on failure last_error is set and the current one keeps serving. A failed or expired row flips to challenge and ends active or failed like issue. Poll get_ssl_certificate until challenge is null. Use after a DNS or CA fix, or to recover a lapsed certificate. 409 conflict: issuance_already_in_progress (the daily sweep's attempt included), cannot_issue_deleted_certificate, acme_unreachable; an active row is not refused.

        Contract:
        - MCP tool `renew_ssl_certificate`, registry package `mcp.id/ssl_certificates`, mount `id.partner`.
        - Operation `action`, response envelope `action_async`.
        - Flags: dangerous: the MCP layer gates it behind a preview/commit token, and the effect cannot be undone through this API.
      tags:
        - ssl_certificates
      parameters:
        - name: sid
          in: path
          required: true
          description: SSL certificate sid (id_sc_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^id_sc_
            description: SSL certificate sid (id_sc_...).
      responses:
        "200":
          description: "`action_async` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RenewSslCertificateResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: renew_ssl_certificate
      x-gs-mcp-mount: id.partner
      x-gs-entity: ssl_certificates
      x-gs-operation: action
      x-gs-envelope: action_async
      x-gs-availability: ga
      x-gs-dangerous: true
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: complex
  /api/subscription-allocations:
    post:
      operationId: create_subscription_allocation
      summary: Create subscription allocation
      description: |-
        Hand a workspace a share of a subscription's pool: the workspace turns active with these quantities as its limits, the credits due so far this period are issued, and a lapsed trial share is superseded. The caller must be the buyer (403 not_subscription_owner) and a partner account (403 partner_only; a standard account's one share follows its plan on its own); the workspace must be the buyer's own or a client workspace of a brand the buyer's team owns (403 team_not_reachable). For every key the shares may not exceed the pool (409 pool_exceeded with key, pool, allocated_elsewhere, requested); a workspace already on a live share is 409 team_already_allocated; a canceled subscription takes no share. Quantities omitted are 0.

        Contract:
        - MCP tool `create_subscription_allocation`, registry package `mcp.id/subscription_allocations`, mount `id.partner`.
        - Operation `create`, response envelope `create`.
        - Flags: none.
      tags:
        - subscription_allocations
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateSubscriptionAllocationRequest"
      responses:
        "200":
          description: "`create` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateSubscriptionAllocationResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: create_subscription_allocation
      x-gs-mcp-mount: id.partner
      x-gs-entity: subscription_allocations
      x-gs-operation: create
      x-gs-envelope: create
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: complex
  /api/subscription-allocations/search:
    post:
      operationId: search_subscription_allocations
      summary: Search subscription allocations
      description: |-
        How a subscription's pool is split across workspaces, or what one workspace draws from: subscription_sid.eq for the split of one pool, team_sid.eq for a workspace's share (its capacity: sender profiles, credits per period, the White label). Scope: the pools the caller bought, plus the current workspace's own share. include team hydrates the workspace with its derived status. Oldest share first by default. page_size 0 returns the count only.

        Contract:
        - MCP tool `search_subscription_allocations`, registry package `mcp.id/subscription_allocations`, mount `id.partner`.
        - Operation `search`, response envelope `search`.
        - Flags: read only.
      tags:
        - subscription_allocations
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SearchSubscriptionAllocationsRequest"
      responses:
        "200":
          description: "`search` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SearchSubscriptionAllocationsResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: search_subscription_allocations
      x-gs-mcp-mount: id.partner
      x-gs-entity: subscription_allocations
      x-gs-operation: search
      x-gs-envelope: search
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/subscription-allocations/{sid}:
    get:
      operationId: get_subscription_allocation
      summary: Get subscription allocation
      description: |-
        One allocation by sid (readable by the buyer and the allocated workspace), with the team include.

        Contract:
        - MCP tool `get_subscription_allocation`, registry package `mcp.id/subscription_allocations`, mount `id.partner`.
        - Operation `get`, response envelope `get`.
        - Flags: read only.
      tags:
        - subscription_allocations
      parameters:
        - name: sid
          in: path
          required: true
          description: The bl_al_* sid of the row to read.
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^bl_al_
            description: The bl_al_* sid of the row to read.
        - name: include[]
          in: query
          required: false
          description: Relations to attach to the row; omit for the bare row.
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
              enum:
                - team
            description: Relations to attach to the row; omit for the bare row.
      responses:
        "200":
          description: "`get` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetSubscriptionAllocationResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: get_subscription_allocation
      x-gs-mcp-mount: id.partner
      x-gs-entity: subscription_allocations
      x-gs-operation: get
      x-gs-envelope: get
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: trivial
    patch:
      operationId: update_subscription_allocation
      summary: Update subscription allocation
      description: |-
        Change a workspace's share: any of the four quantities. The workspace's limits follow at once; a raised credits_per_month issues the difference into the current month's grant, a lowered one claws nothing back. Buyer and partner only; the pool guard applies (409 pool_exceeded). At least one field, else 422 nothing_to_update.

        Contract:
        - MCP tool `update_subscription_allocation`, registry package `mcp.id/subscription_allocations`, mount `id.partner`.
        - Operation `update`, response envelope `update`.
        - Flags: none.
      tags:
        - subscription_allocations
      parameters:
        - name: sid
          in: path
          required: true
          description: Subscription allocation sid (bl_al_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^bl_al_
            description: Subscription allocation sid (bl_al_...).
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateSubscriptionAllocationRequest"
      responses:
        "200":
          description: "`update` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UpdateSubscriptionAllocationResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: update_subscription_allocation
      x-gs-mcp-mount: id.partner
      x-gs-entity: subscription_allocations
      x-gs-operation: update
      x-gs-envelope: update
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
    delete:
      operationId: delete_subscription_allocation
      summary: Delete subscription allocation
      description: |-
        Take a workspace's share back (soft-delete): the workspace turns suspended with zero limits, its automation is held and its data retention clock arms; the pool is free for another workspace. DESTRUCTIVE for the workspace, reversible by a new share. Buyer and partner only. Idempotent.

        Contract:
        - MCP tool `delete_subscription_allocation`, registry package `mcp.id/subscription_allocations`, mount `id.partner`.
        - Operation `delete`, response envelope `delete_simple`.
        - Flags: dangerous: the MCP layer gates it behind a preview/commit token, and the effect cannot be undone through this API.
      tags:
        - subscription_allocations
      parameters:
        - name: sid
          in: path
          required: true
          description: The bl_al_* sid of the row to delete.
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^bl_al_
            description: The bl_al_* sid of the row to delete.
      responses:
        "200":
          description: "`delete_simple` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DeleteSubscriptionAllocationResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: delete_subscription_allocation
      x-gs-mcp-mount: id.partner
      x-gs-entity: subscription_allocations
      x-gs-operation: delete
      x-gs-envelope: delete_simple
      x-gs-availability: ga
      x-gs-dangerous: true
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/team-members:
    post:
      operationId: create_team_member
      summary: Invite team member
      description: |-
        Invite a person by email: born status invited with a one-time code (a week), the invite email goes out. permissions is the explicit token list, stored as sent, inside the CALLER's own grant (403 insufficient_permission; * only from an unrestricted caller). account_sids narrows the member to some sender identities (null = all; beyond the caller's own slice, null included, is 403 account_not_allowed; [] is 422). Natural key (team, email) over live rows: a live member answers already_exists true.

        Contract:
        - MCP tool `create_team_member`, registry package `mcp.id/team_members`, mount `id.identity`.
        - Operation `create`, response envelope `create`.
        - Flags: none.
      tags:
        - team_members
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateTeamMemberRequest"
      responses:
        "200":
          description: "`create` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateTeamMemberResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: create_team_member
      x-gs-mcp-mount: id.identity
      x-gs-entity: team_members
      x-gs-operation: create
      x-gs-envelope: create
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/team-members/accept-invitation:
    post:
      operationId: accept_team_member_invitation
      summary: Accept team member invitation
      description: |-
        Accept a pending invite by its one-time code (no team scope: the caller is not a member yet). The row flips invited to active and binds the signed-in account; already active for the same account answers already_accepted true; a code redeemed by another account is 409 invitation_already_redeemed, an expired one 409 invitation_expired, an unknown one 404. Then call /auth/refresh: the token held was minted before the membership existed.

        Contract:
        - MCP tool `accept_team_member_invitation`, registry package `mcp.id/team_members`, mount `id.identity`.
        - Operation `action`, response envelope `action`.
        - Flags: none.
      tags:
        - team_members
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AcceptTeamMemberInvitationRequest"
      responses:
        "200":
          description: "`action` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AcceptTeamMemberInvitationResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: accept_team_member_invitation
      x-gs-mcp-mount: id.identity
      x-gs-entity: team_members
      x-gs-operation: action
      x-gs-envelope: action
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/team-members/search:
    post:
      operationId: search_team_members
      summary: Search team members
      description: |-
        Members and pending invites of the caller's workspace: the Members tab, the pending invites (user_sid.is_null true or status.eq invited), a member by address (q). include user hydrates the account behind an active member. page_size 0 returns the counts only.

        Contract:
        - MCP tool `search_team_members`, registry package `mcp.id/team_members`, mount `id.identity`.
        - Operation `search`, response envelope `search`.
        - Flags: read only.
      tags:
        - team_members
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SearchTeamMembersRequest"
      responses:
        "200":
          description: "`search` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SearchTeamMembersResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: search_team_members
      x-gs-mcp-mount: id.identity
      x-gs-entity: team_members
      x-gs-operation: search
      x-gs-envelope: search
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/team-members/{sid}:
    patch:
      operationId: update_team_member
      summary: Update team member
      description: |-
        Re-scope a member: replace permissions and/or account_sids (each in full). A narrowing revokes the member's live sessions in this workspace (the peers follow in five minutes; they sign in again); a widening waits for their next refresh. Inside the caller's own grant (403 insufficient_permission / account_not_allowed). The owner's row patches like any other (ownership moves by transfer_team_ownership). Empty body: 422 nothing_to_update; a value-identical patch is accepted.

        Contract:
        - MCP tool `update_team_member`, registry package `mcp.id/team_members`, mount `id.identity`.
        - Operation `update`, response envelope `update`.
        - Flags: none.
      tags:
        - team_members
      parameters:
        - name: sid
          in: path
          required: true
          description: Team member (membership or invite) sid (ts_mb_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^ts_mb_
            description: Team member (membership or invite) sid (ts_mb_...).
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateTeamMemberRequest"
      responses:
        "200":
          description: "`update` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UpdateTeamMemberResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: update_team_member
      x-gs-mcp-mount: id.identity
      x-gs-entity: team_members
      x-gs-operation: update
      x-gs-envelope: update
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
    delete:
      operationId: delete_team_member
      summary: Remove team member
      description: |-
        Cancel a pending invite or remove an active member: one soft-delete verb. DESTRUCTIVE. The owner is protected (409 owner_cannot_be_removed: transfer_team_ownership first). Removing a member revokes their sessions in this workspace only.

        Contract:
        - MCP tool `delete_team_member`, registry package `mcp.id/team_members`, mount `id.identity`.
        - Operation `delete`, response envelope `delete_simple`.
        - Flags: dangerous: the MCP layer gates it behind a preview/commit token, and the effect cannot be undone through this API.
      tags:
        - team_members
      parameters:
        - name: sid
          in: path
          required: true
          description: The ts_mb_* sid of the row to delete.
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^ts_mb_
            description: The ts_mb_* sid of the row to delete.
      responses:
        "200":
          description: "`delete_simple` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DeleteTeamMemberResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: delete_team_member
      x-gs-mcp-mount: id.identity
      x-gs-entity: team_members
      x-gs-operation: delete
      x-gs-envelope: delete_simple
      x-gs-availability: ga
      x-gs-dangerous: true
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/team-members/{sid}/resend-invitation:
    post:
      operationId: resend_team_member_invitation
      summary: Resend team member invitation
      description: |-
        Re-roll the one-time code of a pending invite, push its expiry a week on and send the invite email again. Only on a status invited row (409 invalid_transition otherwise).

        Contract:
        - MCP tool `resend_team_member_invitation`, registry package `mcp.id/team_members`, mount `id.identity`.
        - Operation `action`, response envelope `action`.
        - Flags: none.
      tags:
        - team_members
      parameters:
        - name: sid
          in: path
          required: true
          description: Team member (membership or invite) sid (ts_mb_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^ts_mb_
            description: Team member (membership or invite) sid (ts_mb_...).
      responses:
        "200":
          description: "`action` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResendTeamMemberInvitationResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: resend_team_member_invitation
      x-gs-mcp-mount: id.identity
      x-gs-entity: team_members
      x-gs-operation: action
      x-gs-envelope: action
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: trivial
  /api/teams:
    post:
      operationId: create_team
      summary: Create team
      description: |-
        Create a workspace: the caller becomes its owner and first member. It is born suspended with zero limits; the first workspace of a registration gets the trial, a second one stays suspended until the buyer hands it a share of a paid subscription (create_subscription_allocation on /mcp/id/partner). Names are not unique: every call creates a new team.

        Contract:
        - MCP tool `create_team`, registry package `mcp.id/teams`, mount `id.identity`.
        - Operation `create`, response envelope `create`.
        - Flags: none.
      tags:
        - teams
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateTeamRequest"
      responses:
        "200":
          description: "`create` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateTeamResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: create_team
      x-gs-mcp-mount: id.identity
      x-gs-entity: teams
      x-gs-operation: create
      x-gs-envelope: create
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/teams/search:
    post:
      operationId: search_teams
      summary: Search teams
      description: |-
        The caller's workspaces: the ones they own plus their active memberships. status.eq suspended finds the workspaces with no live share, subscription_sid.is_null the ones nothing pays for, q matches the name. include owner / members_counts. page_size 0 returns the counts only. The capacity a workspace holds is its allocation (search_subscription_allocations on /mcp/id/partner); limits here is its snapshot.

        Contract:
        - MCP tool `search_teams`, registry package `mcp.id/teams`, mount `id.identity`.
        - Operation `search`, response envelope `search`.
        - Flags: read only.
      tags:
        - teams
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SearchTeamsRequest"
      responses:
        "200":
          description: "`search` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SearchTeamsResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: search_teams
      x-gs-mcp-mount: id.identity
      x-gs-entity: teams
      x-gs-operation: search
      x-gs-envelope: search
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/teams/{sid}:
    get:
      operationId: get_team
      summary: Get team
      description: |-
        One workspace by sid, visible to its owner and active members, with optional includes (owner, members_counts).

        Contract:
        - MCP tool `get_team`, registry package `mcp.id/teams`, mount `id.identity`.
        - Operation `get`, response envelope `get`.
        - Flags: read only.
      tags:
        - teams
      parameters:
        - name: sid
          in: path
          required: true
          description: The ts_tm_* sid of the row to read.
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^ts_tm_
            description: The ts_tm_* sid of the row to read.
        - name: include[]
          in: query
          required: false
          description: Relations to attach to the row; omit for the bare row.
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
              enum:
                - owner
                - members_counts
            description: Relations to attach to the row; omit for the bare row.
      responses:
        "200":
          description: "`get` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetTeamResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: get_team
      x-gs-mcp-mount: id.identity
      x-gs-entity: teams
      x-gs-operation: get
      x-gs-envelope: get
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: trivial
    patch:
      operationId: update_team
      summary: Update team
      description: |-
        Rename a workspace or edit its config (the timezone every daily counter counts in). Only name and config are mutable: the owner moves by transfer_team_ownership, status and limits are derived from the allocation, subscription_sid from the share. At least one field, else 422 nothing_to_update.

        Contract:
        - MCP tool `update_team`, registry package `mcp.id/teams`, mount `id.identity`.
        - Operation `update`, response envelope `update`.
        - Flags: none.
      tags:
        - teams
      parameters:
        - name: sid
          in: path
          required: true
          description: Team (workspace) sid (ts_tm_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^ts_tm_
            description: Team (workspace) sid (ts_tm_...).
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateTeamRequest"
      responses:
        "200":
          description: "`update` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UpdateTeamResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: update_team
      x-gs-mcp-mount: id.identity
      x-gs-entity: teams
      x-gs-operation: update
      x-gs-envelope: update
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
    delete:
      operationId: delete_team
      summary: Delete team
      description: |-
        Cascade soft-delete a workspace and its rows (members, keys, sessions, OAuth clients, brands, certificates); its share goes back to the pool. Owner only. DESTRUCTIVE, no restore: the data is erased 30 days later. Soft blockers (active keys, other members) answer 409 delete_blocked until acknowledged. Deleting the owner's last workspace leaves the account untouched and teamless. The caller's session is revoked by the cascade: re-mint for the surviving team first.

        Contract:
        - MCP tool `delete_team`, registry package `mcp.id/teams`, mount `id.identity`.
        - Operation `delete`, response envelope `delete_cascade`.
        - Flags: dangerous: the MCP layer gates it behind a preview/commit token, and the effect cannot be undone through this API.
      tags:
        - teams
      parameters:
        - name: sid
          in: path
          required: true
          description: The ts_tm_* sid of the row to delete.
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^ts_tm_
            description: The ts_tm_* sid of the row to delete.
        - name: acknowledge[]
          in: query
          required: false
          description: Resolution codes of the soft blockers the user confirmed (error.blockers[].resolution of a delete_blocked answer).
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
              enum:
                - revoke_keys
                - remove_members
            description: Resolution codes of the soft blockers the user confirmed (error.blockers[].resolution of a delete_blocked answer).
        - name: next_default_team_sid
          in: query
          required: false
          description: Which of the caller's other live memberships becomes their working team afterwards; default the oldest. 422 when it is not an active membership of theirs.
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^ts_tm_
            description: Which of the caller's other live memberships becomes their working team afterwards; default the oldest. 422 when it is not an active membership of theirs.
      responses:
        "200":
          description: "`delete_cascade` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DeleteTeamResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: delete_team
      x-gs-mcp-mount: id.identity
      x-gs-entity: teams
      x-gs-operation: delete
      x-gs-envelope: delete_cascade
      x-gs-availability: ga
      x-gs-dangerous: true
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/teams/{sid}/transfer-ownership:
    post:
      operationId: transfer_team_ownership
      summary: Transfer team ownership
      description: |-
        Hand the workspace to another active member: the only way owner_user_sid changes, and the prerequisite for the current owner to leave. Owner only (an admin cannot). Transferring to the current owner is a no-op (result.changed false). result.previous_owner_user_sid names who held it before.

        Contract:
        - MCP tool `transfer_team_ownership`, registry package `mcp.id/teams`, mount `id.identity`.
        - Operation `action`, response envelope `action`.
        - Flags: dangerous: the MCP layer gates it behind a preview/commit token, and the effect cannot be undone through this API.
      tags:
        - teams
      parameters:
        - name: sid
          in: path
          required: true
          description: Team (workspace) sid (ts_tm_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^ts_tm_
            description: Team (workspace) sid (ts_tm_...).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TransferTeamOwnershipRequest"
      responses:
        "200":
          description: "`action` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TransferTeamOwnershipResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: transfer_team_ownership
      x-gs-mcp-mount: id.identity
      x-gs-entity: teams
      x-gs-operation: action
      x-gs-envelope: action
      x-gs-availability: ga
      x-gs-dangerous: true
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/user-profile:
    get:
      operationId: get_user_profile
      summary: Get user profile
      description: |-
        The signed-in person's card: name, headline, role and company, location, experience, topics, languages, the LinkedIn axes, each stamped in sources. 404 user_profile_not_found until the first write.

        Contract:
        - MCP tool `get_user_profile`, registry package `mcp.id/user_profiles`, mount `id.identity`.
        - Operation `get`, response envelope `get`.
        - Flags: read only.
      tags:
        - user_profiles
      responses:
        "200":
          description: "`get` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetUserProfileResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: get_user_profile
      x-gs-mcp-mount: id.identity
      x-gs-entity: user_profiles
      x-gs-operation: get
      x-gs-envelope: get
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: trivial
    patch:
      operationId: update_user_profile
      summary: Update user profile
      description: |-
        Write the signed-in person's card: any of full_name, headline, role_title, company_name, location, experience_line, topics, languages, ln_member_id, ln_id, ln_nickname (a profile link is parsed to the slug; null clears a field); avatar_url is the account's picture while it has none; source stamps each field (default person); read_at: when the profile was read. The first write creates the card; a full_name replaces an email-derived name. 422 unknown_field, ln_nickname_invalid.

        Contract:
        - MCP tool `update_user_profile`, registry package `mcp.id/user_profiles`, mount `id.identity`.
        - Operation `update`, response envelope `update`.
        - Flags: none.
      tags:
        - user_profiles
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateUserProfileRequest"
      responses:
        "200":
          description: "`update` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UpdateUserProfileResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: update_user_profile
      x-gs-mcp-mount: id.identity
      x-gs-entity: user_profiles
      x-gs-operation: update
      x-gs-envelope: update
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/users/current:
    get:
      operationId: get_current_user
      summary: Get current user
      description: |-
        The signed-in account itself (no sid): email, name, timezone, default_team_sid. include accessible_teams lists the workspaces it may enter. An API key is not a person and answers 403 not_a_user_actor.

        Contract:
        - MCP tool `get_current_user`, registry package `mcp.id/users`, mount `id.identity`.
        - Operation `get`, response envelope `get`.
        - Flags: read only.
      tags:
        - users
      parameters:
        - name: include[]
          in: query
          required: false
          description: "accessible_teams (the one include): the live workspaces behind the account's active memberships (TeamDomain rows)."
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
            description: "accessible_teams (the one include): the live workspaces behind the account's active memberships (TeamDomain rows)."
      responses:
        "200":
          description: "`get` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetCurrentUserResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: get_current_user
      x-gs-mcp-mount: id.identity
      x-gs-entity: users
      x-gs-operation: get
      x-gs-envelope: get
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: trivial
    patch:
      operationId: update_current_user
      summary: Update current user
      description: |-
        Edit the signed-in account: first_name, last_name, avatar_url, phone, timezone, country and a shallow config patch (keys merge, the rest stays). Email, the default team and erasure keep their own /auth flows; sids are read-only. At least one field. An API key has no profile (403 not_a_user_actor). The avatar FILE goes through the app upload, not here: pass a URL, or null to remove it.

        Contract:
        - MCP tool `update_current_user`, registry package `mcp.id/users`, mount `id.identity`.
        - Operation `update`, response envelope `update`.
        - Flags: none.
      tags:
        - users
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateCurrentUserRequest"
      responses:
        "200":
          description: "`update` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UpdateCurrentUserResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: update_current_user
      x-gs-mcp-mount: id.identity
      x-gs-entity: users
      x-gs-operation: update
      x-gs-envelope: update
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/whitelabel-clients/search:
    post:
      operationId: search_whitelabel_clients
      summary: Search whitelabel clients
      description: |-
        Who registered on the team's brands: one row per client user, newest first. include user for the account, teams for the workspaces the client owns with their gate and the share the reseller allocated (the targets of create_subscription_allocation and open_whitelabel_client_workspace). counts.groups.registered gives the 7d, 30d and 90d registration counters; page_size 0 returns them alone.

        Contract:
        - MCP tool `search_whitelabel_clients`, registry package `mcp.id/whitelabel_clients`, mount `id.partner`.
        - Operation `search`, response envelope `search`.
        - Flags: read only.
      tags:
        - whitelabel_clients
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SearchWhitelabelClientsRequest"
      responses:
        "200":
          description: "`search` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SearchWhitelabelClientsResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: search_whitelabel_clients
      x-gs-mcp-mount: id.partner
      x-gs-entity: whitelabel_clients
      x-gs-operation: search
      x-gs-envelope: search
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/whitelabels:
    post:
      operationId: create_whitelabel
      summary: Create whitelabel
      description: |-
        Register a brand on a custom domain, born pending_domain: nothing serves until the reseller points the host's CNAME at the platform and activate_whitelabel proves it. Needs the White label entitlement on the workspace's share (403 whitelabel_not_enabled). domain is a bare lowercase FQDN, unique across the platform (409 domain_already_taken; 409 domain_held_by_deleted_whitelabel while a deleted brand still holds it, support releases it); the artwork is given as https URLs (the files are uploaded in the app); the palette is #rrggbb per slot; email_from_name and email_reply_to sign the clients' mail at once, email_from_address only after verify_whitelabel_email_domain proves its domain. The setup chain: create, hand over the CNAME, activate, poll get_whitelabel with include ssl_certificate until active.

        Contract:
        - MCP tool `create_whitelabel`, registry package `mcp.id/whitelabels`, mount `id.partner`.
        - Operation `create`, response envelope `create`.
        - Flags: none.
      tags:
        - whitelabels
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateWhitelabelRequest"
      responses:
        "200":
          description: "`create` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateWhitelabelResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: create_whitelabel
      x-gs-mcp-mount: id.partner
      x-gs-entity: whitelabels
      x-gs-operation: create
      x-gs-envelope: create
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: complex
  /api/whitelabels/search:
    post:
      operationId: search_whitelabels
      summary: Search whitelabels
      description: |-
        The reseller team's white label brands: each brand's host, status (pending_domain, active, disabled), artwork, palette and email chrome. include ssl_certificate for the domain's certificate state (why a host is not live yet; it also needs can_view_ssl_certificates, else 403 scope_missing), users_count for how many clients registered on it. page_size 0 returns the counts only. Empty for a team without the White label entitlement.

        Contract:
        - MCP tool `search_whitelabels`, registry package `mcp.id/whitelabels`, mount `id.partner`.
        - Operation `search`, response envelope `search`.
        - Flags: read only.
      tags:
        - whitelabels
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SearchWhitelabelsRequest"
      responses:
        "200":
          description: "`search` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SearchWhitelabelsResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: search_whitelabels
      x-gs-mcp-mount: id.partner
      x-gs-entity: whitelabels
      x-gs-operation: search
      x-gs-envelope: search
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/whitelabels/{sid}:
    get:
      operationId: get_whitelabel
      summary: Get whitelabel
      description: |-
        One brand by sid. include ssl_certificate to poll the domain proof after activate (it also needs can_view_ssl_certificates), users_count for its registrations.

        Contract:
        - MCP tool `get_whitelabel`, registry package `mcp.id/whitelabels`, mount `id.partner`.
        - Operation `get`, response envelope `get`.
        - Flags: read only.
      tags:
        - whitelabels
      parameters:
        - name: sid
          in: path
          required: true
          description: The id_wl_* sid of the row to read.
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^id_wl_
            description: The id_wl_* sid of the row to read.
        - name: include[]
          in: query
          required: false
          description: Relations to attach to the row; omit for the bare row.
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
              enum:
                - ssl_certificate
                - users_count
            description: Relations to attach to the row; omit for the bare row.
      responses:
        "200":
          description: "`get` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetWhitelabelResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: get_whitelabel
      x-gs-mcp-mount: id.partner
      x-gs-entity: whitelabels
      x-gs-operation: get
      x-gs-envelope: get
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: trivial
    patch:
      operationId: update_whitelabel
      summary: Update whitelabel
      description: |-
        Rebrand: name, the artwork URLs, the palette and the email chrome, effective on the next app load and the next email. domain changes only while pending_domain (422 on a live brand: disable and create anew). A new email_from_address on another domain drops the old proof: verify it again. At least one field, else 422 nothing_to_update.

        Contract:
        - MCP tool `update_whitelabel`, registry package `mcp.id/whitelabels`, mount `id.partner`.
        - Operation `update`, response envelope `update`.
        - Flags: none.
      tags:
        - whitelabels
      parameters:
        - name: sid
          in: path
          required: true
          description: Whitelabel (brand) sid (id_wl_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^id_wl_
            description: Whitelabel (brand) sid (id_wl_...).
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateWhitelabelRequest"
      responses:
        "200":
          description: "`update` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UpdateWhitelabelResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: update_whitelabel
      x-gs-mcp-mount: id.partner
      x-gs-entity: whitelabels
      x-gs-operation: update
      x-gs-envelope: update
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
    delete:
      operationId: delete_whitelabel
      summary: Delete whitelabel
      description: |-
        Shut a brand down for good (soft-delete): its clients fall back to the platform brand at once, its certificate stops renewing and is revoked after the commit, its sending domain is released at SendGrid. DESTRUCTIVE, no blockers, no restore. disable_whitelabel is the reversible switch.

        Contract:
        - MCP tool `delete_whitelabel`, registry package `mcp.id/whitelabels`, mount `id.partner`.
        - Operation `delete`, response envelope `delete_simple`.
        - Flags: dangerous: the MCP layer gates it behind a preview/commit token, and the effect cannot be undone through this API.
      tags:
        - whitelabels
      parameters:
        - name: sid
          in: path
          required: true
          description: The id_wl_* sid of the row to delete.
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^id_wl_
            description: The id_wl_* sid of the row to delete.
      responses:
        "200":
          description: "`delete_simple` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DeleteWhitelabelResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: delete_whitelabel
      x-gs-mcp-mount: id.partner
      x-gs-entity: whitelabels
      x-gs-operation: delete
      x-gs-envelope: delete_simple
      x-gs-availability: ga
      x-gs-dangerous: true
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/whitelabels/{sid}/activate:
    post:
      operationId: activate_whitelabel
      summary: Activate whitelabel
      description: |-
        Start or retry proving the brand's domain: the certificate row is ensured and a job issues it over ACME HTTP-01, retrying while the DNS propagates (about a day at most); on success the brand flips pending_domain to active. ASYNC: tell the reseller to point the domain's CNAME at the platform, then poll get_whitelabel with include ssl_certificate until status is active (or the certificate's last_error names the fault: domain_not_pointed, domain_validation_failed). Idempotent while pending; a no-op on an active brand; 404 on a deleted one.

        Contract:
        - MCP tool `activate_whitelabel`, registry package `mcp.id/whitelabels`, mount `id.partner`.
        - Operation `action`, response envelope `action_async`.
        - Flags: none.
      tags:
        - whitelabels
      parameters:
        - name: sid
          in: path
          required: true
          description: Whitelabel (brand) sid (id_wl_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^id_wl_
            description: Whitelabel (brand) sid (id_wl_...).
      responses:
        "200":
          description: "`action_async` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ActivateWhitelabelResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: activate_whitelabel
      x-gs-mcp-mount: id.partner
      x-gs-entity: whitelabels
      x-gs-operation: action
      x-gs-envelope: action_async
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: complex
  /api/whitelabels/{sid}/clients/{teamSid}/open:
    post:
      operationId: open_whitelabel_client_workspace
      summary: Open whitelabel client workspace
      description: |-
        Enter a client workspace of the brand as its owner, the way an admin impersonates: a 30-minute support session is minted and parked behind a one-time code; result.url is the app link that redeems it (the code rides the URL fragment, valid 120 seconds, one redemption). Audited on both halves (who, which brand, which workspace). The workspace's owner must be a client of this brand (403 not_a_client_workspace), the brand the caller's team's. Not idempotent: every call mints a new code.

        Contract:
        - MCP tool `open_whitelabel_client_workspace`, registry package `mcp.id/whitelabels`, mount `id.partner`.
        - Operation `action`, response envelope `action`.
        - Flags: dangerous: the MCP layer gates it behind a preview/commit token, and the effect cannot be undone through this API.
      tags:
        - whitelabels
      parameters:
        - name: sid
          in: path
          required: true
          description: Whitelabel (brand) sid (id_wl_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^id_wl_
            description: Whitelabel (brand) sid (id_wl_...).
        - name: teamSid
          in: path
          required: true
          description: "A client workspace of this brand (ts_tm_...): its owner registered on the brand's host."
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^ts_tm_
            description: "A client workspace of this brand (ts_tm_...): its owner registered on the brand's host."
      responses:
        "200":
          description: "`action` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OpenWhitelabelClientWorkspaceResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: open_whitelabel_client_workspace
      x-gs-mcp-mount: id.partner
      x-gs-entity: whitelabels
      x-gs-operation: action
      x-gs-envelope: action
      x-gs-availability: ga
      x-gs-dangerous: true
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: complex
  /api/whitelabels/{sid}/disable:
    post:
      operationId: disable_whitelabel
      summary: Disable whitelabel
      description: |-
        Switch an active brand off: its host falls back to the platform brand and its clients' mail loses the brand; the domain stays proven and the certificate keeps renewing, so enable_whitelabel brings it back at once. The reversible stop; delete_whitelabel is the final one.

        Contract:
        - MCP tool `disable_whitelabel`, registry package `mcp.id/whitelabels`, mount `id.partner`.
        - Operation `action`, response envelope `action`.
        - Flags: dangerous: the MCP layer gates it behind a preview/commit token, and the effect cannot be undone through this API.
      tags:
        - whitelabels
      parameters:
        - name: sid
          in: path
          required: true
          description: Whitelabel (brand) sid (id_wl_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^id_wl_
            description: Whitelabel (brand) sid (id_wl_...).
      responses:
        "200":
          description: "`action` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DisableWhitelabelResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: disable_whitelabel
      x-gs-mcp-mount: id.partner
      x-gs-entity: whitelabels
      x-gs-operation: action
      x-gs-envelope: action
      x-gs-availability: ga
      x-gs-dangerous: true
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
  /api/whitelabels/{sid}/enable:
    post:
      operationId: enable_whitelabel
      summary: Enable whitelabel
      description: |-
        Switch a disabled brand back on: the domain is still proven, so the host serves the brand again at once.

        Contract:
        - MCP tool `enable_whitelabel`, registry package `mcp.id/whitelabels`, mount `id.partner`.
        - Operation `action`, response envelope `action`.
        - Flags: none.
      tags:
        - whitelabels
      parameters:
        - name: sid
          in: path
          required: true
          description: Whitelabel (brand) sid (id_wl_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^id_wl_
            description: Whitelabel (brand) sid (id_wl_...).
      responses:
        "200":
          description: "`action` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EnableWhitelabelResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: enable_whitelabel
      x-gs-mcp-mount: id.partner
      x-gs-entity: whitelabels
      x-gs-operation: action
      x-gs-envelope: action
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: trivial
  /api/whitelabels/{sid}/verify-email-domain:
    post:
      operationId: verify_whitelabel_email_domain
      summary: Verify whitelabel email domain
      description: |-
        Start or re-run the proof of the domain the brand sends mail from (email_from_address must be set: 422 email_from_address_missing). The first call authenticates the domain at SendGrid and answers the DNS records to publish in email_domain.records; a later call asks SendGrid to look for them now. ASYNC: hand the reseller the records, then poll get_whitelabel until email_domain.status is verified (the brand's mail leaves from its own address from the next email) or failed (records not seen in 48 hours: fix the DNS and call again). Until then the mail leaves from the platform address under the brand's name. 503 email_domain_unavailable when SendGrid cannot be asked.

        Contract:
        - MCP tool `verify_whitelabel_email_domain`, registry package `mcp.id/whitelabels`, mount `id.partner`.
        - Operation `action`, response envelope `action_async`.
        - Flags: none.
      tags:
        - whitelabels
      parameters:
        - name: sid
          in: path
          required: true
          description: Whitelabel (brand) sid (id_wl_...).
          schema:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^id_wl_
            description: Whitelabel (brand) sid (id_wl_...).
      responses:
        "200":
          description: "`action_async` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/VerifyWhitelabelEmailDomainResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: verify_whitelabel_email_domain
      x-gs-mcp-mount: id.partner
      x-gs-entity: whitelabels
      x-gs-operation: action
      x-gs-envelope: action_async
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: complex
  /api/workspace-profile:
    get:
      operationId: get_workspace_profile
      summary: Get workspace profile
      description: |-
        The workspace profile: company, who_buys, offer, each field stamped in sources (source, set_at); confirmed_at once the person confirmed. 404 workspace_profile_not_found until the first write.

        Contract:
        - MCP tool `get_workspace_profile`, registry package `mcp.id/workspace_profiles`, mount `id.identity`.
        - Operation `get`, response envelope `get`.
        - Flags: read only.
      tags:
        - workspace_profiles
      responses:
        "200":
          description: "`get` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetWorkspaceProfileResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: get_workspace_profile
      x-gs-mcp-mount: id.identity
      x-gs-entity: workspace_profiles
      x-gs-operation: get
      x-gs-envelope: get
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: trivial
    patch:
      operationId: update_workspace_profile
      summary: Update workspace profile
      description: |-
        Write the workspace profile: a section given (company, who_buys, offer) replaces that section whole, so read it first and send it back with the fields changed; source stamps every field of the sections given (website, linkedin_company, linkedin_profile, person for the person's own words, creator for an inference; default person); confirm true marks the profile confirmed. The first write creates the row. 422 unknown_field on a key outside a section's shape, website_invalid, ln_nickname_invalid.

        Contract:
        - MCP tool `update_workspace_profile`, registry package `mcp.id/workspace_profiles`, mount `id.identity`.
        - Operation `update`, response envelope `update`.
        - Flags: none.
      tags:
        - workspace_profiles
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateWorkspaceProfileRequest"
      responses:
        "200":
          description: "`update` success envelope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UpdateWorkspaceProfileResponse"
        4XX:
          $ref: "#/components/responses/McpClientError"
        5XX:
          $ref: "#/components/responses/McpServerError"
      x-gs-mcp-tool: update_workspace_profile
      x-gs-mcp-mount: id.identity
      x-gs-entity: workspace_profiles
      x-gs-operation: update
      x-gs-envelope: update
      x-gs-availability: ga
      x-gs-dangerous: false
      x-gs-mass-action: false
      x-gs-step-eligible: false
      x-gs-schedule-required: false
      x-gs-tool-class: typical
components:
  securitySchemes:
    BearerJwt:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Access token issued by gs.service.id. Its `access_identity` claim carries `team_sid`, `actor_sid` and `actor_type`, and that team scope is authoritative.
    TeamSid:
      type: apiKey
      in: header
      name: Team-SID
      description: Team scope for tokens that do not carry one. Ignored when the token already names a team.
  responses:
    McpClientError:
      description: MCP error envelope. `error.code` is one of validation_failed, nothing_to_update, not_found, relation_not_found, invalid_transition, limit_exceeded, payment_required, duplicate_rejected, conflict, delete_blocked, unauthorized, forbidden, rate_limited, not_implemented.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/McpError"
    McpServerError:
      description: MCP error envelope with `error.code` internal_error or service_unavailable.
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/McpError"
  schemas:
    AcceptTeamMemberInvitationRequest:
      type: object
      description: Request body of `accept_team_member_invitation`.
      properties:
        code:
          type: string
          minLength: 1
          maxLength: 255
          description: The raw one-time invite code from the email link.
      required:
        - code
    AcceptTeamMemberInvitationResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - action
        action:
          type: string
          description: kebab-case verb; matches the route segment.
        item:
          type: object
          nullable: true
          properties:
            sid:
              type: string
              description: Membership sid (ts_mb_...).
            team_sid:
              type: string
              description: The workspace (ts_tm_...).
            user_sid:
              type: string
              nullable: true
              description: The member's account (us_mb_...); null while the invite is pending.
            email:
              type: string
              description: The invited address.
            status:
              type: string
              enum:
                - invited
                - active
                - revoked
              description: invited = pending; active = a member; revoked = removed.
            permissions:
              type: array
              items:
                type: string
              description: The explicit token list the member holds, stored as sent (no floor is unioned in).
            account_sids:
              type: array
              nullable: true
              items:
                type: string
              description: The sender identities the member may see and use (ln_ac_...); null = every one of the workspace.
            created_by:
              type: object
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: Who invited.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null = live.
          required:
            - sid
            - team_sid
            - user_sid
            - email
            - status
            - permissions
            - account_sids
            - created_by
            - created_at
            - updated_at
            - deleted_at
        result:
          type: object
          properties:
            already_accepted:
              type: boolean
              description: "true: the same account had accepted this invite before."
            default_team_assigned:
              type: boolean
              description: "true: the account had no default team and this one became it."
            next:
              type: string
              description: What to do next (refresh the token).
          required:
            - already_accepted
            - default_team_assigned
            - next
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - action
        - item
        - result
        - meta
    ActivateWhitelabelResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - action
        action:
          type: string
        async:
          type: boolean
          enum:
            - true
        item:
          type: object
          nullable: true
          properties:
            sid:
              type: string
              description: Brand sid (id_wl_...).
            team_sid:
              type: string
              description: The owning reseller team (ts_tm_...).
            name:
              type: string
              description: The brand name the app shell shows and the mail is signed with.
            domain:
              type: string
              description: The app and login host (app.reseller.com), lowercase FQDN, unique platform-wide; read-only once active.
            status:
              type: string
              enum:
                - pending_domain
                - active
                - disabled
              description: pending_domain = waiting for the CNAME and the certificate; active = the host serves the brand; disabled = switched off, the host falls back to the platform brand.
            logo_url:
              type: string
              nullable: true
              description: The horizontal logo (app shell and email header).
            icon_url:
              type: string
              nullable: true
              description: The square mark or favicon.
            login_image_url:
              type: string
              nullable: true
              description: The login page artwork.
            palette:
              type: object
              nullable: true
              properties:
                primary_color:
                  type: string
                  nullable: true
                  pattern: ^#[0-9a-fA-F]{6}$
                  description: "Buttons and links, #rrggbb; null = the platform default."
                accent_color:
                  type: string
                  nullable: true
                  pattern: ^#[0-9a-fA-F]{6}$
                  description: "The accent, #rrggbb; null = the platform default."
                login_background_color:
                  type: string
                  nullable: true
                  pattern: ^#[0-9a-fA-F]{6}$
                  description: "The login page background, #rrggbb; null = the platform default."
              description: Brand colors; null = all platform defaults.
            email_from_name:
              type: string
              nullable: true
              description: The From name on the clients' mail; null = the brand name.
            email_reply_to:
              type: string
              nullable: true
              description: The Reply-To on the clients' mail; null = none.
            email_from_address:
              type: string
              nullable: true
              description: The brand's own sender address; mail leaves from it once email_domain is verified, from the platform address under the brand's name until then.
            email_domain:
              type: object
              nullable: true
              properties:
                domain:
                  type: string
                  description: "The domain part of email_from_address, lowercase: what SendGrid authenticates."
                status:
                  type: string
                  enum:
                    - pending
                    - verified
                    - failed
                  description: pending = records not all found yet; verified = the brand's mail leaves from its own address; failed = see failure_reason.
                records:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        description: "cname (three of them: the return path and two DKIM keys)."
                      host:
                        type: string
                        description: The record name to publish at the domain's DNS host.
                      value:
                        type: string
                        description: The CNAME target at SendGrid.
                      valid:
                        type: boolean
                        description: What the last check found for this record.
                    required:
                      - type
                      - host
                      - value
                      - valid
                  description: The DNS records to publish, in the order SendGrid issued them.
                failure_reason:
                  type: string
                  nullable: true
                  enum:
                    - email_domain_rejected
                    - email_domain_not_proven_in_time
                  description: email_domain_rejected (SendGrid refused the domain) or email_domain_not_proven_in_time (48 hours lapsed); null unless failed.
                checked_at:
                  type: string
                  nullable: true
                  description: ISO 8601 UTC of the last check against SendGrid.
                verified_at:
                  type: string
                  nullable: true
                  description: ISO 8601 UTC since when it is verified; null while it is not.
              required:
                - domain
                - status
                - records
                - failure_reason
                - checked_at
                - verified_at
              description: The proof of the sending domain; null = verify never ran, or the address moved to another domain.
            created_by:
              type: object
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: Who registered the brand.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null = live.
          required:
            - sid
            - team_sid
            - name
            - domain
            - status
            - logo_url
            - icon_url
            - login_image_url
            - palette
            - email_from_name
            - email_reply_to
            - email_from_address
            - email_domain
            - created_by
            - created_at
            - updated_at
            - deleted_at
        pending:
          type: array
          items:
            type: object
            properties:
              expected_completion_seconds:
                type: integer
                description: "activate: 300; verify-email-domain: 3600."
              webhook_events:
                type: array
                items:
                  type: string
                description: "activate: whitelabels.activated, whitelabels.activation-failed; verify-email-domain: whitelabels.email-domain-verified, whitelabels.email-domain-failed."
              polling_hint:
                type: string
                description: "Poll get_whitelabel: after activate (include ssl_certificate) until status is active; after verify-email-domain until email_domain.status is verified or failed."
            required:
              - expected_completion_seconds
              - webhook_events
              - polling_hint
          description: "One ref: the proof in flight."
        result:
          type: object
          additionalProperties: {}
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - action
        - async
        - item
        - pending
        - result
        - meta
    CancelBillingSubscriptionResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - action
        action:
          type: string
          description: kebab-case verb; matches the route segment.
        item:
          type: object
          nullable: true
          properties:
            sid:
              type: string
              description: Subscription sid (bl_sb_...).
            owner_user_sid:
              type: string
              description: "The buyer (us_mb_...): the one who manages the pool."
            team_sid:
              type: string
              nullable: true
              description: "Always null on this product: a subscription floats and allocations bind workspaces to it."
            paddle_subscription_id:
              type: string
              nullable: true
              description: Paddle's id (sub_...); null on an internal sentinel (the trial).
            status:
              type: string
              enum:
                - active
                - past_due
                - paused
                - canceled
              description: "active; past_due (a failed renewal: LinkedIn and email run 3 more days); paused; canceled (terminal)."
            collection_mode:
              type: string
              enum:
                - automatic
                - manual
              description: automatic = the card is charged; manual = invoiced (a sales deal) or the trial sentinel.
            price_sid:
              type: string
              description: The first line's price (bl_pc_...); the lines include says what each line is.
            quantity:
              type: integer
              description: "1 on a resource subscription: a line is one item of quantity 1."
            addons:
              type: array
              items:
                type: object
                properties:
                  product_sid:
                    type: string
                    description: The line's product (bl_pr_...).
                  price_sid:
                    type: string
                    description: The line's price (bl_pc_...), a non-catalog price of this order.
                  paddle_item_id:
                    type: string
                    nullable: true
                    description: Paddle's item id on the subscription; null on a sentinel.
                  quantity:
                    type: integer
                    description: "Always 1 on a resource subscription: a line is one item."
                  status:
                    type: string
                    enum:
                      - active
                      - canceled
                    description: canceled = the line grants nothing any more.
                required:
                  - product_sid
                  - price_sid
                  - paddle_item_id
                  - quantity
                  - status
              description: The other lines of the order, one item each.
            currency:
              type: string
              description: "ISO 4217: USD, EUR or GBP."
            current_period_starts_at:
              type: string
              nullable: true
              description: ISO 8601 UTC.
            current_period_ends_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; the trial's end on the sentinel.
            next_billed_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null when nothing is billed next.
            paused_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null unless paused.
            scheduled_resume_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null unless a resume is scheduled.
            scheduled_change:
              type: object
              nullable: true
              properties:
                action:
                  type: string
                  enum:
                    - cancel
                    - pause
                    - resume
                  description: What happens at effective_at.
                effective_at:
                  type: string
                  description: ISO 8601 UTC.
                resume_at:
                  type: string
                  nullable: true
                  description: "For a scheduled pause: when it resumes; null = open-ended."
              required:
                - action
                - effective_at
                - resume_at
              description: A cancel, pause or resume waiting for the period end; null = none.
            canceled_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null unless canceled.
            canceled_by:
              type: object
              nullable: true
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: Who canceled; null unless canceled by a person.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null = live.
          required:
            - sid
            - owner_user_sid
            - team_sid
            - paddle_subscription_id
            - status
            - collection_mode
            - price_sid
            - quantity
            - addons
            - currency
            - current_period_starts_at
            - current_period_ends_at
            - next_billed_at
            - paused_at
            - scheduled_resume_at
            - scheduled_change
            - canceled_at
            - canceled_by
            - created_at
            - updated_at
            - deleted_at
        result:
          type: object
          additionalProperties: {}
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - action
        - item
        - result
        - meta
    ChangeBillingSubscriptionRequest:
      type: object
      description: Request body of `change_billing_subscription`.
      properties:
        linkedin:
          type: object
          properties:
            accounts:
              type: integer
              minimum: 0
              maximum: 100000
              description: The new count of LinkedIn accounts.
          required:
            - accounts
          description: The LinkedIn line's target; omit to keep it.
        email:
          type: object
          properties:
            packages:
              type: object
              properties:
                "100":
                  type: integer
                  minimum: 0
                  maximum: 1000
                  description: Packages of 100 inboxes.
                "500":
                  type: integer
                  minimum: 0
                  maximum: 1000
                  description: Packages of 500 inboxes.
                "2000":
                  type: integer
                  minimum: 0
                  maximum: 1000
                  description: Packages of 2,000 inboxes.
                "10000":
                  type: integer
                  minimum: 0
                  maximum: 1000
                  description: Packages of 10,000 inboxes.
              description: How many packages of each size, 0 to 1,000 each; the capacity is their sum.
          required:
            - packages
          description: The email line's target packages, every size named; omit to keep it.
        data:
          type: object
          properties:
            credits:
              type: integer
              minimum: 0
              maximum: 1000000
              description: "The new credits a month: 0, or from 1,000."
          required:
            - credits
          description: The data line's target; omit to keep it.
    ChangeBillingSubscriptionResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - action
        action:
          type: string
          description: kebab-case verb; matches the route segment.
        item:
          type: object
          nullable: true
          properties:
            sid:
              type: string
              description: Subscription sid (bl_sb_...).
            owner_user_sid:
              type: string
              description: "The buyer (us_mb_...): the one who manages the pool."
            team_sid:
              type: string
              nullable: true
              description: "Always null on this product: a subscription floats and allocations bind workspaces to it."
            paddle_subscription_id:
              type: string
              nullable: true
              description: Paddle's id (sub_...); null on an internal sentinel (the trial).
            status:
              type: string
              enum:
                - active
                - past_due
                - paused
                - canceled
              description: "active; past_due (a failed renewal: LinkedIn and email run 3 more days); paused; canceled (terminal)."
            collection_mode:
              type: string
              enum:
                - automatic
                - manual
              description: automatic = the card is charged; manual = invoiced (a sales deal) or the trial sentinel.
            price_sid:
              type: string
              description: The first line's price (bl_pc_...); the lines include says what each line is.
            quantity:
              type: integer
              description: "1 on a resource subscription: a line is one item of quantity 1."
            addons:
              type: array
              items:
                type: object
                properties:
                  product_sid:
                    type: string
                    description: The line's product (bl_pr_...).
                  price_sid:
                    type: string
                    description: The line's price (bl_pc_...), a non-catalog price of this order.
                  paddle_item_id:
                    type: string
                    nullable: true
                    description: Paddle's item id on the subscription; null on a sentinel.
                  quantity:
                    type: integer
                    description: "Always 1 on a resource subscription: a line is one item."
                  status:
                    type: string
                    enum:
                      - active
                      - canceled
                    description: canceled = the line grants nothing any more.
                required:
                  - product_sid
                  - price_sid
                  - paddle_item_id
                  - quantity
                  - status
              description: The other lines of the order, one item each.
            currency:
              type: string
              description: "ISO 4217: USD, EUR or GBP."
            current_period_starts_at:
              type: string
              nullable: true
              description: ISO 8601 UTC.
            current_period_ends_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; the trial's end on the sentinel.
            next_billed_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null when nothing is billed next.
            paused_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null unless paused.
            scheduled_resume_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null unless a resume is scheduled.
            scheduled_change:
              type: object
              nullable: true
              properties:
                action:
                  type: string
                  enum:
                    - cancel
                    - pause
                    - resume
                  description: What happens at effective_at.
                effective_at:
                  type: string
                  description: ISO 8601 UTC.
                resume_at:
                  type: string
                  nullable: true
                  description: "For a scheduled pause: when it resumes; null = open-ended."
              required:
                - action
                - effective_at
                - resume_at
              description: A cancel, pause or resume waiting for the period end; null = none.
            canceled_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null unless canceled.
            canceled_by:
              type: object
              nullable: true
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: Who canceled; null unless canceled by a person.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null = live.
          required:
            - sid
            - owner_user_sid
            - team_sid
            - paddle_subscription_id
            - status
            - collection_mode
            - price_sid
            - quantity
            - addons
            - currency
            - current_period_starts_at
            - current_period_ends_at
            - next_billed_at
            - paused_at
            - scheduled_resume_at
            - scheduled_change
            - canceled_at
            - canceled_by
            - created_at
            - updated_at
            - deleted_at
        result:
          type: object
          properties:
            currency:
              type: string
              description: USD | EUR | GBP, the subscription's.
            period:
              type: string
              description: monthly | annual, the subscription's.
            steps:
              type: array
              items:
                type: object
                additionalProperties: {}
              description: "One per line that moves: line, kind (increase | decrease | restore), applies (now | next_period), charge_minor, charge_exact (false = Paddle's proration preview), from, to; a paid data increase carries credits_now."
            due_now_minor:
              type: integer
              description: What the card is charged now, before tax.
            next_payment:
              type: object
              additionalProperties: {}
              description: "amount_minor and at: the target's recurring invoice on the unchanged renewal date."
            capacity_after:
              type: object
              additionalProperties:
                type: number
              description: "The pool after the change: linkedin_sender_profiles, email_inboxes, credits_per_month, whitelabel."
            quote_after:
              type: object
              properties:
                currency:
                  type: string
                  description: USD | EUR | GBP, the order's.
                period:
                  type: string
                  description: monthly | annual, the order's.
                book:
                  type: string
                  description: The price book version the figures came from.
                lines:
                  type: array
                  items:
                    type: object
                    additionalProperties: {}
                  description: "One per resource ordered: line (linkedin | email | data), its count or packages, capacity, rate_minor, monthly_minor and invoice_minor (the amount per billing period)."
                monthly_minor:
                  type: integer
                  description: The recurring lines a month, before 12 + 2.
                recurring_invoice_minor:
                  type: integer
                  description: "The recurring invoice: the monthly sum, times 12 on annual."
                one_time_minor:
                  type: integer
                  description: The one-time credits line, paid once.
                due_now_minor:
                  type: integer
                  description: "The first payment before tax and coupons: the recurring invoice plus the one-time line."
                has_recurring:
                  type: boolean
                  description: false = one-time credits alone, which make no subscription.
                service_months:
                  type: integer
                  nullable: true
                  description: 1, or 14 for 12 + 2; null when nothing recurs.
                grant_count:
                  type: integer
                  description: How many monthly credit grants the period pays for (1, or 14).
                credit_expiry_days:
                  type: integer
                  nullable: true
                  description: "Days a granted lot lives: null = the credits live with the plan and burn when the workspace leaves it (an order that buys a plan, or credits bought alone under one); 90 for credits bought alone with no paid plan."
                capacity:
                  type: object
                  additionalProperties:
                    type: number
                  description: "What the order grants a workspace: linkedin_sender_profiles, email_inboxes, credits_per_month, whitelabel."
                service:
                  type: object
                  additionalProperties: {}
                  description: level (free | paid | business | enterprise), next_level, next_threshold_minor and gap_minor a month to it; White label is part of Business.
                linkedin_next_tier:
                  type: object
                  nullable: true
                  additionalProperties: {}
                  description: "The next LinkedIn volume tier: accounts, add, capacity, total_minor, per_account_minor, savings_minor (negative = costlier in total); null at the package and above."
              required:
                - currency
                - period
                - book
                - lines
                - monthly_minor
                - recurring_invoice_minor
                - one_time_minor
                - due_now_minor
                - has_recurring
                - service_months
                - grant_count
                - credit_expiry_days
                - capacity
                - service
                - linkedin_next_tier
              description: The quote of the target composition.
            applied:
              type: boolean
              enum:
                - true
              description: The Paddle calls went through; the webhook confirms the row.
          required:
            - currency
            - period
            - steps
            - due_now_minor
            - next_payment
            - capacity_after
            - quote_after
            - applied
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - action
        - item
        - result
        - meta
    CompleteGtmConnectionLinkRequest:
      type: object
      description: Request body of `complete_gtm_connection_link`.
      properties:
        code:
          type: string
          minLength: 1
          maxLength: 2048
          description: The authorization code from the consent redirect.
        state:
          type: string
          minLength: 1
          maxLength: 128
          description: The state start_gtm_connection_link answered.
      required:
        - code
        - state
    CompleteGtmConnectionLinkResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - action
        action:
          type: string
          description: kebab-case verb; matches the route segment.
        item:
          type: object
          nullable: true
          properties:
            sid:
              type: string
              description: Connection sid (gt_cn_...).
            team_sid:
              type: string
              description: The getsales workspace (ts_tm_...).
            mode:
              type: string
              description: managed = the GetSales Managed Workspace the platform runs for the team; linked = a person's own gtm-api workspace, one row per consent.
            status:
              type: string
              description: active | error (a token or provisioning failure that outlived its retries, see error_reason) | revoked.
            gtm_team_sid:
              type: string
              nullable: true
              description: The gtm-api workspace behind the row; several rows on one workspace (one per consenting member) render as one.
            label:
              type: string
              nullable: true
              description: The gtm workspace's name (GetSales Managed Workspace for the managed row).
            error_reason:
              type: string
              nullable: true
              description: Why the row is in error (not_a_member, linked_credential_unreadable, ...); null otherwise.
            gtm_user_email:
              type: string
              nullable: true
              description: Who connected a linked workspace (the consenting gtm user); null on the managed row.
            account_sids:
              type: array
              items:
                type: string
              description: The gtm account sids the team's sender profiles use through this row, as unibox last reported them.
            linked_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; when the consent completed; null on the managed row.
            created_at:
              type: string
              nullable: true
              description: ISO 8601 UTC.
          required:
            - sid
            - team_sid
            - mode
            - status
            - gtm_team_sid
            - label
            - error_reason
            - gtm_user_email
            - account_sids
            - linked_at
            - created_at
        result:
          type: object
          properties:
            next:
              type: string
              description: What the person can do now.
          required:
            - next
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - action
        - item
        - result
        - meta
    CreateApiKeyRequest:
      type: object
      description: Request body of `create_api_key`.
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 255
          description: Human-readable key name; unique among the team's live keys.
        permissions:
          type: array
          items:
            type: string
            enum:
              - can_view_teams
              - can_manage_teams
              - can_view_team_members
              - can_manage_team_members
              - can_view_api_keys
              - can_manage_api_keys
              - can_view_oauth_clients
              - can_manage_oauth_clients
              - can_view_sessions
              - can_manage_sessions
              - can_view_account_shares
              - can_manage_account_shares
              - can_manage_account_transfers
              - can_view_billing
              - can_manage_billing
              - can_view_ssl_certificates
              - can_manage_ssl_certificates
              - can_view_notifications
              - can_manage_notifications
              - can_view_support_requests
              - can_manage_support_requests
              - can_view_linkedin_connections
              - can_act_linkedin_connections
              - can_view_linkedin_messages
              - can_act_linkedin_messages
              - can_act_linkedin_engagements
              - can_view_linkedin_searches
              - can_act_linkedin_searches
              - can_view_linkedin_enrichment
              - can_act_linkedin_enrichment
              - can_view_linkedin_accounts
              - can_update_linkedin_accounts
              - can_manage_linkedin_accounts
              - can_open_cloud_browser
              - can_change_proxy
              - can_edit_schedule
              - can_manage_smart_limits
              - can_manage_cloud_browser_external_links
              - can_share_vendor_profiles
              - can_act_linkedin_custom_requests
              - can_view_email_messages
              - can_act_email_messages
              - can_view_email_engagements
              - can_view_email_accounts
              - can_update_email_accounts
              - can_manage_email_accounts
              - can_view_email_suppressions
              - can_manage_email_suppressions
              - can_view_email_tracking_domains
              - can_manage_email_tracking_domains
              - can_view_email_sending_domains
              - can_manage_email_sending_domains
              - can_view_mass_actions
              - can_manage_mass_actions
              - can_view_webhooks
              - can_manage_webhooks
              - can_view_whitelabels
              - can_manage_whitelabels
              - can_view_integrations
              - can_manage_integrations
              - "*"
            description: A permission token of the gs catalog (can_view_teams, can_manage_webhooks, ...); * only from an unrestricted issuer. Playtables and inbox reads carry no tokens of their own yet.
          description: The explicit token list the key gets; inside the issuer's own grant.
        account_sids:
          type: array
          nullable: true
          items:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^ln_ac_
            description: "A LinkedIn account sid (ln_ac_...): one sender identity of the key's slice."
          minItems: 1
          maxItems: 100
          description: The sender identities the key may act on (ln_ac_...), inside the issuer's own slice; omitted or null = the issuer's whole slice.
        expires_at:
          type: string
          nullable: true
          description: ISO 8601 UTC; omit = now plus three years; null = perpetual.
      required:
        - name
        - permissions
    CreateApiKeyResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - create
        item:
          type: object
          properties:
            sid:
              type: string
              description: API key sid (id_ak_...).
            team_sid:
              type: string
              description: The workspace the key acts as (ts_tm_...).
            name:
              type: string
              description: Human-readable name, unique among the team's live keys.
            token_prefix:
              type: string
              description: The first characters of the token (gs_live_...), for display.
            token_last4:
              type: string
              description: The last four characters of the token, for display.
            permissions:
              type: array
              items:
                type: string
              description: "What the key may do: the explicit token list."
            account_sids:
              type: array
              nullable: true
              items:
                type: string
              description: The key's sender slice (ln_ac_...), clamped to its issuer's; null = every account of the issuer's own slice.
            status:
              type: string
              enum:
                - active
                - revoked
                - expired
              description: active = verifies; revoked | expired = refused.
            expires_at:
              type: string
              nullable: true
              description: "ISO 8601 UTC; null = perpetual. Default at creation: three years."
            last_used_at:
              type: string
              nullable: true
              description: ISO 8601 UTC of the last verified call; null = never used.
            created_by:
              type: object
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: "The issuer: a person, or a parent key on delegation."
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; set with status revoked.
          required:
            - sid
            - team_sid
            - name
            - token_prefix
            - token_last4
            - permissions
            - account_sids
            - status
            - expires_at
            - last_used_at
            - created_by
            - created_at
            - updated_at
            - deleted_at
        already_exists:
          type: boolean
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
        plaintext_token:
          type: string
          description: The full secret, shown ONCE on a real mint; absent when already_exists is true.
      required:
        - success
        - operation
        - item
        - already_exists
        - meta
    CreateBillingSubscriptionCheckoutRequest:
      type: object
      description: Request body of `create_billing_subscription_checkout`.
      properties:
        currency:
          type: string
          enum:
            - USD
            - EUR
            - GBP
          description: USD, EUR or GBP.
        period:
          type: string
          enum:
            - monthly
            - annual
          description: monthly, or annual (12 + 2 months).
        data:
          type: object
          properties:
            credits:
              type: integer
              minimum: 0
              maximum: 1000000
              description: "Credits: 0, or a whole number from 1,000."
            mode:
              type: string
              enum:
                - recurring
                - one_time
              description: recurring (every month, the default) or one_time (paid once; the credits live with the plan).
          required:
            - credits
          description: The data credits line; omit for none.
        linkedin:
          type: object
          properties:
            accounts:
              type: integer
              minimum: 0
              maximum: 100000
              description: LinkedIn accounts to run (slots, not users); the per-account rate falls with the count, 188 to 300 is one package.
          required:
            - accounts
          description: The LinkedIn sender profiles line; omit for none.
        email:
          type: object
          properties:
            packages:
              type: object
              properties:
                "100":
                  type: integer
                  minimum: 0
                  maximum: 1000
                  description: Packages of 100 inboxes.
                "500":
                  type: integer
                  minimum: 0
                  maximum: 1000
                  description: Packages of 500 inboxes.
                "2000":
                  type: integer
                  minimum: 0
                  maximum: 1000
                  description: Packages of 2,000 inboxes.
                "10000":
                  type: integer
                  minimum: 0
                  maximum: 1000
                  description: Packages of 10,000 inboxes.
              description: How many packages of each size, 0 to 1,000 each; the capacity is their sum.
          required:
            - packages
          description: The email inbox capacity line; omit for none.
        team_sid:
          type: string
          nullable: true
          minLength: 18
          maxLength: 18
          pattern: ^ts_tm_
          description: The workspace that takes the whole pool on activation; omit or null to buy floating (a partner's pool).
      required:
        - currency
        - period
    CreateBillingSubscriptionCheckoutResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - action
        action:
          type: string
          description: kebab-case verb; matches the route segment.
        item: {}
        result:
          type: object
          properties:
            checkout_url:
              type: string
              nullable: true
              description: Paddle's checkout link; inert without Paddle.js and the token below.
            paddle_transaction_id:
              type: string
              nullable: true
              description: The pre-created transaction (txn_...).
            client_side_token:
              type: string
              nullable: true
              description: The publishable token Paddle.js boots with; null when the deployment has none.
            paddle_environment:
              type: string
              description: sandbox | production, from the base uri the server dials.
            quote:
              type: object
              properties:
                currency:
                  type: string
                  description: USD | EUR | GBP, the order's.
                period:
                  type: string
                  description: monthly | annual, the order's.
                book:
                  type: string
                  description: The price book version the figures came from.
                lines:
                  type: array
                  items:
                    type: object
                    additionalProperties: {}
                  description: "One per resource ordered: line (linkedin | email | data), its count or packages, capacity, rate_minor, monthly_minor and invoice_minor (the amount per billing period)."
                monthly_minor:
                  type: integer
                  description: The recurring lines a month, before 12 + 2.
                recurring_invoice_minor:
                  type: integer
                  description: "The recurring invoice: the monthly sum, times 12 on annual."
                one_time_minor:
                  type: integer
                  description: The one-time credits line, paid once.
                due_now_minor:
                  type: integer
                  description: "The first payment before tax and coupons: the recurring invoice plus the one-time line."
                has_recurring:
                  type: boolean
                  description: false = one-time credits alone, which make no subscription.
                service_months:
                  type: integer
                  nullable: true
                  description: 1, or 14 for 12 + 2; null when nothing recurs.
                grant_count:
                  type: integer
                  description: How many monthly credit grants the period pays for (1, or 14).
                credit_expiry_days:
                  type: integer
                  nullable: true
                  description: "Days a granted lot lives: null = the credits live with the plan and burn when the workspace leaves it (an order that buys a plan, or credits bought alone under one); 90 for credits bought alone with no paid plan."
                capacity:
                  type: object
                  additionalProperties:
                    type: number
                  description: "What the order grants a workspace: linkedin_sender_profiles, email_inboxes, credits_per_month, whitelabel."
                service:
                  type: object
                  additionalProperties: {}
                  description: level (free | paid | business | enterprise), next_level, next_threshold_minor and gap_minor a month to it; White label is part of Business.
                linkedin_next_tier:
                  type: object
                  nullable: true
                  additionalProperties: {}
                  description: "The next LinkedIn volume tier: accounts, add, capacity, total_minor, per_account_minor, savings_minor (negative = costlier in total); null at the package and above."
              required:
                - currency
                - period
                - book
                - lines
                - monthly_minor
                - recurring_invoice_minor
                - one_time_minor
                - due_now_minor
                - has_recurring
                - service_months
                - grant_count
                - credit_expiry_days
                - capacity
                - service
                - linkedin_next_tier
              description: "The order as priced: exactly what Paddle bills before tax."
            has_subscription:
              type: boolean
              description: "false = one-time credits alone: the credits land on the transaction, no subscription is born."
            pending:
              type: object
              additionalProperties: {}
              description: "When the committed state lands: the activated webhook, or the completed transaction for one-time credits."
          required:
            - checkout_url
            - paddle_transaction_id
            - client_side_token
            - paddle_environment
            - quote
            - has_subscription
            - pending
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - action
        - item
        - result
        - meta
    CreateOauthClientRequest:
      type: object
      description: Request body of `create_oauth_client`.
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 255
          description: The application's name, 1..255 chars.
        redirect_uris:
          type: array
          items:
            type: string
            maxLength: 2048
            format: uri
            pattern: ^https:\/\/
          minItems: 1
          description: Exact-match https callback allow-list, at least one entry.
        permissions:
          type: array
          items:
            type: string
            maxLength: 128
            description: "A permission token of the gs catalog: the ceiling a grant through this client may request."
          description: The permission ceiling the client may request; may be empty.
        grant_types:
          type: array
          items:
            type: string
            enum:
              - authorization_code
              - refresh_token
          minItems: 1
          description: "Default: authorization_code and refresh_token."
        actor_kind:
          type: string
          enum:
            - agent
            - integration
          description: integration (default for a hand-made client) or agent (tokens act for an autonomous caller).
        platform:
          type: boolean
          description: "A platform client with team_sid null, writable afterwards by a system actor only (403 platform_client_not_writable): leave it to provisioning."
      required:
        - name
        - redirect_uris
        - permissions
    CreateOauthClientResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - create
        item:
          type: object
          properties:
            sid:
              type: string
              description: OAuth client sid (id_oc_...).
            team_sid:
              type: string
              nullable: true
              description: The owning workspace (ts_tm_...); null = a platform client.
            name:
              type: string
              description: The application's name as the consent screen shows it.
            client_id:
              type: string
              description: The public identifier the app presents at /oauth/authorize.
            redirect_uris:
              type: array
              items:
                type: string
              description: The exact-match https allow-list of callback URLs.
            grant_types:
              type: array
              items:
                type: string
                enum:
                  - authorization_code
                  - refresh_token
              description: authorization_code and refresh_token.
            permissions:
              type: array
              items:
                type: string
              description: "The ceiling: the most a grant through this client may hold."
            is_confidential:
              type: boolean
              description: true = a confidential client with a secret; false = public, PKCE only.
            registration_kind:
              type: string
              enum:
                - manual
                - dynamic
              description: manual = registered here; dynamic = registered by the app itself (RFC 7591).
            actor_kind:
              type: string
              nullable: true
              enum:
                - agent
                - integration
              description: agent = its tokens act as an autonomous caller; integration = a tool a person uses; null = unclassified legacy row.
            status:
              type: string
              enum:
                - active
                - disabled
              description: disabled = its grants and tokens are revoked, the flow refuses it.
            created_by:
              type: object
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: Who registered the client.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null = live.
            client_secret:
              type: string
              nullable: true
              description: The secret of a confidential client, shown ONCE at create; never on a read.
          required:
            - sid
            - team_sid
            - name
            - client_id
            - redirect_uris
            - grant_types
            - permissions
            - is_confidential
            - registration_kind
            - actor_kind
            - status
            - created_by
            - created_at
            - updated_at
            - deleted_at
        already_exists:
          type: boolean
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - already_exists
        - meta
    CreateSubscriptionAllocationRequest:
      type: object
      description: Request body of `create_subscription_allocation`.
      properties:
        subscription_sid:
          type: string
          minLength: 18
          maxLength: 18
          pattern: ^bl_sb_
          description: The subscription whose pool is shared (bl_sb_...); the caller must be its buyer.
        team_sid:
          type: string
          minLength: 18
          maxLength: 18
          pattern: ^ts_tm_
          description: "The workspace that gets the share (ts_tm_...): the buyer's own, or a client workspace of a brand the buyer's team owns."
        linkedin_sender_profiles:
          type: integer
          minimum: 0
          description: LinkedIn sender profiles (accounts) for the workspace; default 0.
        email_inboxes:
          type: integer
          minimum: 0
          description: Inboxes for the workspace; default 0.
        credits_per_month:
          type: integer
          minimum: 0
          description: Platform credits granted every month; default 0.
        whitelabel:
          type: integer
          minimum: 0
          maximum: 1
          description: 1 to let the workspace register brands; default 0.
      required:
        - subscription_sid
        - team_sid
    CreateSubscriptionAllocationResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - create
        item:
          type: object
          properties:
            sid:
              type: string
              description: Allocation sid (bl_al_...).
            subscription_sid:
              type: string
              description: The pool (bl_sb_...).
            team_sid:
              type: string
              description: The workspace holding the share (ts_tm_...); one live share per workspace.
            created_by:
              type: object
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: "Who handed the share out: the buyer, or system for the checkout and the trial."
            linkedin_sender_profiles:
              type: integer
              description: LinkedIn sender profiles (accounts) the workspace may run.
            email_inboxes:
              type: integer
              description: Inboxes the workspace may connect.
            credits_per_month:
              type: integer
              description: Platform credits granted to the workspace every month of the paid period (one lot per grant, kept while the plan runs and burnt when the workspace leaves it).
            whitelabel:
              type: integer
              description: 1 = the workspace may register white label brands; 0 = not.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; a superseded or taken-back share keeps its history.
          required:
            - sid
            - subscription_sid
            - team_sid
            - created_by
            - linkedin_sender_profiles
            - email_inboxes
            - credits_per_month
            - whitelabel
            - created_at
            - updated_at
            - deleted_at
        already_exists:
          type: boolean
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - already_exists
        - meta
    CreateTeamMemberRequest:
      type: object
      description: Request body of `create_team_member`.
      properties:
        email:
          type: string
          maxLength: 255
          format: email
          description: The address to invite.
        permissions:
          type: array
          items:
            type: string
            enum:
              - can_view_teams
              - can_manage_teams
              - can_view_team_members
              - can_manage_team_members
              - can_view_api_keys
              - can_manage_api_keys
              - can_view_oauth_clients
              - can_manage_oauth_clients
              - can_view_sessions
              - can_manage_sessions
              - can_view_account_shares
              - can_manage_account_shares
              - can_manage_account_transfers
              - can_view_billing
              - can_manage_billing
              - can_view_ssl_certificates
              - can_manage_ssl_certificates
              - can_view_notifications
              - can_manage_notifications
              - can_view_support_requests
              - can_manage_support_requests
              - can_view_linkedin_connections
              - can_act_linkedin_connections
              - can_view_linkedin_messages
              - can_act_linkedin_messages
              - can_act_linkedin_engagements
              - can_view_linkedin_searches
              - can_act_linkedin_searches
              - can_view_linkedin_enrichment
              - can_act_linkedin_enrichment
              - can_view_linkedin_accounts
              - can_update_linkedin_accounts
              - can_manage_linkedin_accounts
              - can_open_cloud_browser
              - can_change_proxy
              - can_edit_schedule
              - can_manage_smart_limits
              - can_manage_cloud_browser_external_links
              - can_share_vendor_profiles
              - can_act_linkedin_custom_requests
              - can_view_email_messages
              - can_act_email_messages
              - can_view_email_engagements
              - can_view_email_accounts
              - can_update_email_accounts
              - can_manage_email_accounts
              - can_view_email_suppressions
              - can_manage_email_suppressions
              - can_view_email_tracking_domains
              - can_manage_email_tracking_domains
              - can_view_email_sending_domains
              - can_manage_email_sending_domains
              - can_view_mass_actions
              - can_manage_mass_actions
              - can_view_webhooks
              - can_manage_webhooks
              - can_view_whitelabels
              - can_manage_whitelabels
              - can_view_integrations
              - can_manage_integrations
              - "*"
            description: A permission token of the gs catalog (can_view_billing, can_manage_webhooks, ...); * is the owner's wildcard.
          description: The tokens the member gets, stored as sent; may be empty. Each must be held by the caller.
        account_sids:
          type: array
          nullable: true
          items:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^ln_ac_
            description: "A LinkedIn account sid (ln_ac_...): one sender identity of the member's slice."
          minItems: 1
          maxItems: 100
          description: The sender identities the member may see (ln_ac_...); null or omitted = every one. An empty list is refused (422).
      required:
        - email
        - permissions
    CreateTeamMemberResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - create
        item:
          type: object
          properties:
            sid:
              type: string
              description: Membership sid (ts_mb_...).
            team_sid:
              type: string
              description: The workspace (ts_tm_...).
            user_sid:
              type: string
              nullable: true
              description: The member's account (us_mb_...); null while the invite is pending.
            email:
              type: string
              description: The invited address.
            status:
              type: string
              enum:
                - invited
                - active
                - revoked
              description: invited = pending; active = a member; revoked = removed.
            permissions:
              type: array
              items:
                type: string
              description: The explicit token list the member holds, stored as sent (no floor is unioned in).
            account_sids:
              type: array
              nullable: true
              items:
                type: string
              description: The sender identities the member may see and use (ln_ac_...); null = every one of the workspace.
            created_by:
              type: object
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: Who invited.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null = live.
          required:
            - sid
            - team_sid
            - user_sid
            - email
            - status
            - permissions
            - account_sids
            - created_by
            - created_at
            - updated_at
            - deleted_at
        already_exists:
          type: boolean
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - already_exists
        - meta
    CreateTeamRequest:
      type: object
      description: Request body of `create_team`.
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 255
          description: Workspace name, 1..255 chars.
        config:
          type: object
          nullable: true
          properties:
            timezone:
              type: string
              nullable: true
              maxLength: 64
              description: IANA zone the workspace counts its day in (Europe/Riga); null = UTC. Defaults to the owner's zone at creation.
          description: Workspace settings; the timezone defaults to the owner's zone when omitted.
      required:
        - name
    CreateTeamResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - create
        item:
          type: object
          properties:
            sid:
              type: string
              description: Team sid (ts_tm_...).
            owner_user_sid:
              type: string
              description: "The structural owner (us_mb_...): the one who can delete the workspace or hand it over."
            subscription_sid:
              type: string
              nullable: true
              description: The subscription the workspace's live allocation draws from (bl_sb_...); null = no share, suspended.
            name:
              type: string
              description: Workspace name; not unique.
            status:
              type: string
              enum:
                - active
                - suspended
              description: active while its allocation draws from a live subscription; suspended otherwise (settings and billing stay reachable).
            plan:
              type: string
              nullable: true
              enum:
                - none
                - free
                - paid
                - partner
              description: none | free (the trial) | paid | partner (a reseller's share).
            limits:
              type: object
              properties:
                linkedin_sender_profiles:
                  type: integer
                  description: "LinkedIn sender profiles (accounts) the workspace may run: its share of the pool."
                email_inboxes:
                  type: integer
                  description: Inboxes the workspace may connect.
                credits_per_month:
                  type: integer
                  description: Platform credits granted to the workspace every month of the paid period.
                whitelabel:
                  type: integer
                  description: 1 = the workspace may register white label brands, 0 = not.
                linkedin_seats:
                  type: integer
                  description: Retired on 2026-10-25, always 0 here (linkedin_sender_profiles replaced it).
                email_seats:
                  type: integer
                  description: Retired on 2026-10-25, always 0 here (email_inboxes replaced it).
                credits_per_period:
                  type: integer
                  description: Retired on 2026-10-25, always 0 here (credits_per_month replaced it).
                accounts:
                  type: integer
                  description: A gtm key, 0 on this product.
                cloud_browser:
                  type: integer
                  description: A gtm key, 0 on this product.
                webhooks:
                  type: integer
                  description: A gtm key, 0 on this product.
                proxy_5g:
                  type: integer
                  description: A gtm key, 0 on this product.
              required:
                - linkedin_sender_profiles
                - email_inboxes
                - credits_per_month
                - whitelabel
              description: "The capacity snapshot: the allocation's quantities, zero when there is none."
            cluster_id:
              type: integer
              nullable: true
              description: The data cluster the workspace was assigned at creation; one cluster today.
            config:
              type: object
              nullable: true
              properties:
                timezone:
                  type: string
                  nullable: true
                  maxLength: 64
                  description: IANA zone the workspace counts its day in (Europe/Riga); null = UTC. Defaults to the owner's zone at creation.
              description: Workspace settings (TeamConfigValue); null when never written.
            created_by:
              type: object
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: Who created the workspace.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            data_deletion_at:
              type: string
              nullable: true
              description: When a workspace that lost its coverage is erased (8 weeks after the loss); null while covered.
            deletion_warned_at:
              type: string
              nullable: true
              description: When the owner was warned two weeks ahead of data_deletion_at; null when not yet.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null = live.
          required:
            - sid
            - owner_user_sid
            - subscription_sid
            - name
            - status
            - plan
            - limits
            - cluster_id
            - config
            - created_by
            - created_at
            - updated_at
            - data_deletion_at
            - deletion_warned_at
            - deleted_at
        already_exists:
          type: boolean
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - already_exists
        - meta
    CreateWhitelabelRequest:
      type: object
      description: Request body of `create_whitelabel`.
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 255
          description: The brand name, 1..255 chars.
        domain:
          type: string
          maxLength: 253
          pattern: ^(?=.{1,253}$)([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$
          description: "The app and login host, bare lowercase FQDN (app.reseller.com): no scheme, no path."
        logo_url:
          type: string
          nullable: true
          maxLength: 2048
          pattern: ^https:\/\/
          description: https URL of the horizontal logo; null clears it. The file itself is uploaded in the app.
        icon_url:
          type: string
          nullable: true
          maxLength: 2048
          pattern: ^https:\/\/
          description: https URL of the square mark; null clears it.
        login_image_url:
          type: string
          nullable: true
          maxLength: 2048
          pattern: ^https:\/\/
          description: https URL of the login artwork; null clears it.
        palette:
          type: object
          nullable: true
          properties:
            primary_color:
              type: string
              nullable: true
              pattern: ^#[0-9a-fA-F]{6}$
              description: "Buttons and links, #rrggbb; null = the platform default."
            accent_color:
              type: string
              nullable: true
              pattern: ^#[0-9a-fA-F]{6}$
              description: "The accent, #rrggbb; null = the platform default."
            login_background_color:
              type: string
              nullable: true
              pattern: ^#[0-9a-fA-F]{6}$
              description: "The login page background, #rrggbb; null = the platform default."
          description: "Brand colors, #rrggbb each; null = the platform defaults."
        email_from_name:
          type: string
          nullable: true
          maxLength: 255
          description: The From name on the clients' mail; null = the brand name.
        email_reply_to:
          type: string
          nullable: true
          maxLength: 255
          format: email
          description: The Reply-To on the clients' mail; null = none.
        email_from_address:
          type: string
          nullable: true
          maxLength: 255
          format: email
          description: The brand's own sender address; refused on a host SendGrid cannot authenticate (422 email_domain_invalid), a platform domain (422 email_domain_reserved) or another team's (409 email_domain_already_taken). Proven by verify_whitelabel_email_domain.
      required:
        - name
        - domain
    CreateWhitelabelResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - create
        item:
          type: object
          properties:
            sid:
              type: string
              description: Brand sid (id_wl_...).
            team_sid:
              type: string
              description: The owning reseller team (ts_tm_...).
            name:
              type: string
              description: The brand name the app shell shows and the mail is signed with.
            domain:
              type: string
              description: The app and login host (app.reseller.com), lowercase FQDN, unique platform-wide; read-only once active.
            status:
              type: string
              enum:
                - pending_domain
                - active
                - disabled
              description: pending_domain = waiting for the CNAME and the certificate; active = the host serves the brand; disabled = switched off, the host falls back to the platform brand.
            logo_url:
              type: string
              nullable: true
              description: The horizontal logo (app shell and email header).
            icon_url:
              type: string
              nullable: true
              description: The square mark or favicon.
            login_image_url:
              type: string
              nullable: true
              description: The login page artwork.
            palette:
              type: object
              nullable: true
              properties:
                primary_color:
                  type: string
                  nullable: true
                  pattern: ^#[0-9a-fA-F]{6}$
                  description: "Buttons and links, #rrggbb; null = the platform default."
                accent_color:
                  type: string
                  nullable: true
                  pattern: ^#[0-9a-fA-F]{6}$
                  description: "The accent, #rrggbb; null = the platform default."
                login_background_color:
                  type: string
                  nullable: true
                  pattern: ^#[0-9a-fA-F]{6}$
                  description: "The login page background, #rrggbb; null = the platform default."
              description: Brand colors; null = all platform defaults.
            email_from_name:
              type: string
              nullable: true
              description: The From name on the clients' mail; null = the brand name.
            email_reply_to:
              type: string
              nullable: true
              description: The Reply-To on the clients' mail; null = none.
            email_from_address:
              type: string
              nullable: true
              description: The brand's own sender address; mail leaves from it once email_domain is verified, from the platform address under the brand's name until then.
            email_domain:
              type: object
              nullable: true
              properties:
                domain:
                  type: string
                  description: "The domain part of email_from_address, lowercase: what SendGrid authenticates."
                status:
                  type: string
                  enum:
                    - pending
                    - verified
                    - failed
                  description: pending = records not all found yet; verified = the brand's mail leaves from its own address; failed = see failure_reason.
                records:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        description: "cname (three of them: the return path and two DKIM keys)."
                      host:
                        type: string
                        description: The record name to publish at the domain's DNS host.
                      value:
                        type: string
                        description: The CNAME target at SendGrid.
                      valid:
                        type: boolean
                        description: What the last check found for this record.
                    required:
                      - type
                      - host
                      - value
                      - valid
                  description: The DNS records to publish, in the order SendGrid issued them.
                failure_reason:
                  type: string
                  nullable: true
                  enum:
                    - email_domain_rejected
                    - email_domain_not_proven_in_time
                  description: email_domain_rejected (SendGrid refused the domain) or email_domain_not_proven_in_time (48 hours lapsed); null unless failed.
                checked_at:
                  type: string
                  nullable: true
                  description: ISO 8601 UTC of the last check against SendGrid.
                verified_at:
                  type: string
                  nullable: true
                  description: ISO 8601 UTC since when it is verified; null while it is not.
              required:
                - domain
                - status
                - records
                - failure_reason
                - checked_at
                - verified_at
              description: The proof of the sending domain; null = verify never ran, or the address moved to another domain.
            created_by:
              type: object
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: Who registered the brand.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null = live.
          required:
            - sid
            - team_sid
            - name
            - domain
            - status
            - logo_url
            - icon_url
            - login_image_url
            - palette
            - email_from_name
            - email_reply_to
            - email_from_address
            - email_domain
            - created_by
            - created_at
            - updated_at
            - deleted_at
        already_exists:
          type: boolean
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - already_exists
        - meta
    DeleteApiKeyResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - delete
        item:
          type: object
          additionalProperties: {}
        already_deleted:
          type: boolean
        soft_deleted:
          type: boolean
        retained:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - already_deleted
        - soft_deleted
        - retained
        - meta
    DeleteBillingPaymentMethodResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - delete
        item:
          type: object
          additionalProperties: {}
        already_deleted:
          type: boolean
        soft_deleted:
          type: boolean
        retained:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - already_deleted
        - soft_deleted
        - retained
        - meta
    DeleteNotificationResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - delete
        item:
          type: object
          additionalProperties: {}
        already_deleted:
          type: boolean
        soft_deleted:
          type: boolean
        retained:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - already_deleted
        - soft_deleted
        - retained
        - meta
    DeleteOauthClientResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - delete
        item:
          type: object
          additionalProperties: {}
        already_deleted:
          type: boolean
        soft_deleted:
          type: boolean
        retained:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - already_deleted
        - soft_deleted
        - retained
        - meta
    DeleteSslCertificateResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - delete
        item:
          type: object
          additionalProperties: {}
        already_deleted:
          type: boolean
        soft_deleted:
          type: boolean
        retained:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - already_deleted
        - soft_deleted
        - retained
        - meta
    DeleteSubscriptionAllocationResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - delete
        item:
          type: object
          additionalProperties: {}
        already_deleted:
          type: boolean
        soft_deleted:
          type: boolean
        retained:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - already_deleted
        - soft_deleted
        - retained
        - meta
    DeleteTeamMemberResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - delete
        item:
          type: object
          additionalProperties: {}
        already_deleted:
          type: boolean
        soft_deleted:
          type: boolean
        retained:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - already_deleted
        - soft_deleted
        - retained
        - meta
    DeleteTeamResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - delete
        item:
          type: object
          additionalProperties: {}
        already_deleted:
          type: boolean
        soft_deleted:
          type: boolean
        cascade:
          type: object
          nullable: true
          properties:
            summary:
              type: string
            details:
              type: array
              items:
                type: object
                properties:
                  entity:
                    type: string
                  deleted:
                    type: integer
                  cancelled:
                    type: integer
                required:
                  - entity
                  - deleted
            recovery_available_until:
              type: string
              nullable: true
          required:
            - summary
            - details
            - recovery_available_until
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - already_deleted
        - soft_deleted
        - cascade
        - meta
    DeleteWhitelabelResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - delete
        item:
          type: object
          additionalProperties: {}
        already_deleted:
          type: boolean
        soft_deleted:
          type: boolean
        retained:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - already_deleted
        - soft_deleted
        - retained
        - meta
    DisableOauthClientResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - action
        action:
          type: string
          description: kebab-case verb; matches the route segment.
        item:
          type: object
          nullable: true
          properties:
            sid:
              type: string
              description: OAuth client sid (id_oc_...).
            team_sid:
              type: string
              nullable: true
              description: The owning workspace (ts_tm_...); null = a platform client.
            name:
              type: string
              description: The application's name as the consent screen shows it.
            client_id:
              type: string
              description: The public identifier the app presents at /oauth/authorize.
            redirect_uris:
              type: array
              items:
                type: string
              description: The exact-match https allow-list of callback URLs.
            grant_types:
              type: array
              items:
                type: string
                enum:
                  - authorization_code
                  - refresh_token
              description: authorization_code and refresh_token.
            permissions:
              type: array
              items:
                type: string
              description: "The ceiling: the most a grant through this client may hold."
            is_confidential:
              type: boolean
              description: true = a confidential client with a secret; false = public, PKCE only.
            registration_kind:
              type: string
              enum:
                - manual
                - dynamic
              description: manual = registered here; dynamic = registered by the app itself (RFC 7591).
            actor_kind:
              type: string
              nullable: true
              enum:
                - agent
                - integration
              description: agent = its tokens act as an autonomous caller; integration = a tool a person uses; null = unclassified legacy row.
            status:
              type: string
              enum:
                - active
                - disabled
              description: disabled = its grants and tokens are revoked, the flow refuses it.
            created_by:
              type: object
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: Who registered the client.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null = live.
            client_secret:
              type: string
              nullable: true
              description: The secret of a confidential client, shown ONCE at create; never on a read.
          required:
            - sid
            - team_sid
            - name
            - client_id
            - redirect_uris
            - grant_types
            - permissions
            - is_confidential
            - registration_kind
            - actor_kind
            - status
            - created_by
            - created_at
            - updated_at
            - deleted_at
        result:
          type: object
          properties:
            revoked_sessions_count:
              type: integer
              description: Installation tokens cut by this call.
            already_disabled:
              type: boolean
              description: "true: the client was disabled before the call."
          required:
            - revoked_sessions_count
            - already_disabled
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - action
        - item
        - result
        - meta
    DisableWhitelabelResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - action
        action:
          type: string
          description: kebab-case verb; matches the route segment.
        item:
          type: object
          nullable: true
          properties:
            sid:
              type: string
              description: Brand sid (id_wl_...).
            team_sid:
              type: string
              description: The owning reseller team (ts_tm_...).
            name:
              type: string
              description: The brand name the app shell shows and the mail is signed with.
            domain:
              type: string
              description: The app and login host (app.reseller.com), lowercase FQDN, unique platform-wide; read-only once active.
            status:
              type: string
              enum:
                - pending_domain
                - active
                - disabled
              description: pending_domain = waiting for the CNAME and the certificate; active = the host serves the brand; disabled = switched off, the host falls back to the platform brand.
            logo_url:
              type: string
              nullable: true
              description: The horizontal logo (app shell and email header).
            icon_url:
              type: string
              nullable: true
              description: The square mark or favicon.
            login_image_url:
              type: string
              nullable: true
              description: The login page artwork.
            palette:
              type: object
              nullable: true
              properties:
                primary_color:
                  type: string
                  nullable: true
                  pattern: ^#[0-9a-fA-F]{6}$
                  description: "Buttons and links, #rrggbb; null = the platform default."
                accent_color:
                  type: string
                  nullable: true
                  pattern: ^#[0-9a-fA-F]{6}$
                  description: "The accent, #rrggbb; null = the platform default."
                login_background_color:
                  type: string
                  nullable: true
                  pattern: ^#[0-9a-fA-F]{6}$
                  description: "The login page background, #rrggbb; null = the platform default."
              description: Brand colors; null = all platform defaults.
            email_from_name:
              type: string
              nullable: true
              description: The From name on the clients' mail; null = the brand name.
            email_reply_to:
              type: string
              nullable: true
              description: The Reply-To on the clients' mail; null = none.
            email_from_address:
              type: string
              nullable: true
              description: The brand's own sender address; mail leaves from it once email_domain is verified, from the platform address under the brand's name until then.
            email_domain:
              type: object
              nullable: true
              properties:
                domain:
                  type: string
                  description: "The domain part of email_from_address, lowercase: what SendGrid authenticates."
                status:
                  type: string
                  enum:
                    - pending
                    - verified
                    - failed
                  description: pending = records not all found yet; verified = the brand's mail leaves from its own address; failed = see failure_reason.
                records:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        description: "cname (three of them: the return path and two DKIM keys)."
                      host:
                        type: string
                        description: The record name to publish at the domain's DNS host.
                      value:
                        type: string
                        description: The CNAME target at SendGrid.
                      valid:
                        type: boolean
                        description: What the last check found for this record.
                    required:
                      - type
                      - host
                      - value
                      - valid
                  description: The DNS records to publish, in the order SendGrid issued them.
                failure_reason:
                  type: string
                  nullable: true
                  enum:
                    - email_domain_rejected
                    - email_domain_not_proven_in_time
                  description: email_domain_rejected (SendGrid refused the domain) or email_domain_not_proven_in_time (48 hours lapsed); null unless failed.
                checked_at:
                  type: string
                  nullable: true
                  description: ISO 8601 UTC of the last check against SendGrid.
                verified_at:
                  type: string
                  nullable: true
                  description: ISO 8601 UTC since when it is verified; null while it is not.
              required:
                - domain
                - status
                - records
                - failure_reason
                - checked_at
                - verified_at
              description: The proof of the sending domain; null = verify never ran, or the address moved to another domain.
            created_by:
              type: object
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: Who registered the brand.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null = live.
          required:
            - sid
            - team_sid
            - name
            - domain
            - status
            - logo_url
            - icon_url
            - login_image_url
            - palette
            - email_from_name
            - email_reply_to
            - email_from_address
            - email_domain
            - created_by
            - created_at
            - updated_at
            - deleted_at
        result:
          type: object
          additionalProperties: {}
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - action
        - item
        - result
        - meta
    EnableOauthClientResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - action
        action:
          type: string
          description: kebab-case verb; matches the route segment.
        item:
          type: object
          nullable: true
          properties:
            sid:
              type: string
              description: OAuth client sid (id_oc_...).
            team_sid:
              type: string
              nullable: true
              description: The owning workspace (ts_tm_...); null = a platform client.
            name:
              type: string
              description: The application's name as the consent screen shows it.
            client_id:
              type: string
              description: The public identifier the app presents at /oauth/authorize.
            redirect_uris:
              type: array
              items:
                type: string
              description: The exact-match https allow-list of callback URLs.
            grant_types:
              type: array
              items:
                type: string
                enum:
                  - authorization_code
                  - refresh_token
              description: authorization_code and refresh_token.
            permissions:
              type: array
              items:
                type: string
              description: "The ceiling: the most a grant through this client may hold."
            is_confidential:
              type: boolean
              description: true = a confidential client with a secret; false = public, PKCE only.
            registration_kind:
              type: string
              enum:
                - manual
                - dynamic
              description: manual = registered here; dynamic = registered by the app itself (RFC 7591).
            actor_kind:
              type: string
              nullable: true
              enum:
                - agent
                - integration
              description: agent = its tokens act as an autonomous caller; integration = a tool a person uses; null = unclassified legacy row.
            status:
              type: string
              enum:
                - active
                - disabled
              description: disabled = its grants and tokens are revoked, the flow refuses it.
            created_by:
              type: object
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: Who registered the client.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null = live.
            client_secret:
              type: string
              nullable: true
              description: The secret of a confidential client, shown ONCE at create; never on a read.
          required:
            - sid
            - team_sid
            - name
            - client_id
            - redirect_uris
            - grant_types
            - permissions
            - is_confidential
            - registration_kind
            - actor_kind
            - status
            - created_by
            - created_at
            - updated_at
            - deleted_at
        result:
          type: object
          additionalProperties: {}
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - action
        - item
        - result
        - meta
    EnableWhitelabelResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - action
        action:
          type: string
          description: kebab-case verb; matches the route segment.
        item:
          type: object
          nullable: true
          properties:
            sid:
              type: string
              description: Brand sid (id_wl_...).
            team_sid:
              type: string
              description: The owning reseller team (ts_tm_...).
            name:
              type: string
              description: The brand name the app shell shows and the mail is signed with.
            domain:
              type: string
              description: The app and login host (app.reseller.com), lowercase FQDN, unique platform-wide; read-only once active.
            status:
              type: string
              enum:
                - pending_domain
                - active
                - disabled
              description: pending_domain = waiting for the CNAME and the certificate; active = the host serves the brand; disabled = switched off, the host falls back to the platform brand.
            logo_url:
              type: string
              nullable: true
              description: The horizontal logo (app shell and email header).
            icon_url:
              type: string
              nullable: true
              description: The square mark or favicon.
            login_image_url:
              type: string
              nullable: true
              description: The login page artwork.
            palette:
              type: object
              nullable: true
              properties:
                primary_color:
                  type: string
                  nullable: true
                  pattern: ^#[0-9a-fA-F]{6}$
                  description: "Buttons and links, #rrggbb; null = the platform default."
                accent_color:
                  type: string
                  nullable: true
                  pattern: ^#[0-9a-fA-F]{6}$
                  description: "The accent, #rrggbb; null = the platform default."
                login_background_color:
                  type: string
                  nullable: true
                  pattern: ^#[0-9a-fA-F]{6}$
                  description: "The login page background, #rrggbb; null = the platform default."
              description: Brand colors; null = all platform defaults.
            email_from_name:
              type: string
              nullable: true
              description: The From name on the clients' mail; null = the brand name.
            email_reply_to:
              type: string
              nullable: true
              description: The Reply-To on the clients' mail; null = none.
            email_from_address:
              type: string
              nullable: true
              description: The brand's own sender address; mail leaves from it once email_domain is verified, from the platform address under the brand's name until then.
            email_domain:
              type: object
              nullable: true
              properties:
                domain:
                  type: string
                  description: "The domain part of email_from_address, lowercase: what SendGrid authenticates."
                status:
                  type: string
                  enum:
                    - pending
                    - verified
                    - failed
                  description: pending = records not all found yet; verified = the brand's mail leaves from its own address; failed = see failure_reason.
                records:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        description: "cname (three of them: the return path and two DKIM keys)."
                      host:
                        type: string
                        description: The record name to publish at the domain's DNS host.
                      value:
                        type: string
                        description: The CNAME target at SendGrid.
                      valid:
                        type: boolean
                        description: What the last check found for this record.
                    required:
                      - type
                      - host
                      - value
                      - valid
                  description: The DNS records to publish, in the order SendGrid issued them.
                failure_reason:
                  type: string
                  nullable: true
                  enum:
                    - email_domain_rejected
                    - email_domain_not_proven_in_time
                  description: email_domain_rejected (SendGrid refused the domain) or email_domain_not_proven_in_time (48 hours lapsed); null unless failed.
                checked_at:
                  type: string
                  nullable: true
                  description: ISO 8601 UTC of the last check against SendGrid.
                verified_at:
                  type: string
                  nullable: true
                  description: ISO 8601 UTC since when it is verified; null while it is not.
              required:
                - domain
                - status
                - records
                - failure_reason
                - checked_at
                - verified_at
              description: The proof of the sending domain; null = verify never ran, or the address moved to another domain.
            created_by:
              type: object
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: Who registered the brand.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null = live.
          required:
            - sid
            - team_sid
            - name
            - domain
            - status
            - logo_url
            - icon_url
            - login_image_url
            - palette
            - email_from_name
            - email_reply_to
            - email_from_address
            - email_domain
            - created_by
            - created_at
            - updated_at
            - deleted_at
        result:
          type: object
          additionalProperties: {}
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - action
        - item
        - result
        - meta
    GetApiKeyResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - get
        item:
          type: object
          properties:
            sid:
              type: string
              description: API key sid (id_ak_...).
            team_sid:
              type: string
              description: The workspace the key acts as (ts_tm_...).
            name:
              type: string
              description: Human-readable name, unique among the team's live keys.
            token_prefix:
              type: string
              description: The first characters of the token (gs_live_...), for display.
            token_last4:
              type: string
              description: The last four characters of the token, for display.
            permissions:
              type: array
              items:
                type: string
              description: "What the key may do: the explicit token list."
            account_sids:
              type: array
              nullable: true
              items:
                type: string
              description: The key's sender slice (ln_ac_...), clamped to its issuer's; null = every account of the issuer's own slice.
            status:
              type: string
              enum:
                - active
                - revoked
                - expired
              description: active = verifies; revoked | expired = refused.
            expires_at:
              type: string
              nullable: true
              description: "ISO 8601 UTC; null = perpetual. Default at creation: three years."
            last_used_at:
              type: string
              nullable: true
              description: ISO 8601 UTC of the last verified call; null = never used.
            created_by:
              type: object
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: "The issuer: a person, or a parent key on delegation."
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; set with status revoked.
          required:
            - sid
            - team_sid
            - name
            - token_prefix
            - token_last4
            - permissions
            - account_sids
            - status
            - expires_at
            - last_used_at
            - created_by
            - created_at
            - updated_at
            - deleted_at
        included:
          type: object
          additionalProperties: {}
        includes:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - included
        - includes
        - meta
    GetApiKeysMetricsRequest:
      type: object
      description: Request body of `get_api_keys_metrics`.
      properties:
        filter:
          type: object
          properties:
            sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: Key sid(s).
            status:
              type: object
              properties:
                eq:
                  type: string
                  enum:
                    - active
                    - revoked
                    - expired
                ne:
                  type: string
                  enum:
                    - active
                    - revoked
                    - expired
                in:
                  type: array
                  items:
                    type: string
                    enum:
                      - active
                      - revoked
                      - expired
                nin:
                  type: array
                  items:
                    type: string
                    enum:
                      - active
                      - revoked
                      - expired
              additionalProperties: false
              description: active | revoked | expired.
            name:
              type: object
              properties:
                eq:
                  type: string
              additionalProperties: false
              description: Exact name.
            created_by_actor_sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: "Keys a teammate (us_mb_) or a parent key (id_ak_) issued: the offboarding slice."
            expires_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                gt:
                  type: string
                lt:
                  type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: is_null true = perpetual keys; a range = expiring between.
            last_used_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                gt:
                  type: string
                lt:
                  type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: is_null true = never used; lt = stale keys.
            created_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                gt:
                  type: string
                lt:
                  type: string
              additionalProperties: false
              description: ISO 8601 bounds.
            deleted_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: "Default scope is { is_null: true } (live rows)."
          description: "Scopes the rows the metrics are computed over: the search filter operators. Omit for all rows."
        period:
          type: object
          properties:
            from:
              type: string
              description: ISO 8601 UTC window start (inclusive).
            to:
              type: string
              description: ISO 8601 UTC window end; at or after from.
          required:
            - from
            - to
          description: Required metrics window.
        group_by:
          type: string
          nullable: true
          enum:
            - status
          description: "Accepted for the shared contract and not split on: the status split always rides aggregated.counts.groups.status; no groups[] is built."
      required:
        - period
    GetApiKeysMetricsResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - metrics
        metrics:
          type: object
          properties:
            filter:
              type: object
              additionalProperties: {}
            period:
              type: object
              properties:
                from:
                  type: string
                to:
                  type: string
              required:
                - from
                - to
            aggregated:
              type: object
              properties:
                counts:
                  type: object
                  additionalProperties: {}
                metrics:
                  type: object
                  properties:
                    created_in_period:
                      type: number
                      description: Keys minted inside the window.
                    expired_in_period:
                      type: number
                      description: Keys that expired inside the window.
                    last_used_at:
                      type: string
                      nullable: true
                      description: The most recent verified call across the set; null = none.
                  required:
                    - created_in_period
                    - expired_in_period
                    - last_used_at
            metrics:
              type: object
              properties:
                created_in_period:
                  type: number
                  description: Keys minted inside the window.
                expired_in_period:
                  type: number
                  description: Keys that expired inside the window.
                last_used_at:
                  type: string
                  nullable: true
                  description: The most recent verified call across the set; null = none.
              required:
                - created_in_period
                - expired_in_period
                - last_used_at
        applied_filters:
          type: object
          additionalProperties: {}
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - metrics
        - meta
    GetBillingPaymentMethodAddLinkResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - action
        action:
          type: string
          description: kebab-case verb; matches the route segment.
        item: {}
        result:
          type: object
          properties:
            add_link:
              type: string
              nullable: true
              description: "The portal URL to open: the update-payment-method deep link, else the portal overview; null when Paddle minted neither."
            expires_at:
              type: string
              description: ISO 8601 UTC when the link lapses.
            subscription_sid:
              type: string
              description: The subscription the card will bill (bl_sb_...).
          required:
            - add_link
            - expires_at
            - subscription_sid
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - action
        - item
        - result
        - meta
    GetBillingSubscriptionResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - get
        item:
          type: object
          properties:
            sid:
              type: string
              description: Subscription sid (bl_sb_...).
            owner_user_sid:
              type: string
              description: "The buyer (us_mb_...): the one who manages the pool."
            team_sid:
              type: string
              nullable: true
              description: "Always null on this product: a subscription floats and allocations bind workspaces to it."
            paddle_subscription_id:
              type: string
              nullable: true
              description: Paddle's id (sub_...); null on an internal sentinel (the trial).
            status:
              type: string
              enum:
                - active
                - past_due
                - paused
                - canceled
              description: "active; past_due (a failed renewal: LinkedIn and email run 3 more days); paused; canceled (terminal)."
            collection_mode:
              type: string
              enum:
                - automatic
                - manual
              description: automatic = the card is charged; manual = invoiced (a sales deal) or the trial sentinel.
            price_sid:
              type: string
              description: The first line's price (bl_pc_...); the lines include says what each line is.
            quantity:
              type: integer
              description: "1 on a resource subscription: a line is one item of quantity 1."
            addons:
              type: array
              items:
                type: object
                properties:
                  product_sid:
                    type: string
                    description: The line's product (bl_pr_...).
                  price_sid:
                    type: string
                    description: The line's price (bl_pc_...), a non-catalog price of this order.
                  paddle_item_id:
                    type: string
                    nullable: true
                    description: Paddle's item id on the subscription; null on a sentinel.
                  quantity:
                    type: integer
                    description: "Always 1 on a resource subscription: a line is one item."
                  status:
                    type: string
                    enum:
                      - active
                      - canceled
                    description: canceled = the line grants nothing any more.
                required:
                  - product_sid
                  - price_sid
                  - paddle_item_id
                  - quantity
                  - status
              description: The other lines of the order, one item each.
            currency:
              type: string
              description: "ISO 4217: USD, EUR or GBP."
            current_period_starts_at:
              type: string
              nullable: true
              description: ISO 8601 UTC.
            current_period_ends_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; the trial's end on the sentinel.
            next_billed_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null when nothing is billed next.
            paused_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null unless paused.
            scheduled_resume_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null unless a resume is scheduled.
            scheduled_change:
              type: object
              nullable: true
              properties:
                action:
                  type: string
                  enum:
                    - cancel
                    - pause
                    - resume
                  description: What happens at effective_at.
                effective_at:
                  type: string
                  description: ISO 8601 UTC.
                resume_at:
                  type: string
                  nullable: true
                  description: "For a scheduled pause: when it resumes; null = open-ended."
              required:
                - action
                - effective_at
                - resume_at
              description: A cancel, pause or resume waiting for the period end; null = none.
            canceled_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null unless canceled.
            canceled_by:
              type: object
              nullable: true
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: Who canceled; null unless canceled by a person.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null = live.
          required:
            - sid
            - owner_user_sid
            - team_sid
            - paddle_subscription_id
            - status
            - collection_mode
            - price_sid
            - quantity
            - addons
            - currency
            - current_period_starts_at
            - current_period_ends_at
            - next_billed_at
            - paused_at
            - scheduled_resume_at
            - scheduled_change
            - canceled_at
            - canceled_by
            - created_at
            - updated_at
            - deleted_at
        included:
          type: object
          additionalProperties: {}
        includes:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - included
        - includes
        - meta
    GetBillingSubscriptionUpdatePaymentMethodLinkResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - action
        action:
          type: string
          description: kebab-case verb; matches the route segment.
        item: {}
        result:
          type: object
          additionalProperties: {}
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - action
        - item
        - result
        - meta
    GetBillingTransactionInvoiceResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - action
        action:
          type: string
          description: kebab-case verb; matches the route segment.
        item:
          type: object
          nullable: true
          properties:
            sid:
              type: string
              description: Transaction sid (bl_tx_...).
            owner_user_sid:
              type: string
              description: The buyer (us_mb_...).
            team_sid:
              type: string
              nullable: true
              description: The workspace notified of it at ingestion (the first allocated one); null when none.
            subscription_sid:
              type: string
              nullable: true
              description: The subscription charged (bl_sb_...); attached on a later event when the charge came first.
            paddle_transaction_id:
              type: string
              description: Paddle's id (txn_...).
            status:
              type: string
              enum:
                - billed
                - paid
                - completed
                - past_due
                - canceled
              description: billed, paid, completed, past_due or canceled, as Paddle reports it.
            origin:
              type: string
              enum:
                - subscription_charge
                - subscription_update
                - one_time
              description: subscription_charge (a period's charge, the first checkout included), subscription_update (a proration), one_time.
            collection_mode:
              type: string
              enum:
                - automatic
                - manual
              description: automatic = charged to the card; manual = invoiced.
            invoice_number:
              type: string
              nullable: true
              description: Paddle's invoice number; the rows that carry one have a PDF.
            total:
              type: string
              description: The total as a decimal string in currency.
            tax:
              type: string
              nullable: true
              description: The tax part as a decimal string; null when unknown.
            currency:
              type: string
              description: ISO 4217.
            items:
              type: array
              items:
                type: object
                properties:
                  price_sid:
                    type: string
                    nullable: true
                    description: The price charged (bl_pc_...); null when Paddle named one we do not mirror.
                  product_sid:
                    type: string
                    nullable: true
                    description: The product (bl_pr_...).
                  product_type:
                    type: string
                    enum:
                      - plan
                      - addon
                      - credits_pack
                    description: plan | addon | credits_pack.
                  quantity:
                    type: integer
                    description: Units charged.
                  unit_amount:
                    type: string
                    description: The unit price as a decimal string.
                  paddle_price_id:
                    type: string
                    nullable: true
                    description: Paddle's price id.
                required:
                  - price_sid
                  - product_sid
                  - product_type
                  - quantity
                  - unit_amount
                  - paddle_price_id
              description: The frozen line items of the charge.
            billed_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null until billed.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
          required:
            - sid
            - owner_user_sid
            - team_sid
            - subscription_sid
            - paddle_transaction_id
            - status
            - origin
            - collection_mode
            - invoice_number
            - total
            - tax
            - currency
            - items
            - billed_at
            - created_at
            - updated_at
        result:
          type: object
          properties:
            invoice_url:
              type: string
              nullable: true
              description: The signed Paddle URL of the PDF; null only when Paddle's answer carried none.
            expires_at:
              type: string
              description: ISO 8601 UTC, about an hour after the mint.
            invoice_number:
              type: string
              nullable: true
              description: The transaction's own invoice number.
          required:
            - invoice_url
            - expires_at
            - invoice_number
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - action
        - item
        - result
        - meta
    GetBillingTransactionResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - get
        item:
          type: object
          properties:
            sid:
              type: string
              description: Transaction sid (bl_tx_...).
            owner_user_sid:
              type: string
              description: The buyer (us_mb_...).
            team_sid:
              type: string
              nullable: true
              description: The workspace notified of it at ingestion (the first allocated one); null when none.
            subscription_sid:
              type: string
              nullable: true
              description: The subscription charged (bl_sb_...); attached on a later event when the charge came first.
            paddle_transaction_id:
              type: string
              description: Paddle's id (txn_...).
            status:
              type: string
              enum:
                - billed
                - paid
                - completed
                - past_due
                - canceled
              description: billed, paid, completed, past_due or canceled, as Paddle reports it.
            origin:
              type: string
              enum:
                - subscription_charge
                - subscription_update
                - one_time
              description: subscription_charge (a period's charge, the first checkout included), subscription_update (a proration), one_time.
            collection_mode:
              type: string
              enum:
                - automatic
                - manual
              description: automatic = charged to the card; manual = invoiced.
            invoice_number:
              type: string
              nullable: true
              description: Paddle's invoice number; the rows that carry one have a PDF.
            total:
              type: string
              description: The total as a decimal string in currency.
            tax:
              type: string
              nullable: true
              description: The tax part as a decimal string; null when unknown.
            currency:
              type: string
              description: ISO 4217.
            items:
              type: array
              items:
                type: object
                properties:
                  price_sid:
                    type: string
                    nullable: true
                    description: The price charged (bl_pc_...); null when Paddle named one we do not mirror.
                  product_sid:
                    type: string
                    nullable: true
                    description: The product (bl_pr_...).
                  product_type:
                    type: string
                    enum:
                      - plan
                      - addon
                      - credits_pack
                    description: plan | addon | credits_pack.
                  quantity:
                    type: integer
                    description: Units charged.
                  unit_amount:
                    type: string
                    description: The unit price as a decimal string.
                  paddle_price_id:
                    type: string
                    nullable: true
                    description: Paddle's price id.
                required:
                  - price_sid
                  - product_sid
                  - product_type
                  - quantity
                  - unit_amount
                  - paddle_price_id
              description: The frozen line items of the charge.
            billed_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null until billed.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
          required:
            - sid
            - owner_user_sid
            - team_sid
            - subscription_sid
            - paddle_transaction_id
            - status
            - origin
            - collection_mode
            - invoice_number
            - total
            - tax
            - currency
            - items
            - billed_at
            - created_at
            - updated_at
        included:
          type: object
          additionalProperties: {}
        includes:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - included
        - includes
        - meta
    GetBillingTransactionsMetricsRequest:
      type: object
      description: Request body of `get_billing_transactions_metrics`.
      properties:
        filter:
          type: object
          properties:
            sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: Transaction sid(s).
            owner_user_sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: The buyer.
            team_sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: The notified workspace.
            subscription_sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: One subscription's charges.
            paddle_transaction_id:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: Paddle's id.
            invoice_number:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: Locate one invoice; is_null false = the rows with a PDF.
            status:
              type: object
              properties:
                eq:
                  type: string
                  enum:
                    - billed
                    - paid
                    - completed
                    - past_due
                    - canceled
                ne:
                  type: string
                  enum:
                    - billed
                    - paid
                    - completed
                    - past_due
                    - canceled
                in:
                  type: array
                  items:
                    type: string
                    enum:
                      - billed
                      - paid
                      - completed
                      - past_due
                      - canceled
                nin:
                  type: array
                  items:
                    type: string
                    enum:
                      - billed
                      - paid
                      - completed
                      - past_due
                      - canceled
              additionalProperties: false
              description: billed | paid | completed | past_due | canceled.
            origin:
              type: object
              properties:
                eq:
                  type: string
                  enum:
                    - subscription_charge
                    - subscription_update
                    - one_time
                ne:
                  type: string
                  enum:
                    - subscription_charge
                    - subscription_update
                    - one_time
                in:
                  type: array
                  items:
                    type: string
                    enum:
                      - subscription_charge
                      - subscription_update
                      - one_time
                nin:
                  type: array
                  items:
                    type: string
                    enum:
                      - subscription_charge
                      - subscription_update
                      - one_time
              additionalProperties: false
              description: subscription_charge | subscription_update | one_time.
            collection_mode:
              type: object
              properties:
                eq:
                  type: string
                  enum:
                    - automatic
                    - manual
                ne:
                  type: string
                  enum:
                    - automatic
                    - manual
                in:
                  type: array
                  items:
                    type: string
                    enum:
                      - automatic
                      - manual
              additionalProperties: false
              description: automatic | manual.
            currency:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: ISO 4217.
            billed_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                gt:
                  type: string
                lt:
                  type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: ISO 8601 bounds.
            created_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                gt:
                  type: string
                lt:
                  type: string
              additionalProperties: false
              description: ISO 8601 bounds.
          description: "Scopes the rows the metrics are computed over: the search filter operators. Omit for all rows."
        period:
          type: object
          properties:
            from:
              type: string
              description: ISO 8601 UTC window start (inclusive).
            to:
              type: string
              description: ISO 8601 UTC window end; at or after from.
          required:
            - from
            - to
          description: Required metrics window.
      required:
        - period
    GetBillingTransactionsMetricsResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - metrics
        metrics:
          type: object
          properties:
            filter:
              type: object
              additionalProperties: {}
            period:
              type: object
              properties:
                from:
                  type: string
                to:
                  type: string
              required:
                - from
                - to
            aggregated:
              type: object
              properties:
                counts:
                  type: object
                  additionalProperties: {}
                metrics:
                  type: object
                  properties:
                    transactions_count:
                      type: integer
                      description: Rows with billed_at inside the window, all currencies.
                    last_billed_at:
                      type: string
                      nullable: true
                      description: ISO 8601 UTC, the newest billed_at in the window; null when none.
                    by_currency:
                      type: object
                      additionalProperties:
                        type: object
                        properties:
                          transactions_count:
                            type: integer
                            description: Rows in this currency inside the window.
                          total_amount:
                            type: string
                            description: SUM(total) as a string, GROSS.
                          total_tax:
                            type: string
                            description: SUM(tax) as a string.
                          paid_amount:
                            type: string
                            description: SUM(total) where status is paid or completed.
                          past_due_amount:
                            type: string
                            description: SUM(total) where status is past_due.
                        required:
                          - transactions_count
                          - total_amount
                          - total_tax
                          - paid_amount
                          - past_due_amount
                      description: One entry per ISO 4217 code present in the window; money never crosses currencies.
                  required:
                    - transactions_count
                    - last_billed_at
                    - by_currency
            metrics:
              type: object
              properties:
                transactions_count:
                  type: integer
                  description: Rows with billed_at inside the window, all currencies.
                last_billed_at:
                  type: string
                  nullable: true
                  description: ISO 8601 UTC, the newest billed_at in the window; null when none.
                by_currency:
                  type: object
                  additionalProperties:
                    type: object
                    properties:
                      transactions_count:
                        type: integer
                        description: Rows in this currency inside the window.
                      total_amount:
                        type: string
                        description: SUM(total) as a string, GROSS.
                      total_tax:
                        type: string
                        description: SUM(tax) as a string.
                      paid_amount:
                        type: string
                        description: SUM(total) where status is paid or completed.
                      past_due_amount:
                        type: string
                        description: SUM(total) where status is past_due.
                    required:
                      - transactions_count
                      - total_amount
                      - total_tax
                      - paid_amount
                      - past_due_amount
                  description: One entry per ISO 4217 code present in the window; money never crosses currencies.
              required:
                - transactions_count
                - last_billed_at
                - by_currency
        applied_filters:
          type: object
          additionalProperties: {}
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - metrics
        - meta
    GetCreditLotsMetricsRequest:
      type: object
      description: Request body of `get_credit_lots_metrics`.
      properties:
        filter:
          type: object
          properties:
            kind:
              type: string
              enum:
                - platform
              description: The wallet axis; platform is the one kind, the default.
          description: "Scopes the rows the metrics are computed over: the search filter operators. Omit for all rows."
    GetCreditLotsMetricsResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - metrics
        metrics:
          type: object
          properties:
            filter:
              type: object
              additionalProperties: {}
            period:
              type: object
              properties:
                from:
                  type: string
                to:
                  type: string
              required:
                - from
                - to
            aggregated:
              type: object
              properties:
                counts:
                  type: object
                  additionalProperties: {}
                metrics:
                  type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - platform
                      description: The wallet axis the numbers are for.
                    available:
                      type: number
                      description: "Credits the workspace can spend now: the active lots minus the holds of running work. Two decimals (0.01 is the smallest amount)."
                    held:
                      type: number
                      description: Credits reserved by work in flight (a run, a play), released or captured when it ends.
                    granted:
                      type: number
                      description: Credits issued over the active lots.
                    remaining:
                      type: number
                      description: What is left of the active lots before the holds.
                    next_expiry_at:
                      type: string
                      nullable: true
                      description: "ISO 8601 UTC when the soonest DATED lot lapses (the trial's grant, credits bought with no plan); null = none. The plan's lots carry no date: they live with the plan and burn when the workspace leaves it."
                    next_expiry_amount:
                      type: number
                      description: How many credits lapse then; 0 when no lot is active.
                    next_grant_at:
                      type: string
                      nullable: true
                      description: ISO 8601 UTC when the next monthly grant lands through the workspace's share (the battery's refill); null with no recurring credits.
                  required:
                    - kind
                    - available
                    - held
                    - granted
                    - remaining
                    - next_expiry_at
                    - next_expiry_amount
                    - next_grant_at
            metrics:
              type: object
              properties:
                kind:
                  type: string
                  enum:
                    - platform
                  description: The wallet axis the numbers are for.
                available:
                  type: number
                  description: "Credits the workspace can spend now: the active lots minus the holds of running work. Two decimals (0.01 is the smallest amount)."
                held:
                  type: number
                  description: Credits reserved by work in flight (a run, a play), released or captured when it ends.
                granted:
                  type: number
                  description: Credits issued over the active lots.
                remaining:
                  type: number
                  description: What is left of the active lots before the holds.
                next_expiry_at:
                  type: string
                  nullable: true
                  description: "ISO 8601 UTC when the soonest DATED lot lapses (the trial's grant, credits bought with no plan); null = none. The plan's lots carry no date: they live with the plan and burn when the workspace leaves it."
                next_expiry_amount:
                  type: number
                  description: How many credits lapse then; 0 when no lot is active.
                next_grant_at:
                  type: string
                  nullable: true
                  description: ISO 8601 UTC when the next monthly grant lands through the workspace's share (the battery's refill); null with no recurring credits.
              required:
                - kind
                - available
                - held
                - granted
                - remaining
                - next_expiry_at
                - next_expiry_amount
                - next_grant_at
        applied_filters:
          type: object
          additionalProperties: {}
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - metrics
        - meta
    GetCreditTransactionsMetricsRequest:
      type: object
      description: Request body of `get_credit_transactions_metrics`.
      properties:
        filter:
          type: object
          properties:
            kind:
              type: string
              enum:
                - platform
              description: The wallet axis; platform is the one kind, the default.
            type:
              type: string
              enum:
                - allocation
                - debit
                - refund
                - expiry
              description: One movement type.
            status:
              type: string
              enum:
                - pending
                - confirmed
                - released
                - expired
              description: One status.
            operation:
              type: string
              maxLength: 64
              description: One wallet operation label (gtm_tool_call, llm.generate, ai_sdr_turn, creator_turn...).
            product:
              type: string
              enum:
                - playtables
                - ai_sdr
                - creator
                - voice
              description: "One product: playtables (the columns, the searches, the work emails), ai_sdr (the agent), creator (its chats), voice (dictation and a voice message)."
            feature:
              type: string
              pattern: ^[a-z][a-z0-9_]{0,31}$
              description: "One kind of work in the product's own word: use_ai, ai_search, enrichment, email_find, dialog_reply, draft, knowledge, chat, dictation..."
            object_sid:
              type: string
              minLength: 18
              maxLength: 18
              description: "One thing: a column (pt_fd_), a data source (ds_sc_), a conversation (ub_cv_), a Creator chat (ct_ss_)."
            container_sid:
              type: string
              minLength: 18
              maxLength: 18
              description: "One holder of things: a playtable (pt_tb_), a sender profile (ub_sp_)."
            actor_sid:
              type: string
              minLength: 18
              maxLength: 18
              description: "One person (us_mb_) the credits count for: who ran it, who asked Creator, who set up the column that runs on new rows."
            started_by:
              type: string
              enum:
                - user
                - creator
                - api
                - automation
                - agent
                - lead
              description: "Who set it going: user, creator (for a person), api, automation (a column on new rows), agent (the AI SDR by itself), lead (a voice message)."
          description: "Scopes the rows the metrics are computed over: the search filter operators. Omit for all rows."
        period:
          type: object
          properties:
            from:
              type: string
              description: ISO 8601 UTC window start (inclusive).
            to:
              type: string
              description: ISO 8601 UTC window end (exclusive); must be >= from.
          required:
            - from
            - to
          description: Required. Half-open [from, to) window on created_at, the UTC day a movement belongs to (a hold is born at reserve and captured inside its 15 minutes).
        group_by:
          type: string
          enum:
            - type
            - status
            - operation
            - created_date
            - product
            - feature
            - object_sid
            - container_sid
            - actor_sid
            - started_by
          description: "One axis: created_date (the burn per UTC day), product, container_sid (tables, sender profiles), object_sid (columns, chats), actor_sid (people), feature, started_by, operation, type or status; adds groups[] with counts and metrics. Cap 500."
      required:
        - period
    GetCreditTransactionsMetricsResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - metrics
        metrics:
          type: object
          properties:
            filter:
              anyOf:
                - type: object
                  additionalProperties: {}
                - type: array
                  items: {}
              description: Echo of the kind and the pinned axis values the numbers are for.
            period:
              type: object
              properties:
                from:
                  type: string
                to:
                  type: string
              required:
                - from
                - to
            aggregated:
              type: object
              properties:
                counts:
                  type: object
                  properties:
                    total_count:
                      type: integer
                      minimum: 0
                      description: "Movements in [from, to): every type and status."
                    groups:
                      type: object
                      properties:
                        type:
                          anyOf:
                            - type: object
                              additionalProperties:
                                type: integer
                                minimum: 0
                            - type: array
                              items: {}
                          description: "Flat {type: rows}: allocation | debit | refund | expiry."
                        status:
                          anyOf:
                            - type: object
                              additionalProperties:
                                type: integer
                                minimum: 0
                            - type: array
                              items: {}
                          description: "Flat {status: rows}: pending (a hold in flight) | confirmed | released (a hold voided) | expired (a hold that lapsed)."
                        operation:
                          anyOf:
                            - type: object
                              additionalProperties:
                                type: integer
                                minimum: 0
                            - type: array
                              items: {}
                          description: 'Flat {operation: rows}: what spent, gtm_tool_call (a column), find_people_search (a Find people walk), creator_turn (the Creator); "" for rows that carry none.'
                        created_date:
                          anyOf:
                            - type: object
                              additionalProperties:
                                type: integer
                                minimum: 0
                            - type: array
                              items: {}
                          description: "Flat {'YYYY-MM-DD': rows}: movements per UTC day of created_at."
                        product:
                          anyOf:
                            - type: object
                              additionalProperties:
                                type: integer
                                minimum: 0
                            - type: array
                              items: {}
                          description: 'Flat {product: rows}: playtables | ai_sdr | creator | voice; "" for a movement that says nothing (an allocation, an expiry, a debit before 2026-10-23).'
                        feature:
                          anyOf:
                            - type: object
                              additionalProperties:
                                type: integer
                                minimum: 0
                            - type: array
                              items: {}
                          description: "Flat {feature: rows}: the kind of work in the product's own word."
                        object_sid:
                          anyOf:
                            - type: object
                              additionalProperties:
                                type: integer
                                minimum: 0
                            - type: array
                              items: {}
                          description: "Flat {sid: rows}: the thing the movement belongs to."
                        container_sid:
                          anyOf:
                            - type: object
                              additionalProperties:
                                type: integer
                                minimum: 0
                            - type: array
                              items: {}
                          description: "Flat {sid: rows}: the playtable or the sender profile that holds the thing."
                        actor_sid:
                          anyOf:
                            - type: object
                              additionalProperties:
                                type: integer
                                minimum: 0
                            - type: array
                              items: {}
                          description: "Flat {sid: rows}: the person the credits count for."
                        started_by:
                          anyOf:
                            - type: object
                              additionalProperties:
                                type: integer
                                minimum: 0
                            - type: array
                              items: {}
                          description: "Flat {starter: rows}: user | creator | api | automation | agent | lead."
                      required:
                        - type
                        - status
                        - operation
                        - created_date
                        - product
                        - feature
                        - object_sid
                        - container_sid
                        - actor_sid
                        - started_by
                      description: "One axis per CreditTransactionGroupableFieldsEnum value: row counts, never credits."
                  required:
                    - total_count
                    - groups
                metrics:
                  type: object
                  properties:
                    spent:
                      type: number
                      minimum: 0
                      description: "Credits the confirmed debits took in [from, to), two decimals (five 0.1 verifications are 0.5): a pending hold is reserved, not spent; a released or expired hold never left the wallet."
                    granted:
                      type: number
                      minimum: 0
                      description: Credits the confirmed allocations and refunds brought in [from, to).
                    expired:
                      type: number
                      minimum: 0
                      description: "Credits that lapsed unspent in [from, to): a period's lot dies with the period."
                    charged:
                      type: integer
                      minimum: 0
                      description: "How many confirmed debits there were: the units of work paid for (a cell, a page, a found address, a turn is one each); a count of all debit rows would read the voided holds too."
                  required:
                    - spent
                    - granted
                    - expired
                    - charged
              required:
                - counts
                - metrics
            groups:
              type: array
              items:
                type: object
                properties:
                  key:
                    type: string
                    nullable: true
                    description: "Value of the group_by axis: a 'YYYY-MM-DD' day, a type, a status, an operation, a product, a feature, a sid or a starter; null = rows without a value on the axis (an allocation has no operation, no product)."
                  counts:
                    type: object
                    properties:
                      total_count:
                        type: integer
                        minimum: 0
                        description: "Movements in [from, to): every type and status."
                      groups:
                        type: object
                        properties:
                          type:
                            anyOf:
                              - type: object
                                additionalProperties:
                                  type: integer
                                  minimum: 0
                              - type: array
                                items: {}
                            description: "Flat {type: rows}: allocation | debit | refund | expiry."
                          status:
                            anyOf:
                              - type: object
                                additionalProperties:
                                  type: integer
                                  minimum: 0
                              - type: array
                                items: {}
                            description: "Flat {status: rows}: pending (a hold in flight) | confirmed | released (a hold voided) | expired (a hold that lapsed)."
                          operation:
                            anyOf:
                              - type: object
                                additionalProperties:
                                  type: integer
                                  minimum: 0
                              - type: array
                                items: {}
                            description: 'Flat {operation: rows}: what spent, gtm_tool_call (a column), find_people_search (a Find people walk), creator_turn (the Creator); "" for rows that carry none.'
                          created_date:
                            anyOf:
                              - type: object
                                additionalProperties:
                                  type: integer
                                  minimum: 0
                              - type: array
                                items: {}
                            description: "Flat {'YYYY-MM-DD': rows}: movements per UTC day of created_at."
                          product:
                            anyOf:
                              - type: object
                                additionalProperties:
                                  type: integer
                                  minimum: 0
                              - type: array
                                items: {}
                            description: 'Flat {product: rows}: playtables | ai_sdr | creator | voice; "" for a movement that says nothing (an allocation, an expiry, a debit before 2026-10-23).'
                          feature:
                            anyOf:
                              - type: object
                                additionalProperties:
                                  type: integer
                                  minimum: 0
                              - type: array
                                items: {}
                            description: "Flat {feature: rows}: the kind of work in the product's own word."
                          object_sid:
                            anyOf:
                              - type: object
                                additionalProperties:
                                  type: integer
                                  minimum: 0
                              - type: array
                                items: {}
                            description: "Flat {sid: rows}: the thing the movement belongs to."
                          container_sid:
                            anyOf:
                              - type: object
                                additionalProperties:
                                  type: integer
                                  minimum: 0
                              - type: array
                                items: {}
                            description: "Flat {sid: rows}: the playtable or the sender profile that holds the thing."
                          actor_sid:
                            anyOf:
                              - type: object
                                additionalProperties:
                                  type: integer
                                  minimum: 0
                              - type: array
                                items: {}
                            description: "Flat {sid: rows}: the person the credits count for."
                          started_by:
                            anyOf:
                              - type: object
                                additionalProperties:
                                  type: integer
                                  minimum: 0
                              - type: array
                                items: {}
                            description: "Flat {starter: rows}: user | creator | api | automation | agent | lead."
                        required:
                          - type
                          - status
                          - operation
                          - created_date
                          - product
                          - feature
                          - object_sid
                          - container_sid
                          - actor_sid
                          - started_by
                        description: "One axis per CreditTransactionGroupableFieldsEnum value: row counts, never credits."
                    required:
                      - total_count
                      - groups
                  metrics:
                    type: object
                    properties:
                      spent:
                        type: number
                        minimum: 0
                        description: "Credits the confirmed debits took in [from, to), two decimals (five 0.1 verifications are 0.5): a pending hold is reserved, not spent; a released or expired hold never left the wallet."
                      granted:
                        type: number
                        minimum: 0
                        description: Credits the confirmed allocations and refunds brought in [from, to).
                      expired:
                        type: number
                        minimum: 0
                        description: "Credits that lapsed unspent in [from, to): a period's lot dies with the period."
                      charged:
                        type: integer
                        minimum: 0
                        description: "How many confirmed debits there were: the units of work paid for (a cell, a page, a found address, a turn is one each); a count of all debit rows would read the voided holds too."
                    required:
                      - spent
                      - granted
                      - expired
                      - charged
                required:
                  - key
                  - counts
                  - metrics
              description: "Present only when group_by was set: one entry per axis value in the window, ascending by key."
          required:
            - period
            - aggregated
        applied_filters:
          type: object
          additionalProperties: {}
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - metrics
        - meta
    GetCurrentUserResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - get
        item:
          type: object
          properties:
            sid:
              type: string
              description: User sid (us_mb_...).
            default_team_sid:
              type: string
              nullable: true
              description: The workspace the account signs into by default (ts_tm_...); null until a membership exists.
            email:
              type: string
              description: The sign-in address, lowercased.
            email_status:
              type: string
              enum:
                - unverified
                - verified
              description: unverified until the address confirmed its code.
            auth_provider:
              type: string
              enum:
                - password
                - google
              description: "How the account was CREATED: password = the email door (a mailed code since 2026-10-23, no password is held), google = Google sign-in."
            first_name:
              type: string
              description: Given name.
            last_name:
              type: string
              nullable: true
              description: Family name; null when not given.
            avatar_url:
              type: string
              nullable: true
              description: The avatar on the assets store (up to 2048 chars); null = initials.
            phone:
              type: string
              nullable: true
              description: Phone number as typed; null when not given.
            timezone:
              type: string
              nullable: true
              description: IANA zone of the person (Europe/Riga); the first workspace takes it as its day.
            country:
              type: string
              nullable: true
              description: ISO 3166-1 alpha-2.
            config:
              type: object
              nullable: true
              properties:
                latest_team_sid:
                  type: string
                  nullable: true
                  description: Which workspace to open on load (ts_tm_...); NOT default_team_sid.
                setup_completed:
                  type: boolean
                  description: The post-signup wizard is finished (or its last step was skipped).
                setup_step:
                  type: string
                  nullable: true
                  enum:
                    - verify
                    - questions
                    - workspace
                    - linkedin
                    - call
                  description: Resume point inside the wizard; null = not started.
                setup_call_step:
                  type: boolean
                  nullable: true
                  description: "Read-only: whether the wizard offers the intro call step; null = not scored yet. Dropped if sent on update."
                onboarding_completed:
                  type: boolean
                  description: The in-app Get started checklist is done.
                onboarding_steps:
                  type: array
                  items:
                    type: string
                  description: The checklist steps already completed.
                locale:
                  type: string
                  nullable: true
                  maxLength: 8
                  description: The UI locale the account picked (en, de, ...); null = the browser decides.
              description: Preferences and onboarding state (UserConfigValue); null when never written.
            utm:
              type: object
              nullable: true
              additionalProperties:
                type: string
              description: The UTM tags of the sign-up, as captured; null when there were none.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            erasure_requested_at:
              type: string
              nullable: true
              description: When the account asked to be erased (GDPR Art. 17); null = not requested. The 72h window runs from here.
            erased_at:
              type: string
              nullable: true
              description: When the erasure ran; null while the account is live.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null = live.
          required:
            - sid
            - default_team_sid
            - email
            - email_status
            - auth_provider
            - first_name
            - last_name
            - avatar_url
            - phone
            - timezone
            - country
            - config
            - utm
            - created_at
            - updated_at
            - erasure_requested_at
            - erased_at
            - deleted_at
        included:
          type: object
          additionalProperties: {}
        includes:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - included
        - includes
        - meta
    GetNotificationResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - get
        item:
          type: object
          properties:
            sid:
              type: string
              description: Notification sid (id_nt_...).
            team_sid:
              type: string
              description: The workspace the notice is about (ts_tm_...).
            user_sid:
              type: string
              nullable: true
              description: The recipient (us_mb_...); null for a cold address (an invite).
            event_name:
              type: string
              description: The domain event that produced it (team-members.invited, ssl-certificates.expiring, ...).
            event_sid:
              type: string
              description: The event instance; two channels of one event share it.
            entity_sid:
              type: string
              nullable: true
              description: The row the notice is about (a site, a person, a certificate); null when none.
            channel:
              type: string
              enum:
                - email
                - in_app
              description: email = sent through SendGrid; in_app = a line of the bell feed.
            status:
              type: string
              enum:
                - pending
                - delivered
                - failed
              description: pending = not sent yet; delivered; failed (see failure_reason). An in_app row is delivered at insert.
            subject:
              type: string
              description: The subject, or the feed line.
            body_html:
              type: string
              description: The rendered HTML body (get only).
            body_text:
              type: string
              description: The rendered text body (get only).
            rate_limit_bucket:
              type: string
              description: "The dedup bucket: event, entity, hour and channel."
            scheduled_at:
              type: string
              description: ISO 8601 UTC when the delivery was due.
            delivered_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null until delivered.
            read_at:
              type: string
              nullable: true
              description: ISO 8601 UTC when the recipient read an in_app row; null = unread, and always null on an email.
            failed_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null unless failed.
            failure_reason:
              type: string
              nullable: true
              description: Why the delivery failed (delivery_not_configured, a provider error); null otherwise.
            retry_count:
              type: integer
              description: Delivery attempts so far (up to 5).
            created_by:
              type: object
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: The actor behind the event, usually system.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC when the recipient dismissed it; null = in the feed.
          required:
            - sid
            - team_sid
            - user_sid
            - event_name
            - event_sid
            - entity_sid
            - channel
            - status
            - subject
            - rate_limit_bucket
            - scheduled_at
            - delivered_at
            - read_at
            - failed_at
            - failure_reason
            - retry_count
            - created_by
            - created_at
            - updated_at
            - deleted_at
        included:
          type: object
          additionalProperties: {}
        includes:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - included
        - includes
        - meta
    GetOauthClientResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - get
        item:
          type: object
          properties:
            sid:
              type: string
              description: OAuth client sid (id_oc_...).
            team_sid:
              type: string
              nullable: true
              description: The owning workspace (ts_tm_...); null = a platform client.
            name:
              type: string
              description: The application's name as the consent screen shows it.
            client_id:
              type: string
              description: The public identifier the app presents at /oauth/authorize.
            redirect_uris:
              type: array
              items:
                type: string
              description: The exact-match https allow-list of callback URLs.
            grant_types:
              type: array
              items:
                type: string
                enum:
                  - authorization_code
                  - refresh_token
              description: authorization_code and refresh_token.
            permissions:
              type: array
              items:
                type: string
              description: "The ceiling: the most a grant through this client may hold."
            is_confidential:
              type: boolean
              description: true = a confidential client with a secret; false = public, PKCE only.
            registration_kind:
              type: string
              enum:
                - manual
                - dynamic
              description: manual = registered here; dynamic = registered by the app itself (RFC 7591).
            actor_kind:
              type: string
              nullable: true
              enum:
                - agent
                - integration
              description: agent = its tokens act as an autonomous caller; integration = a tool a person uses; null = unclassified legacy row.
            status:
              type: string
              enum:
                - active
                - disabled
              description: disabled = its grants and tokens are revoked, the flow refuses it.
            created_by:
              type: object
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: Who registered the client.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null = live.
            client_secret:
              type: string
              nullable: true
              description: The secret of a confidential client, shown ONCE at create; never on a read.
          required:
            - sid
            - team_sid
            - name
            - client_id
            - redirect_uris
            - grant_types
            - permissions
            - is_confidential
            - registration_kind
            - actor_kind
            - status
            - created_by
            - created_at
            - updated_at
            - deleted_at
        included:
          type: object
          additionalProperties: {}
        includes:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - included
        - includes
        - meta
    GetSslCertificateResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - get
        item:
          type: object
          properties:
            sid:
              type: string
              description: Certificate sid (id_sc_...).
            team_sid:
              type: string
              description: The reseller team (ts_tm_...).
            domain:
              type: string
              description: The brand's host, lowercase FQDN.
            status:
              type: string
              enum:
                - pending
                - challenge
                - active
                - failed
                - expired
              description: pending = registered; challenge = a first issuance in flight; active = serving; failed; expired. A renewal of an active row keeps active.
            challenge:
              type: object
              nullable: true
              properties:
                type:
                  type: string
                  enum:
                    - http-01
                  description: The one challenge type served.
                token:
                  type: string
                  description: The ACME token the platform serves at well_known_path.
                key_authorization:
                  type: string
                  description: The key authorization the CA expects there.
                well_known_path:
                  type: string
                  description: The path the CA fetches on the domain.
                cname_target:
                  type: string
                  description: The platform host the domain's CNAME must point at.
                expires_at:
                  type: string
                  nullable: true
                  description: ISO 8601 UTC when the authorization lapses at the CA.
              required:
                - type
                - token
                - key_authorization
                - well_known_path
                - cname_target
                - expires_at
              description: The attempt in flight (first issuance or renewal); null when none.
            issuer:
              type: string
              nullable: true
              description: The CA that issued the serving certificate; null until one did.
            issued_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null until issued.
            expires_at:
              type: string
              nullable: true
              description: ISO 8601 UTC the serving certificate lapses; renewed 30 days ahead.
            last_error:
              type: string
              nullable: true
              description: "Why the last attempt failed, as a token: domain_not_pointed (fix the CNAME), domain_validation_failed (CAA or other DNS), issuance_unavailable (our side or the CA, contact support). null = none."
            created_by:
              type: object
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: Who registered the domain (the brand's activation).
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null = live.
          required:
            - sid
            - team_sid
            - domain
            - status
            - challenge
            - issuer
            - issued_at
            - expires_at
            - last_error
            - created_by
            - created_at
            - updated_at
            - deleted_at
        included:
          type: object
          additionalProperties: {}
        includes:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - included
        - includes
        - meta
    GetSubscriptionAllocationResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - get
        item:
          type: object
          properties:
            sid:
              type: string
              description: Allocation sid (bl_al_...).
            subscription_sid:
              type: string
              description: The pool (bl_sb_...).
            team_sid:
              type: string
              description: The workspace holding the share (ts_tm_...); one live share per workspace.
            created_by:
              type: object
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: "Who handed the share out: the buyer, or system for the checkout and the trial."
            linkedin_sender_profiles:
              type: integer
              description: LinkedIn sender profiles (accounts) the workspace may run.
            email_inboxes:
              type: integer
              description: Inboxes the workspace may connect.
            credits_per_month:
              type: integer
              description: Platform credits granted to the workspace every month of the paid period (one lot per grant, kept while the plan runs and burnt when the workspace leaves it).
            whitelabel:
              type: integer
              description: 1 = the workspace may register white label brands; 0 = not.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; a superseded or taken-back share keeps its history.
          required:
            - sid
            - subscription_sid
            - team_sid
            - created_by
            - linkedin_sender_profiles
            - email_inboxes
            - credits_per_month
            - whitelabel
            - created_at
            - updated_at
            - deleted_at
        included:
          type: object
          properties:
            team:
              type: object
              additionalProperties: {}
              description: The workspace row (TeamDomain) with the derived status and limits.
        includes:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - included
        - includes
        - meta
    GetTeamResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - get
        item:
          type: object
          properties:
            sid:
              type: string
              description: Team sid (ts_tm_...).
            owner_user_sid:
              type: string
              description: "The structural owner (us_mb_...): the one who can delete the workspace or hand it over."
            subscription_sid:
              type: string
              nullable: true
              description: The subscription the workspace's live allocation draws from (bl_sb_...); null = no share, suspended.
            name:
              type: string
              description: Workspace name; not unique.
            status:
              type: string
              enum:
                - active
                - suspended
              description: active while its allocation draws from a live subscription; suspended otherwise (settings and billing stay reachable).
            plan:
              type: string
              nullable: true
              enum:
                - none
                - free
                - paid
                - partner
              description: none | free (the trial) | paid | partner (a reseller's share).
            limits:
              type: object
              properties:
                linkedin_sender_profiles:
                  type: integer
                  description: "LinkedIn sender profiles (accounts) the workspace may run: its share of the pool."
                email_inboxes:
                  type: integer
                  description: Inboxes the workspace may connect.
                credits_per_month:
                  type: integer
                  description: Platform credits granted to the workspace every month of the paid period.
                whitelabel:
                  type: integer
                  description: 1 = the workspace may register white label brands, 0 = not.
                linkedin_seats:
                  type: integer
                  description: Retired on 2026-10-25, always 0 here (linkedin_sender_profiles replaced it).
                email_seats:
                  type: integer
                  description: Retired on 2026-10-25, always 0 here (email_inboxes replaced it).
                credits_per_period:
                  type: integer
                  description: Retired on 2026-10-25, always 0 here (credits_per_month replaced it).
                accounts:
                  type: integer
                  description: A gtm key, 0 on this product.
                cloud_browser:
                  type: integer
                  description: A gtm key, 0 on this product.
                webhooks:
                  type: integer
                  description: A gtm key, 0 on this product.
                proxy_5g:
                  type: integer
                  description: A gtm key, 0 on this product.
              required:
                - linkedin_sender_profiles
                - email_inboxes
                - credits_per_month
                - whitelabel
              description: "The capacity snapshot: the allocation's quantities, zero when there is none."
            cluster_id:
              type: integer
              nullable: true
              description: The data cluster the workspace was assigned at creation; one cluster today.
            config:
              type: object
              nullable: true
              properties:
                timezone:
                  type: string
                  nullable: true
                  maxLength: 64
                  description: IANA zone the workspace counts its day in (Europe/Riga); null = UTC. Defaults to the owner's zone at creation.
              description: Workspace settings (TeamConfigValue); null when never written.
            created_by:
              type: object
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: Who created the workspace.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            data_deletion_at:
              type: string
              nullable: true
              description: When a workspace that lost its coverage is erased (8 weeks after the loss); null while covered.
            deletion_warned_at:
              type: string
              nullable: true
              description: When the owner was warned two weeks ahead of data_deletion_at; null when not yet.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null = live.
          required:
            - sid
            - owner_user_sid
            - subscription_sid
            - name
            - status
            - plan
            - limits
            - cluster_id
            - config
            - created_by
            - created_at
            - updated_at
            - data_deletion_at
            - deletion_warned_at
            - deleted_at
        included:
          type: object
          additionalProperties: {}
        includes:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - included
        - includes
        - meta
    GetUserProfileResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - get
        item:
          type: object
          properties:
            sid:
              type: string
              description: User profile sid (id_up_...).
            user_sid:
              type: string
              description: Whose card it is (ts_us_...).
            full_name:
              type: string
              nullable: true
            headline:
              type: string
              nullable: true
              description: The LinkedIn headline.
            role_title:
              type: string
              nullable: true
              description: The current role.
            company_name:
              type: string
              nullable: true
              description: The current company.
            location:
              type: string
              nullable: true
            experience_line:
              type: string
              nullable: true
              description: The experience in one line ("11 years in B2B sales").
            topics:
              type: array
              items:
                type: string
              description: Two or three topics the person writes about.
            languages:
              type: array
              items:
                type: string
            ln_member_id:
              type: integer
              nullable: true
            ln_id:
              type: string
              nullable: true
              description: The profile URN.
            ln_nickname:
              type: string
              nullable: true
              description: The public identifier (slug), never a URL.
            sources:
              type: object
              additionalProperties:
                type: object
                properties:
                  source:
                    type: string
                    description: "Where the value came from: linkedin_company, linkedin_profile, website, person (the person's own words) or creator (an inference)."
                  set_at:
                    type: string
                    description: ISO 8601 UTC; when it was written.
                required:
                  - source
                  - set_at
              description: One stamp per written field, keyed by the field's name.
            read_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; when the LinkedIn profile was last read.
            created_at:
              type: string
              nullable: true
              description: ISO 8601 UTC.
            updated_at:
              type: string
              nullable: true
              description: ISO 8601 UTC.
          required:
            - sid
            - user_sid
            - full_name
            - headline
            - role_title
            - company_name
            - location
            - experience_line
            - topics
            - languages
            - ln_member_id
            - ln_id
            - ln_nickname
            - sources
            - read_at
            - created_at
            - updated_at
        included:
          type: object
          additionalProperties: {}
        includes:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - included
        - includes
        - meta
    GetWhitelabelResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - get
        item:
          type: object
          properties:
            sid:
              type: string
              description: Brand sid (id_wl_...).
            team_sid:
              type: string
              description: The owning reseller team (ts_tm_...).
            name:
              type: string
              description: The brand name the app shell shows and the mail is signed with.
            domain:
              type: string
              description: The app and login host (app.reseller.com), lowercase FQDN, unique platform-wide; read-only once active.
            status:
              type: string
              enum:
                - pending_domain
                - active
                - disabled
              description: pending_domain = waiting for the CNAME and the certificate; active = the host serves the brand; disabled = switched off, the host falls back to the platform brand.
            logo_url:
              type: string
              nullable: true
              description: The horizontal logo (app shell and email header).
            icon_url:
              type: string
              nullable: true
              description: The square mark or favicon.
            login_image_url:
              type: string
              nullable: true
              description: The login page artwork.
            palette:
              type: object
              nullable: true
              properties:
                primary_color:
                  type: string
                  nullable: true
                  pattern: ^#[0-9a-fA-F]{6}$
                  description: "Buttons and links, #rrggbb; null = the platform default."
                accent_color:
                  type: string
                  nullable: true
                  pattern: ^#[0-9a-fA-F]{6}$
                  description: "The accent, #rrggbb; null = the platform default."
                login_background_color:
                  type: string
                  nullable: true
                  pattern: ^#[0-9a-fA-F]{6}$
                  description: "The login page background, #rrggbb; null = the platform default."
              description: Brand colors; null = all platform defaults.
            email_from_name:
              type: string
              nullable: true
              description: The From name on the clients' mail; null = the brand name.
            email_reply_to:
              type: string
              nullable: true
              description: The Reply-To on the clients' mail; null = none.
            email_from_address:
              type: string
              nullable: true
              description: The brand's own sender address; mail leaves from it once email_domain is verified, from the platform address under the brand's name until then.
            email_domain:
              type: object
              nullable: true
              properties:
                domain:
                  type: string
                  description: "The domain part of email_from_address, lowercase: what SendGrid authenticates."
                status:
                  type: string
                  enum:
                    - pending
                    - verified
                    - failed
                  description: pending = records not all found yet; verified = the brand's mail leaves from its own address; failed = see failure_reason.
                records:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        description: "cname (three of them: the return path and two DKIM keys)."
                      host:
                        type: string
                        description: The record name to publish at the domain's DNS host.
                      value:
                        type: string
                        description: The CNAME target at SendGrid.
                      valid:
                        type: boolean
                        description: What the last check found for this record.
                    required:
                      - type
                      - host
                      - value
                      - valid
                  description: The DNS records to publish, in the order SendGrid issued them.
                failure_reason:
                  type: string
                  nullable: true
                  enum:
                    - email_domain_rejected
                    - email_domain_not_proven_in_time
                  description: email_domain_rejected (SendGrid refused the domain) or email_domain_not_proven_in_time (48 hours lapsed); null unless failed.
                checked_at:
                  type: string
                  nullable: true
                  description: ISO 8601 UTC of the last check against SendGrid.
                verified_at:
                  type: string
                  nullable: true
                  description: ISO 8601 UTC since when it is verified; null while it is not.
              required:
                - domain
                - status
                - records
                - failure_reason
                - checked_at
                - verified_at
              description: The proof of the sending domain; null = verify never ran, or the address moved to another domain.
            created_by:
              type: object
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: Who registered the brand.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null = live.
          required:
            - sid
            - team_sid
            - name
            - domain
            - status
            - logo_url
            - icon_url
            - login_image_url
            - palette
            - email_from_name
            - email_reply_to
            - email_from_address
            - email_domain
            - created_by
            - created_at
            - updated_at
            - deleted_at
        included:
          type: object
          properties:
            ssl_certificate:
              type: object
              nullable: true
              additionalProperties: {}
              description: "The certificate row for the brand's domain (SslCertificateDomain: status, expires_at, the last_error token); null when none yet."
            users_count:
              type: integer
              description: How many client users registered on the brand.
        includes:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - included
        - includes
        - meta
    GetWorkspaceProfileResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - get
        item:
          type: object
          properties:
            sid:
              type: string
              description: Workspace profile sid (id_wp_...).
            team_sid:
              type: string
              description: The workspace (ts_tm_...).
            company:
              type: object
              properties:
                name:
                  type: string
                  nullable: true
                tagline:
                  type: string
                  nullable: true
                  description: What the company does, in one line.
                industry:
                  type: string
                  nullable: true
                people_count:
                  type: integer
                  nullable: true
                  description: The LinkedIn page's headcount.
                founded_year:
                  type: integer
                  nullable: true
                location:
                  type: string
                  nullable: true
                  description: Where it is based.
                website:
                  type: string
                  nullable: true
                  description: A bare domain (acme.com), never a URL.
                ln_id:
                  type: string
                  nullable: true
                  description: The numeric LinkedIn company id, as digits.
                ln_nickname:
                  type: string
                  nullable: true
                  description: The LinkedIn company page slug, never a URL.
              required:
                - name
                - tagline
                - industry
                - people_count
                - founded_year
                - location
                - website
                - ln_id
                - ln_nickname
            who_buys:
              type: object
              properties:
                roles:
                  type: array
                  items:
                    type: string
                  description: The titles that buy.
                industries:
                  type: array
                  items:
                    type: string
                company_size:
                  type: string
                  nullable: true
                  description: In words ("10 to 200 staff").
                regions:
                  type: array
                  items:
                    type: string
                example_clients:
                  type: array
                  items:
                    type: string
                  description: Names from the site's cases and logos.
              required:
                - roles
                - industries
                - company_size
                - regions
                - example_clients
            offer:
              type: object
              properties:
                what_we_sell:
                  type: string
                  nullable: true
                  description: One or two lines.
                proof:
                  type: string
                  nullable: true
                  description: A case, a number; null when nothing said it.
                price:
                  type: string
                  nullable: true
                  description: Price and terms; null when nothing said it.
              required:
                - what_we_sell
                - proof
                - price
            sources:
              type: object
              additionalProperties:
                type: object
                properties:
                  source:
                    type: string
                    description: "Where the value came from: linkedin_company, linkedin_profile, website, person (the person's own words) or creator (an inference)."
                  set_at:
                    type: string
                    description: ISO 8601 UTC; when it was written.
                required:
                  - source
                  - set_at
              description: One stamp per written field, keyed "section.field" ("company.name", "who_buys.roles", "offer.price").
            confirmed_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; when the person said the cards are right (update with confirm true); null until then.
            version:
              type: integer
              description: Moves on every write.
            created_at:
              type: string
              nullable: true
              description: ISO 8601 UTC.
            updated_at:
              type: string
              nullable: true
              description: ISO 8601 UTC.
          required:
            - sid
            - team_sid
            - company
            - who_buys
            - offer
            - sources
            - confirmed_at
            - version
            - created_at
            - updated_at
        included:
          type: object
          additionalProperties: {}
        includes:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - included
        - includes
        - meta
    IssueSslCertificateResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - action
        action:
          type: string
        async:
          type: boolean
          enum:
            - true
        item:
          type: object
          nullable: true
          properties:
            sid:
              type: string
              description: Certificate sid (id_sc_...).
            team_sid:
              type: string
              description: The reseller team (ts_tm_...).
            domain:
              type: string
              description: The brand's host, lowercase FQDN.
            status:
              type: string
              enum:
                - pending
                - challenge
                - active
                - failed
                - expired
              description: pending = registered; challenge = a first issuance in flight; active = serving; failed; expired. A renewal of an active row keeps active.
            challenge:
              type: object
              nullable: true
              properties:
                type:
                  type: string
                  enum:
                    - http-01
                  description: The one challenge type served.
                token:
                  type: string
                  description: The ACME token the platform serves at well_known_path.
                key_authorization:
                  type: string
                  description: The key authorization the CA expects there.
                well_known_path:
                  type: string
                  description: The path the CA fetches on the domain.
                cname_target:
                  type: string
                  description: The platform host the domain's CNAME must point at.
                expires_at:
                  type: string
                  nullable: true
                  description: ISO 8601 UTC when the authorization lapses at the CA.
              required:
                - type
                - token
                - key_authorization
                - well_known_path
                - cname_target
                - expires_at
              description: The attempt in flight (first issuance or renewal); null when none.
            issuer:
              type: string
              nullable: true
              description: The CA that issued the serving certificate; null until one did.
            issued_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null until issued.
            expires_at:
              type: string
              nullable: true
              description: ISO 8601 UTC the serving certificate lapses; renewed 30 days ahead.
            last_error:
              type: string
              nullable: true
              description: "Why the last attempt failed, as a token: domain_not_pointed (fix the CNAME), domain_validation_failed (CAA or other DNS), issuance_unavailable (our side or the CA, contact support). null = none."
            created_by:
              type: object
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: Who registered the domain (the brand's activation).
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null = live.
          required:
            - sid
            - team_sid
            - domain
            - status
            - challenge
            - issuer
            - issued_at
            - expires_at
            - last_error
            - created_by
            - created_at
            - updated_at
            - deleted_at
        pending:
          type: array
          items:
            type: object
            properties:
              expected_completion_seconds:
                type: integer
                description: "120: the self-check, the validation and the finalize once the domain resolves."
              webhook_events:
                type: array
                items:
                  type: string
                description: "issue: ssl-certificates.issued, ssl-certificates.failed; renew: ssl-certificates.renewed, ssl-certificates.renewal-failed, ssl-certificates.failed."
              polling_hint:
                type: string
                description: "Poll get_ssl_certificate: after issue until status is active or failed; after renew until challenge is null."
            required:
              - expected_completion_seconds
              - webhook_events
              - polling_hint
          description: "One ref: the attempt in flight."
        result:
          type: object
          additionalProperties: {}
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - action
        - async
        - item
        - pending
        - result
        - meta
    ListBillingPaymentMethodsResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - search
        items:
          type: array
          items:
            type: object
            properties:
              item:
                type: object
                properties:
                  sid:
                    type: string
                    description: Paddle's payment method id (paymtd_...).
                  type:
                    type: string
                    enum:
                      - card
                      - paypal
                      - apple_pay
                      - google_pay
                      - other
                    description: card | paypal | apple_pay | google_pay | other.
                  card_brand:
                    type: string
                    nullable: true
                    description: visa, mastercard, ...; null off a card.
                  card_last4:
                    type: string
                    nullable: true
                    description: The last four digits; null off a card.
                  card_expiry:
                    type: string
                    nullable: true
                    description: MM/YY; null off a card.
                  is_default:
                    type: boolean
                    description: true on the card that last billed the workspace's subscription.
                  origin:
                    type: string
                    nullable: true
                    enum:
                      - saved_during_purchase
                      - subscription
                      - subscription_saved_during_purchase
                    description: How Paddle came to hold it; null when unknown.
                  saved_at:
                    type: string
                    nullable: true
                    description: ISO 8601 UTC; null when Paddle did not say.
                required:
                  - sid
                  - type
                  - card_brand
                  - card_last4
                  - card_expiry
                  - is_default
                  - origin
                  - saved_at
              included:
                type: object
                additionalProperties: {}
            required:
              - item
              - included
        pagination:
          type: object
          properties:
            next_cursor:
              type: string
              nullable: true
            has_more:
              type: boolean
            total_count:
              type: integer
              nullable: true
          required:
            - next_cursor
            - has_more
            - total_count
        applied_filters:
          type: object
          additionalProperties: {}
        includes:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
        counts:
          type: object
          additionalProperties: {}
      required:
        - success
        - operation
        - items
        - pagination
        - applied_filters
        - includes
        - meta
    MarkAllNotificationsReadResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - action
        action:
          type: string
          description: kebab-case verb; matches the route segment.
        item: {}
        result:
          type: object
          properties:
            marked_read:
              type: integer
              description: Rows stamped by this call.
          required:
            - marked_read
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - action
        - item
        - result
        - meta
    MarkNotificationReadResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - action
        action:
          type: string
          description: kebab-case verb; matches the route segment.
        item:
          type: object
          nullable: true
          properties:
            sid:
              type: string
              description: Notification sid (id_nt_...).
            team_sid:
              type: string
              description: The workspace the notice is about (ts_tm_...).
            user_sid:
              type: string
              nullable: true
              description: The recipient (us_mb_...); null for a cold address (an invite).
            event_name:
              type: string
              description: The domain event that produced it (team-members.invited, ssl-certificates.expiring, ...).
            event_sid:
              type: string
              description: The event instance; two channels of one event share it.
            entity_sid:
              type: string
              nullable: true
              description: The row the notice is about (a site, a person, a certificate); null when none.
            channel:
              type: string
              enum:
                - email
                - in_app
              description: email = sent through SendGrid; in_app = a line of the bell feed.
            status:
              type: string
              enum:
                - pending
                - delivered
                - failed
              description: pending = not sent yet; delivered; failed (see failure_reason). An in_app row is delivered at insert.
            subject:
              type: string
              description: The subject, or the feed line.
            body_html:
              type: string
              description: The rendered HTML body (get only).
            body_text:
              type: string
              description: The rendered text body (get only).
            rate_limit_bucket:
              type: string
              description: "The dedup bucket: event, entity, hour and channel."
            scheduled_at:
              type: string
              description: ISO 8601 UTC when the delivery was due.
            delivered_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null until delivered.
            read_at:
              type: string
              nullable: true
              description: ISO 8601 UTC when the recipient read an in_app row; null = unread, and always null on an email.
            failed_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null unless failed.
            failure_reason:
              type: string
              nullable: true
              description: Why the delivery failed (delivery_not_configured, a provider error); null otherwise.
            retry_count:
              type: integer
              description: Delivery attempts so far (up to 5).
            created_by:
              type: object
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: The actor behind the event, usually system.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC when the recipient dismissed it; null = in the feed.
          required:
            - sid
            - team_sid
            - user_sid
            - event_name
            - event_sid
            - entity_sid
            - channel
            - status
            - subject
            - rate_limit_bucket
            - scheduled_at
            - delivered_at
            - read_at
            - failed_at
            - failure_reason
            - retry_count
            - created_by
            - created_at
            - updated_at
            - deleted_at
        result:
          type: object
          additionalProperties: {}
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - action
        - item
        - result
        - meta
    McpError:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - false
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - validation_failed
                - nothing_to_update
                - not_found
                - relation_not_found
                - invalid_transition
                - limit_exceeded
                - payment_required
                - duplicate_rejected
                - conflict
                - delete_blocked
                - unauthorized
                - forbidden
                - rate_limited
                - internal_error
                - service_unavailable
                - not_implemented
            message:
              type: string
            recoverable:
              type: boolean
            suggestion:
              type: string
            field_errors:
              type: object
              additionalProperties:
                type: array
                items:
                  type: object
                  properties:
                    rule:
                      type: string
                    message:
                      type: string
                  required:
                    - rule
                    - message
            blockers:
              type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    description: Machine-readable blocker type (active_flow, pending_tasks, …).
                  severity:
                    type: string
                    enum:
                      - hard
                      - soft
                    description: hard = external action required; soft = acknowledge is enough.
                  description:
                    type: string
                  entity_sid:
                    type: string
                    nullable: true
                  count:
                    type: integer
                  resolution:
                    type: string
                    description: "Hard: tool name to call. Soft: code for acknowledge[]."
                  resolution_hint:
                    type: string
                required:
                  - type
                  - severity
                  - description
                  - entity_sid
                  - resolution
                  - resolution_hint
            context:
              type: object
              additionalProperties: {}
          required:
            - code
            - message
            - recoverable
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - error
    OpenWhitelabelClientWorkspaceResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - action
        action:
          type: string
          description: kebab-case verb; matches the route segment.
        item: {}
        result:
          type: object
          properties:
            url:
              type: string
              description: The app link that redeems the code (the code is in the URL fragment).
            code_expires_in:
              type: integer
              description: Seconds the one-time code stays redeemable (120).
            expires_in:
              type: integer
              description: Seconds the minted session lives (1800).
            target:
              type: object
              properties:
                team_sid:
                  type: string
                  description: The client workspace entered.
                team_name:
                  type: string
                  description: Its name.
                user_sid:
                  type: string
                  description: Its owner, whose session this is.
                email:
                  type: string
                  description: The owner's address.
                first_name:
                  type: string
                  nullable: true
                  description: The owner's given name.
                last_name:
                  type: string
                  nullable: true
                  description: The owner's family name.
              required:
                - team_sid
                - team_name
                - user_sid
                - email
                - first_name
                - last_name
              description: Whose workspace is entered.
          required:
            - url
            - code_expires_in
            - expires_in
            - target
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - action
        - item
        - result
        - meta
    PauseBillingSubscriptionResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - action
        action:
          type: string
          description: kebab-case verb; matches the route segment.
        item:
          type: object
          nullable: true
          properties:
            sid:
              type: string
              description: Subscription sid (bl_sb_...).
            owner_user_sid:
              type: string
              description: "The buyer (us_mb_...): the one who manages the pool."
            team_sid:
              type: string
              nullable: true
              description: "Always null on this product: a subscription floats and allocations bind workspaces to it."
            paddle_subscription_id:
              type: string
              nullable: true
              description: Paddle's id (sub_...); null on an internal sentinel (the trial).
            status:
              type: string
              enum:
                - active
                - past_due
                - paused
                - canceled
              description: "active; past_due (a failed renewal: LinkedIn and email run 3 more days); paused; canceled (terminal)."
            collection_mode:
              type: string
              enum:
                - automatic
                - manual
              description: automatic = the card is charged; manual = invoiced (a sales deal) or the trial sentinel.
            price_sid:
              type: string
              description: The first line's price (bl_pc_...); the lines include says what each line is.
            quantity:
              type: integer
              description: "1 on a resource subscription: a line is one item of quantity 1."
            addons:
              type: array
              items:
                type: object
                properties:
                  product_sid:
                    type: string
                    description: The line's product (bl_pr_...).
                  price_sid:
                    type: string
                    description: The line's price (bl_pc_...), a non-catalog price of this order.
                  paddle_item_id:
                    type: string
                    nullable: true
                    description: Paddle's item id on the subscription; null on a sentinel.
                  quantity:
                    type: integer
                    description: "Always 1 on a resource subscription: a line is one item."
                  status:
                    type: string
                    enum:
                      - active
                      - canceled
                    description: canceled = the line grants nothing any more.
                required:
                  - product_sid
                  - price_sid
                  - paddle_item_id
                  - quantity
                  - status
              description: The other lines of the order, one item each.
            currency:
              type: string
              description: "ISO 4217: USD, EUR or GBP."
            current_period_starts_at:
              type: string
              nullable: true
              description: ISO 8601 UTC.
            current_period_ends_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; the trial's end on the sentinel.
            next_billed_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null when nothing is billed next.
            paused_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null unless paused.
            scheduled_resume_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null unless a resume is scheduled.
            scheduled_change:
              type: object
              nullable: true
              properties:
                action:
                  type: string
                  enum:
                    - cancel
                    - pause
                    - resume
                  description: What happens at effective_at.
                effective_at:
                  type: string
                  description: ISO 8601 UTC.
                resume_at:
                  type: string
                  nullable: true
                  description: "For a scheduled pause: when it resumes; null = open-ended."
              required:
                - action
                - effective_at
                - resume_at
              description: A cancel, pause or resume waiting for the period end; null = none.
            canceled_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null unless canceled.
            canceled_by:
              type: object
              nullable: true
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: Who canceled; null unless canceled by a person.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null = live.
          required:
            - sid
            - owner_user_sid
            - team_sid
            - paddle_subscription_id
            - status
            - collection_mode
            - price_sid
            - quantity
            - addons
            - currency
            - current_period_starts_at
            - current_period_ends_at
            - next_billed_at
            - paused_at
            - scheduled_resume_at
            - scheduled_change
            - canceled_at
            - canceled_by
            - created_at
            - updated_at
            - deleted_at
        result:
          type: object
          additionalProperties: {}
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - action
        - item
        - result
        - meta
    PreviewBillingSubscriptionChangeRequest:
      type: object
      description: Request body of `preview_billing_subscription_change`.
      properties:
        linkedin:
          type: object
          properties:
            accounts:
              type: integer
              minimum: 0
              maximum: 100000
              description: The new count of LinkedIn accounts.
          required:
            - accounts
          description: The LinkedIn line's target; omit to keep it.
        email:
          type: object
          properties:
            packages:
              type: object
              properties:
                "100":
                  type: integer
                  minimum: 0
                  maximum: 1000
                  description: Packages of 100 inboxes.
                "500":
                  type: integer
                  minimum: 0
                  maximum: 1000
                  description: Packages of 500 inboxes.
                "2000":
                  type: integer
                  minimum: 0
                  maximum: 1000
                  description: Packages of 2,000 inboxes.
                "10000":
                  type: integer
                  minimum: 0
                  maximum: 1000
                  description: Packages of 10,000 inboxes.
              description: How many packages of each size, 0 to 1,000 each; the capacity is their sum.
          required:
            - packages
          description: The email line's target packages, every size named; omit to keep it.
        data:
          type: object
          properties:
            credits:
              type: integer
              minimum: 0
              maximum: 1000000
              description: "The new credits a month: 0, or from 1,000."
          required:
            - credits
          description: The data line's target; omit to keep it.
    PreviewBillingSubscriptionChangeResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - action
        action:
          type: string
          description: kebab-case verb; matches the route segment.
        item: {}
        result:
          type: object
          properties:
            currency:
              type: string
              description: USD | EUR | GBP, the subscription's.
            period:
              type: string
              description: monthly | annual, the subscription's.
            steps:
              type: array
              items:
                type: object
                additionalProperties: {}
              description: "One per line that moves: line, kind (increase | decrease | restore), applies (now | next_period), charge_minor, charge_exact (false = Paddle's proration preview), from, to; a paid data increase carries credits_now."
            due_now_minor:
              type: integer
              description: What the card is charged now, before tax.
            next_payment:
              type: object
              additionalProperties: {}
              description: "amount_minor and at: the target's recurring invoice on the unchanged renewal date."
            capacity_after:
              type: object
              additionalProperties:
                type: number
              description: "The pool after the change: linkedin_sender_profiles, email_inboxes, credits_per_month, whitelabel."
            quote_after:
              type: object
              properties:
                currency:
                  type: string
                  description: USD | EUR | GBP, the order's.
                period:
                  type: string
                  description: monthly | annual, the order's.
                book:
                  type: string
                  description: The price book version the figures came from.
                lines:
                  type: array
                  items:
                    type: object
                    additionalProperties: {}
                  description: "One per resource ordered: line (linkedin | email | data), its count or packages, capacity, rate_minor, monthly_minor and invoice_minor (the amount per billing period)."
                monthly_minor:
                  type: integer
                  description: The recurring lines a month, before 12 + 2.
                recurring_invoice_minor:
                  type: integer
                  description: "The recurring invoice: the monthly sum, times 12 on annual."
                one_time_minor:
                  type: integer
                  description: The one-time credits line, paid once.
                due_now_minor:
                  type: integer
                  description: "The first payment before tax and coupons: the recurring invoice plus the one-time line."
                has_recurring:
                  type: boolean
                  description: false = one-time credits alone, which make no subscription.
                service_months:
                  type: integer
                  nullable: true
                  description: 1, or 14 for 12 + 2; null when nothing recurs.
                grant_count:
                  type: integer
                  description: How many monthly credit grants the period pays for (1, or 14).
                credit_expiry_days:
                  type: integer
                  nullable: true
                  description: "Days a granted lot lives: null = the credits live with the plan and burn when the workspace leaves it (an order that buys a plan, or credits bought alone under one); 90 for credits bought alone with no paid plan."
                capacity:
                  type: object
                  additionalProperties:
                    type: number
                  description: "What the order grants a workspace: linkedin_sender_profiles, email_inboxes, credits_per_month, whitelabel."
                service:
                  type: object
                  additionalProperties: {}
                  description: level (free | paid | business | enterprise), next_level, next_threshold_minor and gap_minor a month to it; White label is part of Business.
                linkedin_next_tier:
                  type: object
                  nullable: true
                  additionalProperties: {}
                  description: "The next LinkedIn volume tier: accounts, add, capacity, total_minor, per_account_minor, savings_minor (negative = costlier in total); null at the package and above."
              required:
                - currency
                - period
                - book
                - lines
                - monthly_minor
                - recurring_invoice_minor
                - one_time_minor
                - due_now_minor
                - has_recurring
                - service_months
                - grant_count
                - credit_expiry_days
                - capacity
                - service
                - linkedin_next_tier
              description: The quote of the target composition.
          required:
            - currency
            - period
            - steps
            - due_now_minor
            - next_payment
            - capacity_after
            - quote_after
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - action
        - item
        - result
        - meta
    QuoteBillingSubscriptionOrderRequest:
      type: object
      description: Request body of `quote_billing_subscription_order`.
      properties:
        currency:
          type: string
          enum:
            - USD
            - EUR
            - GBP
          description: "USD, EUR or GBP: fixed local prices, EUR the USD figure, GBP nine tenths of it."
        period:
          type: string
          enum:
            - monthly
            - annual
          description: "monthly, or annual (12 + 2 months: 12 monthly amounts paid once, 14 months of service)."
        data:
          type: object
          properties:
            credits:
              type: integer
              minimum: 0
              maximum: 1000000
              description: "Credits: 0, or a whole number from 1,000."
            mode:
              type: string
              enum:
                - recurring
                - one_time
              description: recurring (granted every month, the default) or one_time (paid once in the first transaction). Under a plan the credits live with it; see credit_expiry_days.
          required:
            - credits
          description: The data credits line; omit for none.
        linkedin:
          type: object
          properties:
            accounts:
              type: integer
              minimum: 0
              maximum: 100000
              description: LinkedIn accounts to run (slots, not users); the per-account rate falls with the count, 188 to 300 is one package.
          required:
            - accounts
          description: The LinkedIn sender profiles line; omit for none.
        email:
          type: object
          properties:
            packages:
              type: object
              properties:
                "100":
                  type: integer
                  minimum: 0
                  maximum: 1000
                  description: Packages of 100 inboxes.
                "500":
                  type: integer
                  minimum: 0
                  maximum: 1000
                  description: Packages of 500 inboxes.
                "2000":
                  type: integer
                  minimum: 0
                  maximum: 1000
                  description: Packages of 2,000 inboxes.
                "10000":
                  type: integer
                  minimum: 0
                  maximum: 1000
                  description: Packages of 10,000 inboxes.
              description: How many packages of each size, 0 to 1,000 each; the capacity is their sum.
          required:
            - packages
          description: The email inbox capacity line; omit for none.
      required:
        - currency
        - period
    QuoteBillingSubscriptionOrderResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - action
        action:
          type: string
          description: kebab-case verb; matches the route segment.
        item: {}
        result:
          type: object
          properties:
            currency:
              type: string
              description: USD | EUR | GBP, the order's.
            period:
              type: string
              description: monthly | annual, the order's.
            book:
              type: string
              description: The price book version the figures came from.
            lines:
              type: array
              items:
                type: object
                additionalProperties: {}
              description: "One per resource ordered: line (linkedin | email | data), its count or packages, capacity, rate_minor, monthly_minor and invoice_minor (the amount per billing period)."
            monthly_minor:
              type: integer
              description: The recurring lines a month, before 12 + 2.
            recurring_invoice_minor:
              type: integer
              description: "The recurring invoice: the monthly sum, times 12 on annual."
            one_time_minor:
              type: integer
              description: The one-time credits line, paid once.
            due_now_minor:
              type: integer
              description: "The first payment before tax and coupons: the recurring invoice plus the one-time line."
            has_recurring:
              type: boolean
              description: false = one-time credits alone, which make no subscription.
            service_months:
              type: integer
              nullable: true
              description: 1, or 14 for 12 + 2; null when nothing recurs.
            grant_count:
              type: integer
              description: How many monthly credit grants the period pays for (1, or 14).
            credit_expiry_days:
              type: integer
              nullable: true
              description: "Days a granted lot lives: null = the credits live with the plan and burn when the workspace leaves it (an order that buys a plan, or credits bought alone under one); 90 for credits bought alone with no paid plan."
            capacity:
              type: object
              additionalProperties:
                type: number
              description: "What the order grants a workspace: linkedin_sender_profiles, email_inboxes, credits_per_month, whitelabel."
            service:
              type: object
              additionalProperties: {}
              description: level (free | paid | business | enterprise), next_level, next_threshold_minor and gap_minor a month to it; White label is part of Business.
            linkedin_next_tier:
              type: object
              nullable: true
              additionalProperties: {}
              description: "The next LinkedIn volume tier: accounts, add, capacity, total_minor, per_account_minor, savings_minor (negative = costlier in total); null at the package and above."
          required:
            - currency
            - period
            - book
            - lines
            - monthly_minor
            - recurring_invoice_minor
            - one_time_minor
            - due_now_minor
            - has_recurring
            - service_months
            - grant_count
            - credit_expiry_days
            - capacity
            - service
            - linkedin_next_tier
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - action
        - item
        - result
        - meta
    RenewSslCertificateResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - action
        action:
          type: string
        async:
          type: boolean
          enum:
            - true
        item:
          type: object
          nullable: true
          properties:
            sid:
              type: string
              description: Certificate sid (id_sc_...).
            team_sid:
              type: string
              description: The reseller team (ts_tm_...).
            domain:
              type: string
              description: The brand's host, lowercase FQDN.
            status:
              type: string
              enum:
                - pending
                - challenge
                - active
                - failed
                - expired
              description: pending = registered; challenge = a first issuance in flight; active = serving; failed; expired. A renewal of an active row keeps active.
            challenge:
              type: object
              nullable: true
              properties:
                type:
                  type: string
                  enum:
                    - http-01
                  description: The one challenge type served.
                token:
                  type: string
                  description: The ACME token the platform serves at well_known_path.
                key_authorization:
                  type: string
                  description: The key authorization the CA expects there.
                well_known_path:
                  type: string
                  description: The path the CA fetches on the domain.
                cname_target:
                  type: string
                  description: The platform host the domain's CNAME must point at.
                expires_at:
                  type: string
                  nullable: true
                  description: ISO 8601 UTC when the authorization lapses at the CA.
              required:
                - type
                - token
                - key_authorization
                - well_known_path
                - cname_target
                - expires_at
              description: The attempt in flight (first issuance or renewal); null when none.
            issuer:
              type: string
              nullable: true
              description: The CA that issued the serving certificate; null until one did.
            issued_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null until issued.
            expires_at:
              type: string
              nullable: true
              description: ISO 8601 UTC the serving certificate lapses; renewed 30 days ahead.
            last_error:
              type: string
              nullable: true
              description: "Why the last attempt failed, as a token: domain_not_pointed (fix the CNAME), domain_validation_failed (CAA or other DNS), issuance_unavailable (our side or the CA, contact support). null = none."
            created_by:
              type: object
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: Who registered the domain (the brand's activation).
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null = live.
          required:
            - sid
            - team_sid
            - domain
            - status
            - challenge
            - issuer
            - issued_at
            - expires_at
            - last_error
            - created_by
            - created_at
            - updated_at
            - deleted_at
        pending:
          type: array
          items:
            type: object
            properties:
              expected_completion_seconds:
                type: integer
                description: "120: the self-check, the validation and the finalize once the domain resolves."
              webhook_events:
                type: array
                items:
                  type: string
                description: "issue: ssl-certificates.issued, ssl-certificates.failed; renew: ssl-certificates.renewed, ssl-certificates.renewal-failed, ssl-certificates.failed."
              polling_hint:
                type: string
                description: "Poll get_ssl_certificate: after issue until status is active or failed; after renew until challenge is null."
            required:
              - expected_completion_seconds
              - webhook_events
              - polling_hint
          description: "One ref: the attempt in flight."
        result:
          type: object
          additionalProperties: {}
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - action
        - async
        - item
        - pending
        - result
        - meta
    ResendTeamMemberInvitationResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - action
        action:
          type: string
          description: kebab-case verb; matches the route segment.
        item:
          type: object
          nullable: true
          properties:
            sid:
              type: string
              description: Membership sid (ts_mb_...).
            team_sid:
              type: string
              description: The workspace (ts_tm_...).
            user_sid:
              type: string
              nullable: true
              description: The member's account (us_mb_...); null while the invite is pending.
            email:
              type: string
              description: The invited address.
            status:
              type: string
              enum:
                - invited
                - active
                - revoked
              description: invited = pending; active = a member; revoked = removed.
            permissions:
              type: array
              items:
                type: string
              description: The explicit token list the member holds, stored as sent (no floor is unioned in).
            account_sids:
              type: array
              nullable: true
              items:
                type: string
              description: The sender identities the member may see and use (ln_ac_...); null = every one of the workspace.
            created_by:
              type: object
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: Who invited.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null = live.
          required:
            - sid
            - team_sid
            - user_sid
            - email
            - status
            - permissions
            - account_sids
            - created_by
            - created_at
            - updated_at
            - deleted_at
        result:
          type: object
          properties:
            resent:
              type: boolean
              description: "true: the email went out again."
          required:
            - resent
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - action
        - item
        - result
        - meta
    ResumeBillingSubscriptionResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - action
        action:
          type: string
          description: kebab-case verb; matches the route segment.
        item:
          type: object
          nullable: true
          properties:
            sid:
              type: string
              description: Subscription sid (bl_sb_...).
            owner_user_sid:
              type: string
              description: "The buyer (us_mb_...): the one who manages the pool."
            team_sid:
              type: string
              nullable: true
              description: "Always null on this product: a subscription floats and allocations bind workspaces to it."
            paddle_subscription_id:
              type: string
              nullable: true
              description: Paddle's id (sub_...); null on an internal sentinel (the trial).
            status:
              type: string
              enum:
                - active
                - past_due
                - paused
                - canceled
              description: "active; past_due (a failed renewal: LinkedIn and email run 3 more days); paused; canceled (terminal)."
            collection_mode:
              type: string
              enum:
                - automatic
                - manual
              description: automatic = the card is charged; manual = invoiced (a sales deal) or the trial sentinel.
            price_sid:
              type: string
              description: The first line's price (bl_pc_...); the lines include says what each line is.
            quantity:
              type: integer
              description: "1 on a resource subscription: a line is one item of quantity 1."
            addons:
              type: array
              items:
                type: object
                properties:
                  product_sid:
                    type: string
                    description: The line's product (bl_pr_...).
                  price_sid:
                    type: string
                    description: The line's price (bl_pc_...), a non-catalog price of this order.
                  paddle_item_id:
                    type: string
                    nullable: true
                    description: Paddle's item id on the subscription; null on a sentinel.
                  quantity:
                    type: integer
                    description: "Always 1 on a resource subscription: a line is one item."
                  status:
                    type: string
                    enum:
                      - active
                      - canceled
                    description: canceled = the line grants nothing any more.
                required:
                  - product_sid
                  - price_sid
                  - paddle_item_id
                  - quantity
                  - status
              description: The other lines of the order, one item each.
            currency:
              type: string
              description: "ISO 4217: USD, EUR or GBP."
            current_period_starts_at:
              type: string
              nullable: true
              description: ISO 8601 UTC.
            current_period_ends_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; the trial's end on the sentinel.
            next_billed_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null when nothing is billed next.
            paused_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null unless paused.
            scheduled_resume_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null unless a resume is scheduled.
            scheduled_change:
              type: object
              nullable: true
              properties:
                action:
                  type: string
                  enum:
                    - cancel
                    - pause
                    - resume
                  description: What happens at effective_at.
                effective_at:
                  type: string
                  description: ISO 8601 UTC.
                resume_at:
                  type: string
                  nullable: true
                  description: "For a scheduled pause: when it resumes; null = open-ended."
              required:
                - action
                - effective_at
                - resume_at
              description: A cancel, pause or resume waiting for the period end; null = none.
            canceled_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null unless canceled.
            canceled_by:
              type: object
              nullable: true
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: Who canceled; null unless canceled by a person.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null = live.
          required:
            - sid
            - owner_user_sid
            - team_sid
            - paddle_subscription_id
            - status
            - collection_mode
            - price_sid
            - quantity
            - addons
            - currency
            - current_period_starts_at
            - current_period_ends_at
            - next_billed_at
            - paused_at
            - scheduled_resume_at
            - scheduled_change
            - canceled_at
            - canceled_by
            - created_at
            - updated_at
            - deleted_at
        result:
          type: object
          properties:
            resumed:
              type: boolean
              description: "false = nothing was paused or pause-scheduled: a success that changed nothing, no pending block."
            pending:
              type: object
              properties:
                expected_completion_seconds:
                  type: integer
                  description: "60: the resume webhook."
                webhook_events:
                  type: array
                  items:
                    type: string
                  description: "billing-subscriptions.activated: the event the transition back to active emits here."
                polling_hint:
                  type: string
                  description: Poll get_billing_subscription until status is active.
              required:
                - expected_completion_seconds
                - webhook_events
                - polling_hint
              description: Present only when resumed is true.
            updated_team:
              description: "Always null here: the workspaces re-derive active on the webhook, read through the allocations."
          required:
            - resumed
            - updated_team
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - action
        - item
        - result
        - meta
    RevokeGtmConnectionRequest:
      type: object
      description: Request body of `revoke_gtm_connection`.
      properties:
        scope:
          type: string
          description: "workspace (default: this row alone) or consent (every row of the same gtm grant)."
    RevokeGtmConnectionResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - action
        action:
          type: string
          description: kebab-case verb; matches the route segment.
        item:
          type: object
          nullable: true
          properties:
            sid:
              type: string
              description: Connection sid (gt_cn_...).
            team_sid:
              type: string
              description: The getsales workspace (ts_tm_...).
            mode:
              type: string
              description: managed = the GetSales Managed Workspace the platform runs for the team; linked = a person's own gtm-api workspace, one row per consent.
            status:
              type: string
              description: active | error (a token or provisioning failure that outlived its retries, see error_reason) | revoked.
            gtm_team_sid:
              type: string
              nullable: true
              description: The gtm-api workspace behind the row; several rows on one workspace (one per consenting member) render as one.
            label:
              type: string
              nullable: true
              description: The gtm workspace's name (GetSales Managed Workspace for the managed row).
            error_reason:
              type: string
              nullable: true
              description: Why the row is in error (not_a_member, linked_credential_unreadable, ...); null otherwise.
            gtm_user_email:
              type: string
              nullable: true
              description: Who connected a linked workspace (the consenting gtm user); null on the managed row.
            account_sids:
              type: array
              items:
                type: string
              description: The gtm account sids the team's sender profiles use through this row, as unibox last reported them.
            linked_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; when the consent completed; null on the managed row.
            created_at:
              type: string
              nullable: true
              description: ISO 8601 UTC.
          required:
            - sid
            - team_sid
            - mode
            - status
            - gtm_team_sid
            - label
            - error_reason
            - gtm_user_email
            - account_sids
            - linked_at
            - created_at
        result:
          type: object
          properties:
            revoked_connection_sids:
              type: array
              items:
                type: string
              description: The rows the call revoked (several under scope consent).
          required:
            - revoked_connection_sids
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - action
        - item
        - result
        - meta
    RevokeOauthAuthorizationResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - action
        action:
          type: string
          description: kebab-case verb; matches the route segment.
        item:
          type: object
          nullable: true
          properties:
            sid:
              type: string
              description: Grant sid (id_oa_...).
            user_sid:
              type: string
              description: The account that consented (us_mb_...).
            oauth_client_sid:
              type: string
              description: The connected app or agent (id_oc_...).
            team_scope_mode:
              type: string
              enum:
                - selected
                - all_my_teams
              description: selected = the listed workspaces; all_my_teams = every workspace the user is in, now and later.
            consented_team_sids:
              type: array
              items:
                type: string
              description: The workspaces in scope (ts_tm_...); empty under all_my_teams.
            permissions:
              type: array
              items:
                type: string
              description: What the app may do, inside the client's ceiling.
            status:
              type: string
              enum:
                - active
                - revoked
              description: active = tokens can be minted from it; revoked = disconnected.
            last_used_at:
              type: string
              nullable: true
              description: ISO 8601 UTC of the last token minted from the grant; null = never.
            created_at:
              type: string
              description: ISO 8601 UTC (connected since).
            updated_at:
              type: string
              description: ISO 8601 UTC.
          required:
            - sid
            - user_sid
            - oauth_client_sid
            - team_scope_mode
            - consented_team_sids
            - permissions
            - status
            - last_used_at
            - created_at
            - updated_at
        result:
          type: object
          properties:
            revoked_sessions:
              type: integer
              description: Installation tokens cut by this call.
            already_revoked:
              type: boolean
              description: "true: the grant was revoked before the call."
          required:
            - revoked_sessions
            - already_revoked
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - action
        - item
        - result
        - meta
    RevokeSessionResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - action
        action:
          type: string
          description: kebab-case verb; matches the route segment.
        item:
          type: object
          nullable: true
          properties:
            sid:
              type: string
              description: Session sid (id_se_...).
            team_sid:
              type: string
              description: The workspace the session is signed into (ts_tm_...).
            user_sid:
              type: string
              description: The account (us_mb_...).
            status:
              type: string
              enum:
                - active
                - revoked
                - expired
              description: active = the token is accepted; revoked | expired = it is not.
            kind:
              type: string
              enum:
                - login
                - oauth
              description: login = a browser or app sign-in; oauth = an installation token of a connected app or agent.
            oauth_client_sid:
              type: string
              nullable: true
              description: The OAuth client (id_oc_...) behind a kind oauth session; null on a login.
            oauth_authorization_sid:
              type: string
              nullable: true
              description: The grant (id_oa_...) the installation token was minted from; null on a login.
            device:
              type: string
              nullable: true
              description: The browser or client as reported at sign-in.
            ip_hash:
              type: string
              nullable: true
              description: A hash of the sign-in address, never the address.
            last_active_at:
              type: string
              description: ISO 8601 UTC; bumped lazily, about every 30 s, by requests to this service.
            expires_at:
              type: string
              description: ISO 8601 UTC; the refresh credential's end (14 days by default; about 15 minutes for an agent token).
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            is_current:
              type: boolean
              description: true on the row behind the calling token.
          required:
            - sid
            - team_sid
            - user_sid
            - status
            - kind
            - oauth_client_sid
            - oauth_authorization_sid
            - device
            - ip_hash
            - last_active_at
            - expires_at
            - created_at
            - updated_at
            - is_current
        result:
          type: object
          properties:
            already_revoked:
              type: boolean
              description: "true: the session was not active before the call."
            revoked_at:
              type: string
              nullable: true
              description: ISO 8601 UTC of the revoke; null when nothing changed.
          required:
            - already_revoked
            - revoked_at
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - action
        - item
        - result
        - meta
    RotateApiKeyRequest:
      type: object
      description: Request body of `rotate_api_key`.
      properties:
        grace_seconds:
          type: integer
          minimum: 0
          maximum: 604800
          description: 0..604800 (seven days); omit = 24 hours; 0 = the old secret dies at once.
    RotateApiKeyResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - action
        action:
          type: string
          description: kebab-case verb; matches the route segment.
        item:
          type: object
          nullable: true
          properties:
            sid:
              type: string
              description: API key sid (id_ak_...).
            team_sid:
              type: string
              description: The workspace the key acts as (ts_tm_...).
            name:
              type: string
              description: Human-readable name, unique among the team's live keys.
            token_prefix:
              type: string
              description: The first characters of the token (gs_live_...), for display.
            token_last4:
              type: string
              description: The last four characters of the token, for display.
            permissions:
              type: array
              items:
                type: string
              description: "What the key may do: the explicit token list."
            account_sids:
              type: array
              nullable: true
              items:
                type: string
              description: The key's sender slice (ln_ac_...), clamped to its issuer's; null = every account of the issuer's own slice.
            status:
              type: string
              enum:
                - active
                - revoked
                - expired
              description: active = verifies; revoked | expired = refused.
            expires_at:
              type: string
              nullable: true
              description: "ISO 8601 UTC; null = perpetual. Default at creation: three years."
            last_used_at:
              type: string
              nullable: true
              description: ISO 8601 UTC of the last verified call; null = never used.
            created_by:
              type: object
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: "The issuer: a person, or a parent key on delegation."
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; set with status revoked.
          required:
            - sid
            - team_sid
            - name
            - token_prefix
            - token_last4
            - permissions
            - account_sids
            - status
            - expires_at
            - last_used_at
            - created_by
            - created_at
            - updated_at
            - deleted_at
        result:
          type: object
          properties:
            plaintext_token:
              type: string
              description: The new secret, shown once.
            previous_token_expires_at:
              type: string
              nullable: true
              description: ISO 8601 UTC until which the old secret still verifies; null when it died at once.
          required:
            - plaintext_token
            - previous_token_expires_at
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - action
        - item
        - result
        - meta
    SearchApiKeysRequest:
      type: object
      description: Request body of `search_api_keys`.
      properties:
        filter:
          type: object
          properties:
            sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: Key sid(s).
            status:
              type: object
              properties:
                eq:
                  type: string
                  enum:
                    - active
                    - revoked
                    - expired
                ne:
                  type: string
                  enum:
                    - active
                    - revoked
                    - expired
                in:
                  type: array
                  items:
                    type: string
                    enum:
                      - active
                      - revoked
                      - expired
                nin:
                  type: array
                  items:
                    type: string
                    enum:
                      - active
                      - revoked
                      - expired
              additionalProperties: false
              description: active | revoked | expired.
            name:
              type: object
              properties:
                eq:
                  type: string
              additionalProperties: false
              description: Exact name.
            created_by_actor_sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: "Keys a teammate (us_mb_) or a parent key (id_ak_) issued: the offboarding slice."
            expires_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                gt:
                  type: string
                lt:
                  type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: is_null true = perpetual keys; a range = expiring between.
            last_used_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                gt:
                  type: string
                lt:
                  type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: is_null true = never used; lt = stale keys.
            created_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                gt:
                  type: string
                lt:
                  type: string
              additionalProperties: false
              description: ISO 8601 bounds.
            deleted_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: "Default scope is { is_null: true } (live rows)."
          description: "Field filters, ANDed: {field: {eq | ne | in | nin | gte | lte | gt | lt | is_null}}; q inside it is free text. Omit for every row."
        sort:
          type: object
          properties:
            field:
              type: string
              enum:
                - created_at
                - last_used_at
                - expires_at
                - name
              description: The column to order by.
            direction:
              type: string
              enum:
                - asc
                - desc
              description: asc or desc; default desc.
          required:
            - field
          description: One column and its direction; omit for the default order.
        page_size:
          type: integer
          minimum: 0
          maximum: 500
          description: 0..500, default 50; 0 = counts only, 1 = the first row.
        cursor:
          type: string
          nullable: true
          description: pagination.next_cursor of the previous page.
    SearchApiKeysResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - search
        items:
          type: array
          items:
            type: object
            properties:
              item:
                type: object
                properties:
                  sid:
                    type: string
                    description: API key sid (id_ak_...).
                  team_sid:
                    type: string
                    description: The workspace the key acts as (ts_tm_...).
                  name:
                    type: string
                    description: Human-readable name, unique among the team's live keys.
                  token_prefix:
                    type: string
                    description: The first characters of the token (gs_live_...), for display.
                  token_last4:
                    type: string
                    description: The last four characters of the token, for display.
                  permissions:
                    type: array
                    items:
                      type: string
                    description: "What the key may do: the explicit token list."
                  account_sids:
                    type: array
                    nullable: true
                    items:
                      type: string
                    description: The key's sender slice (ln_ac_...), clamped to its issuer's; null = every account of the issuer's own slice.
                  status:
                    type: string
                    enum:
                      - active
                      - revoked
                      - expired
                    description: active = verifies; revoked | expired = refused.
                  expires_at:
                    type: string
                    nullable: true
                    description: "ISO 8601 UTC; null = perpetual. Default at creation: three years."
                  last_used_at:
                    type: string
                    nullable: true
                    description: ISO 8601 UTC of the last verified call; null = never used.
                  created_by:
                    type: object
                    properties:
                      actor_type:
                        type: string
                        enum:
                          - user
                          - support
                          - api_key
                          - system
                          - agent
                      actor_sid:
                        type: string
                        nullable: true
                      team_sid:
                        type: string
                      actor_name:
                        type: string
                        nullable: true
                        description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                      oauth_client_sid:
                        type: string
                        nullable: true
                        description: The acting OAuth client (id_oc_*); null off the OAuth path.
                      reason:
                        type: string
                        nullable: true
                        description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                      permissions:
                        type: object
                        additionalProperties: {}
                        description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                      cluster_id:
                        type: integer
                        nullable: true
                        description: "Internal audit context: the cluster that served the write."
                      trace_id:
                        type: string
                        nullable: true
                        description: "Internal audit context: the trace id of the request that wrote the row."
                    required:
                      - actor_type
                      - actor_sid
                      - team_sid
                      - permissions
                    description: "The issuer: a person, or a parent key on delegation."
                  created_at:
                    type: string
                    description: ISO 8601 UTC.
                  updated_at:
                    type: string
                    description: ISO 8601 UTC.
                  deleted_at:
                    type: string
                    nullable: true
                    description: ISO 8601 UTC; set with status revoked.
                required:
                  - sid
                  - team_sid
                  - name
                  - token_prefix
                  - token_last4
                  - permissions
                  - account_sids
                  - status
                  - expires_at
                  - last_used_at
                  - created_by
                  - created_at
                  - updated_at
                  - deleted_at
              included:
                type: object
                additionalProperties: {}
            required:
              - item
              - included
        pagination:
          type: object
          properties:
            next_cursor:
              type: string
              nullable: true
            has_more:
              type: boolean
            total_count:
              type: integer
              nullable: true
          required:
            - next_cursor
            - has_more
            - total_count
        applied_filters:
          type: object
          additionalProperties: {}
        includes:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
        counts:
          type: object
          properties:
            total_count:
              type: number
              description: Keys matching the filter.
            groups:
              type: object
              additionalProperties: {}
              description: "status: the count per status."
          required:
            - total_count
            - groups
      required:
        - success
        - operation
        - items
        - pagination
        - applied_filters
        - includes
        - meta
    SearchBillingProductsRequest:
      type: object
      description: Request body of `search_billing_products`.
      properties:
        filter:
          type: object
          properties:
            q:
              type: string
              maxLength: 255
              description: Infix match over name and slug.
            sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: Product sid(s).
            paddle_product_id:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: Paddle's product id.
            slug:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: data-credits | linkedin-sender-profiles | email-inboxes.
            type:
              type: object
              properties:
                eq:
                  type: string
                  enum:
                    - plan
                    - addon
                    - credits_pack
                ne:
                  type: string
                  enum:
                    - plan
                    - addon
                    - credits_pack
                in:
                  type: array
                  items:
                    type: string
                    enum:
                      - plan
                      - addon
                      - credits_pack
                nin:
                  type: array
                  items:
                    type: string
                    enum:
                      - plan
                      - addon
                      - credits_pack
              additionalProperties: false
              description: plan | addon | credits_pack.
            is_active:
              type: object
              properties:
                eq:
                  type: boolean
              additionalProperties: false
              description: true = the live catalog.
            created_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                gt:
                  type: string
                lt:
                  type: string
              additionalProperties: false
              description: ISO 8601 bounds.
            updated_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                gt:
                  type: string
                lt:
                  type: string
              additionalProperties: false
              description: ISO 8601 bounds.
            deleted_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: "Default scope is { is_null: true }."
          description: "Field filters, ANDed: {field: {eq | ne | in | nin | gte | lte | gt | lt | is_null}}; q inside it is free text. Omit for every row."
        include:
          type: array
          items:
            type: string
            enum:
              - prices
          description: Relations to attach to every item; omit for the bare rows.
        sort:
          type: object
          properties:
            field:
              type: string
              enum:
                - updated_at
                - created_at
                - slug
              description: The column to order by.
            direction:
              type: string
              enum:
                - asc
                - desc
              description: asc or desc; default desc.
          required:
            - field
          description: One column and its direction; omit for the default order.
        page_size:
          type: integer
          minimum: 0
          maximum: 500
          description: 0..500, default 50; 0 = counts only, 1 = the first row.
        cursor:
          type: string
          nullable: true
          description: pagination.next_cursor of the previous page.
    SearchBillingProductsResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - search
        items:
          type: array
          items:
            type: object
            properties:
              item:
                type: object
                properties:
                  sid:
                    type: string
                    description: Product sid (bl_pr_...).
                  paddle_product_id:
                    type: string
                    nullable: true
                    description: Paddle's id of the product (pro_...); null on an internal sentinel.
                  name:
                    type: string
                    description: Display name.
                  slug:
                    type: string
                    description: data-credits, linkedin-sender-profiles, email-inboxes; the archived seats catalog (linkedin-seat, email-seat, credits, whitelabel) is inactive.
                  type:
                    type: string
                    enum:
                      - plan
                      - addon
                      - credits_pack
                    description: plan = LinkedIn sender profiles; addon = email inbox capacity; credits_pack = data credits.
                  limits:
                    type: object
                    properties:
                      linkedin_sender_profiles:
                        type: integer
                        description: "0 on this product: the line's price carries the accounts."
                      email_inboxes:
                        type: integer
                        description: "0 on this product: the line's price carries the inboxes."
                      credits_per_month:
                        type: integer
                        description: "0 on this product: the line's price carries the credits."
                      linkedin_seats:
                        type: integer
                        description: Retired on 2026-10-25, 0.
                      email_seats:
                        type: integer
                        description: Retired on 2026-10-25, 0.
                      credits_per_period:
                        type: integer
                        description: Retired on 2026-10-25, 0.
                      whitelabel:
                        type: integer
                        description: "0: White label is part of the Business service level, not a line."
                      accounts:
                        type: integer
                        description: A gtm key, 0 on this product.
                      cloud_browser:
                        type: integer
                        description: A gtm key, 0 on this product.
                      webhooks:
                        type: integer
                        description: A gtm key, 0 on this product.
                    required:
                      - linkedin_seats
                      - email_seats
                      - credits_per_period
                      - whitelabel
                    description: What one unit grants.
                  is_active:
                    type: boolean
                    description: false = no longer sold.
                  visibility:
                    type: string
                    nullable: true
                    enum:
                      - public
                      - private
                    description: public = listed to buyers; private = only by a direct offer.
                  created_at:
                    type: string
                    description: ISO 8601 UTC.
                  updated_at:
                    type: string
                    description: ISO 8601 UTC.
                  deleted_at:
                    type: string
                    nullable: true
                    description: ISO 8601 UTC; null = live.
                required:
                  - sid
                  - paddle_product_id
                  - name
                  - slug
                  - type
                  - limits
                  - is_active
                  - visibility
                  - created_at
                  - updated_at
                  - deleted_at
              included:
                type: object
                additionalProperties: {}
            required:
              - item
              - included
        pagination:
          type: object
          properties:
            next_cursor:
              type: string
              nullable: true
            has_more:
              type: boolean
            total_count:
              type: integer
              nullable: true
          required:
            - next_cursor
            - has_more
            - total_count
        applied_filters:
          type: object
          additionalProperties: {}
        includes:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
        counts:
          type: object
          properties:
            total_count:
              type: number
              description: Products matching the filter.
            groups:
              type: object
              additionalProperties: {}
              description: "type and is_active: the count per value."
          required:
            - total_count
            - groups
      required:
        - success
        - operation
        - items
        - pagination
        - applied_filters
        - includes
        - meta
    SearchBillingSubscriptionsRequest:
      type: object
      description: Request body of `search_billing_subscriptions`.
      properties:
        filter:
          type: object
          properties:
            sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: Subscription sid(s).
            owner_user_sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: The buyer.
            team_sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: Always null here; kept for the shared contract.
            paddle_subscription_id:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: is_null true = the internal sentinels (the trial).
            status:
              type: object
              properties:
                eq:
                  type: string
                  enum:
                    - active
                    - past_due
                    - paused
                    - canceled
                ne:
                  type: string
                  enum:
                    - active
                    - past_due
                    - paused
                    - canceled
                in:
                  type: array
                  items:
                    type: string
                    enum:
                      - active
                      - past_due
                      - paused
                      - canceled
                nin:
                  type: array
                  items:
                    type: string
                    enum:
                      - active
                      - past_due
                      - paused
                      - canceled
              additionalProperties: false
              description: active | past_due | paused | canceled.
            collection_mode:
              type: object
              properties:
                eq:
                  type: string
                  enum:
                    - automatic
                    - manual
                in:
                  type: array
                  items:
                    type: string
                    enum:
                      - automatic
                      - manual
              additionalProperties: false
              description: automatic | manual.
            price_sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: The first line's price.
            current_period_ends_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                gt:
                  type: string
                lt:
                  type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: Expiry window.
            next_billed_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                gt:
                  type: string
                lt:
                  type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: ISO 8601 bounds.
            canceled_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: ISO 8601 bounds.
            created_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                gt:
                  type: string
                lt:
                  type: string
              additionalProperties: false
              description: ISO 8601 bounds.
            updated_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                gt:
                  type: string
                lt:
                  type: string
              additionalProperties: false
              description: ISO 8601 bounds.
            deleted_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: "Default scope is { is_null: true }."
          description: "Field filters, ANDed: {field: {eq | ne | in | nin | gte | lte | gt | lt | is_null}}; q inside it is free text. Omit for every row."
        include:
          type: array
          items:
            type: string
            enum:
              - price
              - product
              - team
              - latest_transactions
              - lines
          description: Relations to attach to every item; omit for the bare rows.
        sort:
          type: object
          properties:
            field:
              type: string
              enum:
                - created_at
                - updated_at
                - current_period_ends_at
              description: The column to order by.
            direction:
              type: string
              enum:
                - asc
                - desc
              description: asc or desc; default desc.
          required:
            - field
          description: One column and its direction; omit for the default order.
        page_size:
          type: integer
          minimum: 0
          maximum: 500
          description: 0..500, default 50; 0 = counts only, 1 = the first row.
        cursor:
          type: string
          nullable: true
          description: pagination.next_cursor of the previous page.
    SearchBillingSubscriptionsResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - search
        items:
          type: array
          items:
            type: object
            properties:
              item:
                type: object
                properties:
                  sid:
                    type: string
                    description: Subscription sid (bl_sb_...).
                  owner_user_sid:
                    type: string
                    description: "The buyer (us_mb_...): the one who manages the pool."
                  team_sid:
                    type: string
                    nullable: true
                    description: "Always null on this product: a subscription floats and allocations bind workspaces to it."
                  paddle_subscription_id:
                    type: string
                    nullable: true
                    description: Paddle's id (sub_...); null on an internal sentinel (the trial).
                  status:
                    type: string
                    enum:
                      - active
                      - past_due
                      - paused
                      - canceled
                    description: "active; past_due (a failed renewal: LinkedIn and email run 3 more days); paused; canceled (terminal)."
                  collection_mode:
                    type: string
                    enum:
                      - automatic
                      - manual
                    description: automatic = the card is charged; manual = invoiced (a sales deal) or the trial sentinel.
                  price_sid:
                    type: string
                    description: The first line's price (bl_pc_...); the lines include says what each line is.
                  quantity:
                    type: integer
                    description: "1 on a resource subscription: a line is one item of quantity 1."
                  addons:
                    type: array
                    items:
                      type: object
                      properties:
                        product_sid:
                          type: string
                          description: The line's product (bl_pr_...).
                        price_sid:
                          type: string
                          description: The line's price (bl_pc_...), a non-catalog price of this order.
                        paddle_item_id:
                          type: string
                          nullable: true
                          description: Paddle's item id on the subscription; null on a sentinel.
                        quantity:
                          type: integer
                          description: "Always 1 on a resource subscription: a line is one item."
                        status:
                          type: string
                          enum:
                            - active
                            - canceled
                          description: canceled = the line grants nothing any more.
                      required:
                        - product_sid
                        - price_sid
                        - paddle_item_id
                        - quantity
                        - status
                    description: The other lines of the order, one item each.
                  currency:
                    type: string
                    description: "ISO 4217: USD, EUR or GBP."
                  current_period_starts_at:
                    type: string
                    nullable: true
                    description: ISO 8601 UTC.
                  current_period_ends_at:
                    type: string
                    nullable: true
                    description: ISO 8601 UTC; the trial's end on the sentinel.
                  next_billed_at:
                    type: string
                    nullable: true
                    description: ISO 8601 UTC; null when nothing is billed next.
                  paused_at:
                    type: string
                    nullable: true
                    description: ISO 8601 UTC; null unless paused.
                  scheduled_resume_at:
                    type: string
                    nullable: true
                    description: ISO 8601 UTC; null unless a resume is scheduled.
                  scheduled_change:
                    type: object
                    nullable: true
                    properties:
                      action:
                        type: string
                        enum:
                          - cancel
                          - pause
                          - resume
                        description: What happens at effective_at.
                      effective_at:
                        type: string
                        description: ISO 8601 UTC.
                      resume_at:
                        type: string
                        nullable: true
                        description: "For a scheduled pause: when it resumes; null = open-ended."
                    required:
                      - action
                      - effective_at
                      - resume_at
                    description: A cancel, pause or resume waiting for the period end; null = none.
                  canceled_at:
                    type: string
                    nullable: true
                    description: ISO 8601 UTC; null unless canceled.
                  canceled_by:
                    type: object
                    nullable: true
                    properties:
                      actor_type:
                        type: string
                        enum:
                          - user
                          - support
                          - api_key
                          - system
                          - agent
                      actor_sid:
                        type: string
                        nullable: true
                      team_sid:
                        type: string
                      actor_name:
                        type: string
                        nullable: true
                        description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                      oauth_client_sid:
                        type: string
                        nullable: true
                        description: The acting OAuth client (id_oc_*); null off the OAuth path.
                      reason:
                        type: string
                        nullable: true
                        description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                      permissions:
                        type: object
                        additionalProperties: {}
                        description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                      cluster_id:
                        type: integer
                        nullable: true
                        description: "Internal audit context: the cluster that served the write."
                      trace_id:
                        type: string
                        nullable: true
                        description: "Internal audit context: the trace id of the request that wrote the row."
                    required:
                      - actor_type
                      - actor_sid
                      - team_sid
                      - permissions
                    description: Who canceled; null unless canceled by a person.
                  created_at:
                    type: string
                    description: ISO 8601 UTC.
                  updated_at:
                    type: string
                    description: ISO 8601 UTC.
                  deleted_at:
                    type: string
                    nullable: true
                    description: ISO 8601 UTC; null = live.
                required:
                  - sid
                  - owner_user_sid
                  - team_sid
                  - paddle_subscription_id
                  - status
                  - collection_mode
                  - price_sid
                  - quantity
                  - addons
                  - currency
                  - current_period_starts_at
                  - current_period_ends_at
                  - next_billed_at
                  - paused_at
                  - scheduled_resume_at
                  - scheduled_change
                  - canceled_at
                  - canceled_by
                  - created_at
                  - updated_at
                  - deleted_at
              included:
                type: object
                additionalProperties: {}
            required:
              - item
              - included
        pagination:
          type: object
          properties:
            next_cursor:
              type: string
              nullable: true
            has_more:
              type: boolean
            total_count:
              type: integer
              nullable: true
          required:
            - next_cursor
            - has_more
            - total_count
        applied_filters:
          type: object
          additionalProperties: {}
        includes:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
        counts:
          type: object
          properties:
            total_count:
              type: number
              description: Subscriptions matching the filter.
            groups:
              type: object
              additionalProperties: {}
              description: "status and collection_mode: the count per value."
          required:
            - total_count
            - groups
      required:
        - success
        - operation
        - items
        - pagination
        - applied_filters
        - includes
        - meta
    SearchBillingTransactionsRequest:
      type: object
      description: Request body of `search_billing_transactions`.
      properties:
        filter:
          type: object
          properties:
            sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: Transaction sid(s).
            owner_user_sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: The buyer.
            team_sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: The notified workspace.
            subscription_sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: One subscription's charges.
            paddle_transaction_id:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: Paddle's id.
            invoice_number:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: Locate one invoice; is_null false = the rows with a PDF.
            status:
              type: object
              properties:
                eq:
                  type: string
                  enum:
                    - billed
                    - paid
                    - completed
                    - past_due
                    - canceled
                ne:
                  type: string
                  enum:
                    - billed
                    - paid
                    - completed
                    - past_due
                    - canceled
                in:
                  type: array
                  items:
                    type: string
                    enum:
                      - billed
                      - paid
                      - completed
                      - past_due
                      - canceled
                nin:
                  type: array
                  items:
                    type: string
                    enum:
                      - billed
                      - paid
                      - completed
                      - past_due
                      - canceled
              additionalProperties: false
              description: billed | paid | completed | past_due | canceled.
            origin:
              type: object
              properties:
                eq:
                  type: string
                  enum:
                    - subscription_charge
                    - subscription_update
                    - one_time
                ne:
                  type: string
                  enum:
                    - subscription_charge
                    - subscription_update
                    - one_time
                in:
                  type: array
                  items:
                    type: string
                    enum:
                      - subscription_charge
                      - subscription_update
                      - one_time
                nin:
                  type: array
                  items:
                    type: string
                    enum:
                      - subscription_charge
                      - subscription_update
                      - one_time
              additionalProperties: false
              description: subscription_charge | subscription_update | one_time.
            collection_mode:
              type: object
              properties:
                eq:
                  type: string
                  enum:
                    - automatic
                    - manual
                ne:
                  type: string
                  enum:
                    - automatic
                    - manual
                in:
                  type: array
                  items:
                    type: string
                    enum:
                      - automatic
                      - manual
              additionalProperties: false
              description: automatic | manual.
            currency:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: ISO 4217.
            billed_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                gt:
                  type: string
                lt:
                  type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: ISO 8601 bounds.
            created_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                gt:
                  type: string
                lt:
                  type: string
              additionalProperties: false
              description: ISO 8601 bounds.
          description: "Field filters, ANDed: {field: {eq | ne | in | nin | gte | lte | gt | lt | is_null}}; q inside it is free text. Omit for every row."
        include:
          type: array
          items:
            type: string
            enum:
              - subscription
              - owner
              - team
          description: Relations to attach to every item; omit for the bare rows.
        sort:
          type: object
          properties:
            field:
              type: string
              enum:
                - billed_at
                - created_at
                - total
              description: The column to order by.
            direction:
              type: string
              enum:
                - asc
                - desc
              description: asc or desc; default desc.
          required:
            - field
          description: One column and its direction; omit for the default order.
        page_size:
          type: integer
          minimum: 0
          maximum: 500
          description: 0..500, default 50; 0 = counts only, 1 = the first row.
        cursor:
          type: string
          nullable: true
          description: pagination.next_cursor of the previous page.
    SearchBillingTransactionsResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - search
        items:
          type: array
          items:
            type: object
            properties:
              item:
                type: object
                properties:
                  sid:
                    type: string
                    description: Transaction sid (bl_tx_...).
                  owner_user_sid:
                    type: string
                    description: The buyer (us_mb_...).
                  team_sid:
                    type: string
                    nullable: true
                    description: The workspace notified of it at ingestion (the first allocated one); null when none.
                  subscription_sid:
                    type: string
                    nullable: true
                    description: The subscription charged (bl_sb_...); attached on a later event when the charge came first.
                  paddle_transaction_id:
                    type: string
                    description: Paddle's id (txn_...).
                  status:
                    type: string
                    enum:
                      - billed
                      - paid
                      - completed
                      - past_due
                      - canceled
                    description: billed, paid, completed, past_due or canceled, as Paddle reports it.
                  origin:
                    type: string
                    enum:
                      - subscription_charge
                      - subscription_update
                      - one_time
                    description: subscription_charge (a period's charge, the first checkout included), subscription_update (a proration), one_time.
                  collection_mode:
                    type: string
                    enum:
                      - automatic
                      - manual
                    description: automatic = charged to the card; manual = invoiced.
                  invoice_number:
                    type: string
                    nullable: true
                    description: Paddle's invoice number; the rows that carry one have a PDF.
                  total:
                    type: string
                    description: The total as a decimal string in currency.
                  tax:
                    type: string
                    nullable: true
                    description: The tax part as a decimal string; null when unknown.
                  currency:
                    type: string
                    description: ISO 4217.
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        price_sid:
                          type: string
                          nullable: true
                          description: The price charged (bl_pc_...); null when Paddle named one we do not mirror.
                        product_sid:
                          type: string
                          nullable: true
                          description: The product (bl_pr_...).
                        product_type:
                          type: string
                          enum:
                            - plan
                            - addon
                            - credits_pack
                          description: plan | addon | credits_pack.
                        quantity:
                          type: integer
                          description: Units charged.
                        unit_amount:
                          type: string
                          description: The unit price as a decimal string.
                        paddle_price_id:
                          type: string
                          nullable: true
                          description: Paddle's price id.
                      required:
                        - price_sid
                        - product_sid
                        - product_type
                        - quantity
                        - unit_amount
                        - paddle_price_id
                    description: The frozen line items of the charge.
                  billed_at:
                    type: string
                    nullable: true
                    description: ISO 8601 UTC; null until billed.
                  created_at:
                    type: string
                    description: ISO 8601 UTC.
                  updated_at:
                    type: string
                    description: ISO 8601 UTC.
                required:
                  - sid
                  - owner_user_sid
                  - team_sid
                  - subscription_sid
                  - paddle_transaction_id
                  - status
                  - origin
                  - collection_mode
                  - invoice_number
                  - total
                  - tax
                  - currency
                  - items
                  - billed_at
                  - created_at
                  - updated_at
              included:
                type: object
                additionalProperties: {}
            required:
              - item
              - included
        pagination:
          type: object
          properties:
            next_cursor:
              type: string
              nullable: true
            has_more:
              type: boolean
            total_count:
              type: integer
              nullable: true
          required:
            - next_cursor
            - has_more
            - total_count
        applied_filters:
          type: object
          additionalProperties: {}
        includes:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
        counts:
          type: object
          properties:
            total_count:
              type: number
              description: Transactions matching the filter.
            groups:
              type: object
              additionalProperties: {}
              description: "status, origin, collection_mode and currency: the count per value."
          required:
            - total_count
            - groups
      required:
        - success
        - operation
        - items
        - pagination
        - applied_filters
        - includes
        - meta
    SearchGtmConnectionsResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - search
        items:
          type: array
          items:
            type: object
            properties:
              item:
                type: object
                properties:
                  sid:
                    type: string
                    description: Connection sid (gt_cn_...).
                  team_sid:
                    type: string
                    description: The getsales workspace (ts_tm_...).
                  mode:
                    type: string
                    description: managed = the GetSales Managed Workspace the platform runs for the team; linked = a person's own gtm-api workspace, one row per consent.
                  status:
                    type: string
                    description: active | error (a token or provisioning failure that outlived its retries, see error_reason) | revoked.
                  gtm_team_sid:
                    type: string
                    nullable: true
                    description: The gtm-api workspace behind the row; several rows on one workspace (one per consenting member) render as one.
                  label:
                    type: string
                    nullable: true
                    description: The gtm workspace's name (GetSales Managed Workspace for the managed row).
                  error_reason:
                    type: string
                    nullable: true
                    description: Why the row is in error (not_a_member, linked_credential_unreadable, ...); null otherwise.
                  gtm_user_email:
                    type: string
                    nullable: true
                    description: Who connected a linked workspace (the consenting gtm user); null on the managed row.
                  account_sids:
                    type: array
                    items:
                      type: string
                    description: The gtm account sids the team's sender profiles use through this row, as unibox last reported them.
                  linked_at:
                    type: string
                    nullable: true
                    description: ISO 8601 UTC; when the consent completed; null on the managed row.
                  created_at:
                    type: string
                    nullable: true
                    description: ISO 8601 UTC.
                required:
                  - sid
                  - team_sid
                  - mode
                  - status
                  - gtm_team_sid
                  - label
                  - error_reason
                  - gtm_user_email
                  - account_sids
                  - linked_at
                  - created_at
              included:
                type: object
                additionalProperties: {}
            required:
              - item
              - included
        pagination:
          type: object
          properties:
            next_cursor:
              type: string
              nullable: true
            has_more:
              type: boolean
            total_count:
              type: integer
              nullable: true
          required:
            - next_cursor
            - has_more
            - total_count
        applied_filters:
          type: object
          additionalProperties: {}
        includes:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
        counts:
          type: object
          additionalProperties: {}
      required:
        - success
        - operation
        - items
        - pagination
        - applied_filters
        - includes
        - meta
    SearchNotificationsRequest:
      type: object
      description: Request body of `search_notifications`.
      properties:
        filter:
          type: object
          properties:
            sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: Notification sid(s).
            team_sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: Scoped by the token; an explicit value only for support.
            user_sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: The recipient.
            event_name:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: The producing event, e.g. website-sites.broken.
            read_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                gt:
                  type: string
                lt:
                  type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: is_null true = unread.
            entity_sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: The row the notice is about.
            status:
              type: object
              properties:
                eq:
                  type: string
                  enum:
                    - pending
                    - delivered
                    - failed
                in:
                  type: array
                  items:
                    type: string
                    enum:
                      - pending
                      - delivered
                      - failed
              additionalProperties: false
              description: pending | delivered | failed.
            channel:
              type: object
              properties:
                eq:
                  type: string
                  enum:
                    - email
                    - in_app
              additionalProperties: false
              description: email | in_app.
            scheduled_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                gt:
                  type: string
                lt:
                  type: string
              additionalProperties: false
              description: ISO 8601 bounds.
            delivered_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: is_null true = not delivered yet.
            failed_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: ISO 8601 bounds; is_null true = never failed.
            created_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                gt:
                  type: string
                lt:
                  type: string
              additionalProperties: false
              description: ISO 8601 bounds.
            deleted_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: "Default scope is { is_null: true } (undismissed rows)."
          description: "Field filters, ANDed: {field: {eq | ne | in | nin | gte | lte | gt | lt | is_null}}; q inside it is free text. Omit for every row."
        sort:
          type: object
          properties:
            field:
              type: string
              enum:
                - created_at
                - scheduled_at
                - delivered_at
              description: The column to order by.
            direction:
              type: string
              enum:
                - asc
                - desc
              description: asc or desc; default desc.
          required:
            - field
          description: One column and its direction; omit for the default order.
        page_size:
          type: integer
          minimum: 0
          maximum: 500
          description: 0..500, default 50; 0 = counts only, 1 = the first row.
        cursor:
          type: string
          nullable: true
          description: pagination.next_cursor of the previous page.
    SearchNotificationsResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - search
        items:
          type: array
          items:
            type: object
            properties:
              item:
                type: object
                properties:
                  sid:
                    type: string
                    description: Notification sid (id_nt_...).
                  team_sid:
                    type: string
                    description: The workspace the notice is about (ts_tm_...).
                  user_sid:
                    type: string
                    nullable: true
                    description: The recipient (us_mb_...); null for a cold address (an invite).
                  event_name:
                    type: string
                    description: The domain event that produced it (team-members.invited, ssl-certificates.expiring, ...).
                  event_sid:
                    type: string
                    description: The event instance; two channels of one event share it.
                  entity_sid:
                    type: string
                    nullable: true
                    description: The row the notice is about (a site, a person, a certificate); null when none.
                  channel:
                    type: string
                    enum:
                      - email
                      - in_app
                    description: email = sent through SendGrid; in_app = a line of the bell feed.
                  status:
                    type: string
                    enum:
                      - pending
                      - delivered
                      - failed
                    description: pending = not sent yet; delivered; failed (see failure_reason). An in_app row is delivered at insert.
                  subject:
                    type: string
                    description: The subject, or the feed line.
                  body_html:
                    type: string
                    description: The rendered HTML body (get only).
                  body_text:
                    type: string
                    description: The rendered text body (get only).
                  rate_limit_bucket:
                    type: string
                    description: "The dedup bucket: event, entity, hour and channel."
                  scheduled_at:
                    type: string
                    description: ISO 8601 UTC when the delivery was due.
                  delivered_at:
                    type: string
                    nullable: true
                    description: ISO 8601 UTC; null until delivered.
                  read_at:
                    type: string
                    nullable: true
                    description: ISO 8601 UTC when the recipient read an in_app row; null = unread, and always null on an email.
                  failed_at:
                    type: string
                    nullable: true
                    description: ISO 8601 UTC; null unless failed.
                  failure_reason:
                    type: string
                    nullable: true
                    description: Why the delivery failed (delivery_not_configured, a provider error); null otherwise.
                  retry_count:
                    type: integer
                    description: Delivery attempts so far (up to 5).
                  created_by:
                    type: object
                    properties:
                      actor_type:
                        type: string
                        enum:
                          - user
                          - support
                          - api_key
                          - system
                          - agent
                      actor_sid:
                        type: string
                        nullable: true
                      team_sid:
                        type: string
                      actor_name:
                        type: string
                        nullable: true
                        description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                      oauth_client_sid:
                        type: string
                        nullable: true
                        description: The acting OAuth client (id_oc_*); null off the OAuth path.
                      reason:
                        type: string
                        nullable: true
                        description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                      permissions:
                        type: object
                        additionalProperties: {}
                        description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                      cluster_id:
                        type: integer
                        nullable: true
                        description: "Internal audit context: the cluster that served the write."
                      trace_id:
                        type: string
                        nullable: true
                        description: "Internal audit context: the trace id of the request that wrote the row."
                    required:
                      - actor_type
                      - actor_sid
                      - team_sid
                      - permissions
                    description: The actor behind the event, usually system.
                  created_at:
                    type: string
                    description: ISO 8601 UTC.
                  updated_at:
                    type: string
                    description: ISO 8601 UTC.
                  deleted_at:
                    type: string
                    nullable: true
                    description: ISO 8601 UTC when the recipient dismissed it; null = in the feed.
                required:
                  - sid
                  - team_sid
                  - user_sid
                  - event_name
                  - event_sid
                  - entity_sid
                  - channel
                  - status
                  - subject
                  - rate_limit_bucket
                  - scheduled_at
                  - delivered_at
                  - read_at
                  - failed_at
                  - failure_reason
                  - retry_count
                  - created_by
                  - created_at
                  - updated_at
                  - deleted_at
              included:
                type: object
                additionalProperties: {}
            required:
              - item
              - included
        pagination:
          type: object
          properties:
            next_cursor:
              type: string
              nullable: true
            has_more:
              type: boolean
            total_count:
              type: integer
              nullable: true
          required:
            - next_cursor
            - has_more
            - total_count
        applied_filters:
          type: object
          additionalProperties: {}
        includes:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
        counts:
          type: object
          properties:
            total_count:
              type: number
              description: Rows matching the filter.
            groups:
              type: object
              additionalProperties: {}
              description: "status, event_name and channel: the count per value."
          required:
            - total_count
            - groups
      required:
        - success
        - operation
        - items
        - pagination
        - applied_filters
        - includes
        - meta
    SearchOauthAuthorizationsRequest:
      type: object
      description: Request body of `search_oauth_authorizations`.
      properties:
        filter:
          type: object
          properties:
            oauth_client_sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: One connected client.
            status:
              type: object
              properties:
                eq:
                  type: string
                  enum:
                    - active
                    - revoked
                in:
                  type: array
                  items:
                    type: string
                    enum:
                      - active
                      - revoked
              additionalProperties: false
              description: active, or revoked for history.
            team_scope_mode:
              type: object
              properties:
                eq:
                  type: string
                  enum:
                    - selected
                    - all_my_teams
              additionalProperties: false
              description: selected | all_my_teams.
            created_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
              additionalProperties: false
              description: Connected-since window.
            last_used_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: is_null true = never used; a range = recently active.
          description: "Field filters, ANDed: {field: {eq | ne | in | nin | gte | lte | gt | lt | is_null}}; q inside it is free text. Omit for every row."
        include:
          type: array
          items:
            type: string
            enum:
              - client
              - teams
              - active_sessions
          description: Relations to attach to every item; omit for the bare rows.
        sort:
          type: object
          properties:
            field:
              type: string
              enum:
                - created_at
                - last_used_at
              description: The column to order by.
            direction:
              type: string
              enum:
                - asc
                - desc
              description: asc or desc; default desc.
          required:
            - field
          description: One column and its direction; omit for the default order.
        page_size:
          type: integer
          minimum: 0
          maximum: 500
          description: 0..500, default 50; 0 = counts only, 1 = the first row.
        cursor:
          type: string
          nullable: true
          description: pagination.next_cursor of the previous page.
    SearchOauthAuthorizationsResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - search
        items:
          type: array
          items:
            type: object
            properties:
              item:
                type: object
                properties:
                  sid:
                    type: string
                    description: Grant sid (id_oa_...).
                  user_sid:
                    type: string
                    description: The account that consented (us_mb_...).
                  oauth_client_sid:
                    type: string
                    description: The connected app or agent (id_oc_...).
                  team_scope_mode:
                    type: string
                    enum:
                      - selected
                      - all_my_teams
                    description: selected = the listed workspaces; all_my_teams = every workspace the user is in, now and later.
                  consented_team_sids:
                    type: array
                    items:
                      type: string
                    description: The workspaces in scope (ts_tm_...); empty under all_my_teams.
                  permissions:
                    type: array
                    items:
                      type: string
                    description: What the app may do, inside the client's ceiling.
                  status:
                    type: string
                    enum:
                      - active
                      - revoked
                    description: active = tokens can be minted from it; revoked = disconnected.
                  last_used_at:
                    type: string
                    nullable: true
                    description: ISO 8601 UTC of the last token minted from the grant; null = never.
                  created_at:
                    type: string
                    description: ISO 8601 UTC (connected since).
                  updated_at:
                    type: string
                    description: ISO 8601 UTC.
                required:
                  - sid
                  - user_sid
                  - oauth_client_sid
                  - team_scope_mode
                  - consented_team_sids
                  - permissions
                  - status
                  - last_used_at
                  - created_at
                  - updated_at
              included:
                type: object
                additionalProperties: {}
            required:
              - item
              - included
        pagination:
          type: object
          properties:
            next_cursor:
              type: string
              nullable: true
            has_more:
              type: boolean
            total_count:
              type: integer
              nullable: true
          required:
            - next_cursor
            - has_more
            - total_count
        applied_filters:
          type: object
          additionalProperties: {}
        includes:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
        counts:
          type: object
          properties:
            total_count:
              type: number
              description: All of the caller's grants, unfiltered; the filtered count is pagination.total_count.
            groups:
              type: object
              additionalProperties: {}
              description: "status: active and revoked over all of the caller's grants, unfiltered."
          required:
            - total_count
            - groups
      required:
        - success
        - operation
        - items
        - pagination
        - applied_filters
        - includes
        - meta
    SearchOauthClientsRequest:
      type: object
      description: Request body of `search_oauth_clients`.
      properties:
        filter:
          type: object
          properties:
            sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: Client sid(s).
            team_sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: is_null true = platform clients (owned by no team).
            client_id:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: Exact public identifier.
            name:
              type: object
              properties:
                eq:
                  type: string
              additionalProperties: false
              description: Exact name.
            actor_kind:
              type: object
              properties:
                eq:
                  type: string
                  enum:
                    - agent
                    - integration
                ne:
                  type: string
                  enum:
                    - agent
                    - integration
                in:
                  type: array
                  items:
                    type: string
                    enum:
                      - agent
                      - integration
                nin:
                  type: array
                  items:
                    type: string
                    enum:
                      - agent
                      - integration
                is_null:
                  type: boolean
              additionalProperties: false
              description: agent | integration; is_null true = unclassified legacy clients.
            status:
              type: object
              properties:
                eq:
                  type: string
                  enum:
                    - active
                    - disabled
                in:
                  type: array
                  items:
                    type: string
                    enum:
                      - active
                      - disabled
              additionalProperties: false
              description: active | disabled.
            is_confidential:
              type: object
              properties:
                eq:
                  type: boolean
              additionalProperties: false
              description: false = public PKCE clients; true = confidential.
            registration_kind:
              type: object
              properties:
                eq:
                  type: string
                  enum:
                    - manual
                    - dynamic
                in:
                  type: array
                  items:
                    type: string
                    enum:
                      - manual
                      - dynamic
              additionalProperties: false
              description: manual | dynamic.
            created_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                gt:
                  type: string
                lt:
                  type: string
              additionalProperties: false
              description: ISO 8601 bounds.
            deleted_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: "Default scope is { is_null: true } (live rows)."
          description: "Field filters, ANDed: {field: {eq | ne | in | nin | gte | lte | gt | lt | is_null}}; q inside it is free text. Omit for every row."
        include:
          type: array
          items:
            type: string
            enum:
              - active_sessions
          description: Relations to attach to every item; omit for the bare rows.
        sort:
          type: object
          properties:
            field:
              type: string
              enum:
                - created_at
                - name
              description: The column to order by.
            direction:
              type: string
              enum:
                - asc
                - desc
              description: asc or desc; default desc.
          required:
            - field
          description: One column and its direction; omit for the default order.
        page_size:
          type: integer
          minimum: 0
          maximum: 500
          description: 0..500, default 50; 0 = counts only, 1 = the first row.
        cursor:
          type: string
          nullable: true
          description: pagination.next_cursor of the previous page.
    SearchOauthClientsResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - search
        items:
          type: array
          items:
            type: object
            properties:
              item:
                type: object
                properties:
                  sid:
                    type: string
                    description: OAuth client sid (id_oc_...).
                  team_sid:
                    type: string
                    nullable: true
                    description: The owning workspace (ts_tm_...); null = a platform client.
                  name:
                    type: string
                    description: The application's name as the consent screen shows it.
                  client_id:
                    type: string
                    description: The public identifier the app presents at /oauth/authorize.
                  redirect_uris:
                    type: array
                    items:
                      type: string
                    description: The exact-match https allow-list of callback URLs.
                  grant_types:
                    type: array
                    items:
                      type: string
                      enum:
                        - authorization_code
                        - refresh_token
                    description: authorization_code and refresh_token.
                  permissions:
                    type: array
                    items:
                      type: string
                    description: "The ceiling: the most a grant through this client may hold."
                  is_confidential:
                    type: boolean
                    description: true = a confidential client with a secret; false = public, PKCE only.
                  registration_kind:
                    type: string
                    enum:
                      - manual
                      - dynamic
                    description: manual = registered here; dynamic = registered by the app itself (RFC 7591).
                  actor_kind:
                    type: string
                    nullable: true
                    enum:
                      - agent
                      - integration
                    description: agent = its tokens act as an autonomous caller; integration = a tool a person uses; null = unclassified legacy row.
                  status:
                    type: string
                    enum:
                      - active
                      - disabled
                    description: disabled = its grants and tokens are revoked, the flow refuses it.
                  created_by:
                    type: object
                    properties:
                      actor_type:
                        type: string
                        enum:
                          - user
                          - support
                          - api_key
                          - system
                          - agent
                      actor_sid:
                        type: string
                        nullable: true
                      team_sid:
                        type: string
                      actor_name:
                        type: string
                        nullable: true
                        description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                      oauth_client_sid:
                        type: string
                        nullable: true
                        description: The acting OAuth client (id_oc_*); null off the OAuth path.
                      reason:
                        type: string
                        nullable: true
                        description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                      permissions:
                        type: object
                        additionalProperties: {}
                        description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                      cluster_id:
                        type: integer
                        nullable: true
                        description: "Internal audit context: the cluster that served the write."
                      trace_id:
                        type: string
                        nullable: true
                        description: "Internal audit context: the trace id of the request that wrote the row."
                    required:
                      - actor_type
                      - actor_sid
                      - team_sid
                      - permissions
                    description: Who registered the client.
                  created_at:
                    type: string
                    description: ISO 8601 UTC.
                  updated_at:
                    type: string
                    description: ISO 8601 UTC.
                  deleted_at:
                    type: string
                    nullable: true
                    description: ISO 8601 UTC; null = live.
                  client_secret:
                    type: string
                    nullable: true
                    description: The secret of a confidential client, shown ONCE at create; never on a read.
                required:
                  - sid
                  - team_sid
                  - name
                  - client_id
                  - redirect_uris
                  - grant_types
                  - permissions
                  - is_confidential
                  - registration_kind
                  - actor_kind
                  - status
                  - created_by
                  - created_at
                  - updated_at
                  - deleted_at
              included:
                type: object
                additionalProperties: {}
            required:
              - item
              - included
        pagination:
          type: object
          properties:
            next_cursor:
              type: string
              nullable: true
            has_more:
              type: boolean
            total_count:
              type: integer
              nullable: true
          required:
            - next_cursor
            - has_more
            - total_count
        applied_filters:
          type: object
          additionalProperties: {}
        includes:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
        counts:
          type: object
          properties:
            total_count:
              type: number
              description: Clients matching the filter.
            groups:
              type: object
              additionalProperties: {}
              description: "status, registration_kind, actor_kind, is_confidential: the count per value."
          required:
            - total_count
            - groups
      required:
        - success
        - operation
        - items
        - pagination
        - applied_filters
        - includes
        - meta
    SearchSessionsRequest:
      type: object
      description: Request body of `search_sessions`.
      properties:
        filter:
          type: object
          properties:
            sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: Session sid(s).
            user_sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: Own sessions by default; other users need the sessions view permission.
            team_sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: The workspace(s) signed into.
            status:
              type: object
              properties:
                eq:
                  type: string
                  enum:
                    - active
                    - revoked
                    - expired
                ne:
                  type: string
                  enum:
                    - active
                    - revoked
                    - expired
                in:
                  type: array
                  items:
                    type: string
                    enum:
                      - active
                      - revoked
                      - expired
                nin:
                  type: array
                  items:
                    type: string
                    enum:
                      - active
                      - revoked
                      - expired
              additionalProperties: false
              description: "Default scope is { eq: active }; pass it for revoked or expired history."
            kind:
              type: object
              properties:
                eq:
                  type: string
                  enum:
                    - login
                    - oauth
                in:
                  type: array
                  items:
                    type: string
                    enum:
                      - login
                      - oauth
              additionalProperties: false
              description: kind.eq oauth = the connected apps and agents.
            oauth_client_sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: is_null true = login sessions only.
            last_active_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                gt:
                  type: string
                lt:
                  type: string
              additionalProperties: false
              description: ISO 8601 bounds.
            expires_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                gt:
                  type: string
                lt:
                  type: string
              additionalProperties: false
              description: ISO 8601 bounds.
            created_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                gt:
                  type: string
                lt:
                  type: string
              additionalProperties: false
              description: ISO 8601 bounds.
          description: "Field filters, ANDed: {field: {eq | ne | in | nin | gte | lte | gt | lt | is_null}}; q inside it is free text. Omit for every row."
        sort:
          type: object
          properties:
            field:
              type: string
              enum:
                - last_active_at
                - created_at
                - expires_at
              description: The column to order by.
            direction:
              type: string
              enum:
                - asc
                - desc
              description: asc or desc; default desc.
          required:
            - field
          description: One column and its direction; omit for the default order.
        page_size:
          type: integer
          minimum: 0
          maximum: 500
          description: 0..500, default 50; 0 = counts only, 1 = the first row.
        cursor:
          type: string
          nullable: true
          description: pagination.next_cursor of the previous page.
    SearchSessionsResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - search
        items:
          type: array
          items:
            type: object
            properties:
              item:
                type: object
                properties:
                  sid:
                    type: string
                    description: Session sid (id_se_...).
                  team_sid:
                    type: string
                    description: The workspace the session is signed into (ts_tm_...).
                  user_sid:
                    type: string
                    description: The account (us_mb_...).
                  status:
                    type: string
                    enum:
                      - active
                      - revoked
                      - expired
                    description: active = the token is accepted; revoked | expired = it is not.
                  kind:
                    type: string
                    enum:
                      - login
                      - oauth
                    description: login = a browser or app sign-in; oauth = an installation token of a connected app or agent.
                  oauth_client_sid:
                    type: string
                    nullable: true
                    description: The OAuth client (id_oc_...) behind a kind oauth session; null on a login.
                  oauth_authorization_sid:
                    type: string
                    nullable: true
                    description: The grant (id_oa_...) the installation token was minted from; null on a login.
                  device:
                    type: string
                    nullable: true
                    description: The browser or client as reported at sign-in.
                  ip_hash:
                    type: string
                    nullable: true
                    description: A hash of the sign-in address, never the address.
                  last_active_at:
                    type: string
                    description: ISO 8601 UTC; bumped lazily, about every 30 s, by requests to this service.
                  expires_at:
                    type: string
                    description: ISO 8601 UTC; the refresh credential's end (14 days by default; about 15 minutes for an agent token).
                  created_at:
                    type: string
                    description: ISO 8601 UTC.
                  updated_at:
                    type: string
                    description: ISO 8601 UTC.
                  is_current:
                    type: boolean
                    description: true on the row behind the calling token.
                required:
                  - sid
                  - team_sid
                  - user_sid
                  - status
                  - kind
                  - oauth_client_sid
                  - oauth_authorization_sid
                  - device
                  - ip_hash
                  - last_active_at
                  - expires_at
                  - created_at
                  - updated_at
                  - is_current
              included:
                type: object
                additionalProperties: {}
            required:
              - item
              - included
        pagination:
          type: object
          properties:
            next_cursor:
              type: string
              nullable: true
            has_more:
              type: boolean
            total_count:
              type: integer
              nullable: true
          required:
            - next_cursor
            - has_more
            - total_count
        applied_filters:
          type: object
          additionalProperties: {}
        includes:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
        counts:
          type: object
          properties:
            total_count:
              type: number
              description: Sessions matching the filter across EVERY status (the default active scope applies to the page and pagination.total_count, never here).
            groups:
              type: object
              additionalProperties: {}
              description: "status and kind: the count per value."
          required:
            - total_count
            - groups
      required:
        - success
        - operation
        - items
        - pagination
        - applied_filters
        - includes
        - meta
    SearchSslCertificatesRequest:
      type: object
      description: Request body of `search_ssl_certificates`.
      properties:
        filter:
          type: object
          properties:
            sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: Certificate sid(s).
            domain:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: Exact FQDN (lowercase).
            status:
              type: object
              properties:
                eq:
                  type: string
                  enum:
                    - pending
                    - challenge
                    - active
                    - failed
                    - expired
                ne:
                  type: string
                  enum:
                    - pending
                    - challenge
                    - active
                    - failed
                    - expired
                in:
                  type: array
                  items:
                    type: string
                    enum:
                      - pending
                      - challenge
                      - active
                      - failed
                      - expired
                nin:
                  type: array
                  items:
                    type: string
                    enum:
                      - pending
                      - challenge
                      - active
                      - failed
                      - expired
              additionalProperties: false
              description: pending | challenge | active | failed | expired.
            expires_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                gt:
                  type: string
                lt:
                  type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: "Expiring soon = { lte: now plus 30 days }."
            created_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                gt:
                  type: string
                lt:
                  type: string
              additionalProperties: false
              description: ISO 8601 bounds.
            deleted_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: "Default scope is { is_null: true } (live rows)."
          description: "Field filters, ANDed: {field: {eq | ne | in | nin | gte | lte | gt | lt | is_null}}; q inside it is free text. Omit for every row."
        sort:
          type: object
          properties:
            field:
              type: string
              enum:
                - created_at
                - expires_at
                - issued_at
                - domain
                - status
              description: The column to order by.
            direction:
              type: string
              enum:
                - asc
                - desc
              description: asc or desc; default desc.
          required:
            - field
          description: One column and its direction; omit for the default order.
        page_size:
          type: integer
          minimum: 0
          maximum: 500
          description: 0..500, default 50; 0 = counts only, 1 = the first row.
        cursor:
          type: string
          nullable: true
          description: pagination.next_cursor of the previous page.
    SearchSslCertificatesResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - search
        items:
          type: array
          items:
            type: object
            properties:
              item:
                type: object
                properties:
                  sid:
                    type: string
                    description: Certificate sid (id_sc_...).
                  team_sid:
                    type: string
                    description: The reseller team (ts_tm_...).
                  domain:
                    type: string
                    description: The brand's host, lowercase FQDN.
                  status:
                    type: string
                    enum:
                      - pending
                      - challenge
                      - active
                      - failed
                      - expired
                    description: pending = registered; challenge = a first issuance in flight; active = serving; failed; expired. A renewal of an active row keeps active.
                  challenge:
                    type: object
                    nullable: true
                    properties:
                      type:
                        type: string
                        enum:
                          - http-01
                        description: The one challenge type served.
                      token:
                        type: string
                        description: The ACME token the platform serves at well_known_path.
                      key_authorization:
                        type: string
                        description: The key authorization the CA expects there.
                      well_known_path:
                        type: string
                        description: The path the CA fetches on the domain.
                      cname_target:
                        type: string
                        description: The platform host the domain's CNAME must point at.
                      expires_at:
                        type: string
                        nullable: true
                        description: ISO 8601 UTC when the authorization lapses at the CA.
                    required:
                      - type
                      - token
                      - key_authorization
                      - well_known_path
                      - cname_target
                      - expires_at
                    description: The attempt in flight (first issuance or renewal); null when none.
                  issuer:
                    type: string
                    nullable: true
                    description: The CA that issued the serving certificate; null until one did.
                  issued_at:
                    type: string
                    nullable: true
                    description: ISO 8601 UTC; null until issued.
                  expires_at:
                    type: string
                    nullable: true
                    description: ISO 8601 UTC the serving certificate lapses; renewed 30 days ahead.
                  last_error:
                    type: string
                    nullable: true
                    description: "Why the last attempt failed, as a token: domain_not_pointed (fix the CNAME), domain_validation_failed (CAA or other DNS), issuance_unavailable (our side or the CA, contact support). null = none."
                  created_by:
                    type: object
                    properties:
                      actor_type:
                        type: string
                        enum:
                          - user
                          - support
                          - api_key
                          - system
                          - agent
                      actor_sid:
                        type: string
                        nullable: true
                      team_sid:
                        type: string
                      actor_name:
                        type: string
                        nullable: true
                        description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                      oauth_client_sid:
                        type: string
                        nullable: true
                        description: The acting OAuth client (id_oc_*); null off the OAuth path.
                      reason:
                        type: string
                        nullable: true
                        description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                      permissions:
                        type: object
                        additionalProperties: {}
                        description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                      cluster_id:
                        type: integer
                        nullable: true
                        description: "Internal audit context: the cluster that served the write."
                      trace_id:
                        type: string
                        nullable: true
                        description: "Internal audit context: the trace id of the request that wrote the row."
                    required:
                      - actor_type
                      - actor_sid
                      - team_sid
                      - permissions
                    description: Who registered the domain (the brand's activation).
                  created_at:
                    type: string
                    description: ISO 8601 UTC.
                  updated_at:
                    type: string
                    description: ISO 8601 UTC.
                  deleted_at:
                    type: string
                    nullable: true
                    description: ISO 8601 UTC; null = live.
                required:
                  - sid
                  - team_sid
                  - domain
                  - status
                  - challenge
                  - issuer
                  - issued_at
                  - expires_at
                  - last_error
                  - created_by
                  - created_at
                  - updated_at
                  - deleted_at
              included:
                type: object
                additionalProperties: {}
            required:
              - item
              - included
        pagination:
          type: object
          properties:
            next_cursor:
              type: string
              nullable: true
            has_more:
              type: boolean
            total_count:
              type: integer
              nullable: true
          required:
            - next_cursor
            - has_more
            - total_count
        applied_filters:
          type: object
          additionalProperties: {}
        includes:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
        counts:
          type: object
          properties:
            total_count:
              type: number
              description: Certificates matching the filter.
            groups:
              type: object
              additionalProperties: {}
              description: "status: the count per status."
          required:
            - total_count
            - groups
      required:
        - success
        - operation
        - items
        - pagination
        - applied_filters
        - includes
        - meta
    SearchSubscriptionAllocationsRequest:
      type: object
      description: Request body of `search_subscription_allocations`.
      properties:
        filter:
          type: object
          properties:
            sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: Allocation sid(s).
            subscription_sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: How one pool is split.
            team_sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: What one workspace draws from.
            created_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                gt:
                  type: string
                lt:
                  type: string
              additionalProperties: false
              description: ISO 8601 bounds.
            deleted_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: "Default scope is { is_null: true } (live shares); state it to see superseded ones."
          description: "Field filters, ANDed: {field: {eq | ne | in | nin | gte | lte | gt | lt | is_null}}; q inside it is free text. Omit for every row."
        include:
          type: array
          items:
            type: string
            enum:
              - team
          description: Relations to attach to every item; omit for the bare rows.
        sort:
          type: object
          properties:
            field:
              type: string
              enum:
                - created_at
                - updated_at
              description: created_at or updated_at.
            direction:
              type: string
              enum:
                - asc
                - desc
              description: asc or desc; default asc on this entity.
          required:
            - field
          description: One sort column with its direction. Omit for created_at ascending, the oldest share first.
        page_size:
          type: integer
          minimum: 0
          maximum: 500
          description: 0..500, default 50; 0 = counts only, 1 = the first row.
        cursor:
          type: string
          nullable: true
          description: pagination.next_cursor of the previous page.
    SearchSubscriptionAllocationsResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - search
        items:
          type: array
          items:
            type: object
            properties:
              item:
                type: object
                properties:
                  sid:
                    type: string
                    description: Allocation sid (bl_al_...).
                  subscription_sid:
                    type: string
                    description: The pool (bl_sb_...).
                  team_sid:
                    type: string
                    description: The workspace holding the share (ts_tm_...); one live share per workspace.
                  created_by:
                    type: object
                    properties:
                      actor_type:
                        type: string
                        enum:
                          - user
                          - support
                          - api_key
                          - system
                          - agent
                      actor_sid:
                        type: string
                        nullable: true
                      team_sid:
                        type: string
                      actor_name:
                        type: string
                        nullable: true
                        description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                      oauth_client_sid:
                        type: string
                        nullable: true
                        description: The acting OAuth client (id_oc_*); null off the OAuth path.
                      reason:
                        type: string
                        nullable: true
                        description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                      permissions:
                        type: object
                        additionalProperties: {}
                        description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                      cluster_id:
                        type: integer
                        nullable: true
                        description: "Internal audit context: the cluster that served the write."
                      trace_id:
                        type: string
                        nullable: true
                        description: "Internal audit context: the trace id of the request that wrote the row."
                    required:
                      - actor_type
                      - actor_sid
                      - team_sid
                      - permissions
                    description: "Who handed the share out: the buyer, or system for the checkout and the trial."
                  linkedin_sender_profiles:
                    type: integer
                    description: LinkedIn sender profiles (accounts) the workspace may run.
                  email_inboxes:
                    type: integer
                    description: Inboxes the workspace may connect.
                  credits_per_month:
                    type: integer
                    description: Platform credits granted to the workspace every month of the paid period (one lot per grant, kept while the plan runs and burnt when the workspace leaves it).
                  whitelabel:
                    type: integer
                    description: 1 = the workspace may register white label brands; 0 = not.
                  created_at:
                    type: string
                    description: ISO 8601 UTC.
                  updated_at:
                    type: string
                    description: ISO 8601 UTC.
                  deleted_at:
                    type: string
                    nullable: true
                    description: ISO 8601 UTC; a superseded or taken-back share keeps its history.
                required:
                  - sid
                  - subscription_sid
                  - team_sid
                  - created_by
                  - linkedin_sender_profiles
                  - email_inboxes
                  - credits_per_month
                  - whitelabel
                  - created_at
                  - updated_at
                  - deleted_at
              included:
                type: object
                properties:
                  team:
                    type: object
                    additionalProperties: {}
                    description: The workspace row (TeamDomain) with the derived status and limits.
            required:
              - item
              - included
        pagination:
          type: object
          properties:
            next_cursor:
              type: string
              nullable: true
            has_more:
              type: boolean
            total_count:
              type: integer
              nullable: true
          required:
            - next_cursor
            - has_more
            - total_count
        applied_filters:
          type: object
          additionalProperties: {}
        includes:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
        counts:
          type: object
          properties:
            total_count:
              type: number
              description: Allocations matching the filter.
          required:
            - total_count
      required:
        - success
        - operation
        - items
        - pagination
        - applied_filters
        - includes
        - meta
    SearchTeamMembersRequest:
      type: object
      description: Request body of `search_team_members`.
      properties:
        filter:
          type: object
          properties:
            sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: Membership sid(s).
            user_sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: is_null true = pending invites (not yet accepted).
            email:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: Exact address.
            status:
              type: object
              properties:
                eq:
                  type: string
                  enum:
                    - invited
                    - active
                    - revoked
                ne:
                  type: string
                  enum:
                    - invited
                    - active
                    - revoked
                in:
                  type: array
                  items:
                    type: string
                    enum:
                      - invited
                      - active
                      - revoked
                nin:
                  type: array
                  items:
                    type: string
                    enum:
                      - invited
                      - active
                      - revoked
              additionalProperties: false
              description: invited | active | revoked.
            created_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                gt:
                  type: string
                lt:
                  type: string
              additionalProperties: false
              description: ISO 8601 bounds.
            deleted_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: "Default scope is { is_null: true } (live rows)."
            q:
              type: string
              maxLength: 255
              description: Infix match over the member email.
          description: "Field filters, ANDed: {field: {eq | ne | in | nin | gte | lte | gt | lt | is_null}}; q inside it is free text. Omit for every row."
        include:
          type: array
          items:
            type: string
            enum:
              - user
          description: Relations to attach to every item; omit for the bare rows.
        sort:
          type: object
          properties:
            field:
              type: string
              enum:
                - created_at
                - updated_at
                - email
              description: The column to order by.
            direction:
              type: string
              enum:
                - asc
                - desc
              description: asc or desc; default desc.
          required:
            - field
          description: One column and its direction; omit for the default order.
        page_size:
          type: integer
          minimum: 0
          maximum: 500
          description: 0..500, default 50; 0 = counts only, 1 = the first row.
        cursor:
          type: string
          nullable: true
          description: pagination.next_cursor of the previous page.
    SearchTeamMembersResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - search
        items:
          type: array
          items:
            type: object
            properties:
              item:
                type: object
                properties:
                  sid:
                    type: string
                    description: Membership sid (ts_mb_...).
                  team_sid:
                    type: string
                    description: The workspace (ts_tm_...).
                  user_sid:
                    type: string
                    nullable: true
                    description: The member's account (us_mb_...); null while the invite is pending.
                  email:
                    type: string
                    description: The invited address.
                  status:
                    type: string
                    enum:
                      - invited
                      - active
                      - revoked
                    description: invited = pending; active = a member; revoked = removed.
                  permissions:
                    type: array
                    items:
                      type: string
                    description: The explicit token list the member holds, stored as sent (no floor is unioned in).
                  account_sids:
                    type: array
                    nullable: true
                    items:
                      type: string
                    description: The sender identities the member may see and use (ln_ac_...); null = every one of the workspace.
                  created_by:
                    type: object
                    properties:
                      actor_type:
                        type: string
                        enum:
                          - user
                          - support
                          - api_key
                          - system
                          - agent
                      actor_sid:
                        type: string
                        nullable: true
                      team_sid:
                        type: string
                      actor_name:
                        type: string
                        nullable: true
                        description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                      oauth_client_sid:
                        type: string
                        nullable: true
                        description: The acting OAuth client (id_oc_*); null off the OAuth path.
                      reason:
                        type: string
                        nullable: true
                        description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                      permissions:
                        type: object
                        additionalProperties: {}
                        description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                      cluster_id:
                        type: integer
                        nullable: true
                        description: "Internal audit context: the cluster that served the write."
                      trace_id:
                        type: string
                        nullable: true
                        description: "Internal audit context: the trace id of the request that wrote the row."
                    required:
                      - actor_type
                      - actor_sid
                      - team_sid
                      - permissions
                    description: Who invited.
                  created_at:
                    type: string
                    description: ISO 8601 UTC.
                  updated_at:
                    type: string
                    description: ISO 8601 UTC.
                  deleted_at:
                    type: string
                    nullable: true
                    description: ISO 8601 UTC; null = live.
                required:
                  - sid
                  - team_sid
                  - user_sid
                  - email
                  - status
                  - permissions
                  - account_sids
                  - created_by
                  - created_at
                  - updated_at
                  - deleted_at
              included:
                type: object
                additionalProperties: {}
            required:
              - item
              - included
        pagination:
          type: object
          properties:
            next_cursor:
              type: string
              nullable: true
            has_more:
              type: boolean
            total_count:
              type: integer
              nullable: true
          required:
            - next_cursor
            - has_more
            - total_count
        applied_filters:
          type: object
          additionalProperties: {}
        includes:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
        counts:
          type: object
          properties:
            total_count:
              type: number
              description: Rows matching the filter.
            groups:
              type: object
              additionalProperties: {}
              description: "status: the count per status."
          required:
            - total_count
            - groups
      required:
        - success
        - operation
        - items
        - pagination
        - applied_filters
        - includes
        - meta
    SearchTeamsRequest:
      type: object
      description: Request body of `search_teams`.
      properties:
        filter:
          type: object
          properties:
            sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: Team sid(s).
            owner_user_sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: The workspaces a user owns.
            subscription_sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: is_null true = workspaces with no live share (suspended).
            status:
              type: object
              properties:
                eq:
                  type: string
                  enum:
                    - active
                    - suspended
                ne:
                  type: string
                  enum:
                    - active
                    - suspended
                in:
                  type: array
                  items:
                    type: string
                    enum:
                      - active
                      - suspended
              additionalProperties: false
              description: active | suspended.
            q:
              type: string
              maxLength: 255
              description: Infix match over the workspace name.
            created_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                gt:
                  type: string
                lt:
                  type: string
              additionalProperties: false
              description: ISO 8601 bounds.
            deleted_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: "Default scope is { is_null: true } (live rows)."
          description: "Field filters, ANDed: {field: {eq | ne | in | nin | gte | lte | gt | lt | is_null}}; q inside it is free text. Omit for every row."
        include:
          type: array
          items:
            type: string
            enum:
              - owner
              - members_counts
          description: Relations to attach to every item; omit for the bare rows.
        sort:
          type: object
          properties:
            field:
              type: string
              enum:
                - created_at
                - updated_at
                - name
              description: The column to order by.
            direction:
              type: string
              enum:
                - asc
                - desc
              description: asc or desc; default desc.
          required:
            - field
          description: One column and its direction; omit for the default order.
        page_size:
          type: integer
          minimum: 0
          maximum: 500
          description: 0..500, default 50; 0 = counts only, 1 = the first row.
        cursor:
          type: string
          nullable: true
          description: pagination.next_cursor of the previous page.
    SearchTeamsResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - search
        items:
          type: array
          items:
            type: object
            properties:
              item:
                type: object
                properties:
                  sid:
                    type: string
                    description: Team sid (ts_tm_...).
                  owner_user_sid:
                    type: string
                    description: "The structural owner (us_mb_...): the one who can delete the workspace or hand it over."
                  subscription_sid:
                    type: string
                    nullable: true
                    description: The subscription the workspace's live allocation draws from (bl_sb_...); null = no share, suspended.
                  name:
                    type: string
                    description: Workspace name; not unique.
                  status:
                    type: string
                    enum:
                      - active
                      - suspended
                    description: active while its allocation draws from a live subscription; suspended otherwise (settings and billing stay reachable).
                  plan:
                    type: string
                    nullable: true
                    enum:
                      - none
                      - free
                      - paid
                      - partner
                    description: none | free (the trial) | paid | partner (a reseller's share).
                  limits:
                    type: object
                    properties:
                      linkedin_sender_profiles:
                        type: integer
                        description: "LinkedIn sender profiles (accounts) the workspace may run: its share of the pool."
                      email_inboxes:
                        type: integer
                        description: Inboxes the workspace may connect.
                      credits_per_month:
                        type: integer
                        description: Platform credits granted to the workspace every month of the paid period.
                      whitelabel:
                        type: integer
                        description: 1 = the workspace may register white label brands, 0 = not.
                      linkedin_seats:
                        type: integer
                        description: Retired on 2026-10-25, always 0 here (linkedin_sender_profiles replaced it).
                      email_seats:
                        type: integer
                        description: Retired on 2026-10-25, always 0 here (email_inboxes replaced it).
                      credits_per_period:
                        type: integer
                        description: Retired on 2026-10-25, always 0 here (credits_per_month replaced it).
                      accounts:
                        type: integer
                        description: A gtm key, 0 on this product.
                      cloud_browser:
                        type: integer
                        description: A gtm key, 0 on this product.
                      webhooks:
                        type: integer
                        description: A gtm key, 0 on this product.
                      proxy_5g:
                        type: integer
                        description: A gtm key, 0 on this product.
                    required:
                      - linkedin_sender_profiles
                      - email_inboxes
                      - credits_per_month
                      - whitelabel
                    description: "The capacity snapshot: the allocation's quantities, zero when there is none."
                  cluster_id:
                    type: integer
                    nullable: true
                    description: The data cluster the workspace was assigned at creation; one cluster today.
                  config:
                    type: object
                    nullable: true
                    properties:
                      timezone:
                        type: string
                        nullable: true
                        maxLength: 64
                        description: IANA zone the workspace counts its day in (Europe/Riga); null = UTC. Defaults to the owner's zone at creation.
                    description: Workspace settings (TeamConfigValue); null when never written.
                  created_by:
                    type: object
                    properties:
                      actor_type:
                        type: string
                        enum:
                          - user
                          - support
                          - api_key
                          - system
                          - agent
                      actor_sid:
                        type: string
                        nullable: true
                      team_sid:
                        type: string
                      actor_name:
                        type: string
                        nullable: true
                        description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                      oauth_client_sid:
                        type: string
                        nullable: true
                        description: The acting OAuth client (id_oc_*); null off the OAuth path.
                      reason:
                        type: string
                        nullable: true
                        description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                      permissions:
                        type: object
                        additionalProperties: {}
                        description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                      cluster_id:
                        type: integer
                        nullable: true
                        description: "Internal audit context: the cluster that served the write."
                      trace_id:
                        type: string
                        nullable: true
                        description: "Internal audit context: the trace id of the request that wrote the row."
                    required:
                      - actor_type
                      - actor_sid
                      - team_sid
                      - permissions
                    description: Who created the workspace.
                  created_at:
                    type: string
                    description: ISO 8601 UTC.
                  updated_at:
                    type: string
                    description: ISO 8601 UTC.
                  data_deletion_at:
                    type: string
                    nullable: true
                    description: When a workspace that lost its coverage is erased (8 weeks after the loss); null while covered.
                  deletion_warned_at:
                    type: string
                    nullable: true
                    description: When the owner was warned two weeks ahead of data_deletion_at; null when not yet.
                  deleted_at:
                    type: string
                    nullable: true
                    description: ISO 8601 UTC; null = live.
                required:
                  - sid
                  - owner_user_sid
                  - subscription_sid
                  - name
                  - status
                  - plan
                  - limits
                  - cluster_id
                  - config
                  - created_by
                  - created_at
                  - updated_at
                  - data_deletion_at
                  - deletion_warned_at
                  - deleted_at
              included:
                type: object
                additionalProperties: {}
            required:
              - item
              - included
        pagination:
          type: object
          properties:
            next_cursor:
              type: string
              nullable: true
            has_more:
              type: boolean
            total_count:
              type: integer
              nullable: true
          required:
            - next_cursor
            - has_more
            - total_count
        applied_filters:
          type: object
          additionalProperties: {}
        includes:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
        counts:
          type: object
          properties:
            total_count:
              type: number
              description: Workspaces matching the filter.
            groups:
              type: object
              additionalProperties: {}
              description: "status: the count per status."
          required:
            - total_count
            - groups
      required:
        - success
        - operation
        - items
        - pagination
        - applied_filters
        - includes
        - meta
    SearchWhitelabelClientsRequest:
      type: object
      description: Request body of `search_whitelabel_clients`.
      properties:
        filter:
          type: object
          properties:
            sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: Client sid(s).
            whitelabel_sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: One brand's registrations.
            user_sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: Is this account a client, and of which brand.
            created_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                gt:
                  type: string
                lt:
                  type: string
              additionalProperties: false
              description: Registration window.
          description: "Field filters, ANDed: {field: {eq | ne | in | nin | gte | lte | gt | lt | is_null}}; q inside it is free text. Omit for every row."
        include:
          type: array
          items:
            type: string
            enum:
              - user
              - teams
          description: Relations to attach to every item; omit for the bare rows.
        sort:
          type: object
          properties:
            field:
              type: string
              enum:
                - created_at
              description: The column to order by.
            direction:
              type: string
              enum:
                - asc
                - desc
              description: asc or desc; default desc.
          required:
            - field
          description: One column and its direction; omit for the default order.
        page_size:
          type: integer
          minimum: 0
          maximum: 500
          description: 0..500, default 50; 0 = counts only, 1 = the first row.
        cursor:
          type: string
          nullable: true
          description: pagination.next_cursor of the previous page.
    SearchWhitelabelClientsResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - search
        items:
          type: array
          items:
            type: object
            properties:
              item:
                type: object
                properties:
                  sid:
                    type: string
                    description: Client sid (id_wc_...).
                  whitelabel_sid:
                    type: string
                    description: The brand the client registered on (id_wl_...).
                  user_sid:
                    type: string
                    description: The client's account (us_mb_...); one brand per user.
                  created_at:
                    type: string
                    nullable: true
                    description: "ISO 8601 UTC: the registration moment."
                required:
                  - sid
                  - whitelabel_sid
                  - user_sid
                  - created_at
              included:
                type: object
                properties:
                  user:
                    type: object
                    additionalProperties: {}
                    description: The client's user row (UserDomain).
                  teams:
                    type: array
                    items:
                      type: object
                      additionalProperties: {}
                    description: The workspaces the client OWNS (TeamDomain rows), with the derived gate and the limits the reseller allocated.
            required:
              - item
              - included
        pagination:
          type: object
          properties:
            next_cursor:
              type: string
              nullable: true
            has_more:
              type: boolean
            total_count:
              type: integer
              nullable: true
          required:
            - next_cursor
            - has_more
            - total_count
        applied_filters:
          type: object
          additionalProperties: {}
        includes:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
        counts:
          type: object
          properties:
            total_count:
              type: number
              description: Clients matching the filter.
            groups:
              type: object
              properties:
                registered:
                  type: object
                  additionalProperties:
                    type: number
                  description: Registrations over the same scope in the last 7d, 30d and 90d.
          required:
            - total_count
            - groups
      required:
        - success
        - operation
        - items
        - pagination
        - applied_filters
        - includes
        - meta
    SearchWhitelabelsRequest:
      type: object
      description: Request body of `search_whitelabels`.
      properties:
        filter:
          type: object
          properties:
            sid:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: Brand sid(s).
            domain:
              type: object
              properties:
                eq:
                  type: string
                in:
                  type: array
                  items:
                    type: string
              additionalProperties: false
              description: Exact host.
            name:
              type: object
              properties:
                eq:
                  type: string
              additionalProperties: false
              description: Exact brand name.
            status:
              type: object
              properties:
                eq:
                  type: string
                  enum:
                    - pending_domain
                    - active
                    - disabled
                in:
                  type: array
                  items:
                    type: string
                    enum:
                      - pending_domain
                      - active
                      - disabled
              additionalProperties: false
              description: pending_domain | active | disabled.
            created_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
              additionalProperties: false
              description: ISO 8601 bounds.
            deleted_at:
              type: object
              properties:
                gte:
                  type: string
                lte:
                  type: string
                is_null:
                  type: boolean
              additionalProperties: false
              description: "Default scope is { is_null: true }."
          description: "Field filters, ANDed: {field: {eq | ne | in | nin | gte | lte | gt | lt | is_null}}; q inside it is free text. Omit for every row."
        include:
          type: array
          items:
            type: string
            enum:
              - ssl_certificate
              - users_count
          description: Relations to attach to every item; omit for the bare rows.
        sort:
          type: object
          properties:
            field:
              type: string
              enum:
                - created_at
                - name
                - domain
              description: The column to order by.
            direction:
              type: string
              enum:
                - asc
                - desc
              description: asc or desc; default desc.
          required:
            - field
          description: One column and its direction; omit for the default order.
        page_size:
          type: integer
          minimum: 0
          maximum: 500
          description: 0..500, default 50; 0 = counts only, 1 = the first row.
        cursor:
          type: string
          nullable: true
          description: pagination.next_cursor of the previous page.
    SearchWhitelabelsResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - search
        items:
          type: array
          items:
            type: object
            properties:
              item:
                type: object
                properties:
                  sid:
                    type: string
                    description: Brand sid (id_wl_...).
                  team_sid:
                    type: string
                    description: The owning reseller team (ts_tm_...).
                  name:
                    type: string
                    description: The brand name the app shell shows and the mail is signed with.
                  domain:
                    type: string
                    description: The app and login host (app.reseller.com), lowercase FQDN, unique platform-wide; read-only once active.
                  status:
                    type: string
                    enum:
                      - pending_domain
                      - active
                      - disabled
                    description: pending_domain = waiting for the CNAME and the certificate; active = the host serves the brand; disabled = switched off, the host falls back to the platform brand.
                  logo_url:
                    type: string
                    nullable: true
                    description: The horizontal logo (app shell and email header).
                  icon_url:
                    type: string
                    nullable: true
                    description: The square mark or favicon.
                  login_image_url:
                    type: string
                    nullable: true
                    description: The login page artwork.
                  palette:
                    type: object
                    nullable: true
                    properties:
                      primary_color:
                        type: string
                        nullable: true
                        pattern: ^#[0-9a-fA-F]{6}$
                        description: "Buttons and links, #rrggbb; null = the platform default."
                      accent_color:
                        type: string
                        nullable: true
                        pattern: ^#[0-9a-fA-F]{6}$
                        description: "The accent, #rrggbb; null = the platform default."
                      login_background_color:
                        type: string
                        nullable: true
                        pattern: ^#[0-9a-fA-F]{6}$
                        description: "The login page background, #rrggbb; null = the platform default."
                    description: Brand colors; null = all platform defaults.
                  email_from_name:
                    type: string
                    nullable: true
                    description: The From name on the clients' mail; null = the brand name.
                  email_reply_to:
                    type: string
                    nullable: true
                    description: The Reply-To on the clients' mail; null = none.
                  email_from_address:
                    type: string
                    nullable: true
                    description: The brand's own sender address; mail leaves from it once email_domain is verified, from the platform address under the brand's name until then.
                  email_domain:
                    type: object
                    nullable: true
                    properties:
                      domain:
                        type: string
                        description: "The domain part of email_from_address, lowercase: what SendGrid authenticates."
                      status:
                        type: string
                        enum:
                          - pending
                          - verified
                          - failed
                        description: pending = records not all found yet; verified = the brand's mail leaves from its own address; failed = see failure_reason.
                      records:
                        type: array
                        items:
                          type: object
                          properties:
                            type:
                              type: string
                              description: "cname (three of them: the return path and two DKIM keys)."
                            host:
                              type: string
                              description: The record name to publish at the domain's DNS host.
                            value:
                              type: string
                              description: The CNAME target at SendGrid.
                            valid:
                              type: boolean
                              description: What the last check found for this record.
                          required:
                            - type
                            - host
                            - value
                            - valid
                        description: The DNS records to publish, in the order SendGrid issued them.
                      failure_reason:
                        type: string
                        nullable: true
                        enum:
                          - email_domain_rejected
                          - email_domain_not_proven_in_time
                        description: email_domain_rejected (SendGrid refused the domain) or email_domain_not_proven_in_time (48 hours lapsed); null unless failed.
                      checked_at:
                        type: string
                        nullable: true
                        description: ISO 8601 UTC of the last check against SendGrid.
                      verified_at:
                        type: string
                        nullable: true
                        description: ISO 8601 UTC since when it is verified; null while it is not.
                    required:
                      - domain
                      - status
                      - records
                      - failure_reason
                      - checked_at
                      - verified_at
                    description: The proof of the sending domain; null = verify never ran, or the address moved to another domain.
                  created_by:
                    type: object
                    properties:
                      actor_type:
                        type: string
                        enum:
                          - user
                          - support
                          - api_key
                          - system
                          - agent
                      actor_sid:
                        type: string
                        nullable: true
                      team_sid:
                        type: string
                      actor_name:
                        type: string
                        nullable: true
                        description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                      oauth_client_sid:
                        type: string
                        nullable: true
                        description: The acting OAuth client (id_oc_*); null off the OAuth path.
                      reason:
                        type: string
                        nullable: true
                        description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                      permissions:
                        type: object
                        additionalProperties: {}
                        description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                      cluster_id:
                        type: integer
                        nullable: true
                        description: "Internal audit context: the cluster that served the write."
                      trace_id:
                        type: string
                        nullable: true
                        description: "Internal audit context: the trace id of the request that wrote the row."
                    required:
                      - actor_type
                      - actor_sid
                      - team_sid
                      - permissions
                    description: Who registered the brand.
                  created_at:
                    type: string
                    description: ISO 8601 UTC.
                  updated_at:
                    type: string
                    description: ISO 8601 UTC.
                  deleted_at:
                    type: string
                    nullable: true
                    description: ISO 8601 UTC; null = live.
                required:
                  - sid
                  - team_sid
                  - name
                  - domain
                  - status
                  - logo_url
                  - icon_url
                  - login_image_url
                  - palette
                  - email_from_name
                  - email_reply_to
                  - email_from_address
                  - email_domain
                  - created_by
                  - created_at
                  - updated_at
                  - deleted_at
              included:
                type: object
                properties:
                  ssl_certificate:
                    type: object
                    nullable: true
                    additionalProperties: {}
                    description: "The certificate row for the brand's domain (SslCertificateDomain: status, expires_at, the last_error token); null when none yet."
                  users_count:
                    type: integer
                    description: How many client users registered on the brand.
            required:
              - item
              - included
        pagination:
          type: object
          properties:
            next_cursor:
              type: string
              nullable: true
            has_more:
              type: boolean
            total_count:
              type: integer
              nullable: true
          required:
            - next_cursor
            - has_more
            - total_count
        applied_filters:
          type: object
          additionalProperties: {}
        includes:
          type: array
          items:
            type: string
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
        counts:
          type: object
          properties:
            total_count:
              type: number
              description: Brands matching the filter.
            groups:
              type: object
              additionalProperties: {}
              description: "status: the count per status."
          required:
            - total_count
            - groups
      required:
        - success
        - operation
        - items
        - pagination
        - applied_filters
        - includes
        - meta
    StartGtmConnectionLinkResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - action
        action:
          type: string
          description: kebab-case verb; matches the route segment.
        item: {}
        result:
          type: object
          properties:
            authorize_url:
              type: string
              description: The gtm-api consent screen to open in a browser.
            state:
              type: string
              description: Hand it back verbatim to complete_gtm_connection_link.
            expires_in:
              type: integer
              description: Seconds the state stays valid.
          required:
            - authorize_url
            - state
            - expires_in
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - action
        - item
        - result
        - meta
    TransferTeamOwnershipRequest:
      type: object
      description: Request body of `transfer_team_ownership`.
      properties:
        new_owner_user_sid:
          type: string
          minLength: 18
          maxLength: 18
          pattern: ^us_mb_
          description: User sid (us_mb_...); must be an active member of this team.
      required:
        - new_owner_user_sid
    TransferTeamOwnershipResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - action
        action:
          type: string
          description: kebab-case verb; matches the route segment.
        item:
          type: object
          nullable: true
          properties:
            sid:
              type: string
              description: Team sid (ts_tm_...).
            owner_user_sid:
              type: string
              description: "The structural owner (us_mb_...): the one who can delete the workspace or hand it over."
            subscription_sid:
              type: string
              nullable: true
              description: The subscription the workspace's live allocation draws from (bl_sb_...); null = no share, suspended.
            name:
              type: string
              description: Workspace name; not unique.
            status:
              type: string
              enum:
                - active
                - suspended
              description: active while its allocation draws from a live subscription; suspended otherwise (settings and billing stay reachable).
            plan:
              type: string
              nullable: true
              enum:
                - none
                - free
                - paid
                - partner
              description: none | free (the trial) | paid | partner (a reseller's share).
            limits:
              type: object
              properties:
                linkedin_sender_profiles:
                  type: integer
                  description: "LinkedIn sender profiles (accounts) the workspace may run: its share of the pool."
                email_inboxes:
                  type: integer
                  description: Inboxes the workspace may connect.
                credits_per_month:
                  type: integer
                  description: Platform credits granted to the workspace every month of the paid period.
                whitelabel:
                  type: integer
                  description: 1 = the workspace may register white label brands, 0 = not.
                linkedin_seats:
                  type: integer
                  description: Retired on 2026-10-25, always 0 here (linkedin_sender_profiles replaced it).
                email_seats:
                  type: integer
                  description: Retired on 2026-10-25, always 0 here (email_inboxes replaced it).
                credits_per_period:
                  type: integer
                  description: Retired on 2026-10-25, always 0 here (credits_per_month replaced it).
                accounts:
                  type: integer
                  description: A gtm key, 0 on this product.
                cloud_browser:
                  type: integer
                  description: A gtm key, 0 on this product.
                webhooks:
                  type: integer
                  description: A gtm key, 0 on this product.
                proxy_5g:
                  type: integer
                  description: A gtm key, 0 on this product.
              required:
                - linkedin_sender_profiles
                - email_inboxes
                - credits_per_month
                - whitelabel
              description: "The capacity snapshot: the allocation's quantities, zero when there is none."
            cluster_id:
              type: integer
              nullable: true
              description: The data cluster the workspace was assigned at creation; one cluster today.
            config:
              type: object
              nullable: true
              properties:
                timezone:
                  type: string
                  nullable: true
                  maxLength: 64
                  description: IANA zone the workspace counts its day in (Europe/Riga); null = UTC. Defaults to the owner's zone at creation.
              description: Workspace settings (TeamConfigValue); null when never written.
            created_by:
              type: object
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: Who created the workspace.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            data_deletion_at:
              type: string
              nullable: true
              description: When a workspace that lost its coverage is erased (8 weeks after the loss); null while covered.
            deletion_warned_at:
              type: string
              nullable: true
              description: When the owner was warned two weeks ahead of data_deletion_at; null when not yet.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null = live.
          required:
            - sid
            - owner_user_sid
            - subscription_sid
            - name
            - status
            - plan
            - limits
            - cluster_id
            - config
            - created_by
            - created_at
            - updated_at
            - data_deletion_at
            - deletion_warned_at
            - deleted_at
        result:
          type: object
          properties:
            previous_owner_user_sid:
              type: string
              description: The owner before the transfer (us_mb_...).
            changed:
              type: boolean
              description: false when the new owner was already the owner.
          required:
            - previous_owner_user_sid
            - changed
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - action
        - item
        - result
        - meta
    UndoCancelBillingSubscriptionResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - action
        action:
          type: string
          description: kebab-case verb; matches the route segment.
        item:
          type: object
          nullable: true
          properties:
            sid:
              type: string
              description: Subscription sid (bl_sb_...).
            owner_user_sid:
              type: string
              description: "The buyer (us_mb_...): the one who manages the pool."
            team_sid:
              type: string
              nullable: true
              description: "Always null on this product: a subscription floats and allocations bind workspaces to it."
            paddle_subscription_id:
              type: string
              nullable: true
              description: Paddle's id (sub_...); null on an internal sentinel (the trial).
            status:
              type: string
              enum:
                - active
                - past_due
                - paused
                - canceled
              description: "active; past_due (a failed renewal: LinkedIn and email run 3 more days); paused; canceled (terminal)."
            collection_mode:
              type: string
              enum:
                - automatic
                - manual
              description: automatic = the card is charged; manual = invoiced (a sales deal) or the trial sentinel.
            price_sid:
              type: string
              description: The first line's price (bl_pc_...); the lines include says what each line is.
            quantity:
              type: integer
              description: "1 on a resource subscription: a line is one item of quantity 1."
            addons:
              type: array
              items:
                type: object
                properties:
                  product_sid:
                    type: string
                    description: The line's product (bl_pr_...).
                  price_sid:
                    type: string
                    description: The line's price (bl_pc_...), a non-catalog price of this order.
                  paddle_item_id:
                    type: string
                    nullable: true
                    description: Paddle's item id on the subscription; null on a sentinel.
                  quantity:
                    type: integer
                    description: "Always 1 on a resource subscription: a line is one item."
                  status:
                    type: string
                    enum:
                      - active
                      - canceled
                    description: canceled = the line grants nothing any more.
                required:
                  - product_sid
                  - price_sid
                  - paddle_item_id
                  - quantity
                  - status
              description: The other lines of the order, one item each.
            currency:
              type: string
              description: "ISO 4217: USD, EUR or GBP."
            current_period_starts_at:
              type: string
              nullable: true
              description: ISO 8601 UTC.
            current_period_ends_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; the trial's end on the sentinel.
            next_billed_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null when nothing is billed next.
            paused_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null unless paused.
            scheduled_resume_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null unless a resume is scheduled.
            scheduled_change:
              type: object
              nullable: true
              properties:
                action:
                  type: string
                  enum:
                    - cancel
                    - pause
                    - resume
                  description: What happens at effective_at.
                effective_at:
                  type: string
                  description: ISO 8601 UTC.
                resume_at:
                  type: string
                  nullable: true
                  description: "For a scheduled pause: when it resumes; null = open-ended."
              required:
                - action
                - effective_at
                - resume_at
              description: A cancel, pause or resume waiting for the period end; null = none.
            canceled_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null unless canceled.
            canceled_by:
              type: object
              nullable: true
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: Who canceled; null unless canceled by a person.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null = live.
          required:
            - sid
            - owner_user_sid
            - team_sid
            - paddle_subscription_id
            - status
            - collection_mode
            - price_sid
            - quantity
            - addons
            - currency
            - current_period_starts_at
            - current_period_ends_at
            - next_billed_at
            - paused_at
            - scheduled_resume_at
            - scheduled_change
            - canceled_at
            - canceled_by
            - created_at
            - updated_at
            - deleted_at
        result:
          type: object
          additionalProperties: {}
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - action
        - item
        - result
        - meta
    UpdateApiKeyRequest:
      type: object
      description: Request body of `update_api_key`.
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 255
          description: New name, 1..255 chars.
        permissions:
          type: array
          items:
            type: string
            enum:
              - can_view_teams
              - can_manage_teams
              - can_view_team_members
              - can_manage_team_members
              - can_view_api_keys
              - can_manage_api_keys
              - can_view_oauth_clients
              - can_manage_oauth_clients
              - can_view_sessions
              - can_manage_sessions
              - can_view_account_shares
              - can_manage_account_shares
              - can_manage_account_transfers
              - can_view_billing
              - can_manage_billing
              - can_view_ssl_certificates
              - can_manage_ssl_certificates
              - can_view_notifications
              - can_manage_notifications
              - can_view_support_requests
              - can_manage_support_requests
              - can_view_linkedin_connections
              - can_act_linkedin_connections
              - can_view_linkedin_messages
              - can_act_linkedin_messages
              - can_act_linkedin_engagements
              - can_view_linkedin_searches
              - can_act_linkedin_searches
              - can_view_linkedin_enrichment
              - can_act_linkedin_enrichment
              - can_view_linkedin_accounts
              - can_update_linkedin_accounts
              - can_manage_linkedin_accounts
              - can_open_cloud_browser
              - can_change_proxy
              - can_edit_schedule
              - can_manage_smart_limits
              - can_manage_cloud_browser_external_links
              - can_share_vendor_profiles
              - can_act_linkedin_custom_requests
              - can_view_email_messages
              - can_act_email_messages
              - can_view_email_engagements
              - can_view_email_accounts
              - can_update_email_accounts
              - can_manage_email_accounts
              - can_view_email_suppressions
              - can_manage_email_suppressions
              - can_view_email_tracking_domains
              - can_manage_email_tracking_domains
              - can_view_email_sending_domains
              - can_manage_email_sending_domains
              - can_view_mass_actions
              - can_manage_mass_actions
              - can_view_webhooks
              - can_manage_webhooks
              - can_view_whitelabels
              - can_manage_whitelabels
              - can_view_integrations
              - can_manage_integrations
              - "*"
            description: A permission token of the gs catalog (can_view_teams, can_manage_webhooks, ...); * only from an unrestricted issuer. Playtables and inbox reads carry no tokens of their own yet.
          description: FULL replacement of the key's permission list.
        account_sids:
          type: array
          nullable: true
          items:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^ln_ac_
            description: "A LinkedIn account sid (ln_ac_...): one sender identity of the key's slice."
          minItems: 1
          maxItems: 100
          description: FULL replacement of the key's sender slice (ln_ac_...), inside the issuer's own; null = the issuer's whole slice.
    UpdateApiKeyResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - update
        item:
          type: object
          properties:
            sid:
              type: string
              description: API key sid (id_ak_...).
            team_sid:
              type: string
              description: The workspace the key acts as (ts_tm_...).
            name:
              type: string
              description: Human-readable name, unique among the team's live keys.
            token_prefix:
              type: string
              description: The first characters of the token (gs_live_...), for display.
            token_last4:
              type: string
              description: The last four characters of the token, for display.
            permissions:
              type: array
              items:
                type: string
              description: "What the key may do: the explicit token list."
            account_sids:
              type: array
              nullable: true
              items:
                type: string
              description: The key's sender slice (ln_ac_...), clamped to its issuer's; null = every account of the issuer's own slice.
            status:
              type: string
              enum:
                - active
                - revoked
                - expired
              description: active = verifies; revoked | expired = refused.
            expires_at:
              type: string
              nullable: true
              description: "ISO 8601 UTC; null = perpetual. Default at creation: three years."
            last_used_at:
              type: string
              nullable: true
              description: ISO 8601 UTC of the last verified call; null = never used.
            created_by:
              type: object
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: "The issuer: a person, or a parent key on delegation."
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; set with status revoked.
          required:
            - sid
            - team_sid
            - name
            - token_prefix
            - token_last4
            - permissions
            - account_sids
            - status
            - expires_at
            - last_used_at
            - created_by
            - created_at
            - updated_at
            - deleted_at
        updated_fields:
          type: array
          items:
            type: string
        previous_values:
          type: object
          additionalProperties: {}
        kept_fields:
          type: array
          items:
            type: string
          description: The fields this write did not change because the person's own value stands on them (stamped person); read the item for what landed.
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - updated_fields
        - previous_values
        - meta
    UpdateCurrentUserRequest:
      type: object
      description: Request body of `update_current_user`.
      properties:
        first_name:
          type: string
          minLength: 1
          maxLength: 120
          description: Given name, 1..120 chars.
        last_name:
          type: string
          nullable: true
          maxLength: 120
          description: Family name, up to 120 chars; null clears it.
        avatar_url:
          type: string
          nullable: true
          maxLength: 2048
          format: uri
          description: An absolute URL of the picture, up to 2048 chars; null removes the avatar.
        phone:
          type: string
          nullable: true
          maxLength: 40
          description: Up to 40 chars; null clears it.
        timezone:
          type: string
          nullable: true
          maxLength: 64
          description: IANA zone, e.g. Europe/Riga; null clears it.
        country:
          type: string
          nullable: true
          minLength: 2
          maxLength: 2
          description: ISO 3166-1 alpha-2; null clears it.
        config:
          type: object
          properties:
            latest_team_sid:
              type: string
              nullable: true
              description: Which workspace to open on load (ts_tm_...); NOT default_team_sid.
            setup_completed:
              type: boolean
              description: The post-signup wizard is finished (or its last step was skipped).
            setup_step:
              type: string
              nullable: true
              enum:
                - verify
                - questions
                - workspace
                - linkedin
                - call
              description: Resume point inside the wizard; null = not started.
            onboarding_completed:
              type: boolean
              description: The in-app Get started checklist is done.
            onboarding_steps:
              type: array
              items:
                type: string
              description: The checklist steps already completed.
            locale:
              type: string
              nullable: true
              maxLength: 8
              description: The UI locale the account picked (en, de, ...); null = the browser decides.
          description: "A shallow patch of the preferences: the keys sent are merged over the stored ones."
    UpdateCurrentUserResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - update
        item:
          type: object
          properties:
            sid:
              type: string
              description: User sid (us_mb_...).
            default_team_sid:
              type: string
              nullable: true
              description: The workspace the account signs into by default (ts_tm_...); null until a membership exists.
            email:
              type: string
              description: The sign-in address, lowercased.
            email_status:
              type: string
              enum:
                - unverified
                - verified
              description: unverified until the address confirmed its code.
            auth_provider:
              type: string
              enum:
                - password
                - google
              description: "How the account was CREATED: password = the email door (a mailed code since 2026-10-23, no password is held), google = Google sign-in."
            first_name:
              type: string
              description: Given name.
            last_name:
              type: string
              nullable: true
              description: Family name; null when not given.
            avatar_url:
              type: string
              nullable: true
              description: The avatar on the assets store (up to 2048 chars); null = initials.
            phone:
              type: string
              nullable: true
              description: Phone number as typed; null when not given.
            timezone:
              type: string
              nullable: true
              description: IANA zone of the person (Europe/Riga); the first workspace takes it as its day.
            country:
              type: string
              nullable: true
              description: ISO 3166-1 alpha-2.
            config:
              type: object
              nullable: true
              properties:
                latest_team_sid:
                  type: string
                  nullable: true
                  description: Which workspace to open on load (ts_tm_...); NOT default_team_sid.
                setup_completed:
                  type: boolean
                  description: The post-signup wizard is finished (or its last step was skipped).
                setup_step:
                  type: string
                  nullable: true
                  enum:
                    - verify
                    - questions
                    - workspace
                    - linkedin
                    - call
                  description: Resume point inside the wizard; null = not started.
                setup_call_step:
                  type: boolean
                  nullable: true
                  description: "Read-only: whether the wizard offers the intro call step; null = not scored yet. Dropped if sent on update."
                onboarding_completed:
                  type: boolean
                  description: The in-app Get started checklist is done.
                onboarding_steps:
                  type: array
                  items:
                    type: string
                  description: The checklist steps already completed.
                locale:
                  type: string
                  nullable: true
                  maxLength: 8
                  description: The UI locale the account picked (en, de, ...); null = the browser decides.
              description: Preferences and onboarding state (UserConfigValue); null when never written.
            utm:
              type: object
              nullable: true
              additionalProperties:
                type: string
              description: The UTM tags of the sign-up, as captured; null when there were none.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            erasure_requested_at:
              type: string
              nullable: true
              description: When the account asked to be erased (GDPR Art. 17); null = not requested. The 72h window runs from here.
            erased_at:
              type: string
              nullable: true
              description: When the erasure ran; null while the account is live.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null = live.
          required:
            - sid
            - default_team_sid
            - email
            - email_status
            - auth_provider
            - first_name
            - last_name
            - avatar_url
            - phone
            - timezone
            - country
            - config
            - utm
            - created_at
            - updated_at
            - erasure_requested_at
            - erased_at
            - deleted_at
        updated_fields:
          type: array
          items:
            type: string
        previous_values:
          type: object
          additionalProperties: {}
        kept_fields:
          type: array
          items:
            type: string
          description: The fields this write did not change because the person's own value stands on them (stamped person); read the item for what landed.
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - updated_fields
        - previous_values
        - meta
    UpdateOauthAuthorizationRequest:
      type: object
      description: Request body of `update_oauth_authorization`.
      properties:
        team_scope_mode:
          type: string
          enum:
            - selected
            - all_my_teams
          description: selected = the listed workspaces; all_my_teams = every workspace of the user.
        consented_team_sids:
          type: array
          items:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^ts_tm_
          description: FULL replacement; required and non-empty when the effective mode is selected; ignored under all_my_teams.
        permissions:
          type: array
          items:
            type: string
            maxLength: 128
            description: A permission token of the gs catalog, inside the client's ceiling.
          description: FULL replacement; inside the client's permission ceiling.
    UpdateOauthAuthorizationResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - update
        item:
          type: object
          properties:
            sid:
              type: string
              description: Grant sid (id_oa_...).
            user_sid:
              type: string
              description: The account that consented (us_mb_...).
            oauth_client_sid:
              type: string
              description: The connected app or agent (id_oc_...).
            team_scope_mode:
              type: string
              enum:
                - selected
                - all_my_teams
              description: selected = the listed workspaces; all_my_teams = every workspace the user is in, now and later.
            consented_team_sids:
              type: array
              items:
                type: string
              description: The workspaces in scope (ts_tm_...); empty under all_my_teams.
            permissions:
              type: array
              items:
                type: string
              description: What the app may do, inside the client's ceiling.
            status:
              type: string
              enum:
                - active
                - revoked
              description: active = tokens can be minted from it; revoked = disconnected.
            last_used_at:
              type: string
              nullable: true
              description: ISO 8601 UTC of the last token minted from the grant; null = never.
            created_at:
              type: string
              description: ISO 8601 UTC (connected since).
            updated_at:
              type: string
              description: ISO 8601 UTC.
          required:
            - sid
            - user_sid
            - oauth_client_sid
            - team_scope_mode
            - consented_team_sids
            - permissions
            - status
            - last_used_at
            - created_at
            - updated_at
        updated_fields:
          type: array
          items:
            type: string
        previous_values:
          type: object
          additionalProperties: {}
        kept_fields:
          type: array
          items:
            type: string
          description: The fields this write did not change because the person's own value stands on them (stamped person); read the item for what landed.
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - updated_fields
        - previous_values
        - meta
    UpdateOauthClientRequest:
      type: object
      description: Request body of `update_oauth_client`.
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 255
          description: New name, 1..255 chars.
        redirect_uris:
          type: array
          items:
            type: string
            maxLength: 2048
            format: uri
            pattern: ^https:\/\/
          minItems: 1
          description: FULL replacement of the exact-match https allow-list.
        permissions:
          type: array
          items:
            type: string
            maxLength: 128
            description: "A permission token of the gs catalog: the ceiling a grant through this client may request."
          description: FULL replacement of the permission ceiling.
        grant_types:
          type: array
          items:
            type: string
            enum:
              - authorization_code
              - refresh_token
          minItems: 1
          description: FULL replacement of the grant types.
        actor_kind:
          type: string
          enum:
            - agent
            - integration
          description: Reclassify the client; tokens minted afterwards carry the new kind.
    UpdateOauthClientResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - update
        item:
          type: object
          properties:
            sid:
              type: string
              description: OAuth client sid (id_oc_...).
            team_sid:
              type: string
              nullable: true
              description: The owning workspace (ts_tm_...); null = a platform client.
            name:
              type: string
              description: The application's name as the consent screen shows it.
            client_id:
              type: string
              description: The public identifier the app presents at /oauth/authorize.
            redirect_uris:
              type: array
              items:
                type: string
              description: The exact-match https allow-list of callback URLs.
            grant_types:
              type: array
              items:
                type: string
                enum:
                  - authorization_code
                  - refresh_token
              description: authorization_code and refresh_token.
            permissions:
              type: array
              items:
                type: string
              description: "The ceiling: the most a grant through this client may hold."
            is_confidential:
              type: boolean
              description: true = a confidential client with a secret; false = public, PKCE only.
            registration_kind:
              type: string
              enum:
                - manual
                - dynamic
              description: manual = registered here; dynamic = registered by the app itself (RFC 7591).
            actor_kind:
              type: string
              nullable: true
              enum:
                - agent
                - integration
              description: agent = its tokens act as an autonomous caller; integration = a tool a person uses; null = unclassified legacy row.
            status:
              type: string
              enum:
                - active
                - disabled
              description: disabled = its grants and tokens are revoked, the flow refuses it.
            created_by:
              type: object
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: Who registered the client.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null = live.
            client_secret:
              type: string
              nullable: true
              description: The secret of a confidential client, shown ONCE at create; never on a read.
          required:
            - sid
            - team_sid
            - name
            - client_id
            - redirect_uris
            - grant_types
            - permissions
            - is_confidential
            - registration_kind
            - actor_kind
            - status
            - created_by
            - created_at
            - updated_at
            - deleted_at
        updated_fields:
          type: array
          items:
            type: string
        previous_values:
          type: object
          additionalProperties: {}
        kept_fields:
          type: array
          items:
            type: string
          description: The fields this write did not change because the person's own value stands on them (stamped person); read the item for what landed.
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - updated_fields
        - previous_values
        - meta
    UpdateSubscriptionAllocationRequest:
      type: object
      description: Request body of `update_subscription_allocation`.
      properties:
        linkedin_sender_profiles:
          type: integer
          minimum: 0
          description: New LinkedIn sender profile (account) count.
        email_inboxes:
          type: integer
          minimum: 0
          description: New inbox count.
        credits_per_month:
          type: integer
          minimum: 0
          description: New credits a month.
        whitelabel:
          type: integer
          minimum: 0
          maximum: 1
          description: "1 or 0: the White label entitlement."
    UpdateSubscriptionAllocationResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - update
        item:
          type: object
          properties:
            sid:
              type: string
              description: Allocation sid (bl_al_...).
            subscription_sid:
              type: string
              description: The pool (bl_sb_...).
            team_sid:
              type: string
              description: The workspace holding the share (ts_tm_...); one live share per workspace.
            created_by:
              type: object
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: "Who handed the share out: the buyer, or system for the checkout and the trial."
            linkedin_sender_profiles:
              type: integer
              description: LinkedIn sender profiles (accounts) the workspace may run.
            email_inboxes:
              type: integer
              description: Inboxes the workspace may connect.
            credits_per_month:
              type: integer
              description: Platform credits granted to the workspace every month of the paid period (one lot per grant, kept while the plan runs and burnt when the workspace leaves it).
            whitelabel:
              type: integer
              description: 1 = the workspace may register white label brands; 0 = not.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; a superseded or taken-back share keeps its history.
          required:
            - sid
            - subscription_sid
            - team_sid
            - created_by
            - linkedin_sender_profiles
            - email_inboxes
            - credits_per_month
            - whitelabel
            - created_at
            - updated_at
            - deleted_at
        updated_fields:
          type: array
          items:
            type: string
        previous_values:
          type: object
          additionalProperties: {}
        kept_fields:
          type: array
          items:
            type: string
          description: The fields this write did not change because the person's own value stands on them (stamped person); read the item for what landed.
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - updated_fields
        - previous_values
        - meta
    UpdateTeamMemberRequest:
      type: object
      description: Request body of `update_team_member`.
      properties:
        permissions:
          type: array
          items:
            type: string
            enum:
              - can_view_teams
              - can_manage_teams
              - can_view_team_members
              - can_manage_team_members
              - can_view_api_keys
              - can_manage_api_keys
              - can_view_oauth_clients
              - can_manage_oauth_clients
              - can_view_sessions
              - can_manage_sessions
              - can_view_account_shares
              - can_manage_account_shares
              - can_manage_account_transfers
              - can_view_billing
              - can_manage_billing
              - can_view_ssl_certificates
              - can_manage_ssl_certificates
              - can_view_notifications
              - can_manage_notifications
              - can_view_support_requests
              - can_manage_support_requests
              - can_view_linkedin_connections
              - can_act_linkedin_connections
              - can_view_linkedin_messages
              - can_act_linkedin_messages
              - can_act_linkedin_engagements
              - can_view_linkedin_searches
              - can_act_linkedin_searches
              - can_view_linkedin_enrichment
              - can_act_linkedin_enrichment
              - can_view_linkedin_accounts
              - can_update_linkedin_accounts
              - can_manage_linkedin_accounts
              - can_open_cloud_browser
              - can_change_proxy
              - can_edit_schedule
              - can_manage_smart_limits
              - can_manage_cloud_browser_external_links
              - can_share_vendor_profiles
              - can_act_linkedin_custom_requests
              - can_view_email_messages
              - can_act_email_messages
              - can_view_email_engagements
              - can_view_email_accounts
              - can_update_email_accounts
              - can_manage_email_accounts
              - can_view_email_suppressions
              - can_manage_email_suppressions
              - can_view_email_tracking_domains
              - can_manage_email_tracking_domains
              - can_view_email_sending_domains
              - can_manage_email_sending_domains
              - can_view_mass_actions
              - can_manage_mass_actions
              - can_view_webhooks
              - can_manage_webhooks
              - can_view_whitelabels
              - can_manage_whitelabels
              - can_view_integrations
              - can_manage_integrations
              - "*"
            description: A permission token of the gs catalog (can_view_billing, can_manage_webhooks, ...); * is the owner's wildcard.
          description: Full replacement, stored as sent; each token must be held by the caller.
        account_sids:
          type: array
          nullable: true
          items:
            type: string
            minLength: 18
            maxLength: 18
            pattern: ^ln_ac_
            description: "A LinkedIn account sid (ln_ac_...): one sender identity of the member's slice."
          minItems: 1
          maxItems: 100
          description: Full replacement of the slice; null resets to every sender identity. An empty list is refused (422).
    UpdateTeamMemberResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - update
        item:
          type: object
          properties:
            sid:
              type: string
              description: Membership sid (ts_mb_...).
            team_sid:
              type: string
              description: The workspace (ts_tm_...).
            user_sid:
              type: string
              nullable: true
              description: The member's account (us_mb_...); null while the invite is pending.
            email:
              type: string
              description: The invited address.
            status:
              type: string
              enum:
                - invited
                - active
                - revoked
              description: invited = pending; active = a member; revoked = removed.
            permissions:
              type: array
              items:
                type: string
              description: The explicit token list the member holds, stored as sent (no floor is unioned in).
            account_sids:
              type: array
              nullable: true
              items:
                type: string
              description: The sender identities the member may see and use (ln_ac_...); null = every one of the workspace.
            created_by:
              type: object
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: Who invited.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null = live.
          required:
            - sid
            - team_sid
            - user_sid
            - email
            - status
            - permissions
            - account_sids
            - created_by
            - created_at
            - updated_at
            - deleted_at
        updated_fields:
          type: array
          items:
            type: string
        previous_values:
          type: object
          additionalProperties: {}
        kept_fields:
          type: array
          items:
            type: string
          description: The fields this write did not change because the person's own value stands on them (stamped person); read the item for what landed.
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - updated_fields
        - previous_values
        - meta
    UpdateTeamRequest:
      type: object
      description: Request body of `update_team`.
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 255
          description: New name, 1..255 chars.
        config:
          type: object
          nullable: true
          properties:
            timezone:
              type: string
              nullable: true
              maxLength: 64
              description: IANA zone the workspace counts its day in (Europe/Riga); null = UTC. Defaults to the owner's zone at creation.
          description: Workspace settings; null clears them (the day falls back to UTC).
    UpdateTeamResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - update
        item:
          type: object
          properties:
            sid:
              type: string
              description: Team sid (ts_tm_...).
            owner_user_sid:
              type: string
              description: "The structural owner (us_mb_...): the one who can delete the workspace or hand it over."
            subscription_sid:
              type: string
              nullable: true
              description: The subscription the workspace's live allocation draws from (bl_sb_...); null = no share, suspended.
            name:
              type: string
              description: Workspace name; not unique.
            status:
              type: string
              enum:
                - active
                - suspended
              description: active while its allocation draws from a live subscription; suspended otherwise (settings and billing stay reachable).
            plan:
              type: string
              nullable: true
              enum:
                - none
                - free
                - paid
                - partner
              description: none | free (the trial) | paid | partner (a reseller's share).
            limits:
              type: object
              properties:
                linkedin_sender_profiles:
                  type: integer
                  description: "LinkedIn sender profiles (accounts) the workspace may run: its share of the pool."
                email_inboxes:
                  type: integer
                  description: Inboxes the workspace may connect.
                credits_per_month:
                  type: integer
                  description: Platform credits granted to the workspace every month of the paid period.
                whitelabel:
                  type: integer
                  description: 1 = the workspace may register white label brands, 0 = not.
                linkedin_seats:
                  type: integer
                  description: Retired on 2026-10-25, always 0 here (linkedin_sender_profiles replaced it).
                email_seats:
                  type: integer
                  description: Retired on 2026-10-25, always 0 here (email_inboxes replaced it).
                credits_per_period:
                  type: integer
                  description: Retired on 2026-10-25, always 0 here (credits_per_month replaced it).
                accounts:
                  type: integer
                  description: A gtm key, 0 on this product.
                cloud_browser:
                  type: integer
                  description: A gtm key, 0 on this product.
                webhooks:
                  type: integer
                  description: A gtm key, 0 on this product.
                proxy_5g:
                  type: integer
                  description: A gtm key, 0 on this product.
              required:
                - linkedin_sender_profiles
                - email_inboxes
                - credits_per_month
                - whitelabel
              description: "The capacity snapshot: the allocation's quantities, zero when there is none."
            cluster_id:
              type: integer
              nullable: true
              description: The data cluster the workspace was assigned at creation; one cluster today.
            config:
              type: object
              nullable: true
              properties:
                timezone:
                  type: string
                  nullable: true
                  maxLength: 64
                  description: IANA zone the workspace counts its day in (Europe/Riga); null = UTC. Defaults to the owner's zone at creation.
              description: Workspace settings (TeamConfigValue); null when never written.
            created_by:
              type: object
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: Who created the workspace.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            data_deletion_at:
              type: string
              nullable: true
              description: When a workspace that lost its coverage is erased (8 weeks after the loss); null while covered.
            deletion_warned_at:
              type: string
              nullable: true
              description: When the owner was warned two weeks ahead of data_deletion_at; null when not yet.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null = live.
          required:
            - sid
            - owner_user_sid
            - subscription_sid
            - name
            - status
            - plan
            - limits
            - cluster_id
            - config
            - created_by
            - created_at
            - updated_at
            - data_deletion_at
            - deletion_warned_at
            - deleted_at
        updated_fields:
          type: array
          items:
            type: string
        previous_values:
          type: object
          additionalProperties: {}
        kept_fields:
          type: array
          items:
            type: string
          description: The fields this write did not change because the person's own value stands on them (stamped person); read the item for what landed.
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - updated_fields
        - previous_values
        - meta
    UpdateUserProfileRequest:
      type: object
      description: Request body of `update_user_profile`.
      properties:
        full_name:
          type: string
          nullable: true
          maxLength: 255
          description: Replaces the account's name too while that name is still the one derived from the sign-up email.
        headline:
          type: string
          nullable: true
          maxLength: 255
          description: The LinkedIn headline.
        role_title:
          type: string
          nullable: true
          maxLength: 255
          description: The current role.
        company_name:
          type: string
          nullable: true
          maxLength: 255
          description: The current company.
        location:
          type: string
          nullable: true
          maxLength: 255
          description: Where the person is.
        avatar_url:
          type: string
          nullable: true
          maxLength: 2048
          description: "The photo as read_linkedin_person gives it (an https address): the account takes it as its picture while it has none; a picture already set stays, and null changes nothing. Not a field of the card."
        experience_line:
          type: string
          nullable: true
          maxLength: 255
          description: One line you write from the positions when they say more than the headline ("11 years in B2B sales, before that Oracle"); null when they carry no dates and no earlier company.
        topics:
          type: array
          nullable: true
          items:
            type: string
            maxLength: 120
          maxItems: 10
          description: Two or three topics the person writes about.
        languages:
          type: array
          nullable: true
          items:
            type: string
            maxLength: 64
          maxItems: 20
          description: The languages the profile lists.
        ln_member_id:
          type: integer
          nullable: true
          minimum: 1
          description: The decoded member id.
        ln_id:
          type: string
          nullable: true
          maxLength: 64
          description: The profile URN.
        ln_nickname:
          type: string
          nullable: true
          maxLength: 2048
          description: The profile slug or its linkedin.com/in/ link; parsed to the slug at the edge, a URL is never stored.
        source:
          type: string
          nullable: true
          enum:
            - linkedin_company
            - linkedin_profile
            - website
            - person
            - creator
          description: "Stamps each field written: linkedin_profile for what the read said, person for the person's own words, creator for an inference; default person."
        read_at:
          type: string
          nullable: true
          description: ISO 8601; when the LinkedIn profile was read. A stamp itself, so it gets no source.
    UpdateUserProfileResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - update
        item:
          type: object
          properties:
            sid:
              type: string
              description: User profile sid (id_up_...).
            user_sid:
              type: string
              description: Whose card it is (ts_us_...).
            full_name:
              type: string
              nullable: true
            headline:
              type: string
              nullable: true
              description: The LinkedIn headline.
            role_title:
              type: string
              nullable: true
              description: The current role.
            company_name:
              type: string
              nullable: true
              description: The current company.
            location:
              type: string
              nullable: true
            experience_line:
              type: string
              nullable: true
              description: The experience in one line ("11 years in B2B sales").
            topics:
              type: array
              items:
                type: string
              description: Two or three topics the person writes about.
            languages:
              type: array
              items:
                type: string
            ln_member_id:
              type: integer
              nullable: true
            ln_id:
              type: string
              nullable: true
              description: The profile URN.
            ln_nickname:
              type: string
              nullable: true
              description: The public identifier (slug), never a URL.
            sources:
              type: object
              additionalProperties:
                type: object
                properties:
                  source:
                    type: string
                    description: "Where the value came from: linkedin_company, linkedin_profile, website, person (the person's own words) or creator (an inference)."
                  set_at:
                    type: string
                    description: ISO 8601 UTC; when it was written.
                required:
                  - source
                  - set_at
              description: One stamp per written field, keyed by the field's name.
            read_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; when the LinkedIn profile was last read.
            created_at:
              type: string
              nullable: true
              description: ISO 8601 UTC.
            updated_at:
              type: string
              nullable: true
              description: ISO 8601 UTC.
          required:
            - sid
            - user_sid
            - full_name
            - headline
            - role_title
            - company_name
            - location
            - experience_line
            - topics
            - languages
            - ln_member_id
            - ln_id
            - ln_nickname
            - sources
            - read_at
            - created_at
            - updated_at
        updated_fields:
          type: array
          items:
            type: string
        previous_values:
          type: object
          additionalProperties: {}
        kept_fields:
          type: array
          items:
            type: string
          description: The fields this write did not change because the person's own value stands on them (stamped person); read the item for what landed.
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - updated_fields
        - previous_values
        - meta
    UpdateWhitelabelRequest:
      type: object
      description: Request body of `update_whitelabel`.
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 255
          description: New brand name, 1..255 chars.
        domain:
          type: string
          maxLength: 253
          pattern: ^(?=.{1,253}$)([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$
          description: New host, only while the brand is pending_domain.
        logo_url:
          type: string
          nullable: true
          maxLength: 2048
          pattern: ^https:\/\/
          description: https URL of the horizontal logo; null clears it. The file itself is uploaded in the app.
        icon_url:
          type: string
          nullable: true
          maxLength: 2048
          pattern: ^https:\/\/
          description: https URL of the square mark; null clears it.
        login_image_url:
          type: string
          nullable: true
          maxLength: 2048
          pattern: ^https:\/\/
          description: https URL of the login artwork; null clears it.
        palette:
          type: object
          nullable: true
          properties:
            primary_color:
              type: string
              nullable: true
              pattern: ^#[0-9a-fA-F]{6}$
              description: "Buttons and links, #rrggbb; null = the platform default."
            accent_color:
              type: string
              nullable: true
              pattern: ^#[0-9a-fA-F]{6}$
              description: "The accent, #rrggbb; null = the platform default."
            login_background_color:
              type: string
              nullable: true
              pattern: ^#[0-9a-fA-F]{6}$
              description: "The login page background, #rrggbb; null = the platform default."
          description: "Brand colors, #rrggbb each; null = the platform defaults."
        email_from_name:
          type: string
          nullable: true
          maxLength: 255
          description: The From name on the clients' mail; null = the brand name.
        email_reply_to:
          type: string
          nullable: true
          maxLength: 255
          format: email
          description: The Reply-To on the clients' mail; null = none.
        email_from_address:
          type: string
          nullable: true
          maxLength: 255
          format: email
          description: The brand's own sender address; refused on a host SendGrid cannot authenticate (422 email_domain_invalid), a platform domain (422 email_domain_reserved) or another team's (409 email_domain_already_taken). Proven by verify_whitelabel_email_domain.
    UpdateWhitelabelResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - update
        item:
          type: object
          properties:
            sid:
              type: string
              description: Brand sid (id_wl_...).
            team_sid:
              type: string
              description: The owning reseller team (ts_tm_...).
            name:
              type: string
              description: The brand name the app shell shows and the mail is signed with.
            domain:
              type: string
              description: The app and login host (app.reseller.com), lowercase FQDN, unique platform-wide; read-only once active.
            status:
              type: string
              enum:
                - pending_domain
                - active
                - disabled
              description: pending_domain = waiting for the CNAME and the certificate; active = the host serves the brand; disabled = switched off, the host falls back to the platform brand.
            logo_url:
              type: string
              nullable: true
              description: The horizontal logo (app shell and email header).
            icon_url:
              type: string
              nullable: true
              description: The square mark or favicon.
            login_image_url:
              type: string
              nullable: true
              description: The login page artwork.
            palette:
              type: object
              nullable: true
              properties:
                primary_color:
                  type: string
                  nullable: true
                  pattern: ^#[0-9a-fA-F]{6}$
                  description: "Buttons and links, #rrggbb; null = the platform default."
                accent_color:
                  type: string
                  nullable: true
                  pattern: ^#[0-9a-fA-F]{6}$
                  description: "The accent, #rrggbb; null = the platform default."
                login_background_color:
                  type: string
                  nullable: true
                  pattern: ^#[0-9a-fA-F]{6}$
                  description: "The login page background, #rrggbb; null = the platform default."
              description: Brand colors; null = all platform defaults.
            email_from_name:
              type: string
              nullable: true
              description: The From name on the clients' mail; null = the brand name.
            email_reply_to:
              type: string
              nullable: true
              description: The Reply-To on the clients' mail; null = none.
            email_from_address:
              type: string
              nullable: true
              description: The brand's own sender address; mail leaves from it once email_domain is verified, from the platform address under the brand's name until then.
            email_domain:
              type: object
              nullable: true
              properties:
                domain:
                  type: string
                  description: "The domain part of email_from_address, lowercase: what SendGrid authenticates."
                status:
                  type: string
                  enum:
                    - pending
                    - verified
                    - failed
                  description: pending = records not all found yet; verified = the brand's mail leaves from its own address; failed = see failure_reason.
                records:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        description: "cname (three of them: the return path and two DKIM keys)."
                      host:
                        type: string
                        description: The record name to publish at the domain's DNS host.
                      value:
                        type: string
                        description: The CNAME target at SendGrid.
                      valid:
                        type: boolean
                        description: What the last check found for this record.
                    required:
                      - type
                      - host
                      - value
                      - valid
                  description: The DNS records to publish, in the order SendGrid issued them.
                failure_reason:
                  type: string
                  nullable: true
                  enum:
                    - email_domain_rejected
                    - email_domain_not_proven_in_time
                  description: email_domain_rejected (SendGrid refused the domain) or email_domain_not_proven_in_time (48 hours lapsed); null unless failed.
                checked_at:
                  type: string
                  nullable: true
                  description: ISO 8601 UTC of the last check against SendGrid.
                verified_at:
                  type: string
                  nullable: true
                  description: ISO 8601 UTC since when it is verified; null while it is not.
              required:
                - domain
                - status
                - records
                - failure_reason
                - checked_at
                - verified_at
              description: The proof of the sending domain; null = verify never ran, or the address moved to another domain.
            created_by:
              type: object
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: Who registered the brand.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null = live.
          required:
            - sid
            - team_sid
            - name
            - domain
            - status
            - logo_url
            - icon_url
            - login_image_url
            - palette
            - email_from_name
            - email_reply_to
            - email_from_address
            - email_domain
            - created_by
            - created_at
            - updated_at
            - deleted_at
        updated_fields:
          type: array
          items:
            type: string
        previous_values:
          type: object
          additionalProperties: {}
        kept_fields:
          type: array
          items:
            type: string
          description: The fields this write did not change because the person's own value stands on them (stamped person); read the item for what landed.
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - updated_fields
        - previous_values
        - meta
    UpdateWorkspaceProfileRequest:
      type: object
      description: Request body of `update_workspace_profile`.
      properties:
        company:
          type: object
          properties:
            name:
              type: string
              nullable: true
              maxLength: 255
            tagline:
              type: string
              nullable: true
              maxLength: 500
              description: What the company does, in one line.
            industry:
              type: string
              nullable: true
              maxLength: 255
            people_count:
              type: integer
              nullable: true
              minimum: 0
              maximum: 100000000
            founded_year:
              type: integer
              nullable: true
              minimum: 1000
            location:
              type: string
              nullable: true
              maxLength: 255
            website:
              type: string
              nullable: true
              maxLength: 2048
              description: A domain; a URL is reduced to its host.
            ln_id:
              type: string
              nullable: true
              maxLength: 64
              pattern: ^\d+$
              description: The numeric company id, as digits.
            ln_nickname:
              type: string
              nullable: true
              maxLength: 2048
              description: The company page slug or its linkedin.com/company/ link, parsed to the slug.
          description: "The company section, replaced whole: a key left out becomes null (or an empty list), so read the profile first and send the section back with the fields changed."
        who_buys:
          type: object
          properties:
            roles:
              type: array
              nullable: true
              items:
                type: string
                maxLength: 120
              maxItems: 30
            industries:
              type: array
              nullable: true
              items:
                type: string
                maxLength: 120
              maxItems: 30
            company_size:
              type: string
              nullable: true
              maxLength: 120
            regions:
              type: array
              nullable: true
              items:
                type: string
                maxLength: 120
              maxItems: 30
            example_clients:
              type: array
              nullable: true
              items:
                type: string
                maxLength: 160
              maxItems: 50
          description: The who-buys section, replaced whole (the same rule).
        offer:
          type: object
          properties:
            what_we_sell:
              type: string
              nullable: true
              maxLength: 1000
            proof:
              type: string
              nullable: true
              maxLength: 1000
            price:
              type: string
              nullable: true
              maxLength: 500
          description: The offer section, replaced whole (the same rule).
        source:
          type: string
          nullable: true
          enum:
            - linkedin_company
            - linkedin_profile
            - website
            - person
            - creator
          description: "Stamps every field of the sections given: website, linkedin_company, linkedin_profile for what a read said, person for the person's own words, creator for an inference; default person. A value the person wrote stands against any other source (kept_fields)."
        confirm:
          type: boolean
          nullable: true
          description: True marks the profile confirmed (the person said the cards are right); sent alone, it confirms without a write.
    UpdateWorkspaceProfileResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - update
        item:
          type: object
          properties:
            sid:
              type: string
              description: Workspace profile sid (id_wp_...).
            team_sid:
              type: string
              description: The workspace (ts_tm_...).
            company:
              type: object
              properties:
                name:
                  type: string
                  nullable: true
                tagline:
                  type: string
                  nullable: true
                  description: What the company does, in one line.
                industry:
                  type: string
                  nullable: true
                people_count:
                  type: integer
                  nullable: true
                  description: The LinkedIn page's headcount.
                founded_year:
                  type: integer
                  nullable: true
                location:
                  type: string
                  nullable: true
                  description: Where it is based.
                website:
                  type: string
                  nullable: true
                  description: A bare domain (acme.com), never a URL.
                ln_id:
                  type: string
                  nullable: true
                  description: The numeric LinkedIn company id, as digits.
                ln_nickname:
                  type: string
                  nullable: true
                  description: The LinkedIn company page slug, never a URL.
              required:
                - name
                - tagline
                - industry
                - people_count
                - founded_year
                - location
                - website
                - ln_id
                - ln_nickname
            who_buys:
              type: object
              properties:
                roles:
                  type: array
                  items:
                    type: string
                  description: The titles that buy.
                industries:
                  type: array
                  items:
                    type: string
                company_size:
                  type: string
                  nullable: true
                  description: In words ("10 to 200 staff").
                regions:
                  type: array
                  items:
                    type: string
                example_clients:
                  type: array
                  items:
                    type: string
                  description: Names from the site's cases and logos.
              required:
                - roles
                - industries
                - company_size
                - regions
                - example_clients
            offer:
              type: object
              properties:
                what_we_sell:
                  type: string
                  nullable: true
                  description: One or two lines.
                proof:
                  type: string
                  nullable: true
                  description: A case, a number; null when nothing said it.
                price:
                  type: string
                  nullable: true
                  description: Price and terms; null when nothing said it.
              required:
                - what_we_sell
                - proof
                - price
            sources:
              type: object
              additionalProperties:
                type: object
                properties:
                  source:
                    type: string
                    description: "Where the value came from: linkedin_company, linkedin_profile, website, person (the person's own words) or creator (an inference)."
                  set_at:
                    type: string
                    description: ISO 8601 UTC; when it was written.
                required:
                  - source
                  - set_at
              description: One stamp per written field, keyed "section.field" ("company.name", "who_buys.roles", "offer.price").
            confirmed_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; when the person said the cards are right (update with confirm true); null until then.
            version:
              type: integer
              description: Moves on every write.
            created_at:
              type: string
              nullable: true
              description: ISO 8601 UTC.
            updated_at:
              type: string
              nullable: true
              description: ISO 8601 UTC.
          required:
            - sid
            - team_sid
            - company
            - who_buys
            - offer
            - sources
            - confirmed_at
            - version
            - created_at
            - updated_at
        updated_fields:
          type: array
          items:
            type: string
        previous_values:
          type: object
          additionalProperties: {}
        kept_fields:
          type: array
          items:
            type: string
          description: The fields this write did not change because the person's own value stands on them (stamped person); read the item for what landed.
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - item
        - updated_fields
        - previous_values
        - meta
    VerifyWhitelabelEmailDomainResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        operation:
          type: string
          enum:
            - action
        action:
          type: string
        async:
          type: boolean
          enum:
            - true
        item:
          type: object
          nullable: true
          properties:
            sid:
              type: string
              description: Brand sid (id_wl_...).
            team_sid:
              type: string
              description: The owning reseller team (ts_tm_...).
            name:
              type: string
              description: The brand name the app shell shows and the mail is signed with.
            domain:
              type: string
              description: The app and login host (app.reseller.com), lowercase FQDN, unique platform-wide; read-only once active.
            status:
              type: string
              enum:
                - pending_domain
                - active
                - disabled
              description: pending_domain = waiting for the CNAME and the certificate; active = the host serves the brand; disabled = switched off, the host falls back to the platform brand.
            logo_url:
              type: string
              nullable: true
              description: The horizontal logo (app shell and email header).
            icon_url:
              type: string
              nullable: true
              description: The square mark or favicon.
            login_image_url:
              type: string
              nullable: true
              description: The login page artwork.
            palette:
              type: object
              nullable: true
              properties:
                primary_color:
                  type: string
                  nullable: true
                  pattern: ^#[0-9a-fA-F]{6}$
                  description: "Buttons and links, #rrggbb; null = the platform default."
                accent_color:
                  type: string
                  nullable: true
                  pattern: ^#[0-9a-fA-F]{6}$
                  description: "The accent, #rrggbb; null = the platform default."
                login_background_color:
                  type: string
                  nullable: true
                  pattern: ^#[0-9a-fA-F]{6}$
                  description: "The login page background, #rrggbb; null = the platform default."
              description: Brand colors; null = all platform defaults.
            email_from_name:
              type: string
              nullable: true
              description: The From name on the clients' mail; null = the brand name.
            email_reply_to:
              type: string
              nullable: true
              description: The Reply-To on the clients' mail; null = none.
            email_from_address:
              type: string
              nullable: true
              description: The brand's own sender address; mail leaves from it once email_domain is verified, from the platform address under the brand's name until then.
            email_domain:
              type: object
              nullable: true
              properties:
                domain:
                  type: string
                  description: "The domain part of email_from_address, lowercase: what SendGrid authenticates."
                status:
                  type: string
                  enum:
                    - pending
                    - verified
                    - failed
                  description: pending = records not all found yet; verified = the brand's mail leaves from its own address; failed = see failure_reason.
                records:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        description: "cname (three of them: the return path and two DKIM keys)."
                      host:
                        type: string
                        description: The record name to publish at the domain's DNS host.
                      value:
                        type: string
                        description: The CNAME target at SendGrid.
                      valid:
                        type: boolean
                        description: What the last check found for this record.
                    required:
                      - type
                      - host
                      - value
                      - valid
                  description: The DNS records to publish, in the order SendGrid issued them.
                failure_reason:
                  type: string
                  nullable: true
                  enum:
                    - email_domain_rejected
                    - email_domain_not_proven_in_time
                  description: email_domain_rejected (SendGrid refused the domain) or email_domain_not_proven_in_time (48 hours lapsed); null unless failed.
                checked_at:
                  type: string
                  nullable: true
                  description: ISO 8601 UTC of the last check against SendGrid.
                verified_at:
                  type: string
                  nullable: true
                  description: ISO 8601 UTC since when it is verified; null while it is not.
              required:
                - domain
                - status
                - records
                - failure_reason
                - checked_at
                - verified_at
              description: The proof of the sending domain; null = verify never ran, or the address moved to another domain.
            created_by:
              type: object
              properties:
                actor_type:
                  type: string
                  enum:
                    - user
                    - support
                    - api_key
                    - system
                    - agent
                actor_sid:
                  type: string
                  nullable: true
                team_sid:
                  type: string
                actor_name:
                  type: string
                  nullable: true
                  description: The OAuth client that acted ("Claude", "n8n"); null for a user, an API key or a system job.
                oauth_client_sid:
                  type: string
                  nullable: true
                  description: The acting OAuth client (id_oc_*); null off the OAuth path.
                reason:
                  type: string
                  nullable: true
                  description: Why a system actor wrote the row (snapshot_capture_job, ...); null otherwise.
                permissions:
                  type: object
                  additionalProperties: {}
                  description: "Internal audit context: the grant set the actor held at write time. Not a contract."
                cluster_id:
                  type: integer
                  nullable: true
                  description: "Internal audit context: the cluster that served the write."
                trace_id:
                  type: string
                  nullable: true
                  description: "Internal audit context: the trace id of the request that wrote the row."
              required:
                - actor_type
                - actor_sid
                - team_sid
                - permissions
              description: Who registered the brand.
            created_at:
              type: string
              description: ISO 8601 UTC.
            updated_at:
              type: string
              description: ISO 8601 UTC.
            deleted_at:
              type: string
              nullable: true
              description: ISO 8601 UTC; null = live.
          required:
            - sid
            - team_sid
            - name
            - domain
            - status
            - logo_url
            - icon_url
            - login_image_url
            - palette
            - email_from_name
            - email_reply_to
            - email_from_address
            - email_domain
            - created_by
            - created_at
            - updated_at
            - deleted_at
        pending:
          type: array
          items:
            type: object
            properties:
              expected_completion_seconds:
                type: integer
                description: "activate: 300; verify-email-domain: 3600."
              webhook_events:
                type: array
                items:
                  type: string
                description: "activate: whitelabels.activated, whitelabels.activation-failed; verify-email-domain: whitelabels.email-domain-verified, whitelabels.email-domain-failed."
              polling_hint:
                type: string
                description: "Poll get_whitelabel: after activate (include ssl_certificate) until status is active; after verify-email-domain until email_domain.status is verified or failed."
            required:
              - expected_completion_seconds
              - webhook_events
              - polling_hint
          description: "One ref: the proof in flight."
        result:
          type: object
          additionalProperties: {}
        meta:
          type: object
          properties:
            trace_id:
              type: string
              description: UUID v7; same 128-bit value as the X-Trace-Id header.
            span_id:
              type: string
              pattern: ^[0-9a-f]{16}$
              description: 16 hex chars, root span of this request.
            timestamp:
              type: string
              description: ISO 8601 UTC (Y-m-dTH:i:sZ), response time.
            duration_ms:
              type: integer
              minimum: 0
              description: Server-side wall clock.
            team_sid:
              type: string
              nullable: true
              description: The team this call ran in (the token team, or the team_sid override). Null when unauthenticated; absent from pre-2026-08-20 backends.
            actor_type:
              type: string
              nullable: true
              description: user | agent | api_key | system. Null when unauthenticated; absent from pre-2026-08-20 backends.
          required:
            - trace_id
            - span_id
            - timestamp
            - duration_ms
      required:
        - success
        - operation
        - action
        - async
        - item
        - pending
        - result
        - meta
