openapi: 3.1.0
info:
  title: SparkVault API
  version: 1.2.1702
  description: Generated from the SparkVault API route definitions. Every method, path, tag, and security requirement reflects the deployed code; request/response schemas appear where routes declare them or where apps/api/openapi/overlay.mjs documents them.
servers:
  - url: https://api.sparkvault.com/v1
tags:
  - name: account
  - name: analytics
  - name: api-keys
  - name: apps
  - name: audit-logs
  - name: auth
  - name: billing
  - name: config
  - name: domains
  - name: entropy
  - name: files
  - name: hd
  - name: health
  - name: help-desk
  - name: identity
  - name: me
  - name: messaging
  - name: notify
  - name: profile
  - name: public
  - name: settings
  - name: sparklinks
  - name: sparks
  - name: structured-ingots
  - name: unsubscribe
  - name: users
  - name: vaults
paths:
  /account:
    get:
      tags:
        - account
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "200":
          description: The account.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/Account"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: the account does not exist."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read the account
      description: "The organization's account: its name, handle, time zone, whether its emails name files, logos and proven domains. Any member, or an API key."
    put:
      tags:
        - account
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The account as saved.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/Account"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the name, the time zone or `email_file_names` is malformed (`details.field`), the body names no setting to change, or it carries more than two logos. A logo is refused, the message naming it (`light logo:` or `dark logo:`), when it is not a PNG, JPG or SVG image, its bytes are not the format it declares, an SVG holds a script, an event handler or an embedded document, its width and height cannot be read (an SVG needs a viewBox on its svg element, or a width and height in px or another absolute unit), or a side is more than 100,000 px. A name that reads as SparkVault or as a web address (holding :// or starting with www.), or holds an at sign (@) or a text-direction control character, is refused with `details.field` organization_name and `details.reason` reserved_name. Nothing is uploaded or saved."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller is not an org admin, or the credential is an API key."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: the account does not exist, or its deletion began while the save ran; nothing is saved."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: a logo the save replaces changed while it ran (another save replaced it, or a removal took it out); nothing is saved, and the account keeps the logo that change left. Read the account again and retry."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "413":
          description: "PAYLOAD_TOO_LARGE: a logo is larger than the cap."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Save the organization settings
      description: "Save the organization's settings: its name, the time zone its reports count days in, whether its emails name files, and its logos. A save carries the settings it changes, at least one, and keeps every other as stored. A JSON body carries the name, time zone and `email_file_names`; a multipart body carries the same fields and the logos (`logo` for light backgrounds, `logo_dark` for dark ones, each 2 MB at most). The answer is the account as GET /account serves it, taken from the write. Each change is recorded in the account audit log (`organization_name_changed`, `logo_updated`, `email_file_names_changed`). Org admins only, from their own session."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              minProperties: 1
              properties:
                organization_name:
                  type: string
                  description: The organization's display name. Omitted, it is kept; it cannot be cleared.
                time_zone:
                  type: string
                  description: An IANA time zone such as America/New_York, stored in the time zone database's spelling. Omitted, it is kept.
                email_file_names:
                  type: boolean
                  description: "Whether the emails the platform sends about a file name it: the public-upload notification, a file's SparkLink invitation and the attachments of a help desk update. False, each says a file was uploaded, shared or attached without naming it. True until an org admin turns it off. Omitted, it is kept."
          multipart/form-data:
            schema:
              type: object
              minProperties: 1
              properties:
                organization_name:
                  type: string
                time_zone:
                  type: string
                email_file_names:
                  type: string
                  enum:
                    - "true"
                    - "false"
                logo:
                  type: string
                  format: binary
                logo_dark:
                  type: string
                  format: binary
    delete:
      tags:
        - account
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - confirmation
              properties:
                confirmation:
                  type: string
                  minLength: 1
                  maxLength: 255
                  description: The organization name, exactly as it stands (case-sensitive).
              additionalProperties: false
      responses:
        "202":
          description: The deletion has started.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/AccountDeletionStarted"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the confirmation is missing, or is not the organization name exactly as it stands."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials, or a suspended account (`details.reason` ACCOUNT_UNAVAILABLE)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller is not the account owner, the credential is an API key or an impersonated session, or the account is the SparkVault platform account."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: the account does not exist: its deletion has finished."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "SEAT_CHANGE_IN_PROGRESS: another billing update for this account is in progress. Try again in a moment. LEGAL_HOLD_ACTIVE: a request in the account's help desk is under legal hold; clear every hold, then delete the account."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: "INTERNAL_ERROR: a Stripe subscription could not be cancelled, or the deletion could not start. Retry the request: a retry resumes a deletion that has started."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Delete the account
      description: "The account owner deletes the account, permanently: every vault, ingot, folder, Spark, key and member's access goes, and SparkVault cannot recover any of it. Only the owner may, from their own session (an API key or an impersonated session is refused), confirming with the organization name exactly as it stands. Every Stripe subscription billing the account is cancelled at once, before the deletion starts, and nothing is refunded for the rest of the period. A subscription bought through the App Store or Google Play cannot be cancelled by SparkVault: the deletion goes on, and `store_subscriptions` names each one, which keeps billing until it is cancelled in the store. From the answer on, no member, session or key of the account authenticates (401 with `details.reason` ACCOUNT_UNAVAILABLE) for anything but this request, which the owner may repeat while the deletion runs: it is acknowledged (202) and cancels nothing again. While any request in the account's help desk is under legal hold the deletion does not start: nothing is cancelled, and every hold must be cleared first. The rest of the deletion finishes in the background, and the account is then gone (404)."
  /account/logo:
    delete:
      tags:
        - account
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The account as the removal left it.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/Account"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: `variant` is neither `light` nor `dark`; nothing is removed."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller is not an org admin, or the credential is an API key."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: the account does not exist; nothing is removed."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: a logo the removal names changed since it was read (a save replaced or added it); nothing is removed from the account, which keeps that logo, and the image the removal read, which the account no longer names, is deleted. Read the account again and retry."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Remove the organization's logos
      description: Remove the organization's logo for light backgrounds, its logo for dark ones, or both (`variant` omitted). The account stops naming a logo before its image is deleted, and only while it still names the logo the removal read, so a logo another save put in place meanwhile is never removed unseen. Removing a variant the account holds no logo for changes nothing. The answer is the account as GET /account serves it, as the removal left it. Each removed logo is recorded in the account audit log (`logo_updated`, its new id null). Org admins only, from their own session.
      parameters:
        - name: variant
          in: query
          required: false
          schema:
            type: string
            enum:
              - light
              - dark
          description: "The logo to remove: `light` or `dark`. Omitted, both are removed."
  /account/organization-handle:
    put:
      tags:
        - account
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - handle
                - impacts_acknowledged
              properties:
                handle:
                  type: string
                  maxLength: 63
                  description: "An organization handle: three to 40 lowercase letters, digits and single hyphens, starting with a letter and ending with a letter or digit."
                impacts_acknowledged:
                  type: array
                  uniqueItems: true
                  maxItems: 4
                  items:
                    type: string
                    minLength: 1
                    maxLength: 1024
                  description: "The impacts the admin confirmed: empty for a first claim, and for a change the acknowledgements a 409 IMPACTS_CHANGED answer listed in `details.impacts_acknowledged`, sent back as listed."
                tombstone_handle:
                  type: string
                  maxLength: 63
                  description: "The former handle a change gives up, sent only when the organization already keeps the most former handles it can: one of the `details.tombstone_candidates` a 409 IMPACTS_CHANGED or HANDLE_TOMBSTONE_REQUIRED answer listed."
              additionalProperties: false
      responses:
        "200":
          description: The handle the organization now holds, and the addresses the change moved.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/OrganizationHandleClaimed"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the handle is outside the grammar or reserved, a handle that reads as SparkVault's brand included (`details.reason` invalid | reserved), `tombstone_handle` names a former handle on a change that gives up none (`details.field` tombstone_handle), or the body is malformed."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller is not an org admin, or the credential is an API key. HANDLE_REQUIRES_PRODUCT: the organization holds no product the handle serves (`details.products`)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "IMPACTS_CHANGED: `impacts_acknowledged` is not exactly the acknowledgements of the impacts the change has; `details.impacts` lists the impacts, `details.impacts_acknowledged` their acknowledgements and `details.tombstone_candidates` the former handles the change may give up (empty when it gives up none). HANDLE_TOMBSTONE_REQUIRED: the change gives a former handle up and `tombstone_handle` names none of `details.tombstone_candidates`, with the same details. HANDLE_TAKEN: another claim holds the handle. CONFLICT: the organization's handle changed while the request ran; read it again and retry."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account has spent its 60 handle checks this hour. HANDLE_CHANGE_LIMIT: the organization has changed its handle 3 times in the last 30 days. `Retry-After` carries the seconds until the budget reopens or the change is allowed, and `details.resets_at` the moment."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Claim or change the organization handle
      description: "Claim the organization's handle, or change it. Its sign-in page then answers at https://auth.sv/{handle}, beside the base62 address of the account id, which keeps working. A change commits only against the impacts the server computes: send `impacts_acknowledged` empty, and a change answers 409 IMPACTS_CHANGED with `details.impacts`, the addresses it moves, and `details.impacts_acknowledged`, their acknowledgements; confirm by sending those acknowledgements back as listed. An acknowledgement names one impact whole (its kind and both addresses), so a confirm made before another change landed is refused again with the impacts the change has now. A first claim moves no address and commits at once. The old handle stays the organization's for good: its address redirects to the current one, and no one can claim it again, the organization included. An organization keeps at most 3 former handles: past them, the 409 also lists in `details.tombstone_candidates` the former handles the change may give up (those it left at least 30 days ago), and the confirm names one as `tombstone_handle`. A given-up handle stays the organization's, never claimable again, and stops redirecting. An organization claims or changes a handle only while it holds a product the handle serves (Secure Identity, the help desk or Notify), and changes it at most 3 times in 30 days; a first claim is no change. A request for the handle the organization already holds changes nothing. Each claim spends one of the account's 60 hourly handle checks. Org admins only, from an interactive session."
  /account/organization-handle/availability:
    get:
      tags:
        - account
      security:
        - BearerAuth: []
      parameters:
        - name: handle
          in: query
          required: true
          schema:
            type: string
            maxLength: 63
            description: "An organization handle: three to 40 lowercase letters, digits and single hyphens, starting with a letter and ending with a letter or digit."
      responses:
        "200":
          description: Whether the handle is available.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/OrganizationHandleAvailability"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: `handle` is missing, or longer than 63 characters."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller is not an org admin, or the credential is an API key."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account has spent its 60 handle checks this hour. `Retry-After` carries the seconds until the budget reopens, and `details` carries `limit`, `used` and `resets_at`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Check a handle
      description: "Whether the organization could claim `handle` as its organization handle now. A handle any organization ever claimed is taken, this organization's own current and former handles included, given up or not: a handle is never released. A handle outside the grammar is `invalid`. A platform word, an auth.sv portal section, the first path segment of one of the API's own root routes (such as `health`), and any handle that reads as SparkVault's brand (SparkVault, SparkLink) in any spelling, such as `spark-vault` or `sparkvau1t`, is `reserved`: a handle names the host the organization's mail goes out from ({handle}.help.sv, {handle}.send.sv), so one reading as SparkVault would present that mail as SparkVault's own. Neither reads the claims. Every lookup of the claims spends the account's hourly budget of 60 handle checks, shared with claims. Org admins only, from an interactive session."
  /analytics/activity:
    get:
      tags:
        - analytics
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "200":
          description: The feed.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - events
                      - count
                      - period
                      - filtered_by
                    properties:
                      events:
                        type: array
                        items:
                          $ref: "#/components/schemas/ActivityEvent"
                      count:
                        type: integer
                      period:
                        type: string
                        description: The `period` sent, or `day`.
                      filtered_by:
                        type:
                          - string
                          - "null"
                        description: The `event_type` filter applied, or null.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
      summary: Read the last day's activity
      description: "The account's usage-ledger operations of the last 24 hours, newest first, at most `limit` of them: a monitoring feed, not an audit trail, and not paged."
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 50
          description: "A page-size hint: a value above 200 reads as 200, and a missing, zero, negative or non-numeric one as 50."
        - name: event_type
          in: query
          required: false
          schema:
            type: string
          description: Only the events of this exact `event_type`.
        - name: period
          in: query
          required: false
          schema:
            type: string
            default: day
          description: Answered back as `period`, as sent; the feed always covers the last 24 hours.
  /analytics/api-keys/{id}:
    get:
      tags:
        - analytics
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The API key (`api_key_id`).
      responses:
        "200":
          description: The key's statistics.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - api_key
                      - usage
                      - note
                    properties:
                      api_key:
                        type: object
                        required:
                          - api_key_id
                          - name
                          - key_preview
                          - status
                          - created_at
                        properties:
                          api_key_id:
                            type: string
                          name:
                            type: string
                          key_preview:
                            type: string
                            description: The masked key, as GET /api-keys shows it.
                          status:
                            type: string
                            enum:
                              - active
                              - expired
                              - revoked
                          created_at:
                            type: integer
                            description: Unix seconds.
                      usage:
                        type: object
                        required:
                          - last_used_at
                          - days_since_last_used
                          - days_since_creation
                          - is_active
                        properties:
                          last_used_at:
                            type:
                              - integer
                              - "null"
                            description: Unix seconds; null when the key was never used.
                          days_since_last_used:
                            type:
                              - integer
                              - "null"
                            description: Null when the key was never used.
                          days_since_creation:
                            type: integer
                          is_active:
                            type: boolean
                            description: Used within the last 30 days.
                      note:
                        type: string
                        enum:
                          - Per-request counts are not recorded for API keys.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials, or an API key that no longer authenticates: revoked, expired, or created by a member who has left the account (in the moments after their removal, 403 instead)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller is not an active org admin now (a key whose creator was demoted included), or the credential is not an org admin's own session or API key."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no API key with this id on this account."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read an API key's statistics
      description: "One of the account's API keys and what its record says of its use: when it was created and last used. No request of a key is counted, which the answer's `note` says. For an org admin as they stand now: their own session, or an API key whose creator is an active org admin of the account now. Every other member, an internal caller and an impersonated session are refused."
  /analytics/overview:
    get:
      tags:
        - analytics
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "200":
          description: The overview.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - period
                      - period_start
                      - period_end
                      - period_days
                      - sparks
                      - vaults
                      - ingots
                      - activity
                    properties:
                      period:
                        type: string
                        enum:
                          - day
                          - week
                          - month
                          - quarter
                        description: The period counted.
                      period_start:
                        type: integer
                        description: Unix seconds.
                      period_end:
                        type: integer
                        description: "Unix seconds: now."
                      period_days:
                        type: integer
                      sparks:
                        type: object
                        required:
                          - total
                          - active
                          - burned
                          - deleted
                          - expired
                          - created_this_period
                          - rate_per_day
                        properties:
                          total:
                            type: integer
                            description: "On record now: `active` + `burned` + `deleted` + `expired`."
                          active:
                            type: integer
                            description: Unread and unexpired.
                          burned:
                            type: integer
                            description: A recipient read or answered it, or its content was recalled.
                          deleted:
                            type: integer
                            description: Deleted by the account before anyone read it.
                          expired:
                            type: integer
                            description: Past its lifetime unread.
                          created_this_period:
                            type: integer
                            description: "Created over the period, by the ledger: a Spark an app holds counts, though it is not listed."
                          rate_per_day:
                            type: number
                            description: "`created_this_period` per day, to two decimals."
                      vaults:
                        type: object
                        required:
                          - total
                          - active
                          - created_this_period
                          - rate_per_day
                        properties:
                          total:
                            type: integer
                            description: "Live vaults: one being deleted is not counted."
                          active:
                            type: integer
                            description: Equal to `total`.
                          created_this_period:
                            type: integer
                          rate_per_day:
                            type: number
                      ingots:
                        type: object
                        required:
                          - total
                          - storage_bytes
                          - storage_mb
                          - storage_gb
                        properties:
                          total:
                            type: integer
                            description: Files across the live vaults.
                          storage_bytes:
                            type: integer
                            description: The account's stored bytes, as billing meters them.
                          storage_mb:
                            type: number
                          storage_gb:
                            type: number
                      activity:
                        type: object
                        required:
                          - total_operations
                          - operations_per_day
                        properties:
                          total_operations:
                            type: integer
                            description: Usage-ledger rows over the period.
                          operations_per_day:
                            type: number
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
      summary: Read the account overview
      description: "The account's Sparks, vaults, files and usage at a glance. Every count of Sparks is of the Sparks on record now, the ones GET /sparks lists to the same caller, by the state each is reported in: a Spark's record is removed a day after its lifetime ends, so they are no lifetime totals. `created_this_period` and the rates come from the usage ledger over `period`, which keeps every row."
      parameters:
        - name: period
          in: query
          required: false
          schema:
            type: string
            default: month
          description: "The span the period counts cover: `day`, `week`, `month` (30 days) or `quarter` (90 days). Any other value reads as `month`."
  /analytics/spark-activity:
    get:
      tags:
        - analytics
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Sparks (`details.products`: sparks). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
  /analytics/usage-over-time:
    get:
      tags:
        - analytics
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        default:
          description: Response
  /analytics/vaults/{id}:
    get:
      tags:
        - analytics
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
  /api-keys:
    get:
      tags:
        - api-keys
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "200":
          description: A page of API keys.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - api_keys
                      - count
                      - has_more
                      - active
                    properties:
                      api_keys:
                        type: array
                        items:
                          $ref: "#/components/schemas/ApiKeySummary"
                      count:
                        type: integer
                        description: How many this page holds.
                      has_more:
                        type: boolean
                        description: "More follow. A page can hold fewer than `limit`, or none, while more remain: page on while it is true."
                      next_cursor:
                        type: string
                        description: "Present while `has_more` is true: pass it back as `cursor` for the next page."
                      active:
                        type: integer
                        description: How many keys of this page are active.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: a `cursor` this list did not issue for the same query."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials, or an API key that no longer authenticates: revoked, expired, or created by a member who has left the account (in the moments after their removal, 403 instead)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller is not an active org admin now (a key whose creator was demoted included), or the credential is not an org admin's own session or API key."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List the account's API keys
      description: "A page of the account's API keys, revoked and expired ones included, never the keys themselves. Page with `cursor` until `has_more` is false. For an org admin as they stand now: their own session, or an API key whose creator is an active org admin of the account now. Every other member, an internal caller and an impersonated session are refused."
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 50
          description: "A page-size hint: a value above 100 reads as 100, and a missing, zero, negative or non-numeric one as 50."
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: The `next_cursor` a previous page returned. Opaque, and sealed to the query that issued it.
    post:
      tags:
        - api-keys
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The key, including its one-time secret.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    allOf:
                      - $ref: "#/components/schemas/ApiKeySummary"
                      - type: object
                        required:
                          - api_key
                          - warning
                        properties:
                          api_key:
                            type: string
                            description: The full key, shown once in this response.
                          warning:
                            type: string
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: invalid name, expiry or scope; scopes are mutually exclusive."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: an interactive administrator session is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: an administrator or owner must create the key."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: this account has no such scoped vault or Notify project."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Create an API key
      description: A current administrator or owner signed in interactively creates a key. The secret is returned once. Omit both scopes for existing personal company authority. notify_project_id restricts a personal key to one Notify project. structured_ingots_scope creates an account-owned service key for one vault, with read or read_write access and NHI-DVAK unseal only. The service key survives creator removal; live key/account/vault lifecycle is checked on every request. Scopes are mutually exclusive. Service keys cannot use ordinary file, Spark or administration endpoints.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 100
                expires_in_days:
                  type:
                    - integer
                    - "null"
                  minimum: 1
                  maximum: 3650
                notify_project_id:
                  type: string
                  pattern: ^(?:default|ntp_[A-Za-z0-9_-]+)$
                  maxLength: 128
                structured_ingots_scope:
                  type: object
                  additionalProperties: false
                  required:
                    - vault_id
                    - access_level
                  properties:
                    vault_id:
                      type: string
                    access_level:
                      type: string
                      enum:
                        - read
                        - read_write
  /api-keys/{id}:
    delete:
      tags:
        - api-keys
      security:
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /apps:
    get:
      tags:
        - apps
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        default:
          description: Response
  /apps/hubspot/delete-file:
    post:
      tags:
        - apps
      security:
        - HubSpotRequestSignature: []
      responses:
        default:
          description: Response
  /apps/hubspot/download:
    post:
      tags:
        - apps
      security:
        - HubSpotRequestSignature: []
      responses:
        default:
          description: Response
  /apps/hubspot/files:
    post:
      tags:
        - apps
      security:
        - HubSpotRequestSignature: []
      responses:
        default:
          description: Response
  /apps/hubspot/oauth/callback:
    post:
      tags:
        - apps
      security:
        - BearerAuth: []
      responses:
        default:
          description: Response
  /apps/hubspot/uninstall:
    delete:
      tags:
        - apps
      security:
        - BearerAuth: []
      responses:
        default:
          description: Response
  /apps/hubspot/unseal:
    post:
      tags:
        - apps
      security:
        - HubSpotRequestSignature: []
      responses:
        default:
          description: Response
  /apps/salesforce/delete-file:
    post:
      tags:
        - apps
      security:
        - SalesforcePanelSecret: []
      responses:
        default:
          description: Response
  /apps/salesforce/download:
    post:
      tags:
        - apps
      security:
        - SalesforcePanelSecret: []
      responses:
        default:
          description: Response
  /apps/salesforce/files:
    post:
      tags:
        - apps
      security:
        - SalesforcePanelSecret: []
      responses:
        default:
          description: Response
  /apps/salesforce/oauth/callback:
    post:
      tags:
        - apps
      security:
        - BearerAuth: []
      responses:
        default:
          description: Response
  /apps/salesforce/uninstall:
    delete:
      tags:
        - apps
      security:
        - BearerAuth: []
      responses:
        default:
          description: Response
  /apps/salesforce/unseal:
    post:
      tags:
        - apps
      security:
        - SalesforcePanelSecret: []
      responses:
        default:
          description: Response
  /apps/slack/analytics:
    get:
      tags:
        - apps
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        default:
          description: Response
  /apps/slack/channels:
    get:
      tags:
        - apps
      security:
        - BearerAuth: []
      responses:
        default:
          description: Response
  /apps/slack/oauth/callback:
    post:
      tags:
        - apps
      security:
        - BearerAuth: []
      responses:
        default:
          description: Response
  /apps/slack/uninstall:
    delete:
      tags:
        - apps
      security:
        - BearerAuth: []
      responses:
        default:
          description: Response
  /apps/{app_id}:
    get:
      tags:
        - apps
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: app_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
    post:
      tags:
        - apps
      security:
        - BearerAuth: []
      parameters:
        - name: app_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
    put:
      tags:
        - apps
      security:
        - BearerAuth: []
      parameters:
        - name: app_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
    delete:
      tags:
        - apps
      security:
        - BearerAuth: []
      parameters:
        - name: app_id
          in: path
          required: true
          schema:
            type: string
          description: The app, by its catalog id.
      responses:
        "204":
          description: The installation is removed.
        "400":
          description: "VALIDATION_ERROR: `app_id` is not an app id, `expected_settings` is not an object of at most 20 scalar values, or `expected_installed_at` is not a Unix time in seconds."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller is not an org admin, or the credential is not an interactive session."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such app, or the organization holds no active installation of it."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the installation does not hold the settings or the install time the request names, or it changed while it was being removed; nothing was removed. Read it again before deciding."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Uninstall an app
      description: "Remove the organization's installation of an app (org admins only, from an interactive session: an API key is refused). The removal can be held to the installation the caller last read: `expected_settings` and `expected_installed_at` name what it held, and an installation that holds anything else is left in place and answered 409, so a request made before the app was connected again never removes the new connection. The app's integration session, when it holds one, is revoked with the removal, never apart from it."
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                expected_settings:
                  type: object
                  maxProperties: 20
                  propertyNames:
                    minLength: 1
                    maxLength: 128
                  additionalProperties:
                    type:
                      - string
                      - number
                      - boolean
                      - "null"
                  description: "The installation's settings as last read: each must hold exactly this value, a setting the installation lacks comparing as null. Omitted, the settings are not compared."
                expected_installed_at:
                  type: integer
                  minimum: 0
                  description: Unix seconds the installation was made, as last read. Omitted, it is not compared.
  /audit-logs:
    get:
      tags:
        - audit-logs
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "200":
          description: A page of the trail.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - entries
                      - count
                      - has_more
                      - event_types
                    properties:
                      entries:
                        type: array
                        items:
                          $ref: "#/components/schemas/AuditLogEntry"
                      count:
                        type: integer
                        description: How many this page holds.
                      has_more:
                        type: boolean
                        description: "More follow. A page can hold fewer than `limit`, or none, while more remain: page on while it is true."
                      next_cursor:
                        type: string
                        description: "Present while `has_more` is true: pass it back as `cursor` for the next page."
                      event_types:
                        type: array
                        items:
                          type: string
                        description: Every event type the account scope records.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: a `cursor` this list did not issue for the same query."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read the account's audit trail
      description: A page of the account's audit entries, newest first. Page with `cursor` until `has_more` is false.
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 25
          description: "A page-size hint: a value above 100 reads as 100, and a missing, zero, negative or non-numeric one as 25."
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: The `next_cursor` a previous page returned, with the same `event_types`. Opaque, and sealed to the query that issued it.
        - name: event_types
          in: query
          required: false
          schema:
            type: string
          description: "Only these event types, comma-separated, each one of the scope's `event_types`. Omitted: every event."
  /auth/complete-signup:
    post:
      tags:
        - auth
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - organization_name
              properties:
                organization_name:
                  type: string
                  minLength: 1
                  maxLength: 255
                full_name:
                  type: string
                  maxLength: 100
                given_name:
                  type: string
                  maxLength: 100
                family_name:
                  type: string
                  maxLength: 100
              additionalProperties: false
      responses:
        "200":
          description: The organization is created.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/SignupCompleted"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: `organization_name` is missing, or a name is malformed. An organization name that reads as SparkVault or as a web address (holding :// or starting with www.), or holds an at sign (@) or a text-direction control character, is refused with `details.field` organization_name and `details.reason` reserved_name: the name signs the mail the organization sends through SparkVault. Nothing is created."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the session is not identity-only or the email is registered already, the email's domain is claimed by another organization, or a browser request comes from an origin other than the console's."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: an account for this email, or a claim on its domain, landed while the request ran."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Create your organization
      description: "With the identity-only session of a verified email that has no member yet, create the organization and its first member, who holds the admin role and is the account owner (the account's email is theirs), and answer a full session for them. An email whose domain another organization has claimed is refused: that organization's admin invites its people."
  /auth/identity/token:
    post:
      tags:
        - auth
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - code
                - code_verifier
              properties:
                code:
                  type: string
                  minLength: 1
                  maxLength: 512
                code_verifier:
                  type: string
                  minLength: 43
                  maxLength: 128
              additionalProperties: false
      responses:
        "200":
          description: The session.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/SessionStarted"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: `code` or `code_verifier` is missing or malformed."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: Identity refused the code (expired, replayed, or its verifier or redirect mismatched), or the member or account cannot sign in: a suspended or deleting account answers with `details.reason` ACCOUNT_UNAVAILABLE. A member invited who has not accepted the invitation answers with `details.reason` INVITATION_PENDING, and a message saying to open the invitation emailed to them or ask an admin to resend it, or, when the mail transport declined their latest invitation, that it could not be emailed to their address and an admin can invite them at another."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: a browser request (one carrying `Origin` or `Referer`, or `X-SV-Client: web`) from an origin other than the console's."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "INTERNAL_ERROR: the identity service did not answer. Try again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Exchange an authorization code for a session
      description: "Exchange the authorization code SparkVault Identity redirected back with, and its PKCE verifier, for a SparkVault session: a full one for a registered member, an identity-only one for a verified email with no member yet."
  /auth/identity/verify:
    post:
      tags:
        - auth
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - token
              properties:
                token:
                  type: string
                  minLength: 1
                  maxLength: 4096
              additionalProperties: false
      responses:
        "200":
          description: The session.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/SessionStarted"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: `token` is missing or malformed."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: the token does not verify, or the member or account cannot sign in: a suspended or deleting account answers with `details.reason` ACCOUNT_UNAVAILABLE. A member invited who has not accepted the invitation answers with `details.reason` INVITATION_PENDING, and a message saying to open the invitation emailed to them or ask an admin to resend it, or, when the mail transport declined their latest invitation, that it could not be emailed to their address and an admin can invite them at another."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: a browser request (one carrying `Origin` or `Referer`, or `X-SV-Client: web`) from an origin other than the console's."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "INTERNAL_ERROR: the identity service did not answer. Try again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Exchange an Identity token for a session
      description: "Exchange the Identity token a sign-in through SparkVault's own Identity account answers for a SparkVault session: the same session POST /auth/identity/token answers for an authorization code."
  /auth/logout:
    post:
      tags:
        - auth
      security: []
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                refresh_token:
                  type: string
                  minLength: 1
                  maxLength: 1024
              additionalProperties: false
      responses:
        default:
          description: Response
  /auth/refresh:
    post:
      tags:
        - auth
      security: []
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                refresh_token:
                  type: string
                  minLength: 1
                  maxLength: 1024
              additionalProperties: false
      responses:
        "200":
          description: The renewed session.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/SessionRefreshed"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: a native or server client sent no `refresh_token`, or a malformed one."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: a browser presented no session cookie, or the refresh token is invalid, revoked, expired or presented on the other transport, or the member or account cannot sign in: a suspended or deleting account answers with `details.reason` ACCOUNT_UNAVAILABLE. TOKEN_REPLAY: the refresh token was already used, which ends its session."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: a browser request (one carrying `Origin` or `Referer`, or `X-SV-Client: web`) from an origin other than the console's."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: "TOKEN_VALIDATION_FAILED: the renewal failed before the refresh token rotated (a read of the session, its account, its member or their products failed, for one): repeat the request with the same refresh token. INTERNAL_ERROR: the renewal's outcome is unknown, and the refresh token sent may have rotated."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "TOKEN_GENERATION_FAILED: signing is unavailable for a moment, so nothing rotated: repeat the request with the same refresh token."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Renew a session
      description: "Exchange a refresh token for a new access token and the next refresh token: each refresh token is used once. A native or server client sends `refresh_token` in the body; a browser presents the `__Host-sv_refresh` cookie. A full session answers with the member and the account as they stand now."
  /billing/charge:
    post:
      tags:
        - billing
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        default:
          description: Response
  /billing/credits:
    get:
      tags:
        - billing
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "200":
          description: Available and reserved balances, what the stored files need, opt-in refill settings and a pending purchase.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      balance:
                        type: object
                        description: Subscription credits are consumed first; prepaid purchased credits carry forward. Reserved credits are already removed from available balances.
                        properties:
                          subscription_microcredits:
                            type: integer
                            minimum: 0
                          purchased_microcredits:
                            type: integer
                            minimum: 0
                          reserved_microcredits:
                            type: integer
                            minimum: 0
                          available_microcredits:
                            type: integer
                            minimum: 0
                          subscription_credits:
                            type: number
                            minimum: 0
                          purchased_credits:
                            type: number
                            minimum: 0
                          reserved_credits:
                            type: number
                            minimum: 0
                          available_credits:
                            type: number
                            minimum: 0
                          funding_review_required:
                            type: boolean
                          funding_review_reference:
                            type:
                              - string
                              - "null"
                          subscription_allowance_paused_until:
                            type:
                              - integer
                              - "null"
                            description: When an included allowance paused by payment reversal can next renew. Clearing payment review does not restore revoked included credits.
                          subscription_cycle_id:
                            type:
                              - string
                              - "null"
                          subscription_expires_at:
                            type:
                              - integer
                              - "null"
                      storage:
                        type:
                          - object
                          - "null"
                        description: What the stored files need from the wallet now, by the calculation their funding charge uses. Every paid use of credits covers the stored files first when the balance allows. Until they are covered, paid usage is refused (402 USAGE_CREDITS_EXHAUSTED with details.reason storage_unfunded), except Entropy and a person's sign-in codes and security alerts, which go on to be charged at their own rates. This read never charges, holds or refills. Null for an account not billed in usage credits. With no current subscription period the amounts and funded_until are null.
                        properties:
                          stored_bytes:
                            type: integer
                            minimum: 0
                          funded:
                            type: boolean
                            description: The stored files are covered through funded_until.
                          funded_until:
                            type:
                              - integer
                              - "null"
                            description: Epoch seconds the stored files are covered through, now or once needed credits cover them.
                          needed_microcredits:
                            type:
                              - integer
                              - "null"
                            minimum: 0
                          needed_credits:
                            type:
                              - number
                              - "null"
                            minimum: 0
                          shortfall_microcredits:
                            type:
                              - integer
                              - "null"
                            minimum: 0
                            description: What the available balance lacks of the needed credits.
                          shortfall_credits:
                            type:
                              - number
                              - "null"
                            minimum: 0
                      auto_refill:
                        type: object
                        required:
                          - enabled
                        properties:
                          enabled:
                            type: boolean
                          threshold_credits:
                            type: integer
                            minimum: 0
                          refill_credits:
                            type: integer
                            minimum: 1000
                            maximum: 10000000
                            multipleOf: 1000
                          monthly_limit_usd:
                            type: string
                            description: Positive whole-cent USD limit for unattended refills per UTC calendar month. Subscription changes do not reset the limit; manual purchases are confirmed separately.
                      auto_refill_spent_usd:
                        type: string
                      purchase:
                        anyOf:
                          - type: object
                            properties:
                              request_id:
                                type: string
                              status:
                                type: string
                              credits:
                                type: integer
                              bonus_credits:
                                type: integer
                              total_credits:
                                type: integer
                              amount_cents:
                                type: integer
                              amount_usd:
                                type: string
                              payment_intent_id:
                                type:
                                  - string
                                  - "null"
                              client_secret:
                                type: string
                          - type: "null"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
      summary: Read the organization usage-credit wallet
  /billing/credits/auto-refill:
    put:
      tags:
        - billing
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The saved refill policy.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - enabled
                    properties:
                      enabled:
                        type: boolean
                      threshold_credits:
                        type: integer
                        minimum: 0
                      refill_credits:
                        type: integer
                        minimum: 1000
                        maximum: 10000000
                        multipleOf: 1000
                      monthly_limit_usd:
                        type: string
                        description: Positive whole-cent USD limit for unattended refills per UTC calendar month. Subscription changes do not reset the limit; manual purchases are confirmed separately.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: invalid quantity, settings, request identity or purchase amount confirmation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: money-changing operations require an interactive organization administrator."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: Credit funding changed, another payment is pending, the confirmed quote changed, a payment mismatches the purchase, or a payment method is required. No unfunded credits are issued.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Configure automatic prepaid refills
      description: Disabled by default. Low balance may trigger one saved-card charge within the monthly automatic spending limit. Failure never creates a credit line.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - enabled
              properties:
                enabled:
                  type: boolean
                threshold_credits:
                  type: integer
                  minimum: 0
                refill_credits:
                  type: integer
                  minimum: 1000
                  maximum: 10000000
                  multipleOf: 1000
                monthly_limit_usd:
                  type: string
                  description: Positive whole-cent USD limit for unattended refills per UTC calendar month. Subscription changes do not reset the limit; manual purchases are confirmed separately.
  /billing/credits/purchase:
    post:
      tags:
        - billing
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The verified purchase state and wallet balance.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      purchase:
                        type: object
                        properties:
                          request_id:
                            type: string
                          status:
                            type: string
                          credits:
                            type: integer
                          bonus_credits:
                            type: integer
                          total_credits:
                            type: integer
                          amount_cents:
                            type: integer
                          amount_usd:
                            type: string
                          payment_intent_id:
                            type:
                              - string
                              - "null"
                          client_secret:
                            type: string
                      balance:
                        type: object
                        description: Subscription credits are consumed first; prepaid purchased credits carry forward. Reserved credits are already removed from available balances.
                        properties:
                          subscription_microcredits:
                            type: integer
                            minimum: 0
                          purchased_microcredits:
                            type: integer
                            minimum: 0
                          reserved_microcredits:
                            type: integer
                            minimum: 0
                          available_microcredits:
                            type: integer
                            minimum: 0
                          subscription_credits:
                            type: number
                            minimum: 0
                          purchased_credits:
                            type: number
                            minimum: 0
                          reserved_credits:
                            type: number
                            minimum: 0
                          available_credits:
                            type: number
                            minimum: 0
                          funding_review_required:
                            type: boolean
                          funding_review_reference:
                            type:
                              - string
                              - "null"
                          subscription_allowance_paused_until:
                            type:
                              - integer
                              - "null"
                            description: When an included allowance paused by payment reversal can next renew. Clearing payment review does not restore revoked included credits.
                          subscription_cycle_id:
                            type:
                              - string
                              - "null"
                          subscription_expires_at:
                            type:
                              - integer
                              - "null"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: invalid quantity, settings, request identity or purchase amount confirmation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: money-changing operations require an interactive organization administrator."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: Credit funding changed, another payment is pending, the confirmed quote changed, a payment mismatches the purchase, or a payment method is required. No unfunded credits are issued.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Purchase prepaid usage credits
      description: A durable request_id makes retries safe. Credits appear only after a matching successful payment. Confirm required customer authentication using the returned client_secret, then reconcile the purchase.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - request_id
                - credits
                - quoted_amount_cents
              properties:
                request_id:
                  type: string
                  pattern: ^[A-Za-z0-9_-]{8,128}$
                credits:
                  type: integer
                  minimum: 1000
                  maximum: 10000000
                  multipleOf: 1000
                quoted_amount_cents:
                  type: integer
                  minimum: 1
                promotion_id:
                  type: string
                quoted_total_credits:
                  type: integer
                  minimum: 1
                  description: Required when redeeming a promotion; confirms the server-quoted total including bonus credits.
  /billing/credits/purchase/{id}/confirm:
    post:
      tags:
        - billing
      security:
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: The reconciled purchase and wallet balance.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      purchase:
                        type: object
                        properties:
                          request_id:
                            type: string
                          status:
                            type: string
                          credits:
                            type: integer
                          bonus_credits:
                            type: integer
                          total_credits:
                            type: integer
                          amount_cents:
                            type: integer
                          amount_usd:
                            type: string
                          payment_intent_id:
                            type:
                              - string
                              - "null"
                          client_secret:
                            type: string
                      balance:
                        type: object
                        description: Subscription credits are consumed first; prepaid purchased credits carry forward. Reserved credits are already removed from available balances.
                        properties:
                          subscription_microcredits:
                            type: integer
                            minimum: 0
                          purchased_microcredits:
                            type: integer
                            minimum: 0
                          reserved_microcredits:
                            type: integer
                            minimum: 0
                          available_microcredits:
                            type: integer
                            minimum: 0
                          subscription_credits:
                            type: number
                            minimum: 0
                          purchased_credits:
                            type: number
                            minimum: 0
                          reserved_credits:
                            type: number
                            minimum: 0
                          available_credits:
                            type: number
                            minimum: 0
                          funding_review_required:
                            type: boolean
                          funding_review_reference:
                            type:
                              - string
                              - "null"
                          subscription_allowance_paused_until:
                            type:
                              - integer
                              - "null"
                            description: When an included allowance paused by payment reversal can next renew. Clearing payment review does not restore revoked included credits.
                          subscription_cycle_id:
                            type:
                              - string
                              - "null"
                          subscription_expires_at:
                            type:
                              - integer
                              - "null"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: invalid quantity, settings, request identity or purchase amount confirmation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: money-changing operations require an interactive organization administrator."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: Credit purchase not found for this account.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: Credit funding changed, another payment is pending, the confirmed quote changed, a payment mismatches the purchase, or a payment method is required. No unfunded credits are issued.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Reconcile a prepaid credit payment
      description: Reads payment state from Stripe and grants once only after confirmed success. Client-reported payment success cannot grant credits.
  /billing/credits/purchases:
    get:
      tags:
        - billing
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "200":
          description: A page of sanitized paid receipts.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      purchases:
                        type: array
                        items:
                          type: object
                          properties:
                            request_id:
                              type: string
                            paid_at:
                              type: integer
                            status:
                              type: string
                              enum:
                                - succeeded
                                - partially_refunded
                                - refunded
                            credits:
                              type: integer
                            bonus_credits:
                              type: integer
                            total_credits:
                              type: integer
                            amount_usd:
                              type: string
                            refunded_usd:
                              type: string
                            amount_cents:
                              type: integer
                            refunded_cents:
                              type: integer
                            automatic:
                              type: boolean
                            currency:
                              type: string
                              const: usd
                      next_cursor:
                        type:
                          - string
                          - "null"
                      has_more:
                        type: boolean
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: Invalid, modified or foreign purchase-history cursor.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read prepaid purchase and refill receipts
      description: A bounded chronological page, newest first, containing confirmed purchases and their refund status. The sealed cursor belongs only to this account and list. Provider request bodies and credentials are never returned.
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 25
          description: "A page-size hint: a value above 100 reads as 100, and a missing, zero, negative or non-numeric one as 25."
        - name: cursor
          in: query
          schema:
            type: string
  /billing/credits/quote:
    post:
      tags:
        - billing
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The server-calculated credit quantity and dollar price.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      credits:
                        type: integer
                        minimum: 1000
                        maximum: 10000000
                        multipleOf: 1000
                      bonus_credits:
                        type: integer
                      total_credits:
                        type: integer
                      amount_cents:
                        type: integer
                      amount_usd:
                        type: string
                      currency:
                        type: string
                        const: usd
                      bands:
                        type: array
                        items:
                          type: object
                          additionalProperties: true
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: invalid quantity, settings, request identity or purchase amount confirmation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: money-changing operations require an interactive organization administrator."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: Credit funding changed, another payment is pending, the confirmed quote changed, a payment mismatches the purchase, or a payment method is required. No unfunded credits are issued.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Quote a prepaid credit purchase
      description: Prices marginal purchase bands and an optional server-configured promotion. This read creates no charge or credits.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - credits
              properties:
                credits:
                  type: integer
                  minimum: 1000
                  maximum: 10000000
                  multipleOf: 1000
                promotion_id:
                  type: string
  /billing/iap/validate:
    post:
      tags:
        - billing
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "200":
          description: Verified fulfillment or a verified purchase that no longer entitles.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - provisioned
                    properties:
                      provisioned:
                        type: boolean
                      kind:
                        type: string
                        enum:
                          - consumable
                      channel:
                        type: string
                        enum:
                          - appstore
                          - play
                      credits:
                        type: integer
                        minimum: 1
                      duplicate:
                        type: boolean
                      reason:
                        type: string
                      balance:
                        type: object
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "IAP_RECEIPT_INVALID or VALIDATION_ERROR: the purchase, type, quantity or request does not verify."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "IAP_ACCOUNT_MISMATCH or ACCOUNT_UNAVAILABLE: the verified purchase belongs elsewhere or the account is being deleted."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: A different subscription or permanent purchase owner already holds the entitlement, or a consumed purchase has no recorded grant.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "INTERNAL_ERROR: purchases are not set up, the product is not available, or a store or provisioning step failed for now. Leave the transaction unfinished and retry recovery."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Verify and fulfill a native subscription or prepaid credit pack
      description: The authenticated account must match the store-signed binding of current offers. Monthly subscription proofs grant the included allowance once per verified paid store period. Consumables grant the canonical purchased credits once per permanent transaction identity. Finish or consume the native transaction only after provisioned:true. Recovery remains available when new sales are disabled; verified refunds reconcile the original grant and reversal without creating debt.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - platform
                - product_id
              properties:
                platform:
                  type: string
                  enum:
                    - ios
                    - android
                product_id:
                  type: string
                receipt:
                  type: string
                  writeOnly: true
                  description: Apple signed StoreKit transaction JWS; required on iOS.
                purchase_token:
                  type: string
                  writeOnly: true
                  description: Google Play purchase token; required on Android.
  /billing/invoices:
    get:
      tags:
        - billing
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        default:
          description: Response
  /billing/payment-methods:
    get:
      tags:
        - billing
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        default:
          description: Response
    post:
      tags:
        - billing
      security:
        - BearerAuth: []
      responses:
        default:
          description: Response
  /billing/payment-methods/setup:
    post:
      tags:
        - billing
      security:
        - BearerAuth: []
      responses:
        default:
          description: Response
  /billing/payment-methods/{id}:
    delete:
      tags:
        - billing
      security:
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /billing/payment-methods/{id}/default:
    put:
      tags:
        - billing
      security:
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /billing/seats/bulk:
    post:
      tags:
        - billing
      security:
        - BearerAuth: []
      responses:
        default:
          description: Response
  /billing/seats/preview:
    post:
      tags:
        - billing
      security:
        - BearerAuth: []
      responses:
        default:
          description: Response
  /billing/subscription:
    get:
      tags:
        - billing
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        default:
          description: Response
    post:
      tags:
        - billing
      security:
        - BearerAuth: []
      responses:
        default:
          description: Response
  /billing/subscription/adjust:
    post:
      tags:
        - billing
      security:
        - BearerAuth: []
      responses:
        default:
          description: Response
  /billing/subscription/adjust/preview:
    post:
      tags:
        - billing
      security:
        - BearerAuth: []
      responses:
        default:
          description: Response
  /billing/subscription/resume:
    post:
      tags:
        - billing
      security:
        - BearerAuth: []
      responses:
        default:
          description: Response
  /billing/subscription/retry-payment:
    post:
      tags:
        - billing
      security:
        - BearerAuth: []
      responses:
        default:
          description: Response
  /billing/summaries:
    get:
      tags:
        - billing
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        default:
          description: Response
  /billing/transactions:
    get:
      tags:
        - billing
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "200":
          description: A page of the ledger.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - transactions
                      - count
                      - has_more
                    properties:
                      transactions:
                        type: array
                        items:
                          $ref: "#/components/schemas/LedgerEntry"
                      count:
                        type: integer
                        description: How many this page holds.
                      has_more:
                        type: boolean
                        description: "More follow. A page can hold fewer than `limit`, or none, while more remain: page on while it is true."
                      next_cursor:
                        type: string
                        description: "Present while `has_more` is true: pass it back as `cursor` for the next page."
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: a `cursor` this list did not issue for the same query."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read the usage ledger
      description: "A page of the account's usage ledger, newest first, with the filters applied to that page: a filtered page can hold fewer entries than `limit`, or none, while `has_more` is true. Page with `cursor` until it is false."
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 1000
          description: "A page-size hint: a value above 1000 reads as 1000, and a missing, zero, negative or non-numeric one as 1000."
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: The `next_cursor` a previous page returned, with the same `start_date`, `end_date`, `type` and `category`. Opaque, and sealed to the query that issued it.
        - name: type
          in: query
          required: false
          schema:
            type: string
          description: Only entries of this type (e.g. `spark_create`). Ignored with a YYYY-MM-DD `start_date`.
        - name: category
          in: query
          required: false
          schema:
            type: string
          description: Only entries counted under this usage category, as `GET /billing/summaries` names it.
        - name: start_date
          in: query
          required: false
          schema:
            type: string
          description: "The range's start: a Unix timestamp, or a YYYY-MM-DD date (UTC)."
        - name: end_date
          in: query
          required: false
          schema:
            type: string
            format: date
          description: "The range's last day (YYYY-MM-DD, UTC), with a YYYY-MM-DD `start_date` only. Omitted: the start's day."
  /billing/trial/start:
    post:
      tags:
        - billing
      security:
        - BearerAuth: []
      responses:
        default:
          description: Response
  /billing/usage/breakdown:
    get:
      tags:
        - billing
      security:
        - BearerAuth: []
      responses:
        default:
          description: Response
  /config:
    get:
      tags:
        - config
      security: []
      responses:
        "200":
          description: Public configuration. Partial configuration closes native sales.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      native_iap_catalog:
                        type: object
                        properties:
                          offer_version:
                            type: integer
                            const: 2
                          billing_model:
                            type: string
                            const: usage_credits
                          subscription:
                            type: object
                            properties:
                              product_id:
                                type: string
                                const: com.sparkvault.vaults.monthly.v2
                              kind:
                                type: string
                                const: subscription
                              credits_included:
                                type: integer
                                const: 2500
                          credit_packs:
                            type: array
                            items:
                              oneOf:
                                - type: object
                                  properties:
                                    product_id:
                                      type: string
                                      const: com.sparkvault.credits.1000
                                    kind:
                                      type: string
                                      const: consumable
                                    credits:
                                      type: integer
                                      const: 1000
                                - type: object
                                  properties:
                                    product_id:
                                      type: string
                                      const: com.sparkvault.credits.5000
                                    kind:
                                      type: string
                                      const: consumable
                                    credits:
                                      type: integer
                                      const: 5000
                                - type: object
                                  properties:
                                    product_id:
                                      type: string
                                      const: com.sparkvault.credits.10000
                                    kind:
                                      type: string
                                      const: consumable
                                    credits:
                                      type: integer
                                      const: 10000
                          platforms:
                            type: object
                            properties:
                              ios:
                                type: object
                                required:
                                  - enabled
                                properties:
                                  enabled:
                                    type: boolean
                              android:
                                type: object
                                required:
                                  - enabled
                                properties:
                                  enabled:
                                    type: boolean
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
      summary: Read public platform pricing and native purchase readiness
      description: Native products are offered only for an explicitly enabled platform with a complete trusted server catalog. Prices must be read from the localized native store. Credentials, private rollout configuration and Sandbox account allowlists are never returned.
  /domains:
    get:
      tags:
        - domains
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "200":
          description: The domains.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/DomainList"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: the account is gone."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List your Company Domains
      description: Every domain the organization added, each with whether it still holds the domain's claim, what the domain can do, the records it publishes and the last DNS check, and whether email setup is offered.
    post:
      tags:
        - domains
      security:
        - BearerAuth: []
      responses:
        default:
          description: Response
  /domains/challenge:
    post:
      tags:
        - domains
      security:
        - BearerAuth: []
      responses:
        default:
          description: Response
  /domains/{domain}:
    get:
      tags:
        - domains
      security:
        - BearerAuth: []
      parameters:
        - name: domain
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: The domain.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/DomainAnswer"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller is not an org admin."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: the organization lists no such domain."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read one Company Domain
      description: "One of the organization's domains: whether it still holds the domain's claim, what the domain can do, the records it publishes and the last DNS check (org admins only)."
    delete:
      tags:
        - domains
      security:
        - BearerAuth: []
      parameters:
        - name: domain
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: The domain is removed.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/DomainRemoved"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller is not an org admin."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: the organization lists no such domain."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "DOMAIN_IN_USE: a mail product the organization uses selects the domain (`details.domain`, and `details.product`: help_desk or notify); choose another address in that product's settings, then remove it. CONFLICT: the domain, or a product's use of it, changed while it was being removed; try again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "EMAIL_SETUP_BUSY: the email service is busy; the domain stays listed, so repeat the request in a moment."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Remove a Company Domain
      description: "Remove a domain (org admins only). Every mail product is asked first: a domain the active help desk selects, or Notify selects while the organization holds Notify, is refused until another address is chosen in that product's settings, and a selection by a product the organization does not use now is cleared. Everything the platform set up for the domain (its email sending identity, its help-desk web host and its verification checks) is withdrawn next, and then the domain is released for any organization to claim. A domain whose claim the organization does not hold is taken off the organization's list; no claim is touched and nothing is withdrawn. Its DNS records can then be deleted at the DNS host."
  /domains/{domain}/check:
    post:
      tags:
        - domains
      security:
        - BearerAuth: []
      parameters:
        - name: domain
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: The domain, as the check found it.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/DomainAnswer"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller is not an org admin."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: the organization lists no such domain, or does not hold its claim; nothing is checked."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the domain kept changing while it was checked; try again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "DNS_CHECK_TOO_SOON: the organization checked the domain under 30 seconds ago; `Retry-After` carries the seconds to wait and `details.resets_at` the moment. RATE_LIMIT_EXCEEDED: the account's request budget, as on every route."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "INTERNAL_ERROR: the public resolvers could not say which zone holds the domain within the check's time; nothing is recorded, so check again in a moment. EMAIL_SETUP_BUSY: the email service is busy; try again in a moment."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Check a domain now
      description: "Ask the domain's authoritative nameservers for every record it publishes and, while email is set up, where its sending identity stands (org admins only), at most once every 30 seconds for the organization. The sending identity is asked about only while the organization holds the Secure Help Desk or Notify: otherwise sending pauses (`paused`, error `products_lapsed`), and a check once the organization holds either resumes sending. A check while email is being verified brings the next automatic check forward. For a domain prepared for the Secure Help Desk whose web address is live and whose email receiving is not confirmed, a check from an org admin's own session while the help desk serves customers (`serving` in the help desk's status) also sends the receiving check again (at most once every 5 minutes); the answer shows its receiving as `probing`. An impersonated session's check sends none."
  /domains/{domain}/email:
    post:
      tags:
        - domains
      security:
        - BearerAuth: []
      parameters:
        - name: domain
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: The domain, its DKIM records to publish.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/DomainAnswer"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the ownership record lapsed (`details.reason` ownership_lapsed); publish it again first."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller is not an org admin. DOMAIN_EMAIL_REQUIRES_PRODUCT: the organization holds neither the Secure Help Desk nor Notify (`details.products` help_desk, notify); nothing is set up."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: the organization lists no such domain, or does not hold its claim."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: sending from the domain is paused (`details.reason` paused), or the domain changed while email was being set up; try again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "INTERNAL_ERROR: this deployment does not offer email from custom domains yet. EMAIL_SETUP_BUSY: the email service is busy; try again in a moment."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Set up email sending from a domain
      description: "Set up email from one of the organization's domains (org admins only): its sending identity is created and the answer carries the three DKIM records to publish beside the ownership record. Verification is checked automatically, usually within minutes and at most 72 hours. Email from the organization's own domain comes with the Secure Help Desk or Notify. Sending needs only the domain's ownership standing, so a zone apex is set up as a subdomain is. A setup already under way answers as it stands; one that failed starts over, which issues three new DKIM records."
  /domains/{domain}/help-desk:
    post:
      tags:
        - domains
      security:
        - BearerAuth: []
      parameters:
        - name: domain
          in: path
          required: true
          schema:
            type: string
          description: One of the organization's domains.
      responses:
        "200":
          description: The domain as it stands.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - domain
                    properties:
                      domain:
                        type: object
                        description: The domain, as GET /domains/{domain} answers it.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the domain's ownership lapsed (`details.reason` ownership_lapsed), or it is a zone apex (`details.reason` zone_apex)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access. NOT_FOUND: the organization does not hold this domain."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "DOMAIN_CHECK_REQUIRED: check the domain's DNS first. CONFLICT: the domain changed meanwhile; try again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "502":
          description: "INTERNAL_ERROR: the help-desk host service did not complete the web host's registration; try again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "EMAIL_SETUP_BUSY: another request is setting up the organization's email (`Retry-After` carries 5 seconds), or email setup is busy right now; repeat the request in a moment. INTERNAL_ERROR: this deployment cannot send the help desk's email."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Prepare a domain for the help desk
      description: "Make one of the organization's own domains ready to be its help desk's address: set up sending from it when it has none, register it as a web host of the help desk, and once the web host is live, its sending verified and a desk that selects it active, mail a check to the domain that proves it receives the desk's mail, its identity joined to the desk's email tenant first. Asking again refreshes each from its provider. A zone apex cannot carry the desk: use a subdomain. A company administrator or a Manager of the desk (`desk_id`, else the organization's original desk), from their own session; the organization must hold the help desk."
  /entropy/first-party:
    post:
      tags:
        - entropy
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The draw.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - value
                      - num_bytes
                    properties:
                      value:
                        type: string
                        description: The bytes as padded base64.
                      num_bytes:
                        type: integer
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: `num_bytes` is not an integer from 1 to 1024."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller is not an interactive SparkVault session (an API key, for one)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute, or this person spent the hour's budget of draws. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: "CRYPTOGRAPHIC_ERROR: the hardware entropy source could not supply the draw. Retry the request."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Draw random bytes for a signed-in SparkVault client
      description: "The draw the SparkVault console and mobile app take for their own working values (a stored key's id, a cache key, a pairing secret's server share). It answers an interactive SparkVault session only: an API key is refused, so an integration draws from POST /entropy/generate. It is never refused for a lapsed plan or an empty bandwidth pool and is not recorded as the account's usage; the API rate limit applies as to every request, and each signed-in person has an hourly budget of draws here."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - num_bytes
              properties:
                num_bytes:
                  type: integer
                  minimum: 1
                  maximum: 1024
                  description: "Bytes to draw: 1 to 1024."
  /entropy/generate:
    post:
      tags:
        - entropy
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "200":
          description: The random value.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - value
                      - num_bytes
                      - format
                      - reference_id
                    properties:
                      value:
                        description: "`bytes` returns an array of integers from 0 to 255; every other format a string."
                        oneOf:
                          - type: string
                          - type: array
                            items:
                              type: integer
                              minimum: 0
                              maximum: 255
                      num_bytes:
                        type: integer
                        description: Raw bytes drawn to produce `value`. A character format replaces each rejected byte with a further draw, so it can exceed the opening draw; `value` is always exactly the requested length.
                      format:
                        type: string
                        enum:
                          - hex
                          - base64
                          - base64url
                          - alphanumeric
                          - alphanumeric-mixed
                          - password
                          - numeric
                          - uuid
                          - bytes
                      reference_id:
                        type: string
                        description: Identifies this draw in the account activity log.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: `num_bytes` is not an integer from 1 to its format's ceiling, or `format` is not one of hex, base64, base64url, alphanumeric, alphanumeric-mixed, password, numeric, uuid, bytes."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "402":
          description: "PLAN_REQUIRED: the account holds no active plan. USAGE_CREDITS_EXHAUSTED: its usage credits cannot fund the call, after one automatic refill when that is on. USAGE_CREDITS_REQUIRED: it has no current paid subscription period, which every use of usage credits needs. USAGE_CREDIT_FUNDING_REVIEW: its credits are paused for a payment review. QUOTA_EXCEEDED: a capacity plan's bandwidth pool is empty. Nothing is drawn or charged."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: a capacity plan's account was deleted while the draw was made, so no value was returned. A retry is answered the same way."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: "CRYPTOGRAPHIC_ERROR: the hardware entropy source could not supply the draw in time. Nothing was charged. Retry the request."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "INTERNAL_ERROR: the call could not be completed in time, or its draw could not be recorded as the account's usage, so no value was returned and nothing was charged. Retry the request."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Generate random values
      description: "Draw cryptographically secure random bytes from a FIPS 140-3 Level 3 validated hardware security module, XORed with an independent local CSPRNG, and return them in the requested `format`. There is no software fallback: when the hardware source is unavailable the request fails instead of returning weaker entropy. Each call costs 1 usage credit, whatever its size, held before anything is drawn: a call the account cannot fund draws nothing, and a call answered with an error is not charged. A gateway timeout (504) can, rarely, follow a charged call whose value was ready too late to be returned; a retry is a new call, with a new value and a new charge. Like every paid call it first covers the account's stored files when its credits can, but it is never refused for them. An account on a capacity plan draws its bandwidth pool by the call's size instead."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - num_bytes
              properties:
                num_bytes:
                  type: integer
                  minimum: 1
                  maximum: 1024
                  description: "How much to generate: 1 to 1024 bytes, or 1 to 512 for `alphanumeric`, `alphanumeric-mixed`, `password`, whose characters take two raw bytes each from one hardware draw. For a character format it is the output length in characters. A `uuid` always draws 16 bytes, but the value is still required and checked."
                format:
                  type: string
                  enum:
                    - hex
                    - base64
                    - base64url
                    - alphanumeric
                    - alphanumeric-mixed
                    - password
                    - numeric
                    - uuid
                    - bytes
                  default: hex
                  description: The encoding of `value`.
  /files/in/{vaultId}:
    get:
      tags:
        - files
      security: []
      parameters:
        - name: vaultId
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /files/in/{vaultId}/upload:
    post:
      tags:
        - files
      security: []
      parameters:
        - name: vaultId
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /files/{code}:
    get:
      tags:
        - files
      security: []
      parameters:
        - name: code
          in: path
          required: true
          schema:
            type: string
            pattern: ^[A-Za-z0-9_-]{22}$
          description: The share's link code. A code of any other shape answers 404 SPARKLINK_UNAVAILABLE, exactly as a code that names no share does.
      responses:
        default:
          description: Response
  /files/{code}/download:
    post:
      tags:
        - files
      security: []
      parameters:
        - name: code
          in: path
          required: true
          schema:
            type: string
            pattern: ^[A-Za-z0-9_-]{22}$
          description: The share's link code. A code of any other shape answers 404 SPARKLINK_UNAVAILABLE, exactly as a code that names no share does.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                verify:
                  type: object
                  required:
                    - verified
                    - session_id
                    - timestamp
                    - nonce
                    - account_id
                    - signature
                  properties:
                    verified:
                      type: string
                      const: "true"
                    session_id:
                      type: string
                      minLength: 1
                      maxLength: 256
                    timestamp:
                      type: string
                      pattern: ^\d{1,12}$
                    nonce:
                      type: string
                      minLength: 1
                      maxLength: 128
                    account_id:
                      type: string
                      pattern: ^acc_[A-Za-z0-9_-]+$
                      maxLength: 128
                    signature:
                      type: string
                      minLength: 1
                      maxLength: 256
                      pattern: ^[A-Za-z0-9_-]+$
                  additionalProperties: false
                id_token:
                  type: string
                  minLength: 1
                  maxLength: 16384
              additionalProperties: false
      responses:
        default:
          description: Response
  /files/{code}/meta:
    post:
      tags:
        - files
      security: []
      parameters:
        - name: code
          in: path
          required: true
          schema:
            type: string
            pattern: ^[A-Za-z0-9_-]{22}$
          description: The share's link code. A code of any other shape answers 404 SPARKLINK_UNAVAILABLE, exactly as a code that names no share does.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                verify:
                  type: object
                  required:
                    - verified
                    - session_id
                    - timestamp
                    - nonce
                    - account_id
                    - signature
                  properties:
                    verified:
                      type: string
                      const: "true"
                    session_id:
                      type: string
                      minLength: 1
                      maxLength: 256
                    timestamp:
                      type: string
                      pattern: ^\d{1,12}$
                    nonce:
                      type: string
                      minLength: 1
                      maxLength: 128
                    account_id:
                      type: string
                      pattern: ^acc_[A-Za-z0-9_-]+$
                      maxLength: 128
                    signature:
                      type: string
                      minLength: 1
                      maxLength: 256
                      pattern: ^[A-Za-z0-9_-]+$
                  additionalProperties: false
                id_token:
                  type: string
                  minLength: 1
                  maxLength: 16384
              additionalProperties: false
      responses:
        default:
          description: Response
  /hd/desks:
    get:
      tags:
        - hd
      security: []
      responses:
        "200":
          description: The desk, or where it moved.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskDesk"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: `host` is missing or is no host name."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "DESK_NOT_FOUND: no help desk is at this address."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: this client address has spent its lookups for the minute. `Retry-After` carries the seconds until the budget reopens, and `details` carries `limit` and `resets_at`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE: the desk does not take customers right now. BUDGET_UNAVAILABLE: a budget the request spends could not be counted, so the request was refused rather than let through uncounted; `Retry-After` carries the seconds to wait before trying again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Look up a help desk by its host
      description: "Which desk the host a portal runs on is, and how its customers sign in: the portal sends the host name it is served on, then names the desk by `desk_id` in every customer route. A host the organization has moved away from answers where it moved. Every host that is no desk answers the same 404, and every desk that does not take customers now the same 503, whatever the reason. Needs no credential; each client address spends a budget of lookups a minute."
      parameters:
        - name: host
          in: query
          required: true
          schema:
            type: string
          description: The host name the portal runs on.
  /hd/desks/{desk_id}/access/identity:
    post:
      tags:
        - hd
      security: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
          description: The desk, as its lookup answered it.
        - name: X-SV-Client
          in: header
          required: true
          schema:
            type: string
            const: help-desk-portal
          description: Names the portal. A request without it answers 400 CLIENT_HEADER_REQUIRED.
      responses:
        "200":
          description: The portal access grant.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - token
                      - expires_at
                      - ttl_seconds
                    properties:
                      token:
                        type: string
                      expires_at:
                        type: integer
                      ttl_seconds:
                        type: integer
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the message names the offending field."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_ACCESS_DENIED: the credential does not pass the current access policy."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE: the desk does not take customers right now, or this customer is refused. INTERNAL_ERROR: the identity service did not answer the check of a Secure Identity customer's session, made at most every 15 minutes; the session is kept, and the same request can be sent again. BUDGET_UNAVAILABLE: a budget the request spends could not be counted, so the request was refused rather than let through uncounted; `Retry-After` carries the seconds to wait before trying again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Open employee access to the ticket portal
      description: Opens an eight-hour access grant, additional to customer ticket authentication. Send the returned token as X-SV-Helpdesk-Access on every customer API request. Policy changes invalidate grants; employee access also rechecks active membership, email ownership and Identity session status. Tokens are stored by digest only.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - token
              properties:
                token:
                  type: string
                  pattern: ^hdwip_[A-Za-z0-9_-]{43}$
                  writeOnly: true
                  description: The five-minute identity proof a redeemed help desk sign-in answered (`identity_grant.token`) for a challenge this company's policy started.
  /hd/desks/{desk_id}/access/password:
    post:
      tags:
        - hd
      security: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
          description: The desk, as its lookup answered it.
        - name: X-SV-Client
          in: header
          required: true
          schema:
            type: string
            const: help-desk-portal
          description: Names the portal. A request without it answers 400 CLIENT_HEADER_REQUIRED.
      responses:
        "200":
          description: The portal access grant.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - token
                      - expires_at
                      - ttl_seconds
                    properties:
                      token:
                        type: string
                      expires_at:
                        type: integer
                      ttl_seconds:
                        type: integer
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the message names the offending field."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_ACCESS_DENIED: the credential does not pass the current access policy."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE: the desk does not take customers right now, or this customer is refused. INTERNAL_ERROR: the identity service did not answer the check of a Secure Identity customer's session, made at most every 15 minutes; the session is kept, and the same request can be sent again. BUDGET_UNAVAILABLE: a budget the request spends could not be counted, so the request was refused rather than let through uncounted; `Retry-After` carries the seconds to wait before trying again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Open shared-password access to the ticket portal
      description: Opens an eight-hour access grant, additional to customer ticket authentication. Send the returned token as X-SV-Helpdesk-Access on every customer API request. Policy changes invalidate grants; employee access also rechecks active membership, email ownership and Identity session status. Tokens are stored by digest only.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - password
              properties:
                password:
                  type: string
                  maxLength: 256
                  writeOnly: true
  /hd/desks/{desk_id}/analytics/page-request:
    post:
      tags:
        - hd
      security: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
        - name: X-SV-Helpdesk-Access
          in: header
          required: false
          schema:
            type: string
          description: Required by password or employee ticket-portal policies, in addition to any customer bearer token. IP policies check the actual trusted visitor IP on every request.
      responses:
        "200":
          description: Whether forwarding succeeded.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      forwarded:
                        type: boolean
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the message names the offending field."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_ACCESS_REQUIRED or HELP_DESK_IP_DENIED: the current ticket-portal access policy refuses this request. Complete the access layer or connect from an approved network."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Forward a help-desk page request to its configured analytics webhook
      description: Used server-to-server by the help Worker. Verifies desk ownership of the page URL, applies current path filters, and sends only url and persistent_id to the configured public HTTPS endpoint. Anonymous IDs never grant access. Rate limited; best effort with one retry for temporary delivery failures.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - url
                - persistent_id
              properties:
                url:
                  type: string
                  format: uri
                  maxLength: 8192
                persistent_id:
                  oneOf:
                    - type: string
                      minLength: 1
                      maxLength: 256
                      description: Opaque cookie value, preserved without conversion.
                    - type: "null"
  /hd/desks/{desk_id}/attachments/{attachment_id}/download:
    get:
      tags:
        - hd
      security:
        - HelpDeskCustomerToken: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
          description: The desk, as its lookup answered it.
        - name: attachment_id
          in: path
          required: true
          schema:
            type: string
          description: The file, as the request's timeline names it.
        - name: X-SV-Client
          in: header
          required: true
          schema:
            type: string
            const: help-desk-portal
          description: Names the portal. A request without it answers 400 CLIENT_HEADER_REQUIRED.
        - name: ticket
          in: query
          required: true
          schema:
            type: integer
            minimum: 1
          description: The number of the request the file is on.
        - name: X-SV-Helpdesk-Access
          in: header
          required: false
          schema:
            type: string
          description: Required by password or employee ticket-portal policies, in addition to any customer bearer token. IP policies check the actual trusted visitor IP on every request.
      responses:
        "200":
          description: The link.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskDownloadLink"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "CLIENT_HEADER_REQUIRED: see above."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "CUSTOMER_AUTH_REQUIRED: no bearer token, or one that is not a customer's of this desk now: unknown, expired, revoked, another desk's, or of the sign-in mode the desk no longer uses."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "402":
          description: "PLAN_REQUIRED or QUOTA_EXCEEDED: the organization cannot serve the download right now (its plan, or its bandwidth). No figures are given."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_ACCESS_REQUIRED or HELP_DESK_IP_DENIED: the current ticket-portal access policy refuses this request. Complete the access layer or connect from an approved network."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such request, draft or file is the customer's: one that does not exist, one of another customer and a request closed as spam (which does not exist for its requester) read the same, byte for byte."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the customer has taken their downloads or bytes for the day, the desk its customers' download bytes for the day, this client address its portal reads for the minute across every desk, or this customer their reads at the desk for the minute. `Retry-After` carries the seconds until the budget reopens, and `details` carries `limit` and `resets_at`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE: the desk does not take customers right now, or this customer is refused. INTERNAL_ERROR: the identity service did not answer the check of a Secure Identity customer's session, made at most every 15 minutes; the session is kept, and the same request can be sent again. BUDGET_UNAVAILABLE: a budget the request spends could not be counted, so the request was refused rather than let through uncounted; `Retry-After` carries the seconds to wait before trying again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Download a file of a request
      description: A single-use link to a file a message carries on one of the customer's own requests. A file of a type Chrome and Firefox both show as a page from such a link (a JPEG, PNG, GIF, WebP, AVIF or BMP image, or a PDF) is served inline; anything else downloads, every recording included.
  /hd/desks/{desk_id}/auth/external/challenge:
    post:
      tags:
        - hd
      security: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
        - name: X-SV-Client
          in: header
          required: true
          schema:
            type: string
            const: help-desk-portal
        - name: Origin
          in: header
          required: true
          schema:
            type: string
            format: uri
          description: Exact HTTPS origin of the calling company page or actual desk portal, as the route requires.
      responses:
        "200":
          description: A short-lived challenge and private browser verifier.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskExternalChallenge"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "EXTERNAL_SIGN_IN_INVALID: invalid, expired, replayed or incorrectly bound assertion, challenge or handoff. VALIDATION_ERROR: invalid request body. CLIENT_HEADER_REQUIRED: use the published Help Desk client marker."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: requester ownership changed while the session was opened; sign in again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the person a verified assertion names has spent their sign-in steps at the desk for the hour (each counted once the assertion verifies, before the desk's keys are recovered), this client address its portal reads for the minute across every desk, or the sign-in would create a customer record past the new customers the desk takes in an hour. No leg of a company sign-in is counted on the client address beyond those reads, which are all a challenge spends. `Retry-After` carries the seconds until the budget reopens, and `details` carries `limit` and `resets_at`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE: desk or company-session verifier unavailable. No implicit downgrade to email authentication."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Start a company-session sign-in
      description: Creates a 60-second single-use nonce and PKCE verifier, bound to this desk, the calling company or portal origin, and the current public verifier. Call from a configured company origin for inline completion, or a current portal origin for hosted handoff. Keep verifier in page memory or session storage; never send it to the company bridge.
  /hd/desks/{desk_id}/auth/external/complete:
    post:
      tags:
        - hd
      security: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
        - name: X-SV-Client
          in: header
          required: true
          schema:
            type: string
            const: help-desk-portal
        - name: Origin
          in: header
          required: true
          schema:
            type: string
            format: uri
          description: Exact HTTPS origin of the calling company page or actual desk portal, as the route requires.
      responses:
        "200":
          description: The authentication result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskSession"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "EXTERNAL_SIGN_IN_INVALID: invalid, expired, replayed or incorrectly bound assertion, challenge or handoff. VALIDATION_ERROR: invalid request body. CLIENT_HEADER_REQUIRED: use the published Help Desk client marker."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: requester ownership changed while the session was opened; sign in again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the person a verified assertion names has spent their sign-in steps at the desk for the hour (each counted once the assertion verifies, before the desk's keys are recovered), this client address its portal reads for the minute across every desk, or the sign-in would create a customer record past the new customers the desk takes in an hour. No leg of a company sign-in is counted on the client address beyond those reads, which are all a challenge spends. `Retry-After` carries the seconds until the budget reopens, and `details` carries `limit` and `resets_at`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE: desk or company-session verifier unavailable. No implicit downgrade to email authentication."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Complete a company-session sign-in
      description: Called from a configured company origin. The company backend signs the current verified session after its own authentication and CSRF checks. No customer consent or second login is required. JWT identity fields are never accepted unsigned from browser code.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                assertion:
                  type: string
                  maxLength: 8192
                  description: "Server-signed RS256 JWT: exact configured iss/kid, aud sparkvault-help-desk:{desk_id}, purpose help_desk_session, desk_id, stable sub, explicit email_verified boolean, contact email (required when verified), iat/exp with lifetime at most 60 seconds, exact issued_at_ms whose floor/1000 equals iat, unique jti and nonce. Future clock skew is bounded to five seconds; nbf is optional and cannot be in the future. Every company subject stays isolated from canonical email history and global SVIDs, including when email_verified is true. Verified contact permits delivery only; an unproved contact receives no confidential outbound mail. The browser never receives a signing key. Hosted handoff also requires the signed S256 code_challenge."
                nonce:
                  type: string
                  pattern: ^[A-Za-z0-9_-]{43}$
              required:
                - assertion
                - nonce
  /hd/desks/{desk_id}/auth/external/handoffs:
    post:
      tags:
        - hd
      security: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
        - name: X-SV-Client
          in: header
          required: true
          schema:
            type: string
            const: help-desk-portal
        - name: Origin
          in: header
          required: true
          schema:
            type: string
            format: uri
          description: Exact HTTPS origin of the calling company page or actual desk portal, as the route requires.
      responses:
        "200":
          description: The authentication result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskExternalHandoff"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "EXTERNAL_SIGN_IN_INVALID: invalid, expired, replayed or incorrectly bound assertion, challenge or handoff. VALIDATION_ERROR: invalid request body. CLIENT_HEADER_REQUIRED: use the published Help Desk client marker."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: requester ownership changed while the session was opened; sign in again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the person a verified assertion names has spent their sign-in steps at the desk for the hour (each counted once the assertion verifies, before the desk's keys are recovered), this client address its portal reads for the minute across every desk, or the sign-in would create a customer record past the new customers the desk takes in an hour. No leg of a company sign-in is counted on the client address beyond those reads, which are all a challenge spends. `Retry-After` carries the seconds until the budget reopens, and `details` carries `limit` and `resets_at`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE: desk or company-session verifier unavailable. No implicit downgrade to email authentication."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Create a hosted-portal handoff
      description: Called from a configured company origin. Verify the signed company assertion and PKCE challenge, consume its JWT once, and create a short-lived opaque code bound to an actual current portal origin. No customer identity or bearer session travels in the redirect URL.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                assertion:
                  type: string
                  maxLength: 8192
                  description: "Server-signed RS256 JWT: exact configured iss/kid, aud sparkvault-help-desk:{desk_id}, purpose help_desk_session, desk_id, stable sub, explicit email_verified boolean, contact email (required when verified), iat/exp with lifetime at most 60 seconds, exact issued_at_ms whose floor/1000 equals iat, unique jti and nonce. Future clock skew is bounded to five seconds; nbf is optional and cannot be in the future. Every company subject stays isolated from canonical email history and global SVIDs, including when email_verified is true. Verified contact permits delivery only; an unproved contact receives no confidential outbound mail. The browser never receives a signing key. Hosted handoff also requires the signed S256 code_challenge."
                nonce:
                  type: string
                  pattern: ^[A-Za-z0-9_-]{43}$
                redirect_origin:
                  type: string
                  format: uri
                  description: An exact current desk portal origin from the provisioning readiness endpoint.
              required:
                - assertion
                - nonce
                - redirect_origin
  /hd/desks/{desk_id}/auth/external/redeem:
    post:
      tags:
        - hd
      security: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
        - name: X-SV-Client
          in: header
          required: true
          schema:
            type: string
            const: help-desk-portal
        - name: Origin
          in: header
          required: true
          schema:
            type: string
            format: uri
          description: Exact HTTPS origin of the calling company page or actual desk portal, as the route requires.
      responses:
        "200":
          description: The authentication result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskSession"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "EXTERNAL_SIGN_IN_INVALID: invalid, expired, replayed or incorrectly bound assertion, challenge or handoff. VALIDATION_ERROR: invalid request body. CLIENT_HEADER_REQUIRED: use the published Help Desk client marker."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: requester ownership changed while the session was opened; sign in again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the person a verified assertion names has spent their sign-in steps at the desk for the hour (each counted once the assertion verifies, before the desk's keys are recovered), this client address its portal reads for the minute across every desk, or the sign-in would create a customer record past the new customers the desk takes in an hour. No leg of a company sign-in is counted on the client address beyond those reads, which are all a challenge spends. `Retry-After` carries the seconds until the budget reopens, and `details` carries `limit` and `resets_at`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE: desk or company-session verifier unavailable. No implicit downgrade to email authentication."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Redeem a hosted-portal handoff
      description: Called only from the portal origin that started the challenge. Redeems a single-use opaque code using the original nonce and private PKCE verifier. Current settings epoch, verifier and requester mapping must still match.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                code:
                  type: string
                  pattern: ^[A-Za-z0-9_-]{43}$
                nonce:
                  type: string
                  pattern: ^[A-Za-z0-9_-]{43}$
                verifier:
                  type: string
                  pattern: ^[A-Za-z0-9_-]{43}$
              required:
                - code
                - nonce
                - verifier
  /hd/desks/{desk_id}/auth/logout:
    post:
      tags:
        - hd
      security:
        - HelpDeskCustomerToken: []
        - {}
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
          description: The desk, as its lookup answered it.
        - name: X-SV-Client
          in: header
          required: true
          schema:
            type: string
            const: help-desk-portal
          description: Names the portal. A request without it answers 400 CLIENT_HEADER_REQUIRED.
        - name: X-SV-Helpdesk-Access
          in: header
          required: false
          schema:
            type: string
          description: Required by password or employee ticket-portal policies, in addition to any customer bearer token. IP policies check the actual trusted visitor IP on every request.
      responses:
        "204":
          description: Signed out of the session the bearer names, and nothing else.
        "400":
          description: "CLIENT_HEADER_REQUIRED: see above."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_ACCESS_REQUIRED or HELP_DESK_IP_DENIED: the current ticket-portal access policy refuses this request. Complete the access layer or connect from an approved network."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: this client address has spent its portal reads for the minute, across every desk. `Retry-After` carries the seconds until the budget reopens, and `details` carries `limit` and `resets_at`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE: the desk does not take customers right now. BUDGET_UNAVAILABLE: a budget the request spends could not be counted, so the request was refused rather than let through uncounted; `Retry-After` carries the seconds to wait before trying again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Sign the customer out
      description: "End the help desk session the bearer token (`hdt_…`) names, on the server, whatever its state: a session gone stale ends all the same. A sign-out naming no session of this desk (no bearer, or one that is no session of it) ends nothing and answers the same. A Secure Identity customer's session at the identity service stays theirs: the sign-out ends the desk's session alone."
  /hd/desks/{desk_id}/auth/pin/start:
    post:
      tags:
        - hd
      security: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
          description: The desk, as its lookup answered it.
        - name: X-SV-Client
          in: header
          required: true
          schema:
            type: string
            const: help-desk-portal
          description: Names the portal. A request without it answers 400 CLIENT_HEADER_REQUIRED.
        - name: X-SV-Helpdesk-Access
          in: header
          required: false
          schema:
            type: string
          description: Required by password or employee ticket-portal policies, in addition to any customer bearer token. IP policies check the actual trusted visitor IP on every request.
      responses:
        "202":
          description: The challenge to verify the code against.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskPinChallenge"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the body is no JSON object, or `email` is missing or is no deliverable address. CLIENT_HEADER_REQUIRED: see above."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_ACCESS_REQUIRED or HELP_DESK_IP_DENIED: the current ticket-portal access policy refuses this request. Complete the access layer or connect from an approved network."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: this client address has spent its portal reads for the minute across every desk, it or its network has started too many sign-ins at the desk this hour, this address has been sent too many codes this quarter hour or day, or the desk has sent its codes for the hour. EMAIL_ACCOUNT_RATE_LIMIT: the organization has sent all the email it may send this hour. `Retry-After` carries the seconds until the budget reopens, and `details` carries `limit` and `resets_at`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE: the desk does not take customers right now. EMAIL_SETUP_BUSY: another request is setting up the organization's email (`Retry-After` carries 5 seconds), or email setup is busy right now; repeat the request in a moment. INTERNAL_ERROR: no code was sent. The organization's email volume could not be counted (try again), or this deployment cannot send the help desk's email. BUDGET_UNAVAILABLE: a budget the request spends could not be counted, so the request was refused rather than let through uncounted; `Retry-After` carries the seconds to wait before trying again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Email a sign-in code
      description: "Start an emailed-code sign-in. The answer is the same for every address, known to the desk or not, and at every desk: a desk that takes no emailed code (a company-session desk that takes no guests) answers it and sends nothing. The code is sent from the desk's own mail domain and is good for 10 minutes and 5 attempts."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - email
              properties:
                email:
                  type: string
                  format: email
                  description: The address to send the code to.
  /hd/desks/{desk_id}/auth/pin/verify:
    post:
      tags:
        - hd
      security: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
          description: The desk, as its lookup answered it.
        - name: X-SV-Client
          in: header
          required: true
          schema:
            type: string
            const: help-desk-portal
          description: Names the portal. A request without it answers 400 CLIENT_HEADER_REQUIRED.
        - name: X-SV-Helpdesk-Access
          in: header
          required: false
          schema:
            type: string
          description: Required by password or employee ticket-portal policies, in addition to any customer bearer token. IP policies check the actual trusted visitor IP on every request.
      responses:
        "200":
          description: The customer's session and record.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskSession"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "PIN_INVALID: the code is wrong or has expired. VALIDATION_ERROR: the body is no JSON object. CLIENT_HEADER_REQUIRED: see above."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_ACCESS_REQUIRED or HELP_DESK_IP_DENIED: the current ticket-portal access policy refuses this request. Complete the access layer or connect from an approved network."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the customer's record kept changing while the sign-in was recorded; try the code again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: this address has spent its code attempts for the hour or the day, this client address its portal reads for the minute across every desk, or the sign-in would make the customer's record past the new customers the desk takes in an hour. `Retry-After` carries the seconds until the budget reopens, and `details` carries `limit` and `resets_at`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE: the desk does not take customers right now, or this customer is refused. BUDGET_UNAVAILABLE: a budget the request spends could not be counted, so the request was refused rather than let through uncounted; `Retry-After` carries the seconds to wait before trying again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Verify a sign-in code
      description: "Trade the emailed code, with the challenge it answers and the binding secret the start answered, for the customer's session. Every attempt is counted before the code is compared, and a challenge opens at most one session. Every refusal of the code is the same 400 PIN_INVALID: a wrong, spent, expired or another desk's code, a missing binding secret, a page that did not start the sign-in, and a desk that takes no emailed code."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - challenge_id
                - binding_secret
                - code
              properties:
                challenge_id:
                  type: string
                binding_secret:
                  type: string
                code:
                  type: string
                  pattern: ^[0-9]{6}$
                  description: The six digits the email carried.
  /hd/desks/{desk_id}/auth/widget/authorize:
    post:
      tags:
        - hd
      security: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
        - name: X-SV-Client
          in: header
          required: true
          schema:
            type: string
            const: help-desk-portal
        - name: Origin
          in: header
          required: true
          schema:
            type: string
            format: uri
          description: Actual browser origin; approved tenant website for challenge/result/redeem, exactly https://signin.help.sv for authorize/complete/confirm/cancel.
      responses:
        "200":
          description: The current sign-in step.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      authorize_url:
                        type: string
                        format: uri
                        description: "SparkVault's Identity /authorize for the help desk's client: the code flow with PKCE (S256), redirect_uri https://signin.help.sv/callback, scope openid email profile, the request's state and nonce, the challenge's email hint as login_hint, and prompt=select_account when the challenge or the call asks for the chooser."
                      origin:
                        type: string
                        format: uri
                        description: The website the challenge started from, which receives the session. The window goes to authorize_url only when this is the origin its opener handed it the state from.
                    required:
                      - authorize_url
                      - origin
                    additionalProperties: false
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "HELP_DESK_WIDGET_SIGN_IN_INVALID or VALIDATION_ERROR: an invalid, foreign, expired, consumed or incorrectly bound proof, a sign-in window step without the challenge's state or from another origin, a callback of an authorization request since replaced, spent or refused by Identity, or a confirm with no verified sign-in to confirm or without the confirmation the completion of that sign-in answered. SIGN_IN_NEEDS_EMAIL: a phone or social sign-in at complete, which the person repeats with an email address."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_WIDGET_ORIGIN_DENIED: this website is not a current approved embedding origin. HELP_DESK_EMPLOYEE_ACCESS_DENIED: at complete, the sign-in of a company-bound challenge is not an email sign-in of an active member of that company; the person may authorize again with another account."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: honor Retry-After."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE or INTERNAL_ERROR: retry later. A complete that SparkVault's Identity could not answer (its code exchange or its keys) is INTERNAL_ERROR, its request spent: authorize again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Start the authorization request at SparkVault's Identity
      description: Exactly https://signin.help.sv and the challenge's state only. Records the request on the challenge (its state and nonce by their digests, its PKCE verifier sealed), replacing any earlier one, so only the latest request completes, and discarding a sign-in an earlier request verified that the person has not confirmed. One challenge makes at most five requests; past them the person starts again.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                challenge_id:
                  type: string
                  pattern: ^[A-Za-z0-9_-]{43}$
                state:
                  type: string
                  pattern: ^[A-Za-z0-9_-]{43}$
                  writeOnly: true
                  description: The challenge's state, which the sign-in window obtains only from the window that opened it, at the challenge's origin. A window opened anywhere else holds none, and the step is refused.
                select_account:
                  type: boolean
                  description: "The person asked for another account: no login_hint, and prompt=select_account."
              required:
                - challenge_id
                - state
              additionalProperties: false
  /hd/desks/{desk_id}/auth/widget/cancel:
    post:
      tags:
        - hd
      security: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
        - name: X-SV-Client
          in: header
          required: true
          schema:
            type: string
            const: help-desk-portal
        - name: Origin
          in: header
          required: true
          schema:
            type: string
            format: uri
          description: Actual browser origin; approved tenant website for challenge/result/redeem, exactly https://signin.help.sv for authorize/complete/confirm/cancel.
      responses:
        "200":
          description: The current sign-in step.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      cancelled:
                        type: boolean
                        const: true
                    required:
                      - cancelled
                    additionalProperties: false
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "HELP_DESK_WIDGET_SIGN_IN_INVALID or VALIDATION_ERROR: an invalid, foreign, expired, consumed or incorrectly bound proof, a sign-in window step without the challenge's state or from another origin, a callback of an authorization request since replaced, spent or refused by Identity, or a confirm with no verified sign-in to confirm or without the confirmation the completion of that sign-in answered. SIGN_IN_NEEDS_EMAIL: a phone or social sign-in at complete, which the person repeats with an email address."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_WIDGET_ORIGIN_DENIED: this website is not a current approved embedding origin. HELP_DESK_EMPLOYEE_ACCESS_DENIED: at complete, the sign-in of a company-bound challenge is not an email sign-in of an active member of that company; the person may authorize again with another account."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: honor Retry-After."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE or INTERNAL_ERROR: retry later. A complete that SparkVault's Identity could not answer (its code exchange or its keys) is INTERNAL_ERROR, its request spent: authorize again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Cancel a pending sign-in
      description: Exactly https://signin.help.sv and the challenge's state only. Cancels the pending browser challenge; no host logout, global logout or support ticket is performed.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                challenge_id:
                  type: string
                  pattern: ^[A-Za-z0-9_-]{43}$
                state:
                  type: string
                  pattern: ^[A-Za-z0-9_-]{43}$
                  writeOnly: true
                  description: The challenge's state, which the sign-in window obtains only from the window that opened it, at the challenge's origin. A window opened anywhere else holds none, and the step is refused.
              required:
                - challenge_id
                - state
              additionalProperties: false
  /hd/desks/{desk_id}/auth/widget/challenge:
    post:
      tags:
        - hd
      security: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
        - name: X-SV-Client
          in: header
          required: true
          schema:
            type: string
            const: help-desk-portal
        - name: Origin
          in: header
          required: true
          schema:
            type: string
            format: uri
          description: Actual browser origin; approved tenant website for challenge/result/redeem, exactly https://signin.help.sv for authorize/complete/confirm/cancel.
      responses:
        "200":
          description: The current sign-in step.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskWidgetIdentityChallenge"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "HELP_DESK_WIDGET_SIGN_IN_INVALID or VALIDATION_ERROR: an invalid, foreign, expired, consumed or incorrectly bound proof, a sign-in window step without the challenge's state or from another origin, a callback of an authorization request since replaced, spent or refused by Identity, or a confirm with no verified sign-in to confirm or without the confirmation the completion of that sign-in answered. SIGN_IN_NEEDS_EMAIL: a phone or social sign-in at complete, which the person repeats with an email address."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_WIDGET_ORIGIN_DENIED: this website is not a current approved embedding origin. HELP_DESK_EMPLOYEE_ACCESS_DENIED: at complete, the sign-in of a company-bound challenge is not an email sign-in of an active member of that company; the person may authorize again with another account."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: honor Retry-After."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE or INTERNAL_ERROR: retry later. A complete that SparkVault's Identity could not answer (its code exchange or its keys) is INTERNAL_ERROR, its request spent: authorize again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Prepare the help desk's own sign-in
      description: Approved HTTPS tenant origins only. Creates a 15-minute opaque challenge with sealed hints and an S256 verifier stored only by the initiating browser. `sign_in_url` opens the sign-in window on https://signin.help.sv, which signs the person in at SparkVault's own Identity as a guest of the help desk. Name hints become the requester's name when it has none; nothing is written to the person's Identity profile. No portal sign-in policy is changed.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  format: email
                given_name:
                  type: string
                  description: "A part of the requester's name: given then family, joined by a space, the name is held as a requester's name is (at most 100 characters once whitespace runs collapse, and no markup), else the challenge is refused with VALIDATION_ERROR."
                family_name:
                  type: string
                  description: "A part of the requester's name: given then family, joined by a space, the name is held as a requester's name is (at most 100 characters once whitespace runs collapse, and no markup), else the challenge is refused with VALIDATION_ERROR."
                select_account:
                  type: boolean
                employee_company_id:
                  type: string
                  description: "Optional current KB/ticket employee policy company: the sign-in must then be an email sign-in of an active member of that company."
              required: []
              additionalProperties: false
  /hd/desks/{desk_id}/auth/widget/complete:
    post:
      tags:
        - hd
      security: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
        - name: X-SV-Client
          in: header
          required: true
          schema:
            type: string
            const: help-desk-portal
        - name: Origin
          in: header
          required: true
          schema:
            type: string
            format: uri
          description: Actual browser origin; approved tenant website for challenge/result/redeem, exactly https://signin.help.sv for authorize/complete/confirm/cancel.
      responses:
        "200":
          description: The current sign-in step.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      email:
                        type:
                          - string
                          - "null"
                        description: The address the person signed in with; null for a sign-in through SparkVault's own identity provider that asserted none.
                      organization_name:
                        type:
                          - string
                          - "null"
                        description: The desk's organization; null for an account that names none.
                      desk_name:
                        type:
                          - string
                          - "null"
                        description: A named desk's own name; null for the organization's own desk.
                      desk_host:
                        type: string
                        description: The desk's canonical host.
                      website_host:
                        type: string
                        description: The host of the website that receives the session, in its ASCII serialization.
                      confirmation:
                        type: string
                        pattern: ^[A-Za-z0-9_-]{43}$
                        description: The secret the person's Continue presents to confirm (confirm `confirmation`), answered here alone. The sign-in window keeps it only for its confirmation screen and never hands it to its opener or puts it in a URL, so the website, which holds the challenge's state, cannot confirm a sign-in the person did not.
                    required:
                      - email
                      - organization_name
                      - desk_name
                      - desk_host
                      - website_host
                      - confirmation
                    additionalProperties: false
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "HELP_DESK_WIDGET_SIGN_IN_INVALID or VALIDATION_ERROR: an invalid, foreign, expired, consumed or incorrectly bound proof, a sign-in window step without the challenge's state or from another origin, a callback of an authorization request since replaced, spent or refused by Identity, or a confirm with no verified sign-in to confirm or without the confirmation the completion of that sign-in answered. SIGN_IN_NEEDS_EMAIL: a phone or social sign-in at complete, which the person repeats with an email address."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_WIDGET_ORIGIN_DENIED: this website is not a current approved embedding origin. HELP_DESK_EMPLOYEE_ACCESS_DENIED: at complete, the sign-in of a company-bound challenge is not an email sign-in of an active member of that company; the person may authorize again with another account."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: honor Retry-After."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE or INTERNAL_ERROR: retry later. A complete that SparkVault's Identity could not answer (its code exchange or its keys) is INTERNAL_ERROR, its request spent: authorize again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Complete the authorization request and verify the sign-in
      description: "Exactly https://signin.help.sv and the challenge's state only. The callback's state must be the latest request's; the request is spent before its code is exchanged, so a callback is answered once. Core exchanges the code with the help desk client's secret and verifies the id_token: SparkVault's Identity's signature, the help desk client as its audience, the request's nonce, a live session, and an email address asserted. A phone or social sign-in is refused with SIGN_IN_NEEDS_EMAIL; a sign-in through SparkVault's own identity provider is taken only at SparkVault's own desk. A person blocking the desk's organization is refused, and a company-bound challenge takes only an email sign-in of an active member of that company. Records the verified sign-in on the challenge, sealed, and answers what the window shows the person before they confirm: nothing of the sign-in reaches the website yet, and the website's result reads not ready."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                challenge_id:
                  type: string
                  pattern: ^[A-Za-z0-9_-]{43}$
                state:
                  type: string
                  pattern: ^[A-Za-z0-9_-]{43}$
                  writeOnly: true
                  description: The challenge's state, which the sign-in window obtains only from the window that opened it, at the challenge's origin. A window opened anywhere else holds none, and the step is refused.
                oidc_state:
                  type: string
                  pattern: ^[A-Za-z0-9_-]{22}$
                  writeOnly: true
                  description: The `state` the callback carried.
                code:
                  type: string
                  pattern: ^[A-Za-z0-9._~-]{1,512}$
                  writeOnly: true
                  description: The authorization code the callback carried.
              required:
                - challenge_id
                - state
                - oidc_state
                - code
              additionalProperties: false
  /hd/desks/{desk_id}/auth/widget/confirm:
    post:
      tags:
        - hd
      security: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
        - name: X-SV-Client
          in: header
          required: true
          schema:
            type: string
            const: help-desk-portal
        - name: Origin
          in: header
          required: true
          schema:
            type: string
            format: uri
          description: Actual browser origin; approved tenant website for challenge/result/redeem, exactly https://signin.help.sv for authorize/complete/confirm/cancel.
      responses:
        "200":
          description: The current sign-in step.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      code:
                        type: string
                        pattern: ^[A-Za-z0-9_-]{43}$
                      origin:
                        type: string
                      challenge_id:
                        type: string
                        pattern: ^[A-Za-z0-9_-]{43}$
                    required:
                      - code
                      - origin
                      - challenge_id
                    additionalProperties: false
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "HELP_DESK_WIDGET_SIGN_IN_INVALID or VALIDATION_ERROR: an invalid, foreign, expired, consumed or incorrectly bound proof, a sign-in window step without the challenge's state or from another origin, a callback of an authorization request since replaced, spent or refused by Identity, or a confirm with no verified sign-in to confirm or without the confirmation the completion of that sign-in answered. SIGN_IN_NEEDS_EMAIL: a phone or social sign-in at complete, which the person repeats with an email address."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_WIDGET_ORIGIN_DENIED: this website is not a current approved embedding origin. HELP_DESK_EMPLOYEE_ACCESS_DENIED: at complete, the sign-in of a company-bound challenge is not an email sign-in of an active member of that company; the person may authorize again with another account."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: honor Retry-After."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE or INTERNAL_ERROR: retry later. A complete that SparkVault's Identity could not answer (its code exchange or its keys) is INTERNAL_ERROR, its request spent: authorize again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Confirm the verified sign-in and mint one return code
      description: "Exactly https://signin.help.sv, the challenge's state and the confirmation complete answered only, once the person presses Continue on the screen complete answered. Requires the sign-in complete recorded, and its confirmation: one of another sign-in, of a sign-in a later authorize discarded, or none, is refused and mints nothing. Acts as the requester the sign-in is (the directory must name an email sign-in's person the holder of its address; moving the address's requester to that person ends the former holder's sessions and is audited here as helpdesk_customer_sessions_revoked, reason svid_changed), names a requester that has none from the challenge's hints else the id_token's name (a name the requester rule refuses counting as none), and atomically consumes the challenge and mints one 60-second code, which the window posts to its opener at `origin`. Runs once. A host assertion or matching email alone cannot link a global account or claim native history."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                challenge_id:
                  type: string
                  pattern: ^[A-Za-z0-9_-]{43}$
                state:
                  type: string
                  pattern: ^[A-Za-z0-9_-]{43}$
                  writeOnly: true
                  description: The challenge's state, which the sign-in window obtains only from the window that opened it, at the challenge's origin. A window opened anywhere else holds none, and the step is refused.
                confirmation:
                  type: string
                  pattern: ^[A-Za-z0-9_-]{43}$
                  writeOnly: true
                  description: The `confirmation` complete answered the sign-in window for the sign-in it recorded.
              required:
                - challenge_id
                - state
                - confirmation
              additionalProperties: false
  /hd/desks/{desk_id}/auth/widget/redeem:
    post:
      tags:
        - hd
      security: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
        - name: X-SV-Client
          in: header
          required: true
          schema:
            type: string
            const: help-desk-portal
        - name: Origin
          in: header
          required: true
          schema:
            type: string
            format: uri
          description: Actual browser origin; approved tenant website for challenge/result/redeem, exactly https://signin.help.sv for authorize/complete/confirm/cancel.
      responses:
        "200":
          description: The current sign-in step.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskWidgetIdentitySession"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "HELP_DESK_WIDGET_SIGN_IN_INVALID or VALIDATION_ERROR: an invalid, foreign, expired, consumed or incorrectly bound proof, a sign-in window step without the challenge's state or from another origin, a callback of an authorization request since replaced, spent or refused by Identity, or a confirm with no verified sign-in to confirm or without the confirmation the completion of that sign-in answered. SIGN_IN_NEEDS_EMAIL: a phone or social sign-in at complete, which the person repeats with an email address."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_WIDGET_ORIGIN_DENIED: this website is not a current approved embedding origin. HELP_DESK_EMPLOYEE_ACCESS_DENIED: at complete, the sign-in of a company-bound challenge is not an email sign-in of an active member of that company; the person may authorize again with another account."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: honor Retry-After."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE or INTERNAL_ERROR: retry later. A complete that SparkVault's Identity could not answer (its code exchange or its keys) is INTERNAL_ERROR, its request spent: authorize again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Redeem the help desk's own sign-in once
      description: Exact original approved origin, desk/epoch and S256 verifier required. Code is optional only for the same authenticated result-polling recovery. Atomically consumes the code and creates an hdt_ session plus a five-minute origin-bound identity proof. Every content route continues enforcing its independent ticket/KB access policy; a customer sign-in alone never satisfies employee policy.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                challenge_id:
                  type: string
                  pattern: ^[A-Za-z0-9_-]{43}$
                verifier:
                  type: string
                  pattern: ^[A-Za-z0-9_-]{43}$
                code:
                  type: string
                  pattern: ^[A-Za-z0-9_-]{43}$
              required:
                - challenge_id
                - verifier
              additionalProperties: false
  /hd/desks/{desk_id}/auth/widget/result:
    post:
      tags:
        - hd
      security: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
        - name: X-SV-Client
          in: header
          required: true
          schema:
            type: string
            const: help-desk-portal
        - name: Origin
          in: header
          required: true
          schema:
            type: string
            format: uri
          description: Actual browser origin; approved tenant website for challenge/result/redeem, exactly https://signin.help.sv for authorize/complete/confirm/cancel.
      responses:
        "200":
          description: The current sign-in step.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      ready:
                        type: boolean
                      cancelled:
                        type: boolean
                    required:
                      - ready
                    additionalProperties: false
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "HELP_DESK_WIDGET_SIGN_IN_INVALID or VALIDATION_ERROR: an invalid, foreign, expired, consumed or incorrectly bound proof, a sign-in window step without the challenge's state or from another origin, a callback of an authorization request since replaced, spent or refused by Identity, or a confirm with no verified sign-in to confirm or without the confirmation the completion of that sign-in answered. SIGN_IN_NEEDS_EMAIL: a phone or social sign-in at complete, which the person repeats with an email address."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_WIDGET_ORIGIN_DENIED: this website is not a current approved embedding origin. HELP_DESK_EMPLOYEE_ACCESS_DENIED: at complete, the sign-in of a company-bound challenge is not an email sign-in of an active member of that company; the person may authorize again with another account."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: honor Retry-After."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE or INTERNAL_ERROR: retry later. A complete that SparkVault's Identity could not answer (its code exchange or its keys) is INTERNAL_ERROR, its request spent: authorize again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Recover the sign-in after lost popup messaging
      description: "Exact original approved origin and private PKCE verifier required. The verifier is checked before anything is answered: a wrong or missing verifier, or an unknown or expired challenge, is the one 400 HELP_DESK_WIDGET_SIGN_IN_INVALID whether the challenge is pending, finished or cancelled. Returns readiness/cancellation only, never an Identity token or customer credential."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                challenge_id:
                  type: string
                  pattern: ^[A-Za-z0-9_-]{43}$
                verifier:
                  type: string
                  pattern: ^[A-Za-z0-9_-]{43}$
              required:
                - challenge_id
                - verifier
              additionalProperties: false
  /hd/desks/{desk_id}/avatars/{avatar_handle}:
    get:
      tags:
        - hd
      security: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
          description: The desk, as its lookup answers it.
        - name: avatar_handle
          in: path
          required: true
          schema:
            type: string
          description: The avatar address the desk gave the operator.
      responses:
        "200":
          description: The picture.
          content:
            image/png:
              schema:
                type: string
                format: binary
            image/jpeg:
              schema:
                type: string
                format: binary
            image/webp:
              schema:
                type: string
                format: binary
            image/gif:
              schema:
                type: string
                format: binary
        "429":
          description: "RATE_LIMIT_EXCEEDED: this client address has spent its reads at the desk for the minute. `Retry-After` carries the seconds until the budget reopens."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "BUDGET_UNAVAILABLE: a budget the request spends could not be counted, so the request was refused rather than let through uncounted; `Retry-After` carries the seconds to wait before trying again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read an operator's avatar
      description: "The picture an operator's avatar address shows: their Secure Identity avatar while the desk shows avatars, or one generic silhouette for every other address, a retired or unknown one included, never saying why. Answers are cacheable for five minutes. Needs no credential; each client address spends a budget of reads a minute at the desk."
  /hd/desks/{desk_id}/drafts:
    post:
      tags:
        - hd
      security:
        - HelpDeskCustomerToken: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
          description: The desk, as its lookup answered it.
        - name: X-SV-Client
          in: header
          required: true
          schema:
            type: string
            const: help-desk-portal
          description: Names the portal. A request without it answers 400 CLIENT_HEADER_REQUIRED.
        - name: X-SV-Helpdesk-Access
          in: header
          required: false
          schema:
            type: string
          description: Required by password or employee ticket-portal policies, in addition to any customer bearer token. IP policies check the actual trusted visitor IP on every request.
      responses:
        "201":
          description: The draft.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - ticket_id
                    properties:
                      ticket_id:
                        type: string
                        description: "The draft: its files upload against it, and the request is sent from it."
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "CLIENT_HEADER_REQUIRED: see above."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "CUSTOMER_AUTH_REQUIRED: no bearer token, or one that is not a customer's of this desk now: unknown, expired, revoked, another desk's, or of the sign-in mode the desk no longer uses."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_ACCESS_REQUIRED or HELP_DESK_IP_DENIED: the current ticket-portal access policy refuses this request. Complete the access layer or connect from an approved network."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the customer has opened their drafts for the day, this client address has spent its portal reads for the minute across every desk, or this customer their reads at the desk for the minute. `Retry-After` carries the seconds until the budget reopens, and `details` carries `limit` and `resets_at`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE: the desk does not take customers right now, or this customer is refused. INTERNAL_ERROR: the identity service did not answer the check of a Secure Identity customer's session, made at most every 15 minutes; the session is kept, and the same request can be sent again. BUDGET_UNAVAILABLE: a budget the request spends could not be counted, so the request was refused rather than let through uncounted; `Retry-After` carries the seconds to wait before trying again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Open a draft request
      description: "A draft the customer's files upload against until it is sent as a request (POST /hd/desks/{desk_id}/tickets). A draft takes the customer's files for a day: after that no file uploads into it, no request is sent from it, and it is removed. A file uploaded into it that no sent request carries is deleted at its upload's `pending_until`."
  /hd/desks/{desk_id}/drafts/{ticket_id}/attachments/initiate:
    post:
      tags:
        - hd
      security:
        - HelpDeskCustomerToken: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
          description: The desk, as its lookup answered it.
        - name: ticket_id
          in: path
          required: true
          schema:
            type: string
          description: The draft, as its opening answered it.
        - name: X-SV-Client
          in: header
          required: true
          schema:
            type: string
            const: help-desk-portal
          description: Names the portal. A request without it answers 400 CLIENT_HEADER_REQUIRED.
        - name: X-SV-Helpdesk-Access
          in: header
          required: false
          schema:
            type: string
          description: Required by password or employee ticket-portal policies, in addition to any customer bearer token. IP policies check the actual trusted visitor IP on every request.
      responses:
        "200":
          description: The upload, begun.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskAttachmentUpload"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "ATTACHMENT_REFUSED: the file's name is missing, too long or one a file cannot be stored under, or it ends in no extension a request accepts. A request accepts images (.jpg, .jpeg, .png, .gif, .webp, .heic, .heif, .bmp, .tif, .tiff, .avif), documents (.pdf, .docx, .xlsx, .pptx, .txt, .csv, .tsv, .log, .json) and recordings (.mp4, .mov, .webm, .m4a, .mp3, .wav), and no other file. `details.reason` names which. VALIDATION_ERROR: `size_bytes` is missing or not a whole number of bytes from 1, or the body is not a JSON object. CLIENT_HEADER_REQUIRED: see above."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "CUSTOMER_AUTH_REQUIRED: no bearer token, or one that is not a customer's of this desk now: unknown, expired, revoked, another desk's, or of the sign-in mode the desk no longer uses."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "402":
          description: "PLAN_REQUIRED or QUOTA_EXCEEDED: the organization cannot take the file right now (its plan, its storage or its bandwidth), or the customer's upload allowance refuses it; `details.reason` is `customer_upload_limit` for files past it, and `customer_uploads_off` at a desk whose allowance is 0, which takes no files from customers. No figures are given."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_ACCESS_REQUIRED or HELP_DESK_IP_DENIED: the current ticket-portal access policy refuses this request. Complete the access layer or connect from an approved network."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such request, draft or file is the customer's: one that does not exist, one of another customer and a request closed as spam (which does not exist for its requester) read the same, byte for byte."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the request kept changing while this was saved. Send it again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "413":
          description: "PAYLOAD_TOO_LARGE: the file is larger than the most a customer's file may hold (`details.max_bytes`)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the customer has begun too many uploads on the request this hour, holds the most files waiting to be sent on it, or has sent their files or their bytes for the day; the desk has taken its customers' bytes for the day; or this client address has spent its portal reads for the minute, across every desk, or this customer their reads at the desk for the minute. `Retry-After` carries the seconds until the budget reopens, and `details` carries `limit` and `resets_at`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE: the desk does not take customers right now, or this customer is refused. INTERNAL_ERROR: the identity service did not answer the check of a Secure Identity customer's session, made at most every 15 minutes; the session is kept, and the same request can be sent again. BUDGET_UNAVAILABLE: a budget the request spends could not be counted, so the request was refused rather than let through uncounted; `Retry-After` carries the seconds to wait before trying again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Begin a file's upload into a draft
      description: Begin the upload of one file into one of the customer's own drafts, within its day. The file then goes to `forge_url` by the resumable transfer every SparkVault upload runs, and joins the request once the request is sent naming its `attachment_id`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - size_bytes
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 255
                  description: "The file's name, which alone decides whether a request takes the file and what type it is stored under. A request takes images (.jpg, .jpeg, .png, .gif, .webp, .heic, .heif, .bmp, .tif, .tiff, .avif), documents (.pdf, .docx, .xlsx, .pptx, .txt, .csv, .tsv, .log, .json) and recordings (.mp4, .mov, .webm, .m4a, .mp3, .wav), and no other file: a name must end in one of those extensions, in any case, and be one a file can be stored under (no path separator, control or direction character, none of `:*?\"<>|`, not only dots or spaces). The file is stored, served and downloaded as the type its extension registers, whatever type the browser reports for it."
                size_bytes:
                  type: integer
                  minimum: 1
                  maximum: 26214400
                  description: "The file's size in bytes: the most the upload stores."
  /hd/desks/{desk_id}/drafts/{ticket_id}/attachments/{attachment_id}:
    delete:
      tags:
        - hd
      security:
        - HelpDeskCustomerToken: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
          description: The desk, as its lookup answered it.
        - name: ticket_id
          in: path
          required: true
          schema:
            type: string
          description: The draft, as its opening answered it.
        - name: attachment_id
          in: path
          required: true
          schema:
            type: string
          description: The upload, as its start answered it.
        - name: X-SV-Client
          in: header
          required: true
          schema:
            type: string
            const: help-desk-portal
          description: Names the portal. A request without it answers 400 CLIENT_HEADER_REQUIRED.
        - name: X-SV-Helpdesk-Access
          in: header
          required: false
          schema:
            type: string
          description: Required by password or employee ticket-portal policies, in addition to any customer bearer token. IP policies check the actual trusted visitor IP on every request.
      responses:
        "204":
          description: No upload of the customer's under this id waits to be sent on the draft.
        "401":
          description: "CUSTOMER_AUTH_REQUIRED: no bearer token, or one that is not a customer's of this desk now: unknown, expired, revoked, another desk's, or of the sign-in mode the desk no longer uses."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_ACCESS_REQUIRED or HELP_DESK_IP_DENIED: the current ticket-portal access policy refuses this request. Complete the access layer or connect from an approved network."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such request, draft or file is the customer's: one that does not exist, one of another customer and a request closed as spam (which does not exist for its requester) read the same, byte for byte."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the request kept changing while this was saved. Send it again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE: the desk does not take customers right now, or this customer is refused. INTERNAL_ERROR: the identity service did not answer the check of a Secure Identity customer's session, made at most every 15 minutes; the session is kept, and the same request can be sent again. BUDGET_UNAVAILABLE: a budget the request spends could not be counted, so the request was refused rather than let through uncounted; `Retry-After` carries the seconds to wait before trying again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Cancel a file's upload into a draft
      description: "Cancel one of the customer's own uploads into their draft, a file they removed before sending the request: the upload is deleted, and what it held of the customer's upload allowance is given back at once. An id that names none of the customer's uploads waiting to be sent is answered the same, so a cancel sent again changes nothing."
  /hd/desks/{desk_id}/kb/articles/{article_id}/helpful:
    post:
      tags:
        - hd
      security: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
        - name: article_id
          in: path
          required: true
          schema:
            type: string
        - name: Origin
          in: header
          required: true
          schema:
            type: string
            format: uri
          description: The actual HTTPS origin hosting this desk; credentials, paths and nondefault ports are refused.
      responses:
        "200":
          description: The saved result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      vote:
                        type: string
                        enum:
                          - yes
                          - no
                      version:
                        type: integer
                        minimum: 1
                      review_url:
                        type: string
                        format: uri
                        description: The Positive feedback URL (General settings) of the desk whose help center or support widget the reader votes in, the same link ticket Good ratings use. Returned after a saved Yes vote when one is set, unless the release voted in was published with the feedback setting's on_yes.action thanks. The client shows the review question and link exactly when it is present; it never navigates automatically.
                    required:
                      - vote
                      - version
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the request contains an invalid or unsupported value."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "KB_ORIGIN_REQUIRED: the Origin is missing, unsafe or belongs to another desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "KB_PUBLICATION_CHANGED or CONFLICT: reload a changed publication, or renew an expired visitor."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "413":
          description: "PAYLOAD_TOO_LARGE: a JSON interaction body is at most 1024 bytes."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait for the Retry-After interval."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: The desk is unavailable, its budget store could not be read, or the publication store refused SparkVault's credential (KB_PUBLISHING_UNAVAILABLE). Try again later.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Save whether a published article was helpful
      description: Called by the public knowledge base after page paint or an explicit interaction, never by its HTML/HEAD renderer. No bearer token or cookie is required. The Origin must be an approved HTTPS host for this desk, and the current publication must still be enabled. Rate limits apply before visitor draws and interaction writes; no raw IP, user-agent, referrer or search text is stored in analytics. Only an explicit click submits a vote. The same vote is a no-op; changing it atomically replaces one sample and advances its version while retaining its original day/category. Vote receipts outlive the visitor by one day; aggregates contain no visitor identifier. Clearing the visitor cookie can create a new pseudonym, so these counts do not claim unique people.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                visitor_id:
                  type: string
                  minLength: 1
                  maxLength: 256
                  description: Opaque visitor cookie value. Existing formats are reused exactly; registration is scoped to this desk and never grants authentication.
                release_id:
                  type: string
                  description: The immutable release ID embedded in the page.
                vote:
                  type: string
                  enum:
                    - yes
                    - no
                comment:
                  type: string
                  maxLength: 500
                  description: Optional note sent with a No vote when the knowledge-base feedback setting asks for one.
              required:
                - visitor_id
                - release_id
                - vote
              additionalProperties: false
  /hd/desks/{desk_id}/kb/events:
    post:
      tags:
        - hd
      security: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
        - name: Origin
          in: header
          required: true
          schema:
            type: string
            format: uri
          description: The actual HTTPS origin hosting this desk; credentials, paths and nondefault ports are refused.
      responses:
        "200":
          description: The saved result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      recorded:
                        type: boolean
                    required:
                      - recorded
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the request contains an invalid or unsupported value."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "KB_ORIGIN_REQUIRED: the Origin is missing, unsafe or belongs to another desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "KB_PUBLICATION_CHANGED or CONFLICT: reload a changed publication, or renew an expired visitor."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "413":
          description: "PAYLOAD_TOO_LARGE: a JSON interaction body is at most 1024 bytes."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait for the Retry-After interval."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: The desk is unavailable, its budget store could not be read, or the publication store refused SparkVault's credential (KB_PUBLISHING_UNAVAILABLE). Try again later.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Record a visible article view or submitted search
      description: Called by the public knowledge base after page paint or an explicit interaction, never by its HTML/HEAD renderer. No bearer token or cookie is required. The Origin must be an approved HTTPS host for this desk, and the current publication must still be enabled. Rate limits apply before visitor draws and interaction writes; no raw IP, user-agent, referrer or search text is stored in analytics. A retry records no second count. Article/category attribution comes from the current published membership, never caller-supplied metadata. A search names in result_count how many articles hold every word of it; zero counts it as a search with no results, even when the browser listed its closest partial matches. No GET records events.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  properties:
                    visitor_id:
                      type: string
                      minLength: 1
                      maxLength: 256
                      description: Opaque visitor cookie value. Existing formats are reused exactly; registration is scoped to this desk and never grants authentication.
                    release_id:
                      type: string
                      description: The immutable release ID embedded in the page.
                    event_id:
                      type: string
                      pattern: ^\d{13}-[0-9]{1,10}$
                      description: Milliseconds since epoch, a hyphen and a page ordinal. Retry the original ID and body. Accepted for 24 hours, with at most 60 seconds future skew; receipts survive 48 hours so old replays cannot outlive them.
                    type:
                      const: view
                      type: string
                    article_id:
                      type: string
                  required:
                    - visitor_id
                    - release_id
                    - event_id
                    - type
                    - article_id
                  additionalProperties: false
                - type: object
                  properties:
                    visitor_id:
                      type: string
                      minLength: 1
                      maxLength: 256
                      description: Opaque visitor cookie value. Existing formats are reused exactly; registration is scoped to this desk and never grants authentication.
                    release_id:
                      type: string
                      description: The immutable release ID embedded in the page.
                    event_id:
                      type: string
                      pattern: ^\d{13}-[0-9]{1,10}$
                      description: Milliseconds since epoch, a hyphen and a page ordinal. Retry the original ID and body. Accepted for 24 hours, with at most 60 seconds future skew; receipts survive 48 hours so old replays cannot outlive them.
                    type:
                      const: search
                      type: string
                    result_count:
                      type: integer
                      minimum: 0
                      maximum: 10000
                  required:
                    - visitor_id
                    - release_id
                    - event_id
                    - type
                    - result_count
                  additionalProperties: false
  /hd/desks/{desk_id}/kb/visitor:
    post:
      tags:
        - hd
      security: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
        - name: Origin
          in: header
          required: true
          schema:
            type: string
            format: uri
          description: The actual HTTPS origin hosting this desk; credentials, paths and nondefault ports are refused.
      responses:
        "200":
          description: The saved result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      visitor_id:
                        type: string
                        minLength: 1
                        maxLength: 256
                        description: Opaque visitor cookie value. Existing formats are reused exactly; registration is scoped to this desk and never grants authentication.
                      expires_at:
                        type: integer
                        minimum: 0
                    required:
                      - visitor_id
                      - expires_at
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the request contains an invalid or unsupported value."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "KB_ORIGIN_REQUIRED: the Origin is missing, unsafe or belongs to another desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "KB_PUBLICATION_CHANGED or CONFLICT: reload a changed publication, or renew an expired visitor."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "413":
          description: "PAYLOAD_TOO_LARGE: a JSON interaction body is at most 1024 bytes."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait for the Retry-After interval."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: The desk is unavailable, its budget store could not be read, or the publication store refused SparkVault's credential (KB_PUBLISHING_UNAVAILABLE). Try again later.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Create an anonymous knowledge base visitor
      description: Called by the public knowledge base after page paint or an explicit interaction, never by its HTML/HEAD renderer. No bearer token or cookie is required. The Origin must be an approved HTTPS host for this desk, and the current publication must still be enabled. Rate limits apply before visitor draws and interaction writes; no raw IP, user-agent, referrer or search text is stored in analytics. Accepts an optional existing opaque visitor cookie value (up to 256 cookie-safe ASCII characters), including prefixed IDs and UUIDs created by another site. No format conversion is applied. Otherwise minted through the Entropy service. At most 600 registrations per network address per hour across desks. The server stores only its hash for 30 days. Hosted pages use a first-party cookie; no visitor ID is stored in localStorage. Cache-Control is no-store.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                release_id:
                  type: string
                  description: The immutable release ID embedded in the page.
                visitor_id:
                  type: string
                  minLength: 1
                  maxLength: 256
                  description: Opaque visitor cookie value. Existing formats are reused exactly; registration is scoped to this desk and never grants authentication.
              additionalProperties: false
  /hd/desks/{desk_id}/kb/widget/access:
    post:
      tags:
        - hd
      security: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
        - name: Origin
          in: header
          required: true
          schema:
            type: string
            format: uri
          description: Actual embedding HTTPS origin. Must match a current verified company website, exact desk portal, or explicitly configured external identity origin.
        - name: Authorization
          in: header
          required: false
          schema:
            type: string
          description: Bearer KB grant from /access. Required for password/employee policies. Independent of hdt_ customer ticket tokens and operator credentials.
      responses:
        "200":
          description: The current published result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      token:
                        anyOf:
                          - type: string
                          - type: "null"
                      expires_at:
                        anyOf:
                          - type: integer
                          - type: "null"
                      ttl_seconds:
                        anyOf:
                          - type: integer
                            minimum: 0
                          - type: "null"
                      config:
                        $ref: "#/components/schemas/KnowledgeBaseWidgetConfig"
                    required:
                      - token
                      - expires_at
                      - ttl_seconds
                      - config
                    additionalProperties: false
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: invalid or unsupported input."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "KB_ACCESS_REQUIRED: complete this knowledge base's access layer."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_WIDGET_ORIGIN_DENIED, KB_IP_RESTRICTED, KB_PASSWORD_INCORRECT or KB_ACCESS_DENIED: the current origin or KB access policy refused the request."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "KB_UNAVAILABLE, KB_SEARCH_UNAVAILABLE, KB_DOCUMENT_NOT_FOUND or KB_ASSET_NOT_FOUND: no admitted published content is available."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "KB_PUBLICATION_CHANGED: search the new release. KB_READER_UNAVAILABLE: this immutable release predates reader documents; use the canonical help-center URL."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: honor Retry-After."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE, KB_PUBLISHING_UNAVAILABLE or BUDGET_UNAVAILABLE: retry later."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Open isolated password or employee access for an embedded KB
      description: Every request validates the current active desk and approved embedding origin. Content reads also validate the current DB/R2 publication and independent knowledge-base policy; employee grants recheck live company membership and Identity session. Responses are private/no-store. Drafts and old releases cannot be selected. No global framing, CORS or ticket policy is widened. Password grants last one hour and bind desk, origin, release and current password verifier. Identity grants are isolated opaque hdkbt_ sessions. Keep grants in memory; never place them in URLs or local storage.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                release_id:
                  type: string
                  pattern: ^[a-f0-9]{64}$
                password:
                  type: string
                  minLength: 1
                  maxLength: 256
                  writeOnly: true
                identity_grant:
                  type: string
                  maxLength: 256
                  writeOnly: true
                  description: The help desk's own sign-in's hdwip_ proof (the identity_grant a sign-in's redeem answers), bound to this origin. The employee policy independently checks current directory membership and email ownership. Mutually exclusive with password.
              required: []
              additionalProperties: false
  /hd/desks/{desk_id}/kb/widget/articles/{article_id}/helpful:
    post:
      tags:
        - hd
      security: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
        - name: article_id
          in: path
          required: true
          schema:
            type: string
        - name: Origin
          in: header
          required: true
          schema:
            type: string
            format: uri
          description: The actual HTTPS origin hosting this desk; credentials, paths and nondefault ports are refused.
      responses:
        "200":
          description: The saved result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      vote:
                        type: string
                        enum:
                          - yes
                          - no
                      version:
                        type: integer
                        minimum: 1
                      review_url:
                        type: string
                        format: uri
                        description: The Positive feedback URL (General settings) of the desk whose help center or support widget the reader votes in, the same link ticket Good ratings use. Returned after a saved Yes vote when one is set, unless the release voted in was published with the feedback setting's on_yes.action thanks. The client shows the review question and link exactly when it is present; it never navigates automatically.
                    required:
                      - vote
                      - version
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the request contains an invalid or unsupported value."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "KB_ACCESS_REQUIRED: unlock the knowledge base before submitting feedback."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: The embedding Origin or current KB access policy refuses this interaction.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "KB_DOCUMENT_NOT_FOUND: choose an answer in the current publication."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "KB_PUBLICATION_CHANGED or CONFLICT: reload a changed publication, or renew an expired visitor."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "413":
          description: "PAYLOAD_TOO_LARGE: a JSON interaction body is at most 1024 bytes."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait for the Retry-After interval."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: The desk is unavailable, its budget store could not be read, or the publication store refused SparkVault's credential (KB_PUBLISHING_UNAVAILABLE). Try again later.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Save embedded article feedback
      description: For the embedded article reader. Requires an approved embedding Origin and the current enabled publication. Protected knowledge bases additionally require their own KB access token in Authorization; a ticket session does not grant KB access. Uses the same 30-day KB visitor pseudonym and article vote counters as the public help center, never the support-attempt visitor. Only an explicit click submits a vote. The same vote is a no-op; changing it atomically replaces one sample and advances its version while retaining its original day/category. Vote receipts outlive the visitor by one day; aggregates contain no visitor identifier. Clearing the visitor cookie can create a new pseudonym, so these counts do not claim unique people.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                visitor_id:
                  type: string
                  minLength: 1
                  maxLength: 256
                  description: Opaque visitor cookie value. Existing formats are reused exactly; registration is scoped to this desk and never grants authentication.
                release_id:
                  type: string
                  description: The immutable release ID embedded in the page.
                vote:
                  type: string
                  enum:
                    - yes
                    - no
                comment:
                  type: string
                  maxLength: 500
                  description: Optional note sent with a No vote when the knowledge-base feedback setting asks for one.
              required:
                - visitor_id
                - release_id
                - vote
              additionalProperties: false
  /hd/desks/{desk_id}/kb/widget/asset:
    get:
      tags:
        - hd
      security: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
        - name: Origin
          in: header
          required: true
          schema:
            type: string
            format: uri
          description: Actual embedding HTTPS origin. Must match a current verified company website, exact desk portal, or explicitly configured external identity origin.
        - name: Authorization
          in: header
          required: false
          schema:
            type: string
          description: Bearer KB grant from /access. Required for password/employee policies. Independent of hdt_ customer ticket tokens and operator credentials.
        - name: release_id
          in: query
          required: false
          schema:
            type: string
            pattern: ^[a-f0-9]{64}$
          description: Expected current release. A replaced release returns KB_PUBLICATION_CHANGED.
        - name: path
          in: query
          required: true
          schema:
            type: string
            pattern: ^/_kb/assets/
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
          description: Use next_offset until null. Each raw chunk is at most 512 KiB, below the API response-size limit.
      responses:
        "200":
          description: Integrity-checked current-release image bytes. Each chunk rechecks current access; SDK assembles a temporary blob URL and revokes it when access is cleared.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      content_type:
                        type: string
                        enum:
                          - image/png
                          - image/jpeg
                          - image/gif
                          - image/webp
                          - image/avif
                          - image/svg+xml
                      total_size:
                        type: integer
                        minimum: 0
                        maximum: 10485760
                      offset:
                        type: integer
                        minimum: 0
                      data:
                        type: string
                        contentEncoding: base64
                        description: At most 512 KiB of raw bytes.
                      next_offset:
                        anyOf:
                          - type: integer
                            minimum: 0
                          - type: "null"
                    required:
                      - content_type
                      - total_size
                      - offset
                      - data
                      - next_offset
                    additionalProperties: false
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: invalid or unsupported input."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "KB_ACCESS_REQUIRED: complete this knowledge base's access layer."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_WIDGET_ORIGIN_DENIED, KB_IP_RESTRICTED, KB_PASSWORD_INCORRECT or KB_ACCESS_DENIED: the current origin or KB access policy refused the request."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "KB_UNAVAILABLE, KB_SEARCH_UNAVAILABLE, KB_DOCUMENT_NOT_FOUND or KB_ASSET_NOT_FOUND: no admitted published content is available."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "KB_PUBLICATION_CHANGED: search the new release. KB_READER_UNAVAILABLE: this immutable release predates reader documents; use the canonical help-center URL."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: honor Retry-After."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE, KB_PUBLISHING_UNAVAILABLE or BUDGET_UNAVAILABLE: retry later."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read an authorized published reader image chunk
      description: Every request validates the current active desk and approved embedding origin. Content reads also validate the current DB/R2 publication and independent knowledge-base policy; employee grants recheck live company membership and Identity session. Responses are private/no-store. Drafts and old releases cannot be selected. No global framing, CORS or ticket policy is widened.
  /hd/desks/{desk_id}/kb/widget/config:
    get:
      tags:
        - hd
      security: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
        - name: Origin
          in: header
          required: true
          schema:
            type: string
            format: uri
          description: Actual embedding HTTPS origin. Must match a current verified company website, exact desk portal, or explicitly configured external identity origin.
        - name: Authorization
          in: header
          required: false
          schema:
            type: string
          description: Bearer KB grant from /access. Required for password/employee policies. Independent of hdt_ customer ticket tokens and operator credentials.
      responses:
        "200":
          description: The current published result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/KnowledgeBaseWidgetConfig"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: invalid or unsupported input."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "KB_ACCESS_REQUIRED: complete this knowledge base's access layer."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_WIDGET_ORIGIN_DENIED, KB_IP_RESTRICTED, KB_PASSWORD_INCORRECT or KB_ACCESS_DENIED: the current origin or KB access policy refused the request."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "KB_UNAVAILABLE, KB_SEARCH_UNAVAILABLE, KB_DOCUMENT_NOT_FOUND or KB_ASSET_NOT_FOUND: no admitted published content is available."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "KB_PUBLICATION_CHANGED: search the new release. KB_READER_UNAVAILABLE: this immutable release predates reader documents; use the canonical help-center URL."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: honor Retry-After."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE, KB_PUBLISHING_UNAVAILABLE or BUDGET_UNAVAILABLE: retry later."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Discover the embedded knowledge-base access state
      description: Every request validates the current active desk and approved embedding origin. Content reads also validate the current DB/R2 publication and independent knowledge-base policy; employee grants recheck live company membership and Identity session. Responses are private/no-store. Drafts and old releases cannot be selected. No global framing, CORS or ticket policy is widened.
  /hd/desks/{desk_id}/kb/widget/documents/{document_id}:
    get:
      tags:
        - hd
      security: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
        - name: Origin
          in: header
          required: true
          schema:
            type: string
            format: uri
          description: Actual embedding HTTPS origin. Must match a current verified company website, exact desk portal, or explicitly configured external identity origin.
        - name: Authorization
          in: header
          required: false
          schema:
            type: string
          description: Bearer KB grant from /access. Required for password/employee policies. Independent of hdt_ customer ticket tokens and operator credentials.
        - name: document_id
          in: path
          required: true
          schema:
            type: string
            maxLength: 256
        - name: release_id
          in: query
          required: false
          schema:
            type: string
            pattern: ^[a-f0-9]{64}$
          description: Expected current release. A replaced release returns KB_PUBLICATION_CHANGED.
      responses:
        "200":
          description: The current published result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/KnowledgeBaseWidgetReader"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: invalid or unsupported input."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "KB_ACCESS_REQUIRED: complete this knowledge base's access layer."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_WIDGET_ORIGIN_DENIED, KB_IP_RESTRICTED, KB_PASSWORD_INCORRECT or KB_ACCESS_DENIED: the current origin or KB access policy refused the request."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "KB_UNAVAILABLE, KB_SEARCH_UNAVAILABLE, KB_DOCUMENT_NOT_FOUND or KB_ASSET_NOT_FOUND: no admitted published content is available."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "KB_PUBLICATION_CHANGED: search the new release. KB_READER_UNAVAILABLE: this immutable release predates reader documents; use the canonical help-center URL."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: honor Retry-After."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE, KB_PUBLISHING_UNAVAILABLE or BUDGET_UNAVAILABLE: retry later."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read one published article or FAQ answer in the embedded reader
      description: Every request validates the current active desk and approved embedding origin. Content reads also validate the current DB/R2 publication and independent knowledge-base policy; employee grants recheck live company membership and Identity session. Responses are private/no-store. Drafts and old releases cannot be selected. No global framing, CORS or ticket policy is widened.
  /hd/desks/{desk_id}/kb/widget/index:
    get:
      tags:
        - hd
      security: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
        - name: Origin
          in: header
          required: true
          schema:
            type: string
            format: uri
          description: Actual embedding HTTPS origin. Must match a current verified company website, exact desk portal, or explicitly configured external identity origin.
        - name: Authorization
          in: header
          required: false
          schema:
            type: string
          description: Bearer KB grant from /access. Required for password/employee policies. Independent of hdt_ customer ticket tokens and operator credentials.
        - name: release_id
          in: query
          required: false
          schema:
            type: string
            pattern: ^[a-f0-9]{64}$
          description: Expected current release. A replaced release returns KB_PUBLICATION_CHANGED.
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: Opaque current-release cursor from the previous page.
      responses:
        "200":
          description: The current published result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      version:
                        type: integer
                      release_id:
                        type: string
                        pattern: ^[a-f0-9]{64}$
                      canonical_origin:
                        type: string
                        format: uri
                      next_cursor:
                        anyOf:
                          - type: string
                          - type: "null"
                      articles:
                        type: array
                        maxItems: 4000
                        items:
                          type: object
                          additionalProperties: true
                          description: "Same published index used by the full KB: id, path, title, SEO metadata, summary, text and category, plus kind/document_path in new releases."
                    required:
                      - version
                      - release_id
                      - canonical_origin
                      - next_cursor
                      - articles
                    additionalProperties: false
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: invalid or unsupported input."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "KB_ACCESS_REQUIRED: complete this knowledge base's access layer."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_WIDGET_ORIGIN_DENIED, KB_IP_RESTRICTED, KB_PASSWORD_INCORRECT or KB_ACCESS_DENIED: the current origin or KB access policy refused the request."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "KB_UNAVAILABLE, KB_SEARCH_UNAVAILABLE, KB_DOCUMENT_NOT_FOUND or KB_ASSET_NOT_FOUND: no admitted published content is available."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "KB_PUBLICATION_CHANGED: search the new release. KB_READER_UNAVAILABLE: this immutable release predates reader documents; use the canonical help-center URL."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: honor Retry-After."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE, KB_PUBLISHING_UNAVAILABLE or BUDGET_UNAVAILABLE: retry later."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read the authorized current search index
      description: Every request validates the current active desk and approved embedding origin. Content reads also validate the current DB/R2 publication and independent knowledge-base policy; employee grants recheck live company membership and Identity session. Responses are private/no-store. Drafts and old releases cannot be selected. No global framing, CORS or ticket policy is widened. Index pages stay below 1 MiB; assemble until next_cursor is null. The SDK runs the shared search/recommendation engine locally; it never submits the visitor's issue to this route.
  /hd/desks/{desk_id}/kb/widget/visitor:
    post:
      tags:
        - hd
      security: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
        - name: Origin
          in: header
          required: true
          schema:
            type: string
            format: uri
          description: The actual HTTPS origin hosting this desk; credentials, paths and nondefault ports are refused.
      responses:
        "200":
          description: The saved result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      visitor_id:
                        type: string
                        minLength: 1
                        maxLength: 256
                        description: Opaque visitor cookie value. Existing formats are reused exactly; registration is scoped to this desk and never grants authentication.
                      expires_at:
                        type: integer
                        minimum: 0
                    required:
                      - visitor_id
                      - expires_at
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the request contains an invalid or unsupported value."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "KB_ACCESS_REQUIRED: unlock the knowledge base before submitting feedback."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: The embedding Origin or current KB access policy refuses this interaction.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "KB_DOCUMENT_NOT_FOUND: choose an answer in the current publication."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "KB_PUBLICATION_CHANGED or CONFLICT: reload a changed publication, or renew an expired visitor."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "413":
          description: "PAYLOAD_TOO_LARGE: a JSON interaction body is at most 1024 bytes."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait for the Retry-After interval."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: The desk is unavailable, its budget store could not be read, or the publication store refused SparkVault's credential (KB_PUBLISHING_UNAVAILABLE). Try again later.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Create an embedded knowledge base visitor
      description: For the embedded article reader. Requires an approved embedding Origin and the current enabled publication. Protected knowledge bases additionally require their own KB access token in Authorization; a ticket session does not grant KB access. Uses the same 30-day KB visitor pseudonym and article vote counters as the public help center, never the support-attempt visitor.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                release_id:
                  type: string
                  description: The immutable release ID embedded in the page.
                visitor_id:
                  type: string
                  minLength: 1
                  maxLength: 256
                  description: Opaque visitor cookie value. Existing formats are reused exactly; registration is scoped to this desk and never grants authentication.
              required:
                - release_id
              additionalProperties: false
  /hd/desks/{desk_id}/me:
    get:
      tags:
        - hd
      security:
        - HelpDeskCustomerToken: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
          description: The desk, as its lookup answered it.
        - name: X-SV-Client
          in: header
          required: true
          schema:
            type: string
            const: help-desk-portal
          description: Names the portal. A request without it answers 400 CLIENT_HEADER_REQUIRED.
        - name: X-SV-Helpdesk-Access
          in: header
          required: false
          schema:
            type: string
          description: Required by password or employee ticket-portal policies, in addition to any customer bearer token. IP policies check the actual trusted visitor IP on every request.
      responses:
        "200":
          description: The customer.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskCustomer"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "CLIENT_HEADER_REQUIRED: see above."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "CUSTOMER_AUTH_REQUIRED: no bearer token, or one that is not a customer's of this desk now: unknown, expired, revoked, another desk's, or of the sign-in mode the desk no longer uses."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_ACCESS_REQUIRED or HELP_DESK_IP_DENIED: the current ticket-portal access policy refuses this request. Complete the access layer or connect from an approved network."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: this client address has spent its portal reads for the minute, across every desk, or this customer their reads at the desk for the minute. `Retry-After` carries the seconds until the budget reopens, and `details` carries `limit` and `resets_at`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE: the desk does not take customers right now, or this customer is refused. INTERNAL_ERROR: the identity service did not answer the check of a Secure Identity customer's session, made at most every 15 minutes; the session is kept, and the same request can be sent again. BUDGET_UNAVAILABLE: a budget the request spends could not be counted, so the request was refused rather than let through uncounted; `Retry-After` carries the seconds to wait before trying again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read the signed-in customer
      description: The customer the bearer token names at this desk. A Secure Identity customer's record is made when they first sign in.
    put:
      tags:
        - hd
      security:
        - HelpDeskCustomerToken: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
          description: The desk, as its lookup answered it.
        - name: X-SV-Client
          in: header
          required: true
          schema:
            type: string
            const: help-desk-portal
          description: Names the portal. A request without it answers 400 CLIENT_HEADER_REQUIRED.
        - name: X-SV-Helpdesk-Access
          in: header
          required: false
          schema:
            type: string
          description: Required by password or employee ticket-portal policies, in addition to any customer bearer token. IP policies check the actual trusted visitor IP on every request.
      responses:
        "200":
          description: The customer as they now stand.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskCustomer"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the body is no JSON object, a field is unknown, the name is empty, too long or holds markup, or `email_updates` is not true or false, or is sent by a Secure Identity customer or a federated session. CLIENT_HEADER_REQUIRED: see above."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "CUSTOMER_AUTH_REQUIRED: no bearer token, or one that is not a customer's of this desk now: unknown, expired, revoked, another desk's, or of the sign-in mode the desk no longer uses."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_ACCESS_REQUIRED or HELP_DESK_IP_DENIED: the current ticket-portal access policy refuses this request. Complete the access layer or connect from an approved network."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the customer's record kept changing meanwhile; try again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: this client address has spent its portal reads for the minute, across every desk, or this customer their reads at the desk for the minute. `Retry-After` carries the seconds until the budget reopens, and `details` carries `limit` and `resets_at`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE: the desk does not take customers right now, or this customer is refused. INTERNAL_ERROR: the identity service did not answer the check of a Secure Identity customer's session, made at most every 15 minutes; the session is kept, and the same request can be sent again. BUDGET_UNAVAILABLE: a budget the request spends could not be counted, so the request was refused rather than let through uncounted; `Retry-After` carries the seconds to wait before trying again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Change the signed-in customer
      description: The customer's display name, and, where that choice is the desk's own switch (`email_updates` present on the customer), whether the desk emails them updates. A Secure Identity customer sets that in their notification preferences on auth.sv, so the switch is refused for them, and a session the organization's own identity provider signed in (`federated`) changes it neither way.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              description: The fields to change; a change naming none, or no body, changes nothing.
              properties:
                display_name:
                  type: string
                  description: One line, no markup, at most 100 characters.
                email_updates:
                  type: boolean
  /hd/desks/{desk_id}/support/attempts:
    post:
      tags:
        - hd
      security: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
        - name: Origin
          in: header
          required: true
          schema:
            type: string
          description: An approved embedding origin for this desk.
        - name: Authorization
          in: header
          required: false
          schema:
            type: string
          description: Bearer KB password/employee grant when required, independent of ticket access.
      responses:
        "200":
          description: Attempt receipt.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    additionalProperties: false
                    properties:
                      recorded:
                        type: boolean
                      attempt_id:
                        type: string
                        pattern: ^\d{13}-[0-9]{1,10}$
                        description: Stable timestamp-sequence identifier scoped to the visitor. Reuse on retries.
                    required:
                      - recorded
                      - attempt_id
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: an interaction field is invalid or unsupported."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "KB_ACCESS_REQUIRED: this published help center requires an access grant."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_WIDGET_ORIGIN_DENIED or KB_IP_RESTRICTED: the website or network is not approved."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT or KB_PUBLICATION_CHANGED: the visitor expired, details changed or publication changed."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait before retrying this optional telemetry."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Record one assistance journey
      description: Best-effort browser telemetry. No issue text, search terms, email, name, IP, referrer or user agent is retained in analytics. It establishes no identity and authorizes no ticket access. Failure must not block reading, closing or submitting support. Start once per issue, keeping the same attempt across search refinements. Available starts require the current publication, its access grant and result count. Unavailable help is separate. Zero results alone is not a terminal miss.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                visitor_id:
                  type: string
                  pattern: ^[a-f0-9]{64}$
                  description: Server-minted expiring browser pseudonym, never customer identity.
                attempt_id:
                  type: string
                  pattern: ^\d{13}-[0-9]{1,10}$
                  description: Stable timestamp-sequence identifier scoped to the visitor. Reuse on retries.
                availability:
                  type: string
                  enum:
                    - available
                    - unavailable
                release_id:
                  type: string
                result_count:
                  type: integer
                  minimum: 0
                  maximum: 10000
              required:
                - visitor_id
                - attempt_id
                - availability
  /hd/desks/{desk_id}/support/attempts/{attempt_id}/events:
    post:
      tags:
        - hd
      security: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
        - name: Origin
          in: header
          required: true
          schema:
            type: string
          description: An approved embedding origin for this desk.
        - name: Authorization
          in: header
          required: false
          schema:
            type: string
          description: Bearer KB password/employee grant when required, independent of ticket access.
        - name: attempt_id
          in: path
          required: true
          schema:
            type: string
            pattern: ^\d{13}-[0-9]{1,10}$
            description: Stable timestamp-sequence identifier scoped to the visitor. Reuse on retries.
      responses:
        "200":
          description: Interaction receipt.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    additionalProperties: false
                    properties:
                      recorded:
                        type: boolean
                      attempt_id:
                        type: string
                        pattern: ^\d{13}-[0-9]{1,10}$
                        description: Stable timestamp-sequence identifier scoped to the visitor. Reuse on retries.
                    required:
                      - recorded
                      - attempt_id
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: an interaction field is invalid or unsupported."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "KB_ACCESS_REQUIRED: this published help center requires an access grant."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_WIDGET_ORIGIN_DENIED or KB_IP_RESTRICTED: the website or network is not approved."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT or KB_PUBLICATION_CHANGED: the visitor expired, details changed or publication changed."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait before retrying this optional telemetry."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Record explicit assistance feedback
      description: Best-effort browser telemetry. No issue text, search terms, email, name, IP, referrer or user agent is retained in analytics. It establishes no identity and authorizes no ticket access. Failure must not block reading, closing or submitting support. Article opens validate the published answer, including FAQ entries. Solved requires a previously opened answer. Contact requested records intent, never a ticket creation. A journey accepts one terminal outcome. Closing or abandoning without feedback remains unknown. For available help contact requires one reason; omit reason when help was unavailable. Browser ticket_created is not accepted.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                visitor_id:
                  type: string
                  pattern: ^[a-f0-9]{64}$
                  description: Server-minted expiring browser pseudonym, never customer identity.
                event_id:
                  type: string
                  pattern: ^\d{13}-[0-9]{1,10}$
                  description: Stable timestamp-sequence identifier scoped to the visitor. Reuse on retries.
                type:
                  type: string
                  enum:
                    - article_opened
                    - solved
                    - contact_requested
                article_id:
                  type: string
                release_id:
                  type: string
                reason:
                  type: string
                  enum:
                    - no_results
                    - none_match
                    - article_not_answered
              required:
                - visitor_id
                - event_id
                - type
  /hd/desks/{desk_id}/support/visitor:
    post:
      tags:
        - hd
      security: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
        - name: Origin
          in: header
          required: true
          schema:
            type: string
          description: An approved embedding origin for this desk.
      responses:
        "200":
          description: Expiring browser pseudonym, stored by digest only.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    additionalProperties: false
                    properties:
                      visitor_id:
                        type: string
                        pattern: ^[a-f0-9]{64}$
                        description: Server-minted expiring browser pseudonym, never customer identity.
                      expires_at:
                        type: integer
                        minimum: 0
                    required:
                      - visitor_id
                      - expires_at
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: an interaction field is invalid or unsupported."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "KB_ACCESS_REQUIRED: this published help center requires an access grant."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_WIDGET_ORIGIN_DENIED or KB_IP_RESTRICTED: the website or network is not approved."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT or KB_PUBLICATION_CHANGED: the visitor expired, details changed or publication changed."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait before retrying this optional telemetry."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Start an anonymous assistance visitor
      description: Best-effort browser telemetry. No issue text, search terms, email, name, IP, referrer or user agent is retained in analytics. It establishes no identity and authorizes no ticket access. Failure must not block reading, closing or submitting support.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties: {}
  /hd/desks/{desk_id}/tickets:
    get:
      tags:
        - hd
      security:
        - HelpDeskCustomerToken: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
          description: The desk, as its lookup answered it.
        - name: X-SV-Client
          in: header
          required: true
          schema:
            type: string
            const: help-desk-portal
          description: Names the portal. A request without it answers 400 CLIENT_HEADER_REQUIRED.
        - name: status
          in: query
          required: false
          schema:
            type: string
            enum:
              - open
              - closed
            default: open
          description: "`open`: requests still open, waiting on the customer or on hold. `closed`: requests resolved or closed."
        - name: number
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
          description: "A request number: answers that one request when it is the customer's, else none."
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: Continuation token from the previous page.
        - name: X-SV-Helpdesk-Access
          in: header
          required: false
          schema:
            type: string
          description: Required by password or employee ticket-portal policies, in addition to any customer bearer token. IP policies check the actual trusted visitor IP on every request.
      responses:
        "200":
          description: A page of the customer's requests.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - items
                      - next_cursor
                    properties:
                      items:
                        type: array
                        items:
                          $ref: "#/components/schemas/HelpDeskCustomerTicket"
                      next_cursor:
                        type:
                          - string
                          - "null"
                        description: Opaque continuation token. Null when the listing is exhausted.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: `status` is neither open nor closed, `number` is no request number, or the cursor is not one this list gave the customer. CLIENT_HEADER_REQUIRED: see above."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "CUSTOMER_AUTH_REQUIRED: no bearer token, or one that is not a customer's of this desk now: unknown, expired, revoked, another desk's, or of the sign-in mode the desk no longer uses."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_ACCESS_REQUIRED or HELP_DESK_IP_DENIED: the current ticket-portal access policy refuses this request. Complete the access layer or connect from an approved network."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: this client address has spent its portal reads for the minute, across every desk, or this customer their reads at the desk for the minute. `Retry-After` carries the seconds until the budget reopens, and `details` carries `limit` and `resets_at`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE: the desk does not take customers right now, or this customer is refused. INTERNAL_ERROR: the identity service did not answer the check of a Secure Identity customer's session, made at most every 15 minutes; the session is kept, and the same request can be sent again. BUDGET_UNAVAILABLE: a budget the request spends could not be counted, so the request was refused rather than let through uncounted; `Retry-After` carries the seconds to wait before trying again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List the customer's requests
      description: "The customer's own requests, a page at a time: the open ones, every one waiting on the customer first and then the rest, each part newest first, so each page continues that order; or the closed ones, newest first. A request whose status changes while the customer pages through a list is listed again, or left out, until the list is read again from its first page. With `number`, the one request of the customer's that number names, whatever its status, or none. A request closed as spam is in neither list and no number names it: it does not exist for its requester until an operator reopens it."
    post:
      tags:
        - hd
      security:
        - HelpDeskCustomerToken: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
          description: The desk, as its lookup answered it.
        - name: X-SV-Client
          in: header
          required: true
          schema:
            type: string
            const: help-desk-portal
          description: Names the portal. A request without it answers 400 CLIENT_HEADER_REQUIRED.
        - name: X-SV-Helpdesk-Access
          in: header
          required: false
          schema:
            type: string
          description: Required by password or employee ticket-portal policies, in addition to any customer bearer token. IP policies check the actual trusted visitor IP on every request.
      responses:
        "201":
          description: The request.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - number
                      - ticket_id
                    properties:
                      number:
                        type: integer
                        minimum: 1
                        description: "The request's number: every route names it by it."
                      ticket_id:
                        type: string
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the body is no JSON object, `ticket_id` is no draft's id, the subject or the description is missing, empty or too long, or a file is not one of the customer's uploads waiting on the draft (or is still being saved). CLIENT_HEADER_REQUIRED: see above."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "CUSTOMER_AUTH_REQUIRED: no bearer token, or one that is not a customer's of this desk now: unknown, expired, revoked, another desk's, or of the sign-in mode the desk no longer uses."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "402":
          description: "QUOTA_EXCEEDED: the organization's storage cannot take the request. No figures are given."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_ACCESS_REQUIRED or HELP_DESK_IP_DENIED: the current ticket-portal access policy refuses this request. Complete the access layer or connect from an approved network."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "DRAFT_EXPIRED: the draft is gone, past its day, or is not the customer's (the same answer for each). A draft sent twice answers the request its first send opened. CONFLICT: the request, or its draft as files were uploaded to it, kept changing while it was saved. Send it again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the customer has sent their requests for the day, this client address has spent its portal reads for the minute across every desk, or this customer their reads at the desk for the minute. `Retry-After` carries the seconds until the budget reopens, and `details` carries `limit` and `resets_at`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE: the desk does not take customers right now, or this customer is refused. INTERNAL_ERROR: the identity service did not answer the check of a Secure Identity customer's session, made at most every 15 minutes; the session is kept, and the same request can be sent again. BUDGET_UNAVAILABLE: a budget the request spends could not be counted, so the request was refused rather than let through uncounted; `Retry-After` carries the seconds to wait before trying again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Send a request
      description: "Send one of the customer's own drafts as a request: its subject, its description in safe markup, and the files uploaded to the draft that it carries. The request is routed by the desk's rules and gets the desk's next number."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - ticket_id
                - subject
                - body
              properties:
                ticket_id:
                  type: string
                  description: The draft the request is sent from.
                assistance_attempt_id:
                  type: string
                  description: Optional assistance attempt attribution; analytics never changes the submission result.
                assistance_visitor_id:
                  type: string
                  pattern: ^[a-f0-9]{64}$
                  description: Optional anonymous widget pseudonym, paired with assistance_attempt_id. Never customer identity.
                source_article_id:
                  type: string
                  minLength: 1
                  maxLength: 256
                  description: Optional article or FAQ ID already read. Core resolves it against this desk's current publication for the operator, independently of optional analytics. Removed or unavailable references are omitted without blocking the ticket; article titles and URLs are never returned to the customer. Takes precedence over assistance-attempt context.
                subject:
                  type: string
                  maxLength: 200
                body:
                  type: string
                  description: "The description, in safe markup: at most 65536 bytes."
                attachments:
                  type: array
                  maxItems: 20
                  items:
                    type: string
                  description: The `attachment_id` of each file uploaded to the draft that the request carries.
  /hd/desks/{desk_id}/tickets/{number}:
    get:
      tags:
        - hd
      security:
        - HelpDeskCustomerToken: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
          description: The desk, as its lookup answered it.
        - name: number
          in: path
          required: true
          schema:
            type: string
          description: The request's number at the desk.
        - name: X-SV-Client
          in: header
          required: true
          schema:
            type: string
            const: help-desk-portal
          description: Names the portal. A request without it answers 400 CLIENT_HEADER_REQUIRED.
        - name: response
          in: query
          schema:
            type: string
          description: Optional public operator reply ID from a feedback email. Validated against this request without recording a vote.
        - name: X-SV-Helpdesk-Access
          in: header
          required: false
          schema:
            type: string
          description: Required by password or employee ticket-portal policies, in addition to any customer bearer token. IP policies check the actual trusted visitor IP on every request.
      responses:
        "200":
          description: The request and its timeline's first page.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - ticket
                      - events
                      - next_cursor
                    properties:
                      ticket:
                        allOf:
                          - $ref: "#/components/schemas/HelpDeskCustomerTicket"
                          - type: object
                            required:
                              - can_resolve
                              - feedback
                      events:
                        type: array
                        items:
                          $ref: "#/components/schemas/HelpDeskCustomerEvent"
                      next_cursor:
                        type:
                          - string
                          - "null"
                        description: Opaque continuation token. Null when the listing is exhausted.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "CLIENT_HEADER_REQUIRED: see above."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "CUSTOMER_AUTH_REQUIRED: no bearer token, or one that is not a customer's of this desk now: unknown, expired, revoked, another desk's, or of the sign-in mode the desk no longer uses."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_ACCESS_REQUIRED or HELP_DESK_IP_DENIED: the current ticket-portal access policy refuses this request. Complete the access layer or connect from an approved network."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such request, draft or file is the customer's: one that does not exist, one of another customer and a request closed as spam (which does not exist for its requester) read the same, byte for byte."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: this client address has spent its portal reads for the minute, across every desk, or this customer their reads at the desk for the minute. `Retry-After` carries the seconds until the budget reopens, and `details` carries `limit` and `resets_at`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE: the desk does not take customers right now, or this customer is refused. INTERNAL_ERROR: the identity service did not answer the check of a Secure Identity customer's session, made at most every 15 minutes; the session is kept, and the same request can be sent again. BUDGET_UNAVAILABLE: a budget the request spends could not be counted, so the request was refused rather than let through uncounted; `Retry-After` carries the seconds to wait before trying again. FEEDBACK_LOOKUP_INCOMPLETE: an explicit response lookup could not finish; ordinary reads instead mark feedback lookup_complete false."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read one of the customer's requests
      description: "The request, as its customer reads it, with the first page of its timeline: public events only, each through the customer field allowlist."
  /hd/desks/{desk_id}/tickets/{number}/attachments/initiate:
    post:
      tags:
        - hd
      security:
        - HelpDeskCustomerToken: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
          description: The desk, as its lookup answered it.
        - name: number
          in: path
          required: true
          schema:
            type: string
          description: The request's number at the desk.
        - name: X-SV-Client
          in: header
          required: true
          schema:
            type: string
            const: help-desk-portal
          description: Names the portal. A request without it answers 400 CLIENT_HEADER_REQUIRED.
        - name: X-SV-Helpdesk-Access
          in: header
          required: false
          schema:
            type: string
          description: Required by password or employee ticket-portal policies, in addition to any customer bearer token. IP policies check the actual trusted visitor IP on every request.
      responses:
        "200":
          description: The upload, begun.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskAttachmentUpload"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "ATTACHMENT_REFUSED: the file's name is missing, too long or one a file cannot be stored under, or it ends in no extension a request accepts. A request accepts images (.jpg, .jpeg, .png, .gif, .webp, .heic, .heif, .bmp, .tif, .tiff, .avif), documents (.pdf, .docx, .xlsx, .pptx, .txt, .csv, .tsv, .log, .json) and recordings (.mp4, .mov, .webm, .m4a, .mp3, .wav), and no other file. `details.reason` names which. VALIDATION_ERROR: `size_bytes` is missing or not a whole number of bytes from 1, or the body is not a JSON object. CLIENT_HEADER_REQUIRED: see above."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "CUSTOMER_AUTH_REQUIRED: no bearer token, or one that is not a customer's of this desk now: unknown, expired, revoked, another desk's, or of the sign-in mode the desk no longer uses."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "402":
          description: "PLAN_REQUIRED or QUOTA_EXCEEDED: the organization cannot take the file right now (its plan, its storage or its bandwidth), or the customer's upload allowance refuses it; `details.reason` is `customer_upload_limit` for files past it, and `customer_uploads_off` at a desk whose allowance is 0, which takes no files from customers. No figures are given."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_ACCESS_REQUIRED or HELP_DESK_IP_DENIED: the current ticket-portal access policy refuses this request. Complete the access layer or connect from an approved network."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such request, draft or file is the customer's: one that does not exist, one of another customer and a request closed as spam (which does not exist for its requester) read the same, byte for byte."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the request kept changing while the upload was recorded, or its merges are too many to follow."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "413":
          description: "PAYLOAD_TOO_LARGE: the file is larger than the most a customer's file may hold (`details.max_bytes`)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the customer has begun too many uploads on the request this hour, holds the most files waiting to be sent on it, or has sent their files or their bytes for the day; the desk has taken its customers' bytes for the day; or this client address has spent its portal reads for the minute, across every desk, or this customer their reads at the desk for the minute. `Retry-After` carries the seconds until the budget reopens, and `details` carries `limit` and `resets_at`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE: the desk does not take customers right now, or this customer is refused. INTERNAL_ERROR: the identity service did not answer the check of a Secure Identity customer's session, made at most every 15 minutes; the session is kept, and the same request can be sent again. BUDGET_UNAVAILABLE: a budget the request spends could not be counted, so the request was refused rather than let through uncounted; `Retry-After` carries the seconds to wait before trying again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Begin a file's upload into a reply
      description: Begin the upload of one file into the customer's own request. The file then goes to `forge_url` by the resumable transfer every SparkVault upload runs, and joins the request with the reply that names its `attachment_id`. For a request merged into another, the file goes to the request its merges lead to, where a reply on the merged request lands.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - size_bytes
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 255
                  description: "The file's name, which alone decides whether a request takes the file and what type it is stored under. A request takes images (.jpg, .jpeg, .png, .gif, .webp, .heic, .heif, .bmp, .tif, .tiff, .avif), documents (.pdf, .docx, .xlsx, .pptx, .txt, .csv, .tsv, .log, .json) and recordings (.mp4, .mov, .webm, .m4a, .mp3, .wav), and no other file: a name must end in one of those extensions, in any case, and be one a file can be stored under (no path separator, control or direction character, none of `:*?\"<>|`, not only dots or spaces). The file is stored, served and downloaded as the type its extension registers, whatever type the browser reports for it."
                size_bytes:
                  type: integer
                  minimum: 1
                  maximum: 26214400
                  description: "The file's size in bytes: the most the upload stores."
  /hd/desks/{desk_id}/tickets/{number}/attachments/{attachment_id}:
    delete:
      tags:
        - hd
      security:
        - HelpDeskCustomerToken: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
          description: The desk, as its lookup answered it.
        - name: number
          in: path
          required: true
          schema:
            type: string
          description: The request's number at the desk.
        - name: attachment_id
          in: path
          required: true
          schema:
            type: string
          description: The upload, as its start answered it.
        - name: X-SV-Client
          in: header
          required: true
          schema:
            type: string
            const: help-desk-portal
          description: Names the portal. A request without it answers 400 CLIENT_HEADER_REQUIRED.
        - name: X-SV-Helpdesk-Access
          in: header
          required: false
          schema:
            type: string
          description: Required by password or employee ticket-portal policies, in addition to any customer bearer token. IP policies check the actual trusted visitor IP on every request.
      responses:
        "204":
          description: No upload of the customer's under this id waits to be sent on the request.
        "401":
          description: "CUSTOMER_AUTH_REQUIRED: no bearer token, or one that is not a customer's of this desk now: unknown, expired, revoked, another desk's, or of the sign-in mode the desk no longer uses."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_ACCESS_REQUIRED or HELP_DESK_IP_DENIED: the current ticket-portal access policy refuses this request. Complete the access layer or connect from an approved network."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such request, draft or file is the customer's: one that does not exist, one of another customer and a request closed as spam (which does not exist for its requester) read the same, byte for byte."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the request kept changing while this was saved. Send it again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE: the desk does not take customers right now, or this customer is refused. INTERNAL_ERROR: the identity service did not answer the check of a Secure Identity customer's session, made at most every 15 minutes; the session is kept, and the same request can be sent again. BUDGET_UNAVAILABLE: a budget the request spends could not be counted, so the request was refused rather than let through uncounted; `Retry-After` carries the seconds to wait before trying again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Cancel a file's upload into a reply
      description: "Cancel one of the customer's own uploads into a reply on their request, a file they removed before sending the reply: the upload is deleted, and what it held of the customer's upload allowance is given back at once. For a request merged into another, the upload is looked for on the request its merges lead to as well. An id that names none of the customer's uploads waiting to be sent is answered the same, so a cancel sent again changes nothing."
  /hd/desks/{desk_id}/tickets/{number}/events:
    get:
      tags:
        - hd
      security:
        - HelpDeskCustomerToken: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
          description: The desk, as its lookup answered it.
        - name: number
          in: path
          required: true
          schema:
            type: string
          description: The request's number at the desk.
        - name: X-SV-Client
          in: header
          required: true
          schema:
            type: string
            const: help-desk-portal
          description: Names the portal. A request without it answers 400 CLIENT_HEADER_REQUIRED.
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: Continuation token from the previous page.
        - name: X-SV-Helpdesk-Access
          in: header
          required: false
          schema:
            type: string
          description: Required by password or employee ticket-portal policies, in addition to any customer bearer token. IP policies check the actual trusted visitor IP on every request.
      responses:
        "200":
          description: A page of the timeline.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskCustomerTimelinePage"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the cursor is not one this request's timeline gave. CLIENT_HEADER_REQUIRED: see above."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "CUSTOMER_AUTH_REQUIRED: no bearer token, or one that is not a customer's of this desk now: unknown, expired, revoked, another desk's, or of the sign-in mode the desk no longer uses."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_ACCESS_REQUIRED or HELP_DESK_IP_DENIED: the current ticket-portal access policy refuses this request. Complete the access layer or connect from an approved network."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such request, draft or file is the customer's: one that does not exist, one of another customer and a request closed as spam (which does not exist for its requester) read the same, byte for byte."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: this client address has spent its portal reads for the minute, across every desk, or this customer their reads at the desk for the minute. `Retry-After` carries the seconds until the budget reopens, and `details` carries `limit` and `resets_at`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE: the desk does not take customers right now, or this customer is refused. INTERNAL_ERROR: the identity service did not answer the check of a Secure Identity customer's session, made at most every 15 minutes; the session is kept, and the same request can be sent again. BUDGET_UNAVAILABLE: a budget the request spends could not be counted, so the request was refused rather than let through uncounted; `Retry-After` carries the seconds to wait before trying again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read more of a request's timeline
      description: The next page of a request's timeline, from the cursor the previous page answered.
  /hd/desks/{desk_id}/tickets/{number}/feedback:
    post:
      tags:
        - hd
      security:
        - HelpDeskCustomerToken: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
          description: The desk, as its lookup answered it.
        - name: number
          in: path
          required: true
          schema:
            type: string
          description: The request's number at the desk.
        - name: X-SV-Client
          in: header
          required: true
          schema:
            type: string
            const: help-desk-portal
          description: Names the portal. A request without it answers 400 CLIENT_HEADER_REQUIRED.
        - name: X-SV-Helpdesk-Access
          in: header
          required: false
          schema:
            type: string
          description: Required by password or employee ticket-portal policies, in addition to any customer bearer token. IP policies check the actual trusted visitor IP on every request.
      responses:
        "200":
          description: The saved feedback and its optional follow-up link.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - feedback
                      - destination_url
                    properties:
                      feedback:
                        $ref: "#/components/schemas/HelpDeskCustomerFeedback"
                      destination_url:
                        type:
                          - string
                          - "null"
                        format: uri
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: choose a supported rating and reply ID. CLIENT_HEADER_REQUIRED: see above."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "CUSTOMER_AUTH_REQUIRED: no bearer token, or one that is not a customer's of this desk now: unknown, expired, revoked, another desk's, or of the sign-in mode the desk no longer uses."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_ACCESS_REQUIRED or HELP_DESK_IP_DENIED: the current ticket-portal access policy refuses this request. Complete the access layer or connect from an approved network."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such request, draft or file is the customer's: one that does not exist, one of another customer and a request closed as spam (which does not exist for its requester) read the same, byte for byte."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the request is not eligible for feedback or the target differs from its saved rating."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: this client address has spent its portal reads for the minute, across every desk, or this customer their reads at the desk for the minute. `Retry-After` carries the seconds until the budget reopens, and `details` carries `limit` and `resets_at`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE: the desk does not take customers right now, or this customer is refused. INTERNAL_ERROR: the identity service did not answer the check of a Secure Identity customer's session, made at most every 15 minutes; the session is kept, and the same request can be sent again. BUDGET_UNAVAILABLE: a budget the request spends could not be counted, so the request was refused rather than let through uncounted; `Retry-After` carries the seconds to wait before trying again. FEEDBACK_LOOKUP_INCOMPLETE: a bounded reply lookup could not finish; no vote was recorded."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Rate the support received on your request
      description: "Authenticated customers explicitly submit Good or Bad feedback for their own request. The first vote is credited to a stored public operator reply, never a client-provided operator. One current vote is kept: retries do not add ratings and edits replace the original reporting sample. Merged-away or spam requests and internal/unpublished replies are ineligible. No GET or email link records a vote."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - rating
              properties:
                rating:
                  type: string
                  enum:
                    - positive
                    - negative
                reply_event_id:
                  type: string
                  description: Optional public operator reply ID. Existing feedback cannot be moved to a different reply.
  /hd/desks/{desk_id}/tickets/{number}/mute:
    put:
      tags:
        - hd
      security:
        - HelpDeskCustomerToken: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
          description: The desk, as its lookup answered it.
        - name: number
          in: path
          required: true
          schema:
            type: string
          description: The request's number at the desk.
        - name: X-SV-Client
          in: header
          required: true
          schema:
            type: string
            const: help-desk-portal
          description: Names the portal. A request without it answers 400 CLIENT_HEADER_REQUIRED.
        - name: X-SV-Helpdesk-Access
          in: header
          required: false
          schema:
            type: string
          description: Required by password or employee ticket-portal policies, in addition to any customer bearer token. IP policies check the actual trusted visitor IP on every request.
      responses:
        "204":
          description: The request's update emails are as asked.
        "400":
          description: "VALIDATION_ERROR: `muted` is not true or false, the body is not a JSON object, or the session is a federated sign-in's. CLIENT_HEADER_REQUIRED: see above."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "CUSTOMER_AUTH_REQUIRED: no bearer token, or one that is not a customer's of this desk now: unknown, expired, revoked, another desk's, or of the sign-in mode the desk no longer uses."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_ACCESS_REQUIRED or HELP_DESK_IP_DENIED: the current ticket-portal access policy refuses this request. Complete the access layer or connect from an approved network."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such request, draft or file is the customer's: one that does not exist, one of another customer and a request closed as spam (which does not exist for its requester) read the same, byte for byte."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the request kept changing while this was saved. Send it again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: this client address has spent its portal reads for the minute, across every desk, or this customer their reads at the desk for the minute. `Retry-After` carries the seconds until the budget reopens, and `details` carries `limit` and `resets_at`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE: the desk does not take customers right now, or this customer is refused. INTERNAL_ERROR: the identity service did not answer the check of a Secure Identity customer's session, made at most every 15 minutes; the session is kept, and the same request can be sent again. BUDGET_UNAVAILABLE: a budget the request spends could not be counted, so the request was refused rather than let through uncounted; `Retry-After` carries the seconds to wait before trying again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Turn a request's update emails off or on
      description: "Set whether the desk emails the customer updates on one of their requests; setting what is set changes nothing. A session the organization's own identity provider signed in (`federated`) is refused: the address's update email choices are made by signing in with the address itself."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - muted
              properties:
                muted:
                  type: boolean
                  description: True turns the request's update emails off; false turns them on.
  /hd/desks/{desk_id}/tickets/{number}/replies:
    post:
      tags:
        - hd
      security:
        - HelpDeskCustomerToken: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
          description: The desk, as its lookup answered it.
        - name: number
          in: path
          required: true
          schema:
            type: string
          description: The request's number at the desk.
        - name: X-SV-Client
          in: header
          required: true
          schema:
            type: string
            const: help-desk-portal
          description: Names the portal. A request without it answers 400 CLIENT_HEADER_REQUIRED.
        - name: X-SV-Helpdesk-Access
          in: header
          required: false
          schema:
            type: string
          description: Required by password or employee ticket-portal policies, in addition to any customer bearer token. IP policies check the actual trusted visitor IP on every request.
      responses:
        "201":
          description: The reply.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - event_id
                    properties:
                      event_id:
                        type: string
                        description: The reply on the request's timeline.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the body is no JSON object, the reply is missing, empty or too long, a file is not one uploaded to the request, or `event_id` is no message id. CLIENT_HEADER_REQUIRED: see above."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "CUSTOMER_AUTH_REQUIRED: no bearer token, or one that is not a customer's of this desk now: unknown, expired, revoked, another desk's, or of the sign-in mode the desk no longer uses."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "402":
          description: "QUOTA_EXCEEDED: the organization's storage cannot take the reply. No figures are given."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_ACCESS_REQUIRED or HELP_DESK_IP_DENIED: the current ticket-portal access policy refuses this request. Complete the access layer or connect from an approved network."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such request, draft or file is the customer's: one that does not exist, one of another customer and a request closed as spam (which does not exist for its requester) read the same, byte for byte."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the request was merged, or kept changing, while the reply was saved. Send it again. Or `event_id` names another record of the request (`details.field`): name the reply anew."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the request, or the customer, has taken its replies for the hour, this client address has spent its portal reads for the minute across every desk, or this customer their reads at the desk for the minute. `Retry-After` carries the seconds until the budget reopens, and `details` carries `limit` and `resets_at`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE: the desk does not take customers right now, or this customer is refused. INTERNAL_ERROR: the identity service did not answer the check of a Secure Identity customer's session, made at most every 15 minutes; the session is kept, and the same request can be sent again. BUDGET_UNAVAILABLE: a budget the request spends could not be counted, so the request was refused rather than let through uncounted; `Retry-After` carries the seconds to wait before trying again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Reply on a request
      description: "The customer's reply on their own request, with the files uploaded to the request that it carries. A reply reopens a closed request; a reply on a request merged into another is added to that other request. A reply sent again under the `event_id` an earlier send named it by (after that send's answer was lost, or a refusal) answers `201` with the reply that send posted, before any budget is spent, and posts nothing again: the reply is looked for among the newest events of the request and of each request its merges lead to."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - body
              properties:
                event_id:
                  type: string
                  pattern: ^hdev_[A-Za-z0-9_-]+$
                  maxLength: 128
                  description: The id the reply is posted under, named once per composed reply (the SDK's `newReplyId()`) and sent with every send of it while its words and files stand unchanged, whatever an earlier send answered. Without one the desk names the reply, and a reply sent again posts again.
                body:
                  type: string
                  description: "The reply, in safe markup: at most 65536 bytes."
                attachments:
                  type: array
                  maxItems: 20
                  items:
                    type: string
                  description: The `attachment_id` of each file uploaded to the request that the reply carries.
  /hd/desks/{desk_id}/tickets/{number}/resolve:
    post:
      tags:
        - hd
      security:
        - HelpDeskCustomerToken: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
          description: The desk, as its lookup answered it.
        - name: number
          in: path
          required: true
          schema:
            type: string
          description: The request's number at the desk.
        - name: X-SV-Client
          in: header
          required: true
          schema:
            type: string
            const: help-desk-portal
          description: Names the portal. A request without it answers 400 CLIENT_HEADER_REQUIRED.
        - name: X-SV-Helpdesk-Access
          in: header
          required: false
          schema:
            type: string
          description: Required by password or employee ticket-portal policies, in addition to any customer bearer token. IP policies check the actual trusted visitor IP on every request.
      responses:
        "204":
          description: The request is resolved.
        "400":
          description: "CLIENT_HEADER_REQUIRED: see above."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "CUSTOMER_AUTH_REQUIRED: no bearer token, or one that is not a customer's of this desk now: unknown, expired, revoked, another desk's, or of the sign-in mode the desk no longer uses."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the desk's operators alone resolve its requests (`details.reason` `customer_resolve_off`)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such request, draft or file is the customer's: one that does not exist, one of another customer and a request closed as spam (which does not exist for its requester) read the same, byte for byte."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the request kept changing while this was saved. Send it again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: this client address has spent its portal reads for the minute, across every desk, or this customer their reads at the desk for the minute. `Retry-After` carries the seconds until the budget reopens, and `details` carries `limit` and `resets_at`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "HELP_DESK_UNAVAILABLE: the desk does not take customers right now, or this customer is refused. INTERNAL_ERROR: the identity service did not answer the check of a Secure Identity customer's session, made at most every 15 minutes; the session is kept, and the same request can be sent again. BUDGET_UNAVAILABLE: a budget the request spends could not be counted, so the request was refused rather than let through uncounted; `Retry-After` carries the seconds to wait before trying again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Mark a request resolved
      description: The customer marks their own request resolved, on a desk that lets its customers do so. A request already closed stays as it is.
  /hd/desks/{desk_id}/visitor:
    post:
      tags:
        - hd
      security: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
        - name: X-SV-Helpdesk-Access
          in: header
          required: false
          schema:
            type: string
          description: Required by password or employee ticket-portal policies, in addition to any customer bearer token. IP policies check the actual trusted visitor IP on every request.
      responses:
        "200":
          description: The anonymous identifier.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      visitor_id:
                        oneOf:
                          - type: string
                            pattern: ^[a-f0-9]{64}$
                          - type: "null"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the message names the offending field."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "HELP_DESK_ACCESS_REQUIRED or HELP_DESK_IP_DENIED: the current ticket-portal access policy refuses this request. Complete the access layer or connect from an approved network."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Create a first-party help-desk visitor identifier
      description: The help Worker obtains a new 64-character hexadecimal identifier from Core's Entropy service. Anonymous, rate limited, no authentication or browser storage is created by this API. Returns null if persistent identifiers are disabled.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties: {}
  /hd/kb/access/logout:
    post:
      tags:
        - hd
      security: []
      responses:
        "204":
          description: The presented KB session has ended, or is already absent.
        "400":
          description: "VALIDATION_ERROR: the request contains an invalid or unsupported value."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait for the Retry-After interval."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: End a knowledge-base Identity session
      description: The opaque KB credential is sufficient to revoke its isolated session, even after publication or employee access changes. Returns no account information; other ticket and Identity sessions remain active.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                token:
                  type: string
                  maxLength: 256
                  writeOnly: true
              required:
                - token
              additionalProperties: false
  /hd/kb/access/verify:
    post:
      tags:
        - hd
      security: []
      responses:
        "200":
          description: The saved result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      authorized:
                        type: boolean
                        const: true
                      expires_at:
                        type: integer
                        minimum: 0
                      session_token:
                        type: string
                        description: Returned once after the proof exchange. The edge keeps it in a host-only Secure HttpOnly cookie.
                    required:
                      - authorized
                      - expires_at
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the request contains an invalid or unsupported value."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "KB_ACCESS_DENIED: this sign-in has no active employee access under the published policy."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait for the Retry-After interval."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: Identity or knowledge-base access is unavailable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Verify employee access to a published knowledge base
      description: Used by the help-center edge. Exchanges the help desk's own sign-in's five-minute proof (hdwip_, the identity_grant a sign-in's redeem answers) for an eight-hour opaque knowledge-base session, then verifies that session on each artifact request. Requires the company named by the published policy and a proof whose sign-in that company's gate started, active company membership, continued employee email ownership and a live session at SparkVault's Identity. Sessions are bound to the desk, company and release. Does not create a customer ticket session.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                desk_id:
                  type: string
                company_id:
                  type: string
                token:
                  type: string
                  maxLength: 256
                  writeOnly: true
                  description: The hdwip_ sign-in proof, or the opaque hdkbt_ knowledge-base session on subsequent checks.
                origin:
                  type: string
                  format: uri
                  description: "With an hdwip_ proof only, and then required: the origin the proof was minted for (the help center's). Never sent with an hdkbt_ session."
              required:
                - desk_id
                - company_id
                - token
              additionalProperties: false
  /hd/unsubscribe:
    get:
      tags:
        - hd
      security: []
      responses:
        "200":
          description: The confirmation page.
          content:
            text/html:
              schema:
                type: string
        "429":
          description: This client address has spent its reads for the minute; `Retry-After` carries the seconds until the budget reopens.
          content:
            text/html:
              schema:
                type: string
        "503":
          description: The page could not be built just now.
          content:
            text/html:
              schema:
                type: string
      summary: Ask to mute a request's update emails
      description: "The page an update email's mute link opens: it names the request and its organization and asks, and changes nothing, since mail security scanners fetch every link in a message. Its button posts the link's `d` and `t` to POST /hd/unsubscribe. A link that names no request, or one of a desk that does not take customers now, opens a page that names none. Needs no credential; each client address spends a budget of reads a minute."
      parameters:
        - name: d
          in: query
          required: true
          schema:
            type: string
          description: The desk the email came from.
        - name: t
          in: query
          required: true
          schema:
            type: string
          description: The request's mute token for its requester.
    post:
      tags:
        - hd
      security: []
      responses:
        "200":
          description: The page saying that updates are muted, if the request exists.
          content:
            text/html:
              schema:
                type: string
        "429":
          description: This client address has spent its requests for the minute; `Retry-After` carries the seconds until the budget reopens.
          content:
            text/html:
              schema:
                type: string
        "503":
          description: The mute could not be recorded just now; nothing changed.
          content:
            text/html:
              schema:
                type: string
      summary: Mute a request's update emails
      description: "Mutes the request a mute link names, for its requester: a mail provider's RFC 8058 one-click POST to the List-Unsubscribe URL (`d` and `t` in its query, the body `List-Unsubscribe=One-Click`, form-encoded or multipart), or the confirmation page's form (`d` and `t` in a form-encoded body). The mute token is the only authority: idempotent, mute-only, and the same page answers whether or not the link names a request. Needs no credential; each client address spends a budget of requests a minute."
      parameters:
        - name: d
          in: query
          required: false
          schema:
            type: string
          description: The desk the email came from (or `d` in the form body).
        - name: t
          in: query
          required: false
          schema:
            type: string
          description: The request's mute token for its requester (or `t` in the form body).
  /health:
    get:
      tags:
        - health
      security: []
      responses:
        default:
          description: Response
  /health/detailed:
    get:
      tags:
        - health
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        default:
          description: Response
  /me/notifications:
    get:
      tags:
        - me
      security:
        - BearerAuth: []
      responses:
        "200":
          description: A page of notifications.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/NotifyFeedPage"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the message names the offending field; a cursor that does not decode is one. INVALID_CURSOR: the cursor decoded but is not a position in this list: a hand-made cursor, or one another list issued. Cursors are never portable between lists; start the list again without one."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is not a signed-in member's own session; an API key or an identity-only session holds no personal inbox."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List your notifications
      description: "The signed-in person's notifications, newest first, as one feed: the ones SparkVault itself delivered to them in_app and the ones their own organization's Notify delivered to them in_app. It is the feed the console's bell and the mobile app read. A notification sent to them on other channels alone is never in it. The feed is the session's own: a recipient or account the request names is never read. Each row says who it is from (`from`), SparkVault or their organization, since its title alone cannot. Filtering happens after the page is read, so a short page with a live cursor means keep paging. A notification past its send's history horizon is never listed."
      parameters:
        - name: state
          in: query
          required: false
          schema:
            type: string
            enum:
              - all
              - unseen
              - unread
              - archived
            default: all
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 50
          description: "A page-size hint: a value above 100 reads as 100, and a missing, zero, negative or non-numeric one as 50."
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: Continuation token from the previous page.
  /me/notifications/devices:
    post:
      tags:
        - me
      security:
        - BearerAuth: []
      responses:
        default:
          description: Response
    delete:
      tags:
        - me
      security:
        - BearerAuth: []
      responses:
        default:
          description: Response
  /me/notifications/devices/{token_hash}:
    delete:
      tags:
        - me
      security:
        - BearerAuth: []
      parameters:
        - name: token_hash
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /me/notifications/state:
    post:
      tags:
        - me
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The page was marked.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/NotifyInboxPageMarked"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the message names the offending field; a cursor that does not decode is one. INVALID_CURSOR: the cursor decoded but is not a position in this list: a hand-made cursor, or one another list issued. Cursors are never portable between lists; start the list again without one."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is not a signed-in member's own session; an API key or an identity-only session holds no personal inbox."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Mark all your notifications
      description: Mark a page of the signed-in person's notifications, from SparkVault and from their own organization's Notify, seen or read. Page size is fixed server-side; keep calling with the returned cursor until it is null. Archiving in bulk is not offered.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - state
              properties:
                state:
                  type: string
                  enum:
                    - seen
                    - read
                cursor:
                  type: string
                  description: Continuation token from the previous call.
  /me/notifications/unread-count:
    get:
      tags:
        - me
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The unseen count.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - unread_count
                      - capped
                    properties:
                      unread_count:
                        type: integer
                        minimum: 0
                      capped:
                        type: boolean
                        description: 'True when the count is a floor, not a total: show it as "N+".'
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is not a signed-in member's own session; an API key or an identity-only session holds no personal inbox."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Count your unseen notifications
      description: The badge count of the signed-in person's notifications from SparkVault and from their own organization's Notify not yet seen, read from the unseen index, never a scan.
  /me/notifications/web-push:
    post:
      tags:
        - me
      security:
        - BearerAuth: []
      responses:
        default:
          description: Response
  /me/notifications/web-push/key:
    get:
      tags:
        - me
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        default:
          description: Response
  /me/notifications/web-push/unsubscribe:
    post:
      tags:
        - me
      security:
        - BearerAuth: []
      responses:
        default:
          description: Response
  /me/notifications/{notificationId}/state:
    post:
      tags:
        - me
      security:
        - BearerAuth: []
      parameters:
        - name: notificationId
          in: path
          required: true
          schema:
            type: string
          description: The notification to mark.
      responses:
        "200":
          description: The notification was marked.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/NotifyInboxMarked"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the message names the offending field."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is not a signed-in member's own session; an API key or an identity-only session holds no personal inbox."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such notification in the signed-in person's feed: none by that id, one past its send's history horizon, or one the feed never lists."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Mark one of your notifications
      description: Set one of the signed-in person's notifications, from SparkVault or from their own organization's Notify, seen, read or archived; marking it again changes nothing. `created_at` is the row's own, from the feed.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - created_at
                - state
              properties:
                created_at:
                  type: integer
                  description: Unix seconds, from the feed row.
                state:
                  type: string
                  enum:
                    - seen
                    - read
                    - archived
  /products/help-desk/activate:
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The settings of the active desk.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskSettings"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: `vault_id` is no vault id, or `vmk` is missing or malformed."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is not a company administrator (a Manager of the desk included). HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access. NOT_FOUND: the vault is not one of the organization's own live vaults."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "HANDLE_REQUIRED: the organization holds no handle yet. HELP_DESK_VAULT_IN_USE: the company's desks keep their content in another vault that still exists (`details.vault_id`); activate the desk with that one. HELP_DESK_VAULT_DELETING: the company's Help Desk vault (`details.vault_id`) is being deleted, with every desk's requests and articles stored under it; activate on another vault once its deletion has finished. CONFLICT: the desk changed while the activation ran; try again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "412":
          description: "PRECONDITION_FAILED: the key does not open this vault."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "EMAIL_SETUP_BUSY: another request is setting up the organization's email (`Retry-After` carries 5 seconds), or email setup is busy right now; repeat the request in a moment. INTERNAL_ERROR: this deployment cannot send the help desk's email."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Activate the help desk
      description: "Turn the desk on in one of the organization's own vaults, presenting that vault's key. Presenting it is the consent: the help desk can then open every file in that vault, the ones already there included, on the organization's behalf, until it is deactivated. The first activation creates the settings, asking customers to sign in with the email sign-in. Activating again finishes an activation cut short, reactivates a deactivated desk, and moves the company's binding to another vault when the vault its desks share is gone, or, short of that vault's deletion running, when its one desk holds no requests or knowledge-base content yet; otherwise every desk activates on that vault. A company administrator, from their own session (the desk's Manager deactivates it but does not activate it); the organization must hold the help desk and a handle, which names the desk's address."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/HelpDeskActivation"
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/analytics:
    get:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The report.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskAnalyticsReport"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: a day is missing or not a calendar day, `from` is after `to`, the range passes 366 days, or `queue_id` or `operator_id` is malformed."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is not a Manager of the desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read the help desk analytics
      description: "One range of account-local days, at most 366 of them, read from the desk's daily counts: tickets created, resolved and reopened, first response and resolution times (median, 90th percentile and mean, by rank within their buckets), the backlog each day, the tickets created by weekday and hour, and each queue's tickets, each figure beside the same for the period of equal length just before. Spam and duplicates are left out. With `queue_id`, the figures are that queue's. Each operator's work is broken out beside them. A Manager of the desk, from their own session: company administration alone does not grant it."
      parameters:
        - name: from
          in: query
          required: true
          schema:
            type: string
          description: The first day, YYYY-MM-DD, in the organization's time zone.
        - name: to
          in: query
          required: true
          schema:
            type: string
          description: The last day, YYYY-MM-DD; today in that zone may be ahead of UTC.
        - name: queue_id
          in: query
          required: false
          schema:
            type: string
          description: One queue's figures instead of the desk's.
        - name: operator_id
          in: query
          required: false
          schema:
            type: string
          description: One operator's row alone in the operator breakdown.
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/analytics/export.csv:
    get:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The report, as an attachment.
          content:
            text/csv:
              schema:
                type: string
        "400":
          description: "VALIDATION_ERROR: a day is missing or not a calendar day, `from` is after `to`, the range passes 366 days, or `queue_id` or `operator_id` is malformed."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is not a Manager of the desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Download the help desk analytics as CSV
      description: "The same report as GET /products/help-desk/analytics, as one RFC 4180 table `section,subject,metric,value`, one record per figure, the operator breakdown included. A cell a spreadsheet would run as a formula is written as text. A Manager of the desk, from their own session: company administration alone does not grant it."
      parameters:
        - name: from
          in: query
          required: true
          schema:
            type: string
          description: The first day, YYYY-MM-DD, in the organization's time zone.
        - name: to
          in: query
          required: true
          schema:
            type: string
          description: The last day, YYYY-MM-DD.
        - name: queue_id
          in: query
          required: false
          schema:
            type: string
          description: One queue's figures instead of the desk's.
        - name: operator_id
          in: query
          required: false
          schema:
            type: string
          description: One operator's row alone in the operator breakdown.
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/attachments/{attachment_id}:
    delete:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: attachment_id
          in: path
          required: true
          schema:
            type: string
          description: The attachment.
        - name: ticket_id
          in: query
          required: true
          schema:
            type: string
          description: The ticket that carries it.
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: What the deletion did.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskTicketWrite"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is not a Manager of the desk. LICENSE_REQUIRED: the caller does not hold a Full License. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access. NOT_FOUND: the ticket carries no such attached file."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "LEGAL_HOLD: the ticket is under legal hold."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Delete an attachment
      description: "Delete an attached file: its ingot goes and the timeline records it. Refused while the ticket is under legal hold. A Manager of the desk holding a Full License, from their own session; the organization must hold the help desk."
  /products/help-desk/attachments/{attachment_id}/download:
    get:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: attachment_id
          in: path
          required: true
          schema:
            type: string
          description: The attachment.
        - name: ticket_id
          in: query
          required: true
          schema:
            type: string
          description: The ticket that carries it.
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: The link.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskDownloadLink"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "402":
          description: "PLAN_REQUIRED or QUOTA_EXCEEDED: the organization cannot pay for the download."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is a company administrator who holds no role on the desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access. NOT_FOUND: the ticket carries no such attached file."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Download an attachment
      description: A single-use link that downloads an attached file; the organization's bandwidth pays for it. A role holder of the desk, from their own session; a held reply's file is its author's and the desk's Managers' alone.
  /products/help-desk/chat:
    get:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: Chat configuration and provider availability.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - version
                      - intake
                      - routes
                      - providers
                    properties:
                      version:
                        type:
                          - integer
                          - "null"
                      intake:
                        type: object
                        additionalProperties: true
                      routes:
                        type: array
                        items:
                          type: object
                          properties:
                            provider:
                              type: string
                            queue_id:
                              type:
                                - string
                                - "null"
                              description: The desk's queue whose requests it posts; null for every request.
                            channel_id:
                              type: string
                            channel_name:
                              type: string
                      providers:
                        type: array
                        items:
                          type: object
                          properties:
                            provider:
                              type: string
                            display_name:
                              type: string
                            installed:
                              type: boolean
                            can_create_tickets:
                              type: boolean
                            intake_enabled:
                              type: boolean
                            default_queue_id:
                              type:
                                - string
                                - "null"
                            setup_reason:
                              type:
                                - string
                                - "null"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is not a company administrator (a Manager, Agent or Trainee of the desk included)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read optional chat intake and queue notification settings
      description: "A company administrator, from their own session: the desk's chat intake and notifications join it to the company's own chat workspace, so they are never a desk role's. Returns configuration version, provider readiness, intake preferences and queue notification routes; never provider credentials. Slack is the first supported adapter. Queue posts contain only neutral metadata and a link whose ticket access is checked separately."
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
    put:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The saved configuration and current provider availability.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the message names the offending field."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is not a company administrator (a Manager, Agent or Trainee of the desk included). HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: another administrator changed chat settings; reload before saving. CONFLICT with `details.reason` `queues_changed`: a queue of the desk was created, renamed or deleted while the save was made; read the queues again and save again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Configure employee chat intake and queue channel notifications
      description: A company administrator, from their own session; requires Helpdesk. Saves the complete configuration against its loaded version. Intake is disabled by default. Active full workspace members use their current provider email; employee-only desks also check selected-company membership. Web password and IP policies continue to govern portal access. Hosted Slack manifest registration and workspace reconnection are separate setup steps.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - version
                - intake
                - routes
              properties:
                version:
                  type:
                    - integer
                    - "null"
                intake:
                  type: object
                  additionalProperties:
                    type: object
                    additionalProperties: false
                    required:
                      - enabled
                      - default_queue_id
                    properties:
                      enabled:
                        type: boolean
                      default_queue_id:
                        type:
                          - string
                          - "null"
                        description: The desk's queue a chat request lands in; null for none.
                routes:
                  type: array
                  maxItems: 100
                  items:
                    type: object
                    additionalProperties: false
                    required:
                      - provider
                      - queue_id
                      - channel_id
                    properties:
                      provider:
                        type: string
                      queue_id:
                        type:
                          - string
                          - "null"
                        description: One of the desk's queues; null posts every request.
                      channel_id:
                        type: string
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/deactivate:
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The settings as they stand; null for a desk never activated.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    oneOf:
                      - $ref: "#/components/schemas/HelpDeskSettings"
                      - type: "null"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the settings changed while the deactivation ran; try again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "EMAIL_SETUP_BUSY: email setup is busy right now; try again in a moment."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Deactivate the help desk
      description: "Turn the desk off: it stops taking customers at once, its access to its vault is withdrawn, and its email setup is released. Its settings and requests stay, unreadable by anyone until the desk is activated again with the vault's key. Deactivating again finishes a deactivation cut short. Open to an organization whose subscription lapsed. The desk's configurer (a company administrator, or its Manager), from their own session."
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/desks:
    get:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: Desk directory and company capacity.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskDirectory"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: correct the named field."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: an interactive company member session is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller lacks the authority the operation names; or the credential is an API key or an impersonated session."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: no desk the caller sees has this ID in the company."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List current and archived desks
      description: Interactive company-member session only; not a server API key. A company administrator configures every desk without gaining ticket-content access; every role holder of a desk works its whole ticket pool. Any active company member. A company administrator sees every current desk and the archived directory; anyone else sees the current desks they hold a role on with Help Desk access. Each desk carries the caller's role on it and whether they manage it. The count and capacity support billing review and restoration.
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "201":
          description: Saved inactive desk, including an idempotent creation replay.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskDescriptor"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: correct the named field."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: an interactive company member session is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller lacks the authority the operation names; or the credential is an API key or an impersonated session. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: no desk the caller sees has this ID in the company."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT, SEAT_CHANGE_IN_PROGRESS, HELP_DESK_CAPACITY_REACHED, HELP_DESK_CREATE_REQUEST_CHANGED or HELP_DESK_MAILBOX_TAKEN: refresh current state and follow the refusal; do not repeat a purchase blindly."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Create one inactive desk
      description: "Interactive company-member session only; not a server API key. A company administrator configures every desk without gaining ticket-content access; every role holder of a desk works its whole ticket pool. Company administrator only (403 otherwise). Requires already purchased capacity. The desk starts with no role holder: its configurer chooses who works it afterwards (PUT /products/help-desk/operators/{user_id}/role). Audience is immutable. Supply one stable request_id before sending; reuse it with identical details after an uncertain response. Its knowledge base starts disabled: publish and enable it afterwards (POST /products/help-desk/knowledge-base/publish). Activation and vault consent are separate; creation never changes billing."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 80
                mailbox:
                  type: string
                  minLength: 1
                  maxLength: 31
                  description: Available lowercase contact name on the company help.sv mail host. Reserved mail operations names and names claimed by another desk or queue are refused.
                audience:
                  type: string
                  enum:
                    - internal
                    - external
                slug:
                  type: string
                  maxLength: 30
                  description: Optional available hosted-address label; also bounded by the company handle length.
                request_id:
                  type: string
                  minLength: 16
                  maxLength: 128
                  pattern: ^[A-Za-z0-9_-]+$
              required:
                - name
                - audience
              additionalProperties: false
  /products/help-desk/desks/{desk_id}:
    patch:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Current desk descriptor. Retirement and restoration return inactive service.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskDescriptor"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: correct the named field."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: an interactive company member session is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller lacks the authority the operation names; or the credential is an API key or an impersonated session. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk. HELP_DESK_CAPACITY_REQUIRED: the purchased desk count does not cover this desk, which is read-only until capacity is added."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: no desk the caller sees has this ID in the company."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT, HELP_DESK_ARCHIVED or HELP_DESK_MAILBOX_TAKEN: refresh current state and follow the refusal; do not repeat a purchase blindly."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Change desk setup
      description: "Interactive company-member session only; not a server API key. A company administrator configures every desk without gaining ticket-content access; every role holder of a desk works its whole ticket pool. The desk's configurer: a company administrator, or the desk's Manager (403 for another role holder; 404 to a member who does not see the desk). Changes its name or mailbox. Uses the descriptor version, not the settings version. Audience, hosted slug and company ownership cannot change here. Restore an archived desk before editing it."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                version:
                  type: integer
                  minimum: 0
                  description: The descriptor version returned by the directory. Refresh after a conflict.
                name:
                  type: string
                  minLength: 1
                  maxLength: 80
                mailbox:
                  type: string
                  minLength: 1
                  maxLength: 31
                  description: Available lowercase contact name on the company help.sv mail host. Reserved mail operations names and names claimed by another desk or queue are refused.
              required:
                - version
              additionalProperties: false
  /products/help-desk/desks/{desk_id}/archive:
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Current desk descriptor. Retirement and restoration return inactive service.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskDescriptor"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: correct the named field."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: an interactive company member session is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller lacks the authority the operation names; or the credential is an API key or an impersonated session."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: no desk the caller sees has this ID in the company."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT or SEAT_CHANGE_IN_PROGRESS: refresh current state and follow the refusal; do not repeat a purchase blindly."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "EMAIL_SETUP_BUSY: email setup is busy right now; try again in a moment."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Archive a desk and release its reserved capacity
      description: "Interactive company-member session only; not a server API key. A company administrator configures every desk without gaining ticket-content access; every role holder of a desk works its whole ticket pool. Company administrator only: 403 to the desk's role holders, 404 to anyone who does not see the desk (an archived desk is seen by company administrators alone). Stops service and withdraws published knowledge before releasing its capacity. Tickets, knowledge, legal holds and original address claims are retained. The purchased quantity and charges remain unchanged until a separate explicit billing review."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                version:
                  type: integer
                  minimum: 0
                  description: The descriptor version returned by the directory. Refresh after a conflict.
              required:
                - version
              additionalProperties: false
  /products/help-desk/desks/{desk_id}/restore:
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: desk_id
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Current desk descriptor. Retirement and restoration return inactive service.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskDescriptor"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: correct the named field."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: an interactive company member session is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller lacks the authority the operation names; or the credential is an API key or an impersonated session."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: no desk the caller sees has this ID in the company."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT, SEAT_CHANGE_IN_PROGRESS or HELP_DESK_CAPACITY_REACHED: refresh current state and follow the refusal; do not repeat a purchase blindly."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Restore the same desk using available plan capacity
      description: "Interactive company-member session only; not a server API key. A company administrator configures every desk without gaining ticket-content access; every role holder of a desk works its whole ticket pool. Company administrator only: 403 to the desk's role holders, 404 to anyone who does not see the desk (an archived desk is seen by company administrators alone). Requires available paid capacity; returns the original desk inactive with its data and addresses. Activate with normal vault consent before serving. This action never buys capacity or changes billing; purchase additional capacity separately if required."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                version:
                  type: integer
                  minimum: 0
                  description: The descriptor version returned by the directory. Refresh after a conflict.
              required:
                - version
              additionalProperties: false
  /products/help-desk/external-identity:
    get:
      tags:
        - help-desk
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "200":
          description: This account's public integration configuration and current portal origins.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskExternalIdentityIntegration"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: invalid public verifier configuration or an unsupported request field."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: provide a valid company server API key or current administrator session."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: current organization administrator membership is required. Writes also require the Help Desk product."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: stale settings version, or HELP_DESK_NOT_ACTIVE: activate the desk first."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read company-session integration readiness
      description: Uses an organization administrator's own session or a server-held API key whose creator remains an administrator. Internal and impersonated callers are refused. The account comes from the credential, never from the request body. This narrow endpoint grants no operator or ticket-content access. Reads remain available without product entitlement.
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
    put:
      tags:
        - help-desk
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "200":
          description: The account's saved integration configuration.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskExternalIdentityIntegration"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: invalid public verifier configuration or an unsupported request field."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: provide a valid company server API key or current administrator session."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: current organization administrator membership is required. Writes also require the Help Desk product."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: stale settings version, or HELP_DESK_NOT_ACTIVE: activate the desk first."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Provision a company-session public verifier
      description: Uses an organization administrator's own session or a server-held API key whose creator remains an administrator. Internal and impersonated callers are refused. The account comes from the credential, never from the request body. This narrow endpoint grants no operator or ticket-content access. Requires an active desk. Only activate:true selects company-session mode. Identical normalized configuration is a no-op. Key, issuer, origins, mode or guest-policy changes invalidate existing customer sessions. Null external_identity revokes the verifier and pauses company sign-in without fallback.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                external_identity:
                  oneOf:
                    - $ref: "#/components/schemas/HelpDeskExternalIdentityConfig"
                    - type: "null"
                activate:
                  type: boolean
                external_guest_email:
                  type: boolean
                version:
                  type: integer
                  minimum: 1
                  description: Optional optimistic settings version. When omitted, the strongly read current version is used.
              required:
                - external_identity
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/external-identity/revoke:
    post:
      tags:
        - help-desk
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "204":
          description: Support sessions revoked, or the subject was unknown.
        "400":
          description: "VALIDATION_ERROR: invalid public verifier configuration or an unsupported request field."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: provide a valid company server API key or current administrator session."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: current organization administrator membership is required. Writes also require the Help Desk product."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: stale settings version, or HELP_DESK_NOT_ACTIVE: activate the desk first."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: End a company customer's support sessions
      description: Uses an organization administrator's own session or a server-held API key whose creator remains an administrator. Internal and impersonated callers are refused. The account comes from the credential, never from the request body. This narrow endpoint grants no operator or ticket-content access. The company server calls this on logout, account deletion or a security revocation, with durable retry. Support sessions and pending hosted handoffs issued at or before this logout cutoff end; later fresh company logins remain valid. The requester is not blocked. The configured issuer is derived server-side. Unknown subjects receive the same empty answer. This recovery action remains available without active product entitlement.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                subject:
                  type: string
                  minLength: 1
                  maxLength: 256
                  description: The stable company user ID used as the signed assertion sub.
                revoked_before_ms:
                  type: integer
                  minimum: 0
                  maximum: 9007199254740991
                  description: Optional trusted company-server logout cutoff in Unix milliseconds, no more than five seconds ahead of Core time. Capture the original logout time before queueing and preserve it on retries; an older or duplicate cutoff is a no-op, so delayed delivery cannot end a later fresh login. If omitted, Core uses receipt time. The company backend supplies this value; never accept a browser-provided timestamp.
              required:
                - subject
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/healthz:
    get:
      tags:
        - help-desk
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        default:
          description: Response
  /products/help-desk/jobs/{job_id}:
    get:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: job_id
          in: path
          required: true
          schema:
            type: string
          description: The job, as its start answered it.
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: The job.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskJob"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization. FORBIDDEN: the caller may not start the job's kind."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access. NOT_FOUND: the desk holds no such job."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read a job
      description: "A job's state, progress and, once done, what it did; poll it until `state` is done or failed. It is read as it stands from the moment its start answers. A job that nothing has moved for 30 minutes is ended as it is read, failed with the reason `stopped`. Read by whoever may start its kind, from their own session: a requester's export or erasure by a company administrator who is a Manager of the desk (on an archived desk too), since an export's result is a link to everything the desk holds of a person; a routing re-apply or a knowledge base publication by a company administrator or a Manager of the desk."
  /products/help-desk/knowledge-base:
    get:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The saved result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/KnowledgeBaseWorkspace"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the request contains an invalid or unsupported value."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: a current organization session is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk. Management writes also require a Full License."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees. NOT_FOUND: the desk has no matching article, category, FAQ entry, image, revision or operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: a stale version, publication in progress, changed public release, or lifecycle fence, or the caller's Full License, administrator standing or desk role moved after their session's gate read it. Reload before retrying."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait for the Retry-After interval."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read the knowledge base workspace
      description: The desk's configurer (a company administrator, or a Manager of the desk), from their own console session, never an API key or impersonated session. The help desk must be active. Management writes require a Full License and a matching version; private content stays encrypted in the desk vault until explicitly published.
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/knowledge-base/analytics:
    get:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The saved result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/KnowledgeBaseAnalytics"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the request contains an invalid or unsupported value."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: a current organization session is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: a stale version, publication in progress, changed public release, or lifecycle fence, or the caller's Full License, administrator standing or desk role moved after their session's gate read it. Reload before retrying."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait for the Retry-After interval."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read knowledge base activity for a date range
      description: A role holder of the desk or a company administrator, from their own console session. Dates are account-local, inclusive, at most 366 days, and cannot end in the future. The previous period has equal length. Views and searches are browser-recorded events, not verified people; search result counts are client-observed. Query text is never accepted or stored. Helpful votes count one current sample per article/browser pseudonym, with changes retained on the original date/category. Partial reports are explicitly marked. Imported lifetime counts are separate from every dated metric.
      parameters:
        - name: from
          in: query
          required: true
          schema:
            type: string
            format: date
        - name: to
          in: query
          required: true
          schema:
            type: string
            format: date
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/knowledge-base/articles:
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "201":
          description: The saved result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      article:
                        $ref: "#/components/schemas/KnowledgeBaseArticle"
                    required:
                      - article
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the request contains an invalid or unsupported value."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: a current organization session is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk. Management writes also require a Full License."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees. NOT_FOUND: the desk has no matching article, category, FAQ entry, image, revision or operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: a stale version, publication in progress, changed public release, or lifecycle fence, or the caller's Full License, administrator standing or desk role moved after their session's gate read it. Reload before retrying."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait for the Retry-After interval."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Create an article draft
      description: The desk's configurer (a company administrator, or a Manager of the desk), from their own console session, never an API key or impersonated session. The help desk must be active. Management writes require a Full License and a matching version; private content stays encrypted in the desk vault until explicitly published. A slug another article in the same category holds (or, without a category, another article without one) is refused with 400 (field slug).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/KnowledgeBaseArticleInput"
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/knowledge-base/articles/{article_id}:
    get:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: article_id
          in: path
          required: true
          schema:
            type: string
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: The saved result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      article:
                        $ref: "#/components/schemas/KnowledgeBaseArticle"
                    required:
                      - article
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the request contains an invalid or unsupported value."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: a current organization session is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk. Management writes also require a Full License."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees. NOT_FOUND: the desk has no matching article, category, FAQ entry, image, revision or operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: a stale version, publication in progress, changed public release, or lifecycle fence, or the caller's Full License, administrator standing or desk role moved after their session's gate read it. Reload before retrying."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait for the Retry-After interval."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read an article draft
      description: The desk's configurer (a company administrator, or a Manager of the desk), from their own console session, never an API key or impersonated session. The help desk must be active. Management writes require a Full License and a matching version; private content stays encrypted in the desk vault until explicitly published.
    put:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: article_id
          in: path
          required: true
          schema:
            type: string
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: The saved result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      article:
                        $ref: "#/components/schemas/KnowledgeBaseArticle"
                    required:
                      - article
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the request contains an invalid or unsupported value."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: a current organization session is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk. Management writes also require a Full License."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees. NOT_FOUND: the desk has no matching article, category, FAQ entry, image, revision or operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: a stale version, publication in progress, changed public release, or lifecycle fence, or the caller's Full License, administrator standing or desk role moved after their session's gate read it. Reload before retrying."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait for the Retry-After interval."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Save a new article revision
      description: The desk's configurer (a company administrator, or a Manager of the desk), from their own console session, never an API key or impersonated session. The help desk must be active. Management writes require a Full License and a matching version; private content stays encrypted in the desk vault until explicitly published. A slug another article in the same category holds (or, without a category, another article without one) is refused with 400 (field slug).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                version:
                  type: integer
                  minimum: 0
                  description: The version last read; a stale version is refused with 409.
                patch:
                  $ref: "#/components/schemas/KnowledgeBaseArticlePatch"
              required:
                - version
                - patch
    delete:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: article_id
          in: path
          required: true
          schema:
            type: string
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "204":
          description: The draft was archived, the empty category deleted or the FAQ entry deleted.
        "400":
          description: "VALIDATION_ERROR: the request contains an invalid or unsupported value."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: a current organization session is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk. Management writes also require a Full License."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees. NOT_FOUND: the desk has no matching article, category, FAQ entry, image, revision or operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: a stale version, publication in progress, changed public release, or lifecycle fence, or the caller's Full License, administrator standing or desk role moved after their session's gate read it. Reload before retrying."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait for the Retry-After interval."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Archive an unpublished article
      description: The desk's configurer (a company administrator, or a Manager of the desk), from their own console session, never an API key or impersonated session. The help desk must be active. Management writes require a Full License and a matching version; private content stays encrypted in the desk vault until explicitly published. Unpublish a live article before archiving it.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                version:
                  type: integer
                  minimum: 0
                  description: The version last read; a stale version is refused with 409.
              required:
                - version
  /products/help-desk/knowledge-base/articles/{article_id}/pin:
    put:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: article_id
          in: path
          required: true
          schema:
            type: string
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: The saved result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/KnowledgeBaseWorkspace"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the request contains an invalid or unsupported value."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: a current organization session is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk. Management writes also require a Full License."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees. NOT_FOUND: the desk has no matching article, category, FAQ entry, image, revision or operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: a stale version, publication in progress, changed public release, or lifecycle fence, or the caller's Full License, administrator standing or desk role moved after their session's gate read it. Reload before retrying."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait for the Retry-After interval."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Pin or unpin an article
      description: "The desk's configurer (a company administrator, or a Manager of the desk), from their own console session, never an API key or impersonated session. The help desk must be active. Management writes require a Full License and a matching version; private content stays encrypted in the desk vault until explicitly published. pinned true places the article among the desk's pinned articles, immediately before the pinned before_article_id, or last when that is null or absent; pinned false unpins it. A before_article_id that is not an article id, names the article itself, comes with pinned false, or names an active article that is not pinned is refused with 400 (field before_article_id). The path's article, or a well-formed before_article_id, naming no active article of the desk is 404. version is the workspace version. Returns the workspace; a request that changes no pin writes nothing and returns the workspace as it stands, whatever version it carries, so a pin submitted twice answers its landed result again. Pins belong to the desk, never to an article revision: a pin marks no article changed, and the next publication applies it, listing the pinned articles first."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                version:
                  type: integer
                  minimum: 0
                  description: The version last read; a stale version is refused with 409.
                pinned:
                  type: boolean
                before_article_id:
                  type:
                    - string
                    - "null"
              required:
                - version
                - pinned
  /products/help-desk/knowledge-base/articles/{article_id}/restore:
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: article_id
          in: path
          required: true
          schema:
            type: string
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: The saved result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      article:
                        $ref: "#/components/schemas/KnowledgeBaseArticle"
                    required:
                      - article
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the request contains an invalid or unsupported value."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: a current organization session is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk. Management writes also require a Full License."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees. NOT_FOUND: the desk has no matching article, category, FAQ entry, image, revision or operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: a stale version, publication in progress, changed public release, or lifecycle fence, or the caller's Full License, administrator standing or desk role moved after their session's gate read it. Reload before retrying."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait for the Retry-After interval."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Restore a revision as a new draft
      description: The desk's configurer (a company administrator, or a Manager of the desk), from their own console session, never an API key or impersonated session. The help desk must be active. Management writes require a Full License and a matching version; private content stays encrypted in the desk vault until explicitly published. Restoring creates a new draft revision and does not change the live article.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                version:
                  type: integer
                  minimum: 0
                  description: The version last read; a stale version is refused with 409.
                revision_id:
                  type: string
              required:
                - version
                - revision_id
  /products/help-desk/knowledge-base/articles/{article_id}/revisions:
    get:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: article_id
          in: path
          required: true
          schema:
            type: string
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: The saved result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      revisions:
                        type: array
                        items:
                          $ref: "#/components/schemas/KnowledgeBaseRevisionSummary"
                    required:
                      - revisions
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the request contains an invalid or unsupported value."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: a current organization session is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk. Management writes also require a Full License."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees. NOT_FOUND: the desk has no matching article, category, FAQ entry, image, revision or operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: a stale version, publication in progress, changed public release, or lifecycle fence, or the caller's Full License, administrator standing or desk role moved after their session's gate read it. Reload before retrying."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait for the Retry-After interval."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List immutable article revisions
      description: The desk's configurer (a company administrator, or a Manager of the desk), from their own console session, never an API key or impersonated session. The help desk must be active. Management writes require a Full License and a matching version; private content stays encrypted in the desk vault until explicitly published.
  /products/help-desk/knowledge-base/articles/{article_id}/revisions/{revision_id}:
    get:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: article_id
          in: path
          required: true
          schema:
            type: string
        - name: revision_id
          in: path
          required: true
          schema:
            type: string
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: The saved result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      revision:
                        $ref: "#/components/schemas/KnowledgeBaseRevision"
                    required:
                      - revision
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the request contains an invalid or unsupported value."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: a current organization session is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk. Management writes also require a Full License."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees. NOT_FOUND: the desk has no matching article, category, FAQ entry, image, revision or operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: a stale version, publication in progress, changed public release, or lifecycle fence, or the caller's Full License, administrator standing or desk role moved after their session's gate read it. Reload before retrying."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait for the Retry-After interval."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read a saved article revision
      description: The desk's configurer (a company administrator, or a Manager of the desk), from their own console session, never an API key or impersonated session. The help desk must be active. Management writes require a Full License and a matching version; private content stays encrypted in the desk vault until explicitly published.
  /products/help-desk/knowledge-base/assets:
    get:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The saved result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      assets:
                        type: array
                        items:
                          $ref: "#/components/schemas/KnowledgeBaseAsset"
                    required:
                      - assets
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the request contains an invalid or unsupported value."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: a current organization session is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk. Management writes also require a Full License."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees. NOT_FOUND: the desk has no matching article, category, FAQ entry, image, revision or operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: a stale version, publication in progress, changed public release, or lifecycle fence, or the caller's Full License, administrator standing or desk role moved after their session's gate read it. Reload before retrying."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait for the Retry-After interval."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List private knowledge base images
      description: The desk's configurer (a company administrator, or a Manager of the desk), from their own console session, never an API key or impersonated session. The help desk must be active. Management writes require a Full License and a matching version; private content stays encrypted in the desk vault until explicitly published.
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "201":
          description: The saved result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      asset:
                        $ref: "#/components/schemas/KnowledgeBaseAsset"
                    required:
                      - asset
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the request contains an invalid or unsupported value."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: a current organization session is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk. Management writes also require a Full License."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees. NOT_FOUND: the desk has no matching article, category, FAQ entry, image, revision or operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: a stale version, publication in progress, changed public release, or lifecycle fence, or the caller's Full License, administrator standing or desk role moved after their session's gate read it. Reload before retrying."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "413":
          description: "PAYLOAD_TOO_LARGE: the image exceeds 8 MiB."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait for the Retry-After interval."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Upload a private knowledge base image
      description: The desk's configurer (a company administrator, or a Manager of the desk), from their own console session, never an API key or impersonated session. The help desk must be active. Management writes require a Full License and a matching version; private content stays encrypted in the desk vault until explicitly published. One PNG, JPEG, GIF, WebP or AVIF image, at most 8 MiB. SVG is refused. Publication copies only referenced images into its immutable public release.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                source_url:
                  type: string
                  format: uri
                  maxLength: 2048
                  description: Optional original HTTPS image URL for migration deduplication; credentials are forbidden.
              required:
                - file
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/knowledge-base/assets/{asset_id}/content:
    get:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: asset_id
          in: path
          required: true
          schema:
            type: string
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: The image bytes, no-store and nosniff.
          content:
            image/png:
              schema:
                type: string
                format: binary
            image/jpeg:
              schema:
                type: string
                format: binary
            image/gif:
              schema:
                type: string
                format: binary
            image/webp:
              schema:
                type: string
                format: binary
            image/avif:
              schema:
                type: string
                format: binary
        "400":
          description: "VALIDATION_ERROR: the request contains an invalid or unsupported value."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: a current organization session is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk. Management writes also require a Full License."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees. NOT_FOUND: the desk has no matching article, category, FAQ entry, image, revision or operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: a stale version, publication in progress, changed public release, or lifecycle fence, or the caller's Full License, administrator standing or desk role moved after their session's gate read it. Reload before retrying."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait for the Retry-After interval."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Preview a private knowledge base image
      description: The desk's configurer (a company administrator, or a Manager of the desk), from their own console session, never an API key or impersonated session. The help desk must be active. Management writes require a Full License and a matching version; private content stays encrypted in the desk vault until explicitly published.
  /products/help-desk/knowledge-base/categories:
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "201":
          description: The saved result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      category:
                        $ref: "#/components/schemas/KnowledgeBaseCategory"
                    required:
                      - category
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the request contains an invalid or unsupported value."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: a current organization session is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk. Management writes also require a Full License."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees. NOT_FOUND: the desk has no matching article, category, FAQ entry, image, revision or operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: a stale version, publication in progress, changed public release, or lifecycle fence, or the caller's Full License, administrator standing or desk role moved after their session's gate read it. Reload before retrying."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait for the Retry-After interval."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Create a knowledge base category
      description: The desk's configurer (a company administrator, or a Manager of the desk), from their own console session, never an API key or impersonated session. The help desk must be active. Management writes require a Full License and a matching version; private content stays encrypted in the desk vault until explicitly published. A slug another category under the same parent holds is refused with 400 (field slug).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/KnowledgeBaseCategoryInput"
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/knowledge-base/categories/{category_id}:
    put:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: category_id
          in: path
          required: true
          schema:
            type: string
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: The saved result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      category:
                        $ref: "#/components/schemas/KnowledgeBaseCategory"
                    required:
                      - category
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the request contains an invalid or unsupported value."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: a current organization session is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk. Management writes also require a Full License."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees. NOT_FOUND: the desk has no matching article, category, FAQ entry, image, revision or operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: a stale version, publication in progress, changed public release, or lifecycle fence, or the caller's Full License, administrator standing or desk role moved after their session's gate read it. Reload before retrying."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait for the Retry-After interval."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Update a category
      description: The desk's configurer (a company administrator, or a Manager of the desk), from their own console session, never an API key or impersonated session. The help desk must be active. Management writes require a Full License and a matching version; private content stays encrypted in the desk vault until explicitly published. A slug another category under the same parent holds is refused with 400 (field slug).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                version:
                  type: integer
                  minimum: 0
                  description: The version last read; a stale version is refused with 409.
                patch:
                  $ref: "#/components/schemas/KnowledgeBaseCategoryPatch"
              required:
                - version
                - patch
    delete:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: category_id
          in: path
          required: true
          schema:
            type: string
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "204":
          description: The draft was archived, the empty category deleted or the FAQ entry deleted.
        "400":
          description: "VALIDATION_ERROR: the request contains an invalid or unsupported value."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: a current organization session is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk. Management writes also require a Full License."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees. NOT_FOUND: the desk has no matching article, category, FAQ entry, image, revision or operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: a stale version, publication in progress, changed public release, or lifecycle fence, or the caller's Full License, administrator standing or desk role moved after their session's gate read it. Reload before retrying."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait for the Retry-After interval."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Delete an empty category
      description: The desk's configurer (a company administrator, or a Manager of the desk), from their own console session, never an API key or impersonated session. The help desk must be active. Management writes require a Full License and a matching version; private content stays encrypted in the desk vault until explicitly published. A category with child categories or articles cannot be deleted.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                version:
                  type: integer
                  minimum: 0
                  description: The version last read; a stale version is refused with 409.
              required:
                - version
  /products/help-desk/knowledge-base/disable:
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The saved result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/KnowledgeBaseWorkspace"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the request contains an invalid or unsupported value."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: a current organization session is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees. NOT_FOUND: the desk has no matching article, category, FAQ entry, image, revision or operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: a stale version, publication in progress, changed public release, or lifecycle fence, or the caller's Full License, administrator standing or desk role moved after their session's gate read it. Reload before retrying."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait for the Retry-After interval."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "KB_PUBLISHING_UNAVAILABLE: SparkVault's credential for the publication store is missing, invalid or refused; publishing setup needs repair before it can continue."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Disable the public knowledge base
      description: The desk's configurer (a company administrator, or a Manager of the desk), from their own console session. This recovery operation remains available without a Full License or an active product entitlement. The help desk must remain activated; private content is retained. Disabling withdraws the public pointer; private drafts and recorded analytics remain.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                version:
                  type: integer
                  minimum: 0
                  description: The version last read; a stale version is refused with 409.
              required:
                - version
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/knowledge-base/enable:
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The saved result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/KnowledgeBaseWorkspace"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the request contains an invalid or unsupported value."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: a current organization session is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk. Management writes also require a Full License."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees. NOT_FOUND: the desk has no matching article, category, FAQ entry, image, revision or operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: a stale version, publication in progress, changed public release, or lifecycle fence, or the caller's Full License, administrator standing or desk role moved after their session's gate read it. Reload before retrying."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait for the Retry-After interval."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "KB_PUBLISHING_UNAVAILABLE: SparkVault's credential for the publication store is missing, invalid or refused; publishing setup needs repair before it can continue."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Enable the public knowledge base
      description: The desk's configurer (a company administrator, or a Manager of the desk), from their own console session, never an API key or impersonated session. The help desk must be active. Management writes require a Full License and a matching version; private content stays encrypted in the desk vault until explicitly published. An existing published release is required.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                version:
                  type: integer
                  minimum: 0
                  description: The version last read; a stale version is refused with 409.
              required:
                - version
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/knowledge-base/faq:
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "201":
          description: The saved result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      faq:
                        $ref: "#/components/schemas/KnowledgeBaseFaq"
                    required:
                      - faq
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the request contains an invalid or unsupported value."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: a current organization session is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk. Management writes also require a Full License."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees. NOT_FOUND: the desk has no matching article, category, FAQ entry, image, revision or operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: a stale version, publication in progress, changed public release, or lifecycle fence, or the caller's Full License, administrator standing or desk role moved after their session's gate read it. Reload before retrying."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait for the Retry-After interval."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Add an FAQ entry
      description: The desk's configurer (a company administrator, or a Manager of the desk), from their own console session, never an API key or impersonated session. The help desk must be active. Management writes require a Full License and a matching version; private content stays encrypted in the desk vault until explicitly published. The entry joins last. A desk holds at most 500 entries; the next publication applies them.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/KnowledgeBaseFaqInput"
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/knowledge-base/faq/{faq_id}:
    put:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: faq_id
          in: path
          required: true
          schema:
            type: string
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: The saved result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      faq:
                        $ref: "#/components/schemas/KnowledgeBaseFaq"
                    required:
                      - faq
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the request contains an invalid or unsupported value."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: a current organization session is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk. Management writes also require a Full License."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees. NOT_FOUND: the desk has no matching article, category, FAQ entry, image, revision or operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: a stale version, publication in progress, changed public release, or lifecycle fence, or the caller's Full License, administrator standing or desk role moved after their session's gate read it. Reload before retrying."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait for the Retry-After interval."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Update an FAQ entry
      description: The desk's configurer (a company administrator, or a Manager of the desk), from their own console session, never an API key or impersonated session. The help desk must be active. Management writes require a Full License and a matching version; private content stays encrypted in the desk vault until explicitly published.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                version:
                  type: integer
                  minimum: 0
                  description: The version last read; a stale version is refused with 409.
                patch:
                  $ref: "#/components/schemas/KnowledgeBaseFaqPatch"
              required:
                - version
                - patch
    delete:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: faq_id
          in: path
          required: true
          schema:
            type: string
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "204":
          description: The draft was archived, the empty category deleted or the FAQ entry deleted.
        "400":
          description: "VALIDATION_ERROR: the request contains an invalid or unsupported value."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: a current organization session is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk. Management writes also require a Full License."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees. NOT_FOUND: the desk has no matching article, category, FAQ entry, image, revision or operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: a stale version, publication in progress, changed public release, or lifecycle fence, or the caller's Full License, administrator standing or desk role moved after their session's gate read it. Reload before retrying."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait for the Retry-After interval."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Delete an FAQ entry
      description: The desk's configurer (a company administrator, or a Manager of the desk), from their own console session, never an API key or impersonated session. The help desk must be active. Management writes require a Full License and a matching version; private content stays encrypted in the desk vault until explicitly published. The entry leaves the public FAQ page with the next publication.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                version:
                  type: integer
                  minimum: 0
                  description: The version last read; a stale version is refused with 409.
              required:
                - version
  /products/help-desk/knowledge-base/faq/{faq_id}/position:
    put:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: faq_id
          in: path
          required: true
          schema:
            type: string
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: The saved result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/KnowledgeBaseWorkspace"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the request contains an invalid or unsupported value."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: a current organization session is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk. Management writes also require a Full License."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees. NOT_FOUND: the desk has no matching article, category, FAQ entry, image, revision or operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: a stale version, publication in progress, changed public release, or lifecycle fence, or the caller's Full License, administrator standing or desk role moved after their session's gate read it. Reload before retrying."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait for the Retry-After interval."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Move an FAQ entry
      description: The desk's configurer (a company administrator, or a Manager of the desk), from their own console session, never an API key or impersonated session. The help desk must be active. Management writes require a Full License and a matching version; private content stays encrypted in the desk vault until explicitly published. Places the entry immediately before the entry before_faq_id names, or last when that is null or absent, under the workspace version. A move that leaves the order as it stands changes nothing. A before_faq_id that names the entry itself or no entry id is refused with 400; one that names no entry of this desk with 404.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                version:
                  type: integer
                  minimum: 0
                  description: The version last read; a stale version is refused with 409.
                before_faq_id:
                  type:
                    - string
                    - "null"
              required:
                - version
  /products/help-desk/knowledge-base/publication/cancel:
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The saved result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/KnowledgeBaseWorkspace"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the request contains an invalid or unsupported value."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: a current organization session is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees. NOT_FOUND: the desk has no matching article, category, FAQ entry, image, revision or operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: a stale version, publication in progress, changed public release, or lifecycle fence, or the caller's Full License, administrator standing or desk role moved after their session's gate read it. Reload before retrying."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait for the Retry-After interval."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "KB_PUBLISHING_UNAVAILABLE: SparkVault's credential for the publication store is missing, invalid or refused; publishing setup needs repair before it can continue."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Cancel a pending publication
      description: The desk's configurer (a company administrator, or a Manager of the desk), from their own console session. This recovery operation remains available without a Full License or an active product entitlement. The help desk must remain activated; private content is retained. Cancellation is refused once the public pointer has activated; retry that publication to finish recording it.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                operation_id:
                  type: string
              required:
                - operation_id
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/knowledge-base/publication/retry:
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "202":
          description: The saved result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/KnowledgeBasePublicationOperation"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the request contains an invalid or unsupported value."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: a current organization session is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk. Management writes also require a Full License."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees. NOT_FOUND: the desk has no matching article, category, FAQ entry, image, revision or operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: a stale version, publication in progress, changed public release, or lifecycle fence, or the caller's Full License, administrator standing or desk role moved after their session's gate read it. Reload before retrying."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait for the Retry-After interval."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Retry a pending publication
      description: "The desk's configurer (a company administrator, or a Manager of the desk), from their own console session, never an API key or impersonated session. The help desk must be active. Management writes require a Full License and a matching version; private content stays encrypted in the desk vault until explicitly published. A refused publication (the workspace's publication retryable false) is refused with 409: cancel it, fix what its error names, then publish again."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                operation_id:
                  type: string
              required:
                - operation_id
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/knowledge-base/publish:
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "202":
          description: The saved result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/KnowledgeBasePublicationOperation"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the request contains an invalid or unsupported value."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: a current organization session is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk. Management writes also require a Full License."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees. NOT_FOUND: the desk has no matching article, category, FAQ entry, image, revision or operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: a stale version, publication in progress, changed public release, or lifecycle fence, or the caller's Full License, administrator standing or desk role moved after their session's gate read it. Reload before retrying."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait for the Retry-After interval."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "KB_PUBLISHING_UNAVAILABLE: SparkVault's credential for the publication store is missing, invalid or refused; publishing setup needs repair before it can continue."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Publish saved article revisions
      description: The desk's configurer (a company administrator, or a Manager of the desk), from their own console session, never an API key or impersonated session. The help desk must be active. Management writes require a Full License and a matching version; private content stays encrypted in the desk vault until explicitly published. Queues a complete immutable release and changes the edge pointer only after all files are ready. Select exact saved revision IDs; concurrent edits refuse publication. A selected revision without a category, or with unresolved_images, is refused with 400 (details.article_id) before anything is queued. A published article's previous paths redirect (301) to its current one while it stays published; a page, or one of the desk's own redirects, at an old path takes precedence, and unpublishing an article drops its redirects. A refusal of the desk's content found while rendering (a path two pages claim, a redirect, an image, a size limit) ends the job failed with failure.reason publication_refused, and the workspace's publication carries its error with retryable false. Every release also applies the saved categories, pins, FAQ entries and appearance; after its pinned articles, it lists the rest by their recorded views over the 90 days ending on the day the publication is requested, most viewed first. Poll the returned job using GET /products/help-desk/jobs/{job_id}.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                version:
                  type: integer
                  minimum: 0
                  description: The version last read; a stale version is refused with 409.
                articles:
                  type: array
                  maxItems: 2000
                  items:
                    type: object
                    properties:
                      article_id:
                        type: string
                      revision_id:
                        type: string
                    required:
                      - article_id
                      - revision_id
                unpublish_article_ids:
                  type: array
                  maxItems: 2000
                  items:
                    type: string
                    maxLength: 128
                enable:
                  type: boolean
              required:
                - version
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/knowledge-base/settings:
    put:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The saved result.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/KnowledgeBaseWorkspace"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the request contains an invalid or unsupported value."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: a current organization session is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk. Management writes also require a Full License."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees. NOT_FOUND: the desk has no matching article, category, FAQ entry, image, revision or operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: a stale version, publication in progress, changed public release, or lifecycle fence, or the caller's Full License, administrator standing or desk role moved after their session's gate read it. Reload before retrying."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: wait for the Retry-After interval."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Save knowledge base appearance, access and SEO
      description: The desk's configurer (a company administrator, or a Manager of the desk), from their own console session, never an API key or impersonated session. The help desk must be active. Management writes require a Full License and a matching version; private content stays encrypted in the desk vault until explicitly published.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                version:
                  type: integer
                  minimum: 0
                  description: The version last read; a stale version is refused with 409.
                patch:
                  $ref: "#/components/schemas/KnowledgeBaseSettingsPatch"
              required:
                - version
                - patch
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/legal-holds:
    get:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The held tickets.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskLegalHolds"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is not a company administrator who holds a role on the desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List the tickets under legal hold
      description: The desk's tickets under legal hold, most recently held first, each with its hold. A deactivated desk lists them without their subjects. A company administrator who holds a role on the desk, from their own session, on an archived desk too.
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/operator-access:
    get:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The caller's access.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - account_id
                      - user_id
                      - member_active
                      - product_access
                      - role
                      - can_configure
                    properties:
                      account_id:
                        type: string
                      user_id:
                        type: string
                      member_active:
                        type: boolean
                      product_access:
                        type: boolean
                        description: Whether they hold Help Desk access as an active member.
                      role:
                        type:
                          - string
                          - "null"
                        enum:
                          - manager
                          - agent
                          - trainee
                          - null
                        description: Their role on the desk; null for none, and on an archived desk.
                      can_configure:
                        type: boolean
                        description: "Whether they configure the desk and assign its roles: a company administrator, or its Manager."
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read my access to a desk
      description: The signed-in member's own access to the desk (`desk_id`, else the organization's original desk), read from their member row, their Help Desk access and their role on the desk as they stand. Any active member, from their own session; the original desk answers without a role. A role counts only for an active member who holds Help Desk access, and only while the desk is not archived. Every capability follows from the role and whether the caller configures the desk (a company administrator, or its Manager); a company administrator without a role configures it and reads no ticket. Neither a Full License nor an assignment grants access.
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/operators:
    get:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: "The operators: every role holder for scope desk, a page of them for scope product."
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskOperatorsPage"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: `scope` is neither desk nor product, `cursor` or `q` was sent for scope desk, `q` is longer than 320 characters, or the cursor is not one this list issued."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization. FORBIDDEN: scope product, to a caller who is neither a company administrator nor a Manager of the desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "HELP_DESK_NOT_ACTIVE: the organization has no help desk yet: it has never activated one."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "ROSTER_INDEX_PROVISIONING: searching members (`q`) is still being set up for this deployment."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List the desk's operators
      description: "The desk's operators, by `scope`. desk (the default): every role holder of the desk, in name order, in one page; a role counts only for an active member who holds Help Desk access. product: everyone with Help Desk access, active and invited (`member_status`), a page at a time in name order within each page, with their role on this desk: the members its configurer gives roles to (PUT /products/help-desk/operators/{user_id}/role), searchable by a name or email prefix (`q`). Each operator's open assigned requests are the desk's configurer's to read (a company administrator, or its Manager), null for anyone else. A role holder of the desk or a company administrator, from their own session; the product scope is its configurer's alone."
      parameters:
        - name: scope
          in: query
          required: false
          schema:
            type: string
            enum:
              - desk
              - product
            default: desk
          description: "desk: the desk's role holders. product: everyone with Help Desk access."
        - name: q
          in: query
          required: false
          schema:
            type: string
            maxLength: 320
          description: "scope product only: the prefix of a name or an email address."
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: "scope product only: the continuation token from the previous page."
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/operators/me:
    get:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: Your preferences.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskOperatorSelf"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is a company administrator who holds no role on the desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read your desk preferences
      description: "The signed-in operator's availability for new requests (their alerts and balanced assignment), single-key shortcuts, the first name and last initial customers see, their avatar handle and their role on the desk. Before the desk first needed them, the preferences they would start with: available, shortcuts on, the name prefilled from their own, and no avatar handle yet. Reads only. A role holder of the desk, from their own session."
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
    put:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: Your preferences as written.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskOperatorSelf"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: a field is malformed, or the body names another field."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is a company administrator who holds no role on the desk. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: your preferences changed meanwhile; try again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Change your desk preferences
      description: The signed-in operator's availability for new requests (their alerts and balanced assignment), single-key shortcuts, and the first name and last initial customers see. A change of the name customers see is recorded in the audit log. A role holder of the desk, from their own session; the organization must hold the help desk.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/HelpDeskOperatorSelfChange"
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/operators/me/avatar-handle/rotate:
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: Your preferences, with the new avatar handle.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskOperatorSelf"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is a company administrator who holds no role on the desk. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: your preferences changed meanwhile; try again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Retire your avatar address
      description: "Give the signed-in operator a new avatar address: every link to the old one, in email already sent included, shows the generic silhouette from now on. A role holder of the desk, from their own session; the organization must hold the help desk."
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/operators/{user_id}/role:
    put:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: string
          description: The member whose role changes.
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: The member's role as it stands.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - user_id
                      - role
                      - version
                    properties:
                      user_id:
                        type: string
                      role:
                        type:
                          - string
                          - "null"
                        enum:
                          - manager
                          - agent
                          - trainee
                          - null
                      version:
                        type:
                          - integer
                          - "null"
                        minimum: 1
                        description: The role's version, which the next change sends; null for none.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: `role` is not manager, agent, trainee or null, or `version` is neither a positive integer nor null."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk. HELP_DESK_SUBSCRIPTION_REQUIRED: a role given or changed while the organization does not hold the help desk. HELP_DESK_CAPACITY_REQUIRED: a role given or changed on a desk beyond the organization's purchased desk count (an archived desk takes roles while it waits to be restored). Taking a role away is always open."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access. NOT_FOUND: a role given to someone who is not an active member of the organization: invited and not joined yet, suspended, departed, or never one."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the member's role changed since it was loaded, load it again and retry; or your own authority on the desk (your company administrator role, or your Manager role) changed while the change was being saved, so nothing was saved: refresh and try again. HELP_DESK_PRODUCT_ACCESS_REQUIRED: the member does not hold Help Desk access, or it was removed while the role was being saved."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Set a member's role on the desk
      description: "Give a member a role on the desk (manager, agent or trainee), change it, or take it away (null), decided on the role at the `version` the caller loaded (an operator's `role_version`; null when they held none). A Manager configures the desk and assigns its roles, approves or returns Trainees' replies, reads its analytics and blocks requesters; an Agent works every request of the desk; a Trainee's replies wait for a Manager's approval. A role is given only to an active member who holds Help Desk access, which a company administrator gives on the Users page, while the organization holds the Help Desk; taking one away needs none of those. A role stands on the Help Desk access it was given with: one left from access since withdrawn counts for nothing and is listed nowhere, so it is replaced, or taken away, at version null. Taking a role away hands the member's open requests on the desk back to its queues, and its operators are told. Setting the role a member holds answers it as it stands. Every change is audited. The desk's configurer (a company administrator, or its Manager), from their own session; a company administrator assigns roles on an archived desk too."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - role
                - version
              properties:
                role:
                  type:
                    - string
                    - "null"
                  enum:
                    - manager
                    - agent
                    - trainee
                    - null
                  description: The role to hold; null for none.
                version:
                  type:
                    - integer
                    - "null"
                  minimum: 1
                  description: The role's version as loaded (`role_version`); null when the member held none.
  /products/help-desk/queues:
    get:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The queues.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - queues
                      - queue_aliases
                    properties:
                      queues:
                        type: array
                        maxItems: 100
                        items:
                          $ref: "#/components/schemas/HelpDeskQueue"
                      queue_aliases:
                        type: boolean
                        description: Whether a queue of this desk may claim a mail alias.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List the desk's queues
      description: "Every queue of the desk, in name order, with its mail alias and assignment mode, and whether the desk's queues may claim an alias (`queue_aliases`: a desk with no mailbox of its own). Queues route requests; every role holder of the desk works every queue, and a desk with no queues works its requests as one pool. A role holder of the desk or a company administrator, from their own session."
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "201":
          description: The queue.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskQueue"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: `name` is missing, blank after cleaning, over 60 characters, or another field is sent (`details.unknown`)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "HELP_DESK_QUEUE_NAME_TAKEN: another queue of the desk has the name, whatever its case. HELP_DESK_QUEUE_LIMIT: the desk keeps 100 queues. CONFLICT: another queue change landed meanwhile; try again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Create a queue
      description: Add a queue to the desk, on claim assignment with no alias. Its name is unique on the desk whatever its case; a desk keeps at most 100 queues. A create sent again with the same name is refused as taken, never doubled. The desk's configurer (a company administrator, or its Manager), from their own session; the organization must hold the help desk.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - name
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 60
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/queues/{queue_id}:
    patch:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: queue_id
          in: path
          required: true
          schema:
            type: string
          description: The queue.
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: The queue as changed.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskQueue"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: a field is malformed or unsupported (`details.unknown`), no change is named, or `alias` on a desk written to at its own mailbox (`details.field` alias)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access. HELP_DESK_QUEUE_NOT_FOUND: the desk has no such queue."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "HELP_DESK_QUEUE_NAME_TAKEN: another queue of the desk has the name. ALIAS_TAKEN: another queue or desk uses that alias. CONFLICT: the queue changed since it was loaded; reload it and try again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Change a queue
      description: Rename a queue, set its mail alias or its assignment mode, against the `version` loaded. Only a desk whose queues may claim an alias (`queue_aliases`) accepts `alias`; a desk written to at its own mailbox changes that mailbox on the desk instead. The desk's configurer (a company administrator, or its Manager), from their own session; the organization must hold the help desk.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/HelpDeskQueueChange"
    delete:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: queue_id
          in: path
          required: true
          schema:
            type: string
          description: The queue.
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: The queue is deleted.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - queue_id
                      - deleted
                    properties:
                      queue_id:
                        type: string
                      deleted:
                        type: boolean
                        description: Always true.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access. HELP_DESK_QUEUE_NOT_FOUND: the desk has no such queue."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "HELP_DESK_QUEUE_IN_USE: something still needs the queue; `details.reason` names it (open_requests, routing_rule, saved_replies, chat_intake or chat_route) and nothing changed. CONFLICT: another queue change, or a routing rule, saved reply or chat setting saved meanwhile, landed while the delete was decided; try again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Delete a queue
      description: "Delete a queue and release its alias, while nothing still needs it: a live request in it, a routing rule sending requests to it, a saved reply filed under it, or a chat intake or notification route naming it. Its closed requests keep its id. The desk's configurer (a company administrator, or its Manager), from their own session; the organization must hold the help desk."
  /products/help-desk/reply-reviews:
    get:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: Private reviews.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskReplyReviewsPage"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: a filter or cursor is invalid."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is a company administrator who holds no role on the desk. FORBIDDEN: view approvals or all, to a caller who is not a Manager of the desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read private reply reviews
      description: "The replies the desk's Trainees sent for a Manager's approval, by `view`: approvals (those waiting for a Manager, status pending alone) and all (every one) are its Managers'; mine (the caller's own) is every role holder's. With no view, approvals for a Manager and mine for anyone else. A role holder of the desk, from their own session. Cursors are bound to the desk, user and filters. These drafts are never customer content."
      parameters:
        - name: view
          in: query
          schema:
            type: string
            enum:
              - approvals
              - mine
              - all
          description: approvals or all (Managers), or mine; approvals for a Manager and mine for anyone else when left out.
        - name: status
          in: query
          schema:
            type: string
            enum:
              - pending
              - rejected
              - approved
              - discarded
              - all
            default: pending
        - name: ticket_id
          in: query
          schema:
            type: string
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: Continuation token from the previous page.
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/requesters/{requester_id}:
    get:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: requester_id
          in: path
          required: true
          schema:
            type: string
          description: The requester.
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: The requester.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskRequesterDetails"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is a company administrator who holds no role on the desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access. NOT_FOUND: the desk holds no such requester."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "HELP_DESK_NOT_ACTIVE: the desk is not active."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read a requester
      description: "A requester of the desk, their address and name opened: how they last proved their address, how many requests they have made, and their block while it stands. An erased requester names no address and no name. A role holder of the desk, from their own session: every role works every request of the desk, so reads every requester of it. The desk must be active, since its sealed fields open through its vault."
  /products/help-desk/requesters/{requester_id}/block:
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: requester_id
          in: path
          required: true
          schema:
            type: string
          description: The requester.
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: The requester as the block left them.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskRequesterDetails"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: `reason` is too long or holds markup."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is not a Manager of the desk. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access. NOT_FOUND: the desk holds no such requester."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "REQUESTER_ERASED: the requester was erased. CONFLICT: the requester changed meanwhile; try again. HELP_DESK_NOT_ACTIVE: the desk is not active."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Block a requester
      description: "Refuse the requester on every customer surface with the desk's one neutral answer: their sessions at the desk end and the reply tokens of their requests stop working. Their requests stay. Blocking a requester already blocked changes nothing but revokes their reply tokens again. A Manager of the desk, from their own session; the organization must hold the help desk."
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                reason:
                  type: string
                  maxLength: 280
                  description: A note on why, kept with the block.
  /products/help-desk/requesters/{requester_id}/erase:
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: requester_id
          in: path
          required: true
          schema:
            type: string
          description: The requester.
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "202":
          description: The job, queued; an erasure of the requester already queued or running is answered instead.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskJobStarted"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: `confirmation` is not the requester's id."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is not a company administrator who is a Manager of the desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access. NOT_FOUND: the desk holds no such requester."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "HELP_DESK_NOT_ACTIVE: the desk is not active."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "JOB_NOT_STARTED: the job could not be started; try again in a moment."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Erase a requester's data
      description: "Start a job that erases the requester: they are signed out and cut off from the desk at once (a later sign-in with the same address is a new requester with no history), every message, attachment and email of their requests is deleted from the vault, each timeline event keeps only its type, sequence, visibility, time and who wrote it (a kind and an id), their requests' subjects and their own fields are emptied, a request of theirs still live is closed as resolved, with no update email, and the desk's exports of them are deleted. A legal hold on any of their requests refuses it; one placed while it runs stops it there, the job failed and what it erased already erased. Asked again for a requester erased already, it deletes only what an earlier erasure or an export left of them. Audited when it ends having erased anything. `confirmation` must be the requester's id, typed out. A company administrator who is a Manager of the desk, from their own session, with or without a seat, on a lapsed plan and an archived desk too, since answering a person's request for their erasure is a duty a lapse does not end."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - confirmation
              properties:
                confirmation:
                  type: string
                  description: The requester's id.
  /products/help-desk/requesters/{requester_id}/export:
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: requester_id
          in: path
          required: true
          schema:
            type: string
          description: The requester.
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "202":
          description: The job, queued; an export of the requester already queued or running is answered instead.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskJobStarted"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is not a company administrator who is a Manager of the desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access. NOT_FOUND: the desk holds no such requester."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "HELP_DESK_NOT_ACTIVE: the desk is not active. REQUESTER_ERASED: the requester was erased, so nothing of theirs is left to export."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "JOB_NOT_STARTED: the job could not be started; try again in a moment."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Export a requester's data
      description: "Start a job that writes what the desk holds of the requester that they could see (their own fields, each of their requests and its public timeline, every attachment with a single-use link) into files sealed in the desk's vault, and reports a single-use link to them (GET /products/help-desk/jobs/{job_id}). Internal notes and the desk's own records are left out. Audited when it completes. A company administrator who is a Manager of the desk, from their own session, with or without a seat, on a lapsed plan and an archived desk too, since answering a person's request for their data is a duty a lapse does not end. It finishes whatever the organization pays for: the files are sealed outside the storage pool's cap and every attachment is linked whatever the account can pay."
  /products/help-desk/requesters/{requester_id}/unblock:
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: requester_id
          in: path
          required: true
          schema:
            type: string
          description: The requester.
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: The requester as the unblock left them.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskRequesterDetails"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is not a Manager of the desk. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access. NOT_FOUND: the desk holds no such requester."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "REQUESTER_ERASED: the requester was erased. CONFLICT: the requester changed meanwhile; try again. HELP_DESK_NOT_ACTIVE: the desk is not active."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Unblock a requester
      description: Let the requester sign in and write again. Sessions and reply tokens the block ended stay ended. A Manager of the desk, from their own session; the organization must hold the help desk.
  /products/help-desk/routing-rules:
    get:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The routing rules.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskRoutingRules"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List the routing rules
      description: The desk's routing rules in order, the version a save is made against, and the rules that can never match. The desk's configurer (a company administrator, or its Manager), from their own session.
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
    put:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The rules as saved.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskRoutingRules"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: a rule is malformed (`details.rule` is its position), names no `actions.queue_id` or a queue that is not the desk's (`details.rule_id` and `details.queue_id` name the rule and the queue), appears twice, or names a `rule_id` the desk does not hold; or the save changes more than 98 rules."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the rules changed since they were loaded; reload them and try again. CONFLICT with `details.reason` `queues_changed`: a queue of the desk was created, renamed or deleted while the save was made; read the queues again and save the same rules again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Save the routing rules
      description: "Save the whole ordered list against the `version` the caller loaded: a rule without `rule_id` is new, and a saved rule missing from the list is removed. At most 100 rules; one save adds, changes or removes at most 98. Rules run once, when a request is created, and the first enabled rule that matches wins. The desk's configurer (a company administrator, or its Manager), from their own session; the organization must hold the help desk."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - rules
                - version
              properties:
                rules:
                  type: array
                  maxItems: 100
                  items:
                    $ref: "#/components/schemas/HelpDeskRoutingRuleInput"
                version:
                  type: integer
                  minimum: 0
                  description: The `version` the list was loaded at; 0 before the first save.
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/routing-rules/apply:
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "202":
          description: The job, queued; a re-apply already queued or running is answered instead.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskJobStarted"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk. LICENSE_REQUIRED: the caller does not hold a Full License. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "HELP_DESK_NOT_ACTIVE: the desk is not active."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "JOB_NOT_STARTED: the job could not be started; try again in a moment."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Apply the routing rules to existing tickets
      description: "Start a job that routes every live ticket nobody is assigned to, as it stood when the job started, by the saved rules: the first rule a ticket matches sets its queue and priority, as at its arrival. Assigned and closed tickets are left as they are. A company administrator or a Manager of the desk, from their own session, with a Full License; the organization must hold the help desk."
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/routing-rules/test:
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The match.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskRoutingTestResult"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: a rule is malformed (`details.rule` is its position), or `sample` has no `requester_email`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Test routing rules against a sample
      description: Which of the rules sent a sample request would match, saving nothing. The desk's configurer (a company administrator, or its Manager), from their own session.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - rules
                - sample
              properties:
                rules:
                  type: array
                  maxItems: 100
                  items:
                    $ref: "#/components/schemas/HelpDeskRoutingRuleInput"
                sample:
                  type: object
                  required:
                    - requester_email
                  properties:
                    requester_email:
                      type: string
                    subject:
                      type: string
                    body:
                      type: string
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/saved-replies:
    get:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The saved replies.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - saved_replies
                    properties:
                      saved_replies:
                        type: array
                        items:
                          $ref: "#/components/schemas/HelpDeskSavedReply"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is a company administrator who holds no role on the desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List saved replies
      description: "The saved replies of the desk, by title: those shared across it and each queue's. Every role holder of the desk uses every one, from their own session."
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "201":
          description: The saved reply.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskSavedReply"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the title, body, scope or queue is malformed."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is a company administrator who holds no role on the desk. FORBIDDEN: the scope is not one the operator's role keeps. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "SAVED_REPLY_LIMIT: the desk keeps its most saved replies, or this one would take their text past 2 MiB. CONFLICT: the operator's role on the desk changed while it was being written; nothing is written. CONFLICT with `details.reason` `queue_deleted` and `details.queue_id`: the queue it is filed under was deleted while it was being written; nothing is written, and it is filed under another queue or shared with everyone on the desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Save a reply
      description: "Save a reply for reuse, its author the caller: one shared across the desk (kept by its Managers) or a queue's (kept by its Managers and Agents; a Trainee keeps none). The save rides with the caller's role as their session's gate read it. A desk keeps at most 500 saved replies, holding 2 MiB of text between them (each counted as its title and body take in the list), so one list answers them all. The organization must hold the help desk."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/HelpDeskSavedReplyInput"
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/saved-replies/{saved_reply_id}:
    patch:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: saved_reply_id
          in: path
          required: true
          schema:
            type: string
          description: The saved reply.
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: The saved reply as written.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskSavedReply"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: a field is malformed."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is a company administrator who holds no role on the desk. FORBIDDEN: the operator does not keep this reply: its scope is not one their role keeps, or another member wrote it and they are not a Manager of the desk. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access. NOT_FOUND: no such saved reply the operator may use."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: it changed since it was loaded. CONFLICT: the operator's role on the desk changed while it was being written; nothing is written. CONFLICT with `details.reason` `queue_deleted` and `details.queue_id`: the queue it is filed under was deleted while it was being written; nothing is written, and it is filed under another queue or shared with everyone on the desk. SAVED_REPLY_LIMIT: the change would take the desk's saved replies past 2 MiB of text."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Change a saved reply
      description: Change a saved reply the operator keeps, against the `version` loaded. A queue's reply is kept by the desk's Managers and Agents, one shared across the desk by its Managers, and one another member wrote (its `created_by`) by a Manager alone; a Trainee keeps none, and every role holder uses every one. The organization must hold the help desk.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - patch
                - version
              properties:
                patch:
                  type: object
                  additionalProperties: false
                  properties:
                    title:
                      type: string
                      maxLength: 80
                    body_markup:
                      type: string
                    scope:
                      type: string
                      enum:
                        - org
                        - queue
                    queue_id:
                      type:
                        - string
                        - "null"
                version:
                  type: integer
                  minimum: 1
    delete:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: saved_reply_id
          in: path
          required: true
          schema:
            type: string
          description: The saved reply.
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "204":
          description: Deleted.
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is a company administrator who holds no role on the desk. FORBIDDEN: the operator does not keep this reply: its scope is not one their role keeps, or another member wrote it and they are not a Manager of the desk. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access. NOT_FOUND: no such saved reply the operator may use."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: it changed while it was being deleted; it is kept. CONFLICT: the operator's role on the desk changed while it was being written; nothing is written."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Delete a saved reply
      description: Delete a saved reply the operator keeps. A queue's reply is kept by the desk's Managers and Agents, one shared across the desk by its Managers, and one another member wrote (its `created_by`) by a Manager alone; a Trainee keeps none, and every role holder uses every one. The organization must hold the help desk.
  /products/help-desk/settings:
    get:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The settings; null until the desk's first activation.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    oneOf:
                      - $ref: "#/components/schemas/HelpDeskSettings"
                      - type: "null"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read the help desk settings
      description: "The desk's settings, with the version a change is made against and the vault its requests are sealed in; null until the first activation. A role holder of the desk or a company administrator, from their own session: an API key or an impersonated session is refused. An organization whose help desk subscription lapsed still reads them."
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
    put:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The settings as written.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskSettings"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: `version` or a field of `patch` is malformed, or `patch` names a field the settings do not have (`details.unknown`)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access. NOT_FOUND: `custom_domain` is not one of the organization's own domains."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the settings changed since they were loaded; reload them and try again. HELP_DESK_NOT_ACTIVE: the desk was never activated, or a custom domain was selected while it is not active. DOMAIN_NOT_READY: `custom_domain` is not prepared for the help desk yet (`details.domain`, `details.product` help_desk), or its email does not reach the help desk: its MX names another host, or a flattened record left it none (`details.reason` mail_not_routed), or none of its nameservers answered (`details.reason` dns_unreachable; try again)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`. RATE_LIMIT_EXCEEDED is also the answer once the organization has made its 10 sending-domain selections this hour; `Retry-After` carries the seconds until the budget reopens. DNS_CHECK_TOO_SOON: the domain's DNS was checked under 30 seconds ago; try again after `Retry-After`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "EMAIL_SETUP_BUSY: another request is setting up the organization's email (`Retry-After` carries 5 seconds), or email setup is busy right now; repeat the request in a moment. INTERNAL_ERROR: this deployment cannot send the help desk's email."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Change the help desk settings
      description: "Change the settings `patch` names, against the `version` the caller loaded: a save made after another one landed is refused and writes nothing. A patch that changes nothing answers the settings as they stand. Changing `customer_auth_preference` ends every customer session started before it. Selecting `custom_domain` needs the desk active, the domain prepared (POST /domains/{domain}/help-desk: its ownership verified, a subdomain, its web ready) and its MX naming the help desk's inbound host, which a CNAME to help.sv carries; the desk's portal moves to it at once and its email once it also sends and receives. null clears it. Each change to a domain that passes those checks spends one of the organization's 10 sending-domain selections an hour, shared with Notify's `email.sending_domain`; a refused change spends none. The MX check spends the domain's DNS check budget, so a selection within 30 seconds of the domain's last check is answered 429 DNS_CHECK_TOO_SOON. The desk's configurer (a company administrator, or its Manager), from their own session; the organization must hold the help desk."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/HelpDeskSettingsChange"
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/settings/icon:
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The settings as written.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskSettings"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the body is not one PNG `icon` and its `version`, or the image is not a square PNG from 48 to 1024 pixels (`details.field` icon)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the settings changed since they were loaded. HELP_DESK_NOT_ACTIVE: the desk was never activated."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "413":
          description: "PAYLOAD_TOO_LARGE: the icon is larger than 512 KB."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Upload the help desk icon
      description: "The desk's browser icon (favicon): the customer portal shows it once it loads the desk, and the next knowledge base publication copies it into the help center, whose own themes otherwise supply one (a preset with fixed branding keeps its own icons). One square PNG from 48 to 1024 pixels a side, at most 512 KB; a multiple of 48 pixels suits search results. Sent against the settings `version` the caller loaded; a new icon replaces the old one, whose image is deleted. The desk's configurer (a company administrator, or its Manager), from their own session; the organization must hold the help desk."
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - icon
                - version
              properties:
                icon:
                  type: string
                  format: binary
                version:
                  type: string
                  description: The settings version, as a decimal string.
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
    delete:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The settings as written.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskSettings"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is neither a company administrator nor a Manager of the desk. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the settings changed since they were loaded. HELP_DESK_NOT_ACTIVE: the desk was never activated."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Remove the help desk icon
      description: Remove the desk's browser icon and delete its image, against the settings `version` the caller loaded. The portal returns to its neutral mark, and the help center to its theme's icon at its next publication. A desk with no icon answers its settings as they stand. The desk's configurer (a company administrator, or its Manager), from their own session.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - version
              properties:
                version:
                  type: integer
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/settings/status:
    get:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The desk's status.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskStatus"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read the help desk status
      description: Whether the desk is active and takes customers now, how its customers sign in, the hosts its portal and email use, and the selected custom domain's readiness. A role holder of the desk or a company administrator, from their own session.
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/support/analytics:
    get:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: Assistance cohorts and preceding period.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskSupportAnalytics"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: choose a real calendar range of one to 366 days, ending no later than today."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: an operator session is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller is not a Manager of this desk, or the credential is an API key or an impersonated session."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the caller does not see the desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read desk-wide assistance outcomes
      description: "The desk's Manager only: company administration alone does not grant it. Every outcome stays in its original account-local start-day cohort. resolution_pct = solved / eligible; answered_outcomes_pct = solved / (solved + eligible_contact_requested). Unknown and unavailable remain explicit; neither is inferred success or failure. Ticket creations are server-confirmed, once per ticket and attempt. Figures are advisory, not unique people or proof of tickets avoided. Read at most 366 days; incomplete reports are marked partial."
      parameters:
        - name: from
          in: query
          required: true
          schema:
            type: string
            format: date
        - name: to
          in: query
          required: true
          schema:
            type: string
            format: date
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/tickets:
    get:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: A page of the queue.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskQueuePage"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: a query parameter the queue does not take (`details.unknown` names each), or a view, status, queue, priority, requester or `q` it does not read. INVALID_CURSOR: the cursor is another view's."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is a company administrator who holds no role on the desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "HELP_DESK_NOT_ACTIVE: the desk is not active."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List the queue
      description: "One page of a queue view: `all` (the whole desk, or one queue with `queue_id`), `queue` (one queue's), `mine` (the signed-in operator's) or `unassigned`, in the statuses asked for (at most four; open for all and queue, every live status for mine and unassigned), newest activity first (`last_activity`) or the least recent activity first (`oldest_waiting`), a ticket's activity being its latest event of any kind, internal ones included. `requester_id` lists one requester's tickets, in the order they were opened (newest first, or oldest first with `oldest_waiting`), narrowed by the view and the filters. `q` finds one ticket by its number, or lists the tickets of the requester an email address names, as `requester_id` does. Each row carries its requester and who is on it now. A role holder of the desk, from their own session."
      parameters:
        - name: view
          in: query
          required: false
          schema:
            type: string
            enum:
              - all
              - mine
              - unassigned
              - queue
        - name: status
          in: query
          required: false
          schema:
            type: array
            items:
              type: string
              enum:
                - open
                - waiting_on_customer
                - on_hold
                - closed
          description: Repeat for several, at most four.
        - name: queue_id
          in: query
          required: false
          schema:
            type: string
          description: One of the desk's queues, or none for the tickets in no queue.
        - name: assignee_id
          in: query
          required: false
          schema:
            type: string
        - name: priority
          in: query
          required: false
          schema:
            type: array
            items:
              type: string
              enum:
                - urgent
                - high
                - normal
                - low
        - name: q
          in: query
          required: false
          schema:
            type: string
          description: "A ticket number (#1042 or 1042), or a requester's email address: the tickets of the requester it names, as requester_id lists them, and none for an address no requester holds."
        - name: requester_id
          in: query
          required: false
          schema:
            type: string
          description: One requester's tickets, by the requester's id.
        - name: sort
          in: query
          required: false
          schema:
            type: string
            enum:
              - last_activity
              - oldest_waiting
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: Continuation token from the previous page.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 50
          description: "A page-size hint: a value above 100 reads as 100, and a missing, zero, negative or non-numeric one as 50."
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "201":
          description: The request it opened, or the one an earlier send of it opened, as an operator reads it.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskTicket"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: `request_id` is no message id; the address is not deliverable, or not an active member's at a desk admitting its own organization's members alone; the subject or message is missing or too long; the name is too long or holds markup. `details.field` names the request id, address, subject or message refused."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "402":
          description: "QUOTA_EXCEEDED: the vault's storage cannot take the message."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is a company administrator who holds no role on the desk. FORBIDDEN: the caller is a Trainee of the desk (`details.reason` operator_in_training). LICENSE_REQUIRED: the caller does not hold a Full License. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "REQUESTER_BLOCKED: the desk blocked the customer. REQUESTER_ERASED: the customer's data is being erased. CONFLICT: the customer, or the caller's role on the desk, changed meanwhile; send again. DRAFT_EXPIRED: the request was sent again a day or more after a send of it that failed: send it under a new `request_id`. HELP_DESK_NOT_ACTIVE: the desk is not active."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the address names no customer yet, and the organization's help desks have taken the new customers they take in an hour. A portal's first sign-in, an email's new sender and an operator's new request share them. A customer the desk already holds is not counted. `Retry-After` carries the seconds until the budget reopens, and `details` carries `limit` and `resets_at`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "BUDGET_UNAVAILABLE: a budget the request spends could not be counted, so the request was refused rather than let through uncounted; `Retry-After` carries the seconds to wait before trying again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Open a request for a customer
      description: "Open a request for a customer, with the operator's message to them as its first message: a phone call or a visit written up, or the desk writing first. The customer is the requester the address names at the desk, created as an email's sender is when none does (a new customer counts among the new customers the desk takes in an hour); `name` names one who has none, and never replaces a name the customer gave. A desk whose ticket portal admits its own organization's members alone (every employee desk) takes the address of an active member alone; one admitting another organization's members takes any address, and asks that organization's directory nothing. The request is routed as every new request is (a rule's queue and priority; with no rule, no queue), moves to the desk's status after a reply, is assigned to the operator and alerts nobody; the customer is emailed the message as every reply is emailed. The address, subject and message are read, and the queue decided, before the customer is found or created. `request_id` is named once per composed request and sent with every send of it while its fields stand unchanged: a send made again, a double-click among them, answers the request the first opened and opens nothing more. Files join with a reply once it is open. A Manager or an Agent of the desk holding a Full License: a Trainee's replies wait for a Manager's approval, so a Trainee opens none. The organization must hold the help desk."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - request_id
                - email
                - subject
                - body
              properties:
                request_id:
                  type: string
                  pattern: ^hdev_[A-Za-z0-9_-]+$
                  maxLength: 128
                  description: "The id the send is named by: a message id, the same on every send of the request."
                email:
                  type: string
                  format: email
                  description: The customer's address, read in its canonical (trimmed, lowercased) form.
                name:
                  type: string
                  maxLength: 100
                  description: The name the operator knows them by. One line.
                subject:
                  type: string
                  maxLength: 200
                body:
                  type: string
                  description: "The operator's message: safe markup, at most 65536 bytes."
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/tickets/bulk:
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: Which tickets changed, which were left as they were, and which could not be written.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - updated
                      - stale
                      - failed
                    properties:
                      updated:
                        type: array
                        items:
                          type: string
                      stale:
                        type: array
                        items:
                          type: string
                      failed:
                        type: array
                        items:
                          type: object
                          required:
                            - ticket_id
                            - code
                          properties:
                            ticket_id:
                              type: string
                            code:
                              type: string
                              description: The error code the ticket's write failed with, as an error answer would carry it.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the ticket list or the change is malformed, or names a queue or assignee the desk cannot use. INVALID_TRANSITION: the status move is malformed: a status no ticket has, a close naming neither resolved nor spam, a hold not ending within the next year."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is a company administrator who holds no role on the desk. LICENSE_REQUIRED: the caller does not hold a Full License. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Change several tickets
      description: One change to up to 100 tickets, each made on the ticket as it stands; a ticket the change does not fit now is left as it was and named in `stale`, and a ticket whose write failed is named in `failed` with the code of its error, so the change can be made again on it. Every ticket's write has ended when the change is answered. A change malformed whatever the ticket is refused before any ticket is written, with the 400 a change to one ticket answers. Needs a Full License; the organization must hold the help desk.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - ticket_ids
                - patch
              properties:
                ticket_ids:
                  type: array
                  minItems: 1
                  maxItems: 100
                  items:
                    type: string
                patch:
                  $ref: "#/components/schemas/HelpDeskTicketPatch"
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/tickets/counts:
    get:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The counts.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskQueueCounts"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is a company administrator who holds no role on the desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "HELP_DESK_NOT_ACTIVE: the desk is not active."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read the queue counts
      description: The desk's live tickets by status and unassigned, and the signed-in operator's own. A role holder of the desk, from their own session.
      parameters:
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
  /products/help-desk/tickets/{ticket_id}:
    get:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: ticket_id
          in: path
          required: true
          schema:
            type: string
          description: The ticket.
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: The ticket.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskTicket"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is a company administrator who holds no role on the desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access. NOT_FOUND: the desk holds no such ticket."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "HELP_DESK_NOT_ACTIVE: the desk is not active."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read a ticket
      description: A ticket with its requester. A hold whose time has passed wakes on this read. A role holder of the desk, from their own session.
    patch:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: ticket_id
          in: path
          required: true
          schema:
            type: string
          description: The ticket.
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: What the change did.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskTicketWrite"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: a field is malformed (a close reason or a hold's end beside a status it does not belong to among them), or names a queue or assignee the desk cannot use. INVALID_TRANSITION: the status move is malformed (a status no ticket has, a close naming neither resolved nor spam, a hold not ending within the next year) or not allowed from the ticket's status."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is a company administrator who holds no role on the desk. LICENSE_REQUIRED: the caller does not hold a Full License. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access. NOT_FOUND: the desk holds no such ticket."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the ticket changed since it was loaded, your role on the desk changed while the change was being saved, or a reopen keeps the ticket with an assignee whose role changed meanwhile; load it again. CONFLICT with `details.reason` `queue_deleted` and `details.queue_id`: the queue it moves to was deleted meanwhile; choose another. HELP_DESK_NOT_ACTIVE: the desk is not active."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Change a ticket
      description: "Change its status (with a close reason, or a hold's end), priority, queue or assignee, against the `version` held: a ticket that moved on since refuses the change. Reopening a closed ticket counts as a reopen. Needs a Full License; the organization must hold the help desk."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - patch
                - version
              properties:
                patch:
                  $ref: "#/components/schemas/HelpDeskTicketPatch"
                version:
                  type: integer
                  minimum: 1
  /products/help-desk/tickets/{ticket_id}/attachments/initiate:
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: ticket_id
          in: path
          required: true
          schema:
            type: string
          description: The ticket.
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: The upload.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskAttachmentUpload"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "ATTACHMENT_REFUSED: the file's name is missing, too long or one a file cannot be stored under, or it ends in no extension a ticket accepts. A ticket accepts images (.jpg, .jpeg, .png, .gif, .webp, .heic, .heif, .bmp, .tif, .tiff, .avif), documents (.pdf, .docx, .xlsx, .pptx, .txt, .csv, .tsv, .log, .json) and recordings (.mp4, .mov, .webm, .m4a, .mp3, .wav), and no other file. `details.reason` names which. VALIDATION_ERROR: a malformed size."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "402":
          description: "PLAN_REQUIRED or QUOTA_EXCEEDED: the organization cannot pay for the upload."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is a company administrator who holds no role on the desk. LICENSE_REQUIRED: the caller does not hold a Full License. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access. NOT_FOUND: the desk holds no such ticket."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "TICKET_MERGED: the ticket was merged into another."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "413":
          description: "PAYLOAD_TOO_LARGE: the file is past the size an attachment may be."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: too many uploads to the ticket this hour, or too many waiting to be sent; `details.resets_at` says when."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "BUDGET_UNAVAILABLE: a budget the request spends could not be counted, so the request was refused rather than let through uncounted; `Retry-After` carries the seconds to wait before trying again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Start an attachment upload
      description: "Begin an operator's upload to a ticket (at most 104857600 bytes; a customer's are capped at 26214400): the browser streams the file to `forge_url`, and a reply names `attachment_id` once it is stored. An operator holds at most 20 uploads waiting to be sent per ticket. An upload is recorded on the ticket, so it moves the ticket's `version`, and answers it: a change sent with the version loaded before it answers 409 CONFLICT, and one sent with the answered `version` (when it is one past the version held) lands. Needs a Full License; the organization must hold the help desk."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - size_bytes
              properties:
                name:
                  type: string
                  description: "The file's name, which alone decides whether the ticket takes the file and what type it is stored under: the type its extension registers, whatever type the browser reports for it."
                size_bytes:
                  type: integer
                  minimum: 1
  /products/help-desk/tickets/{ticket_id}/attachments/{attachment_id}:
    delete:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: ticket_id
          in: path
          required: true
          schema:
            type: string
          description: The ticket.
        - name: attachment_id
          in: path
          required: true
          schema:
            type: string
          description: The upload, as its start answered it.
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: What the cancel did.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - cancelled
                    properties:
                      cancelled:
                        type: boolean
                        description: Whether an upload of the operator's was cancelled.
                      version:
                        type: integer
                        description: The ticket's version once the cancel is recorded; present when one was.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is a company administrator who holds no role on the desk. LICENSE_REQUIRED: the caller does not hold a Full License. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access. NOT_FOUND: the desk holds no such ticket."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Cancel an attachment upload
      description: "Cancel one of the operator's own uploads waiting to be sent on the ticket, a file they removed before sending it: the upload is deleted and frees one of the uploads the operator may hold waiting. An upload a message already carries, another's, or one already gone is left as it is, and answered `cancelled: false`, so a cancel sent again changes nothing. A cancel recorded on the ticket moves its `version` and answers it, as an upload's start does. Needs a Full License; the organization must hold the help desk."
  /products/help-desk/tickets/{ticket_id}/claim:
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: ticket_id
          in: path
          required: true
          schema:
            type: string
          description: The ticket.
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: What the claim did.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskTicketWrite"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is a company administrator who holds no role on the desk. LICENSE_REQUIRED: the caller does not hold a Full License. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access. NOT_FOUND: the desk holds no such ticket."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: it is closed, someone else took it first (`details.assignee_id`), it changed since it was loaded, or your role on the desk changed while the claim was being saved."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Claim a ticket
      description: Take an unassigned live ticket, against the `version` held; a ticket that is already the caller's is answered as it stands, so a claim sent twice lands once. Needs a Full License; the organization must hold the help desk.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - version
              properties:
                version:
                  type: integer
                  minimum: 1
  /products/help-desk/tickets/{ticket_id}/events:
    get:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: ticket_id
          in: path
          required: true
          schema:
            type: string
          description: The ticket.
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: Continuation token from the previous page.
        - name: after_seq
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
          description: "The newest event `seq` the client holds every event through. Asks of the newest page alone: never sent with `cursor`."
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: A page of the timeline.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskTimelinePage"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the cursor is not one this timeline issued, or `after_seq` is no whole number of zero or more, or comes with a cursor."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is a company administrator who holds no role on the desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access. NOT_FOUND: the desk holds no such ticket."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "HELP_DESK_NOT_ACTIVE: the desk is not active."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read a ticket's timeline
      description: "One page of the ticket's events, newest first, internal ones included; the cursor walks back to earlier ones. A message whose body cannot be read now is a gap (its `body` null), never a failed page. The bodies a page reads are metered to the organization's bandwidth. A poll for new activity names the newest `seq` it holds every event through (`after_seq`): while no event landed after it, the answer is no events and no cursor, and no page is read or metered; once one has, it is the newest page, as without it. A role holder of the desk, from their own session."
  /products/help-desk/tickets/{ticket_id}/held/{held_id}/discard:
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: ticket_id
          in: path
          required: true
          schema:
            type: string
          description: The ticket that holds the email.
        - name: held_id
          in: path
          required: true
          schema:
            type: string
          description: The held email, as its `email_held` event names it.
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: What the discard did.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskTicketWrite"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is a company administrator who holds no role on the desk. LICENSE_REQUIRED: the caller does not hold a Full License. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access. NOT_FOUND: the ticket holds no such email."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "HELD_EMAIL_SETTLED: the email was released or discarded already. LEGAL_HOLD: the ticket is under legal hold. HELP_DESK_NOT_ACTIVE: the desk is not active."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Discard a held email
      description: Delete an email the desk held and its original, recording `email_discarded`. A ticket under legal hold keeps it. Needs a Full License; the organization must hold the help desk.
  /products/help-desk/tickets/{ticket_id}/held/{held_id}/release:
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: ticket_id
          in: path
          required: true
          schema:
            type: string
          description: The ticket that holds the email.
        - name: held_id
          in: path
          required: true
          schema:
            type: string
          description: The held email, as its `email_held` event names it.
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: What the release did.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskTicketWrite"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "402":
          description: The vault's storage cannot take the message.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is a company administrator who holds no role on the desk. LICENSE_REQUIRED: the caller does not hold a Full License. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access. NOT_FOUND: the ticket holds no such email, or its original is gone."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "HELD_EMAIL_SETTLED: the email was released or discarded already. HELD_EMAIL_NOT_RELEASABLE: the requester is blocked, gone, or erased or being erased, the email carries nothing the desk takes, or the ticket's merges lead nowhere (`details.reason`). HELP_DESK_NOT_ACTIVE: the desk is not active."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Release a held email
      description: "Let an email the desk held, because its sender could not be verified as the requester, into the ticket as the requester's message, read again from its original (`provenance: released`), in the one write that marks it released. A ticket merged since hands the message to the ticket its merges lead to. Needs a Full License; the organization must hold the help desk."
  /products/help-desk/tickets/{ticket_id}/legal-hold:
    put:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: ticket_id
          in: path
          required: true
          schema:
            type: string
          description: The ticket.
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: "What the change did: the ticket as written and the event it appended (none when nothing changed)."
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskTicketWrite"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "204":
          description: "The change, on a deactivated desk: made, with nothing its closed vault would have to open."
        "400":
          description: "VALIDATION_ERROR: `held` is not a boolean, or `reason` is missing, too long or holds markup."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is not a company administrator who holds a role on the desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access. NOT_FOUND: the desk holds no such ticket."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the ticket kept changing while the hold was being saved; try again. HELP_DESK_VAULT_DELETING: a hold placed while the company's Help Desk vault (`details.vault_id`) is being deleted, with the ticket."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Place or clear a legal hold
      description: "While a ticket is on legal hold, nothing on it can be deleted or erased, its requester cannot be erased, and neither the company's Help Desk vault nor the organization's account can be deleted. Once that vault's deletion runs, deleting every request stored in it, no hold is placed; one is still cleared. Placing a hold on a held ticket, or clearing one that is not held, changes nothing. The reason is kept with the hold and on the timeline event the change appends; the change is audited. A deactivated desk keeps its holds, and they are placed and cleared there too, so its account can come to be deleted: its vault is closed, so the change is answered with no body. An organization whose subscription lapsed places and clears its holds as well: an admin, with or without a seat, on a lapsed plan too, so its account can come to be deleted. A company administrator who holds a role on the desk, from their own session, on an archived desk too."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - held
                - reason
              properties:
                held:
                  type: boolean
                  description: true places the hold; false clears it.
                reason:
                  type: string
                  maxLength: 500
                  description: Why.
  /products/help-desk/tickets/{ticket_id}/merge:
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: ticket_id
          in: path
          required: true
          schema:
            type: string
          description: The ticket.
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: What the merge did to the merged ticket.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskTicketWrite"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the tickets are one, are different requesters', one is merged already, the ticket is closed, or the other is closed."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is a company administrator who holds no role on the desk. LICENSE_REQUIRED: the caller does not hold a Full License. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access. NOT_FOUND: the desk holds no such ticket."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: either ticket changed since it was loaded. REPLY_REVIEWS_PENDING: the ticket has replies awaiting review or rewriting; settle those reviews first."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Merge a ticket into another
      description: Close the ticket as a duplicate of another live request of the same requester, both against the versions held; the requester is emailed the merge, and later messages to the ticket land on the other. Undoable for 86400 seconds. Needs a Full License; the organization must hold the help desk.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - into_ticket_id
                - version
                - into_version
              properties:
                into_ticket_id:
                  type: string
                version:
                  type: integer
                into_version:
                  type: integer
  /products/help-desk/tickets/{ticket_id}/notes:
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: ticket_id
          in: path
          required: true
          schema:
            type: string
          description: The ticket.
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: What the note did.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskTicketWrite"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the body is empty or too long, or a mention is not an active member."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is a company administrator who holds no role on the desk. LICENSE_REQUIRED: the caller does not hold a Full License. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access. NOT_FOUND: the desk holds no such ticket."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "STALE_TICKET: a message landed since `last_seen_event_id`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Add an internal note
      description: "A note in safe markup that only the desk reads: its words are emailed to nobody, and it moves no status. The members it mentions, its writer aside, are alerted on the organization's alert route (`alerts_delivery` in the desk's status): its own Notify when it holds Notify, else one email each from SparkVault. The alert names the request's number and nothing of the note. `last_seen_event_id` guards it as a reply's does. Needs a Full License; the organization must hold the help desk."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - body
                - last_seen_event_id
              properties:
                body:
                  type: string
                  description: Safe markup, at most 65536 bytes.
                mentions:
                  type: array
                  maxItems: 20
                  items:
                    type: string
                  description: Active members' user ids.
                last_seen_event_id:
                  type: string
  /products/help-desk/tickets/{ticket_id}/presence:
    put:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: ticket_id
          in: path
          required: true
          schema:
            type: string
          description: The ticket.
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: Who is on the ticket now.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - presence
                    properties:
                      presence:
                        type: array
                        items:
                          $ref: "#/components/schemas/HelpDeskPresenceEntry"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: `state` is neither viewing nor replying."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is a company administrator who holds no role on the desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access. NOT_FOUND: the desk holds no such ticket."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "PRESENCE_UNAVAILABLE: who is on the ticket cannot be told right now; the heartbeat recorded nothing. The next beat tries again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Say you are on a ticket
      description: The signed-in operator's heartbeat on a ticket (viewing it, or writing to it), answering who is on it now. A role holder of the desk, from their own session.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - state
              properties:
                state:
                  type: string
                  enum:
                    - viewing
                    - replying
  /products/help-desk/tickets/{ticket_id}/replies:
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: ticket_id
          in: path
          required: true
          schema:
            type: string
          description: The ticket.
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: What the reply did.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskTicketWrite"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the body is empty or too long, an attachment is not one of the operator's stored uploads on the ticket, or `review_id` is no message id."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "402":
          description: "QUOTA_EXCEEDED: the vault's storage cannot take the message."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is a company administrator who holds no role on the desk. LICENSE_REQUIRED: the caller does not hold a Full License. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access. NOT_FOUND: the desk holds no such ticket."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "STALE_TICKET: a message landed since `last_seen_event_id`: review it, then send again. TICKET_MERGED: the ticket was merged into another (`details.merged_into_number`). CONFLICT: `review_id` names another operator's held reply, or a reply held on another ticket in the same second (`details.field`): name the reply anew; or the caller's role on the desk, or that of the assignee a reply reopening the ticket keeps it with, changed while the reply was being sent: send again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Reply to the customer
      description: "A public reply in safe markup, with the operator's own stored uploads attached. The ticket moves to `status_after` (the desk's default when absent), an unassigned ticket goes to the replier while the desk auto-assigns on first reply, and the requester is emailed. `last_seen_event_id` is the newest event the operator had seen: a message that landed since refuses the reply. Needs a Full License; the organization must hold the help desk. For a Trainee of the desk, the response instead includes a pending `review`: the reply and attachments stay private, the status is unchanged and no customer update is queued until a Manager of the desk approves. The role is decided on the server whatever the client shows. A held reply is submitted under the `review_id` its client named it by: sent again under it unchanged, after a lost answer or a refusal, a reply this operator's earlier send already held answers with that `review` as it stands now and no events, and nothing is held again."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - body
                - last_seen_event_id
              properties:
                body:
                  type: string
                  description: Safe markup, at most 65536 bytes.
                attachments:
                  type: array
                  maxItems: 20
                  items:
                    type: string
                status_after:
                  type: string
                  enum:
                    - waiting_on_customer
                    - open
                last_seen_event_id:
                  type: string
                review_id:
                  type: string
                  pattern: ^hdev_[A-Za-z0-9_-]+$
                  maxLength: 128
                  description: "For a Trainee: the id the reply is held under, named once per composed reply and sent with every send of it while its words and files stand unchanged. Drawn by the desk when absent."
  /products/help-desk/tickets/{ticket_id}/reply-reviews/{review_id}/approve:
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: ticket_id
          in: path
          required: true
          schema:
            type: string
          description: The ticket.
        - name: review_id
          in: path
          required: true
          schema:
            type: string
          description: The held review.
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: The sent reply and review.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskTicketWrite"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is not a Manager of the desk. FORBIDDEN: the reply is the caller's own: another Manager of the desk decides it. LICENSE_REQUIRED: the caller does not hold a Full License. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access. NOT_FOUND: the desk holds no such review or ticket."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the review or the caller's role changed, or the review is no longer pending. STALE_TICKET: a new message arrived. TICKET_MERGED: reply on the merged ticket."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Approve and send a held reply
      description: A Manager of the desk who holds a Full License approves another operator's held reply. Publishes exactly one reply under the original rep, applies its requested status, records the response in analytics and queues the customer update. The Manager must have read the latest message; the review version must still match, and so must the Manager's role.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - version
                - last_seen_event_id
              properties:
                version:
                  type: integer
                  minimum: 1
                last_seen_event_id:
                  type: string
  /products/help-desk/tickets/{ticket_id}/reply-reviews/{review_id}/discard:
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: ticket_id
          in: path
          required: true
          schema:
            type: string
          description: The ticket.
        - name: review_id
          in: path
          required: true
          schema:
            type: string
          description: The held review.
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: The discarded review and private event.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskTicketWrite"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the reason is blank or too long."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is not a Manager of the desk. LICENSE_REQUIRED: the caller does not hold a Full License. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access. NOT_FOUND: the desk holds no such review or ticket."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the review changed or was already settled."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Discard a held reply without sending it
      description: A Manager of the desk who holds a Full License ends a pending or returned review with a required private reason, including after its original author leaves or loses their Full License. This settles the review count without changing the ticket status or sending customer content. The draft, feedback and held files remain private history until requester erasure. Concurrent approval or another decision cannot also settle the review.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - version
                - reason
              properties:
                version:
                  type: integer
                  minimum: 1
                reason:
                  type: string
                  minLength: 1
                  maxLength: 4000
  /products/help-desk/tickets/{ticket_id}/reply-reviews/{review_id}/reject:
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: ticket_id
          in: path
          required: true
          schema:
            type: string
          description: The ticket.
        - name: review_id
          in: path
          required: true
          schema:
            type: string
          description: The held review.
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: The returned review and internal event.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskTicketWrite"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the comment is blank or too long."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is not a Manager of the desk. FORBIDDEN: the reply is the caller's own: another Manager of the desk decides it. LICENSE_REQUIRED: the caller does not hold a Full License. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access. NOT_FOUND: the desk holds no such review or ticket."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the review or the caller's role changed, or the review is no longer pending."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Return a held reply with feedback
      description: A Manager of the desk who holds a Full License returns another operator's pending reply. A nonempty comment tells the author what to rewrite; the reply and comment remain private, and no customer update is sent.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - version
                - comment
              properties:
                version:
                  type: integer
                  minimum: 1
                comment:
                  type: string
                  minLength: 1
                  maxLength: 4000
  /products/help-desk/tickets/{ticket_id}/reply-reviews/{review_id}/resubmit:
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: ticket_id
          in: path
          required: true
          schema:
            type: string
          description: The ticket.
        - name: review_id
          in: path
          required: true
          schema:
            type: string
          description: The returned review.
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: The resubmitted review.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskTicketWrite"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the rewritten body or desired status is invalid."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is a company administrator who holds no role on the desk. FORBIDDEN: the caller is not the reply's author. LICENSE_REQUIRED: the caller does not hold a Full License. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access. NOT_FOUND: the desk holds no such review or ticket."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the review changed or is not returned. STALE_TICKET: a new message arrived. TICKET_MERGED: reply on the merged ticket."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Resubmit a rewritten reply
      description: Only the original author, holding a role on the desk, may resubmit a returned review. Keeps the selected held attachments and feedback history, seals the rewritten body and returns it to the desk's approvals. Omit attachments to keep them all, or pass a subset to exclude files from the reply. Removed files stay private with the review history until erasure. This action never sends to the customer, including after the author is promoted.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - version
                - body
                - last_seen_event_id
              properties:
                version:
                  type: integer
                  minimum: 1
                body:
                  type: string
                  description: Safe markup, at most 65536 bytes.
                last_seen_event_id:
                  type: string
                status_after:
                  type: string
                  enum:
                    - waiting_on_customer
                    - open
                attachments:
                  type: array
                  maxItems: 20
                  items:
                    type: string
                  description: A subset of this review's held attachment ids. Empty removes every attachment from the revised reply.
  /products/help-desk/tickets/{ticket_id}/unmerge:
    post:
      tags:
        - help-desk
      security:
        - BearerAuth: []
      parameters:
        - name: ticket_id
          in: path
          required: true
          schema:
            type: string
          description: The ticket.
        - name: desk_id
          in: query
          required: false
          schema:
            type: string
          description: Select the original acc_ or named hdd_ desk. Omitted selects the original desk; an unknown or inaccessible explicit ID never falls back to another desk. Desk membership and the operation's current permissions still apply.
      responses:
        "200":
          description: What the undo did.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/HelpDeskTicketWrite"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "INVALID_TRANSITION: the ticket is not merged, or the merge is past its undo window."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the credential is an API key or an impersonated session, or the caller is not an active member of the organization, or the caller is a company administrator who holds no role on the desk. LICENSE_REQUIRED: the caller does not hold a Full License. HELP_DESK_SUBSCRIPTION_REQUIRED: the organization does not hold the help desk."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "HELP_DESK_NOT_FOUND: the desk (`desk_id`, else the organization's original desk) is not one the caller sees: a company administrator sees every desk, anyone else the current desks they hold a role on with Help Desk access. NOT_FOUND: the desk holds no such ticket."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the ticket changed since it was loaded, or the role of the assignee the undo keeps it with changed while it was being saved."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Undo a merge
      description: Give the ticket back the status it had before its merge, while the merge can still be undone; an assignee who can no longer hold tickets (no longer an active member with a Full License) is taken off it. Needs a Full License; the organization must hold the help desk.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - version
              properties:
                version:
                  type: integer
                  minimum: 1
  /products/identity:
    get:
      tags:
        - identity
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Identity (`details.products`: identity). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
    put:
      tags:
        - identity
      security:
        - BearerAuth: []
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Identity (`details.products`: identity). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
  /products/identity/.well-known/oauth-authorization-server/{account_id}:
    get:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/.well-known/web-identity:
    get:
      tags:
        - identity
      security: []
      responses:
        default:
          description: Response
  /products/identity/clients:
    get:
      tags:
        - identity
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Identity (`details.products`: identity). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
    post:
      tags:
        - identity
      security:
        - BearerAuth: []
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Identity (`details.products`: identity). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
  /products/identity/clients/{client_id}:
    delete:
      tags:
        - identity
      security:
        - BearerAuth: []
      parameters:
        - name: client_id
          in: path
          required: true
          schema:
            type: string
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Identity (`details.products`: identity). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
  /products/identity/favicon.ico:
    get:
      tags:
        - identity
      security: []
      responses:
        default:
          description: Response
  /products/identity/fedcm/accounts:
    get:
      tags:
        - identity
      security: []
      responses:
        default:
          description: Response
  /products/identity/fedcm/login:
    get:
      tags:
        - identity
      security: []
      responses:
        default:
          description: Response
  /products/identity/federation/discover:
    post:
      tags:
        - identity
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The connection values the provider publishes.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - issuer
                      - authorization_endpoint
                      - token_endpoint
                      - userinfo_endpoint
                      - jwks_uri
                      - id_token_signing_alg_values
                      - token_endpoint_auth_methods
                      - authorization_response_iss_parameter_supported
                      - prompt_values_supported
                    properties:
                      issuer:
                        type: string
                        format: uri
                      authorization_endpoint:
                        type: string
                        format: uri
                      token_endpoint:
                        type: string
                        format: uri
                      userinfo_endpoint:
                        type:
                          - string
                          - "null"
                        format: uri
                      jwks_uri:
                        type: string
                        format: uri
                      id_token_signing_alg_values:
                        type: array
                        minItems: 1
                        items:
                          type: string
                          enum:
                            - RS256
                            - PS256
                            - ES256
                            - EdDSA
                        description: The algorithms the provider lists that a connection may name.
                      token_endpoint_auth_methods:
                        type: array
                        minItems: 1
                        items:
                          type: string
                          enum:
                            - client_secret_basic
                            - client_secret_post
                        description: The client authentication methods the provider lists that a connection may use.
                      authorization_response_iss_parameter_supported:
                        type: boolean
                        description: Whether the provider sends the RFC 9207 `iss` with its answer.
                      prompt_values_supported:
                        type:
                          - array
                          - "null"
                        items:
                          type: string
                        description: The `prompt` values the provider lists, or null when it lists none; a silent first attempt needs `none`.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the issuer is missing, not an https URL on a public host, or carries a query, credentials or fragment."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "402":
          description: "PLAN_REQUIRED: Identity is not active for the account."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller is not an organization admin in a human session. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Identity (`details.products`: identity). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "422":
          description: "DISCOVERY_UNREACHABLE: the discovery document could not be read; DISCOVERY_ISSUER_MISMATCH: it names another issuer; DISCOVERY_INCOMPLETE: it lacks an endpoint, the code flow, S256 or a usable algorithm; JWKS_UNUSABLE: the key set could not be read or holds no key for a usable algorithm."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account spent its 30 identity provider discoveries this hour."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read an OpenID Connect provider's settings from its issuer
      description: "Fills the identity provider connection form: reads the issuer's `/.well-known/openid-configuration` and its key set, checks them, and answers the values a connection stores. Nothing is stored, and no sign-in ever reads discovery: a connection always stores explicit endpoints. The issuer must be an https URL on a public host with no query, credentials or fragment; each provider call is held to public addresses, 64 KiB and 5 seconds, and follows no redirect. The document is taken only when it names exactly this issuer, publishes usable authorization, token and key set endpoints, supports the code flow (and S256 when it lists PKCE methods) and an asymmetric signature algorithm (RS256, PS256, ES256 or EdDSA) its key set holds a key for. Organization admins only, with Identity active; each call spends one of the account's 30 discoveries an hour, after the issuer is checked and before anything is called. A refusal names one fixed reason and none of the provider's words."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - issuer
              properties:
                issuer:
                  type: string
                  format: uri
                  maxLength: 2048
                  description: The provider's issuer, exactly as its id_tokens name it.
  /products/identity/federation/identities/{svid}:
    delete:
      tags:
        - identity
      security:
        - BearerAuth: []
      parameters:
        - name: svid
          in: path
          required: true
          schema:
            type: string
          description: The person's SVID.
      responses:
        "200":
          description: The person is erased.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - deleted
                      - svid
                    properties:
                      deleted:
                        const: true
                      svid:
                        type: string
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the path does not name an SVID."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller is not an organization admin in a human session. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Identity (`details.products`: identity). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no person of this account's directory has this SVID."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: a merge or another erasure holds the identity; retry once it settles."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Erase a person your identity provider signed in
      description: "Erases one person of the account's own directory, everything that names them included: their sessions, activity, connected sites, public profile and notification preferences, their directory index row, and the identity itself. Only a person the account's own identity provider signed in qualifies; any other SVID, and one that does not exist, is answered 404 alike, so the route tells no account about another's people. Organization admins only. A lapsed Identity subscription does not block it. Each erasure is audited as `federated_identity_erased`."
  /products/identity/portal/account:
    delete:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      responses:
        default:
          description: Response
  /products/identity/portal/activity:
    get:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      responses:
        default:
          description: Response
  /products/identity/portal/authenticator:
    get:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      responses:
        default:
          description: Response
  /products/identity/portal/authenticator/confirm:
    post:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      responses:
        default:
          description: Response
  /products/identity/portal/authenticator/provision:
    post:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      responses:
        default:
          description: Response
  /products/identity/portal/authenticator/recovery-codes:
    post:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      responses:
        default:
          description: Response
  /products/identity/portal/authenticator/{id}:
    delete:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/portal/email:
    post:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      responses:
        default:
          description: Response
    delete:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      responses:
        default:
          description: Response
  /products/identity/portal/email/verify:
    post:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      responses:
        default:
          description: Response
  /products/identity/portal/lockdown:
    post:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      responses:
        default:
          description: Response
  /products/identity/portal/logout:
    post:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      responses:
        default:
          description: Response
  /products/identity/portal/me:
    get:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      responses:
        default:
          description: Response
  /products/identity/portal/passkey/register/handoff:
    post:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      responses:
        default:
          description: Response
  /products/identity/portal/passkey/{credentialId}:
    delete:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      parameters:
        - name: credentialId
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/portal/phone:
    post:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      responses:
        default:
          description: Response
    delete:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      responses:
        default:
          description: Response
  /products/identity/portal/phone/verify:
    post:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      responses:
        default:
          description: Response
  /products/identity/portal/profile:
    patch:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      responses:
        default:
          description: Response
  /products/identity/portal/profile/akas:
    post:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      responses:
        default:
          description: Response
  /products/identity/portal/profile/akas/{aka_id}:
    patch:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      parameters:
        - name: aka_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
    delete:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      parameters:
        - name: aka_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/portal/public-profile:
    get:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      responses:
        default:
          description: Response
    patch:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      responses:
        default:
          description: Response
  /products/identity/portal/public-profile/avatar:
    put:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      responses:
        default:
          description: Response
    delete:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      responses:
        default:
          description: Response
  /products/identity/portal/public-profile/identifiers:
    put:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      responses:
        default:
          description: Response
  /products/identity/portal/sessions:
    get:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      responses:
        default:
          description: Response
  /products/identity/portal/sessions/revoke-others:
    post:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      responses:
        default:
          description: Response
  /products/identity/portal/sessions/{id}:
    delete:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/portal/sites:
    get:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      responses:
        default:
          description: Response
  /products/identity/portal/sites/{accountId}:
    patch:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      parameters:
        - name: accountId
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/portal/sites/{accountId}/notifications:
    get:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      parameters:
        - name: accountId
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
    put:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      parameters:
        - name: accountId
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/portal/social:
    get:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      responses:
        default:
          description: Response
  /products/identity/portal/social/complete:
    post:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      responses:
        default:
          description: Response
  /products/identity/portal/social/{provider}:
    post:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      parameters:
        - name: provider
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
    delete:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      parameters:
        - name: provider
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/portal/step-up/otp:
    post:
      tags:
        - identity
      security:
        - IdentityPortalToken: []
      responses:
        default:
          description: Response
  /products/identity/resource-introspection:
    post:
      tags:
        - identity
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "200":
          description: The token verdict.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    oneOf:
                      - type: object
                        required:
                          - active
                        properties:
                          active:
                            const: false
                      - type: object
                        required:
                          - active
                          - iss
                          - sub
                          - svid
                          - aud
                          - client_id
                          - exp
                          - iat
                          - token_type
                          - scope
                          - session_id
                          - token_version
                        properties:
                          active:
                            const: true
                          iss:
                            type: string
                            format: uri
                          sub:
                            type: string
                          svid:
                            type: string
                          aud:
                            type: string
                            format: uri
                          client_id:
                            type: string
                          exp:
                            type: integer
                          iat:
                            type: integer
                          token_type:
                            const: access
                          scope:
                            const: mcp
                          session_id:
                            type: string
                          token_version:
                            type: integer
                            minimum: 0
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: token and resource must be supplied."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller may not act on this account. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Identity (`details.products`: identity). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: Token verification could not complete because a dependency or internal operation failed.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Inspect an OAuth token for your resource
      description: Core authentication selects the resource owner. The resource must be an exact canonical HTTPS URI under a verified domain of that account. Checks the signed access token, resource audience, mcp scope, client, SVID, live session version, expiry and connected-site block. Invalid tokens return active:false; dependency failures return an error, never an inactive verdict. Credential responses are not cached.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - token
                - resource
              properties:
                token:
                  type: string
                  minLength: 1
                  maxLength: 16384
                resource:
                  type: string
                  format: uri
                  maxLength: 2048
  /products/identity/robots.txt:
    get:
      tags:
        - identity
      security: []
      responses:
        default:
          description: Response
  /products/identity/social/{provider}/callback:
    get:
      tags:
        - identity
      security: []
      parameters:
        - name: provider
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
    post:
      tags:
        - identity
      security: []
      parameters:
        - name: provider
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}:
    get:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/.well-known/jwks.json:
    get:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/.well-known/openid-configuration:
    get:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/authorize:
    get:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/backup-verification/send:
    post:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/backup-verification/verify:
    post:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/config:
    get:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/consent:
    post:
      tags:
        - identity
      security:
        - IdentityHubSessionCookie: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
          description: The issuer account.
      responses:
        "200":
          description: "An approval or denial: a page that sends the browser to the validated client callback by its refresh, with a link to it."
          content:
            text/html:
              schema:
                type: string
        "303":
          description: "After sign_out: hosted account selection for the same pending request."
          headers:
            Location:
              schema:
                type: string
                format: uri
        "400":
          description: "A page saying why: a malformed form, or a request that can no longer be decided (it lapsed, it was answered otherwise, or the approval a repeat names issued no code)."
          content:
            text/html:
              schema:
                type: string
        "401":
          description: "A page saying why: a submission from another origin, or a browser that no longer proves the selected identity."
          content:
            text/html:
              schema:
                type: string
        "500":
          description: The sign-in fault page.
          content:
            text/html:
              schema:
                type: string
      summary: Approve or deny a resource grant, or sign out to switch accounts
      description: Requires the Identity origin, the browser hub cookie, a signed pending authorization request, and its selected identity. The decision spends the request in one conditioned write that records it, then answers a page on the Identity origin that sends the browser to the client callback with code or access_denied, state and issuer, by a navigation of its own rather than a redirect of the form POST, so a callback that redirects onward still receives it; an approval the account cannot be read for answers server_error the same way and spends the request too. A platform resource approval names the chosen organization. The same decision for the same identity, submitted again while the request lives (a double click on the page), is answered with the same page once the code it carries is issued, and issues nothing more; any other decision of a decided request is refused. The sign_out action removes only the selected account from the browser hub roster, clears its selection and fresh-login proof on the open request, and returns to the account chooser with the same pending request, without granting or denying access. Resource grants always require an explicit decision, including after SSO. The page is a native form, so every refusal is a page in the browser window, never a JSON error.
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
                - auth_request
                - svid
                - decision
              properties:
                auth_request:
                  type: string
                  maxLength: 128
                svid:
                  type: string
                  maxLength: 128
                decision:
                  type: string
                  enum:
                    - approve
                    - deny
                    - sign_out
                organization:
                  type: string
                  maxLength: 128
                  description: The organization a platform resource approval connects, one the platform lists for the person. A platform resource's deny or sign_out ignores it; any decision on a tenant resource that names one is refused.
  /products/identity/{account_id}/end_session:
    get:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
    post:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/entropy:
    post:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        "201":
          description: The draw.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - value
                      - num_bytes
                    properties:
                      value:
                        type: string
                        description: The bytes as unpadded base64url.
                      num_bytes:
                        type: integer
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: `num_bytes` is not an integer from 1 to 64. ORIGIN_NOT_ALLOWED: the browser's origin is not one of the account's own origins (its verified domains)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: this network address has started too many sign-ins this hour, whichever account each named. `Retry-After` carries the seconds until the budget reopens, and `details` carries `limit`, `used` and `resets_at`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Draw an authorization request's random values (sign-in pages)
      description: "The draw a page that holds no SparkVault credential takes its sign-in values from: an authorization request's PKCE verifier, state and nonce, which the browser SDK's `signIn()` and the hosted sign-in pages draw here. Every call first spends one draw of its network address's hourly budget, before anything is read, counted whichever account the path names, and the call past it is refused 429 with nothing drawn. A browser on an origin the account has not verified is then refused, with nothing drawn."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - num_bytes
              properties:
                num_bytes:
                  type: integer
                  minimum: 1
                  maximum: 64
                  description: "Bytes to draw: 1 to 64."
  /products/identity/{account_id}/fedcm/assertion:
    post:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/fedcm/client_metadata:
    get:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/fedcm/config.json:
    get:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/federation:
    get:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
          description: The issuer account.
        - name: auth_request_id
          in: query
          required: false
          schema:
            type: string
          description: The OIDC authorization request this sign-in continues.
        - name: redirect_uri
          in: query
          required: false
          schema:
            type: string
            format: uri
          description: A redirect URI the account registered; required without `auth_request_id`.
        - name: state
          in: query
          required: false
          schema:
            type: string
          description: Returned to `redirect_uri` unchanged.
        - name: client_id
          in: query
          required: false
          schema:
            type: string
        - name: nonce
          in: query
          required: false
          schema:
            type: string
        - name: code_challenge
          in: query
          required: false
          schema:
            type: string
        - name: code_challenge_method
          in: query
          required: false
          schema:
            type: string
            enum:
              - S256
        - name: opener_origin
          in: query
          required: false
          schema:
            type: string
        - name: prompt
          in: query
          required: false
          schema:
            type: string
            enum:
              - none
          description: Try the provider silently first.
      responses:
        "302":
          description: To the provider's authorization endpoint, with the binding cookie set.
          headers:
            Location:
              schema:
                type: string
                format: uri
            Set-Cookie:
              schema:
                type: string
        "400":
          description: "A page saying why: the connection is off or incomplete, the return is not registered, or the request names a verify session."
          content:
            text/html:
              schema:
                type: string
        "429":
          description: A page saying this network address has started too many sign-ins this hour, whichever account each named.
          content:
            text/html:
              schema:
                type: string
        "500":
          description: The sign-in fault page.
          content:
            text/html:
              schema:
                type: string
      summary: Start a sign-in with the account's own identity provider (browser)
      description: "A browser navigation that sends the person to the identity provider the account connected (OpenID Connect or OAuth 2.0), with S256 PKCE, a single-use state, a nonce for OpenID Connect, and the account's own callback. Takes the same return parameters as a social start: an OIDC `auth_request_id`, or a `redirect_uri` the account registered, with the `state`, `nonce` and PKCE challenge the completion carries back to it. `prompt=none` asks for a silent attempt, honoured only while the connection allows one. Sets the `__Host-authsv_fed` cookie that binds the sign-in to this browser. Spends one draw of the network address's hourly budget. A refusal is a page in fixed words."
  /products/identity/{account_id}/federation/callback:
    get:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
          description: The issuer account.
        - name: code
          in: query
          required: false
          schema:
            type: string
        - name: state
          in: query
          required: true
          schema:
            type: string
        - name: iss
          in: query
          required: false
          schema:
            type: string
            format: uri
        - name: error
          in: query
          required: false
          schema:
            type: string
      responses:
        "302":
          description: To the sign-in's return, the binding cookie cleared.
          headers:
            Location:
              schema:
                type: string
                format: uri
        "400":
          description: "A page saying why: the sign-in expired or was used, it was started in another browser, it came back from another provider, the connection changed, the provider refused it, or the person is locked down or blocked this account."
          content:
            text/html:
              schema:
                type: string
        "403":
          description: "A page saying why: the account cannot sign anyone in right now (its Identity capacity or trial), or the person belongs to another organization."
          content:
            text/html:
              schema:
                type: string
        "500":
          description: The sign-in fault page.
          content:
            text/html:
              schema:
                type: string
      summary: The identity provider's return (browser)
      description: "Where the account's identity provider returns the person. Completes only in the browser that started the sign-in, once, for this account: the state is spent first, whatever else the return carries. An RFC 9207 `iss` must name the connection's issuer, and is required when the connection says its provider sends one. The connection must still be the one the start sent the person to. The person signs in to this account alone. On success it redirects to the sign-in's return with its token or code; on a provider error, to the return with `#error=federation_failed`, or for a silent attempt with `#error=interaction_required&method=federation` (one interactive attempt instead when the provider is the account's only method). The provider's words never reach the page."
  /products/identity/{account_id}/introspect:
    post:
      tags:
        - identity
      security:
        - OidcClientSecretBasic: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/otp/send:
    post:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/otp/verify:
    post:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/passkey/check:
    post:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/passkey/list:
    get:
      tags:
        - identity
      security:
        - IdentityAccessToken: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/passkey/popup:
    get:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/passkey/register:
    post:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/passkey/register/complete:
    post:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/passkey/register/from-spark:
    post:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/passkey/verify:
    post:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        "201":
          description: The WebAuthn request options and the ceremony session.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - options
                      - session
                    properties:
                      options:
                        type: object
                        description: WebAuthn PublicKeyCredentialRequestOptions (base64url challenge).
                      session:
                        type: object
                        required:
                          - sessionId
                          - challenge
                          - rpId
                        properties:
                          sessionId:
                            type: string
                          challenge:
                            type: string
                          rpId:
                            type: string
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: passkeys are not enabled for the account, an identifier or action is malformed, or the identifier (or, for a discoverable start, the network address) is backed off after failed sign-ins; the message gives the wait."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: this network address has started too many sign-ins this hour, whichever account each named. `Retry-After` carries the seconds until the budget reopens, and `details` carries `limit`, `used` and `resets_at`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Start a passkey sign-in ceremony
      description: Answers the WebAuthn request options for a passkey sign-in and a one-shot ceremony session that `/passkey/verify/complete` consumes. An optional `email` or `phone` scopes the ceremony to that person's passkeys; without one it is discoverable. An optional `action` descriptor (or its `action_hash`) binds the ceremony to the action it approves. Every start spends one draw of its network address's hourly budget before anything is read or written, counted whichever account the path names; the start past it is refused 429 with nothing drawn or stored.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  description: Scopes the ceremony to this person's passkeys.
                phone:
                  type: string
                  description: E.164. Scopes the ceremony to this person's passkeys; not with `email`.
                action:
                  type: object
                  description: The action this ceremony approves, hashed onto the signed result.
                action_hash:
                  type: string
                  description: The action's hash, instead of `action`.
  /products/identity/{account_id}/passkey/verify/complete:
    post:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/passkey/{credential_id}:
    delete:
      tags:
        - identity
      security:
        - IdentityAccessToken: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
        - name: credential_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/recommendations/dismiss:
    post:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/revoke:
    post:
      tags:
        - identity
      security:
        - OidcClientSecretBasic: []
        - {}
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/saml/{provider}:
    get:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
        - name: provider
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/saml/{provider}/acs:
    post:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
        - name: provider
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/second-factor:
    get:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/second-factor/verify:
    post:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/signin:
    get:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/signin/handoff:
    post:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/signin/redeem:
    post:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/signin/verify-origin:
    get:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/social/{provider}:
    get:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
        - name: provider
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/sparklink/result:
    get:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/sparklink/send:
    post:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/sparklink/verify:
    get:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/sso:
    get:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/sso/accounts:
    get:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/sso/continue:
    post:
      tags:
        - identity
      security:
        - IdentityHubSessionCookie: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/sso/remove:
    post:
      tags:
        - identity
      security:
        - IdentityHubSessionCookie: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/token:
    post:
      tags:
        - identity
      security:
        - OidcClientSecretBasic: []
        - {}
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/userinfo:
    get:
      tags:
        - identity
      security:
        - IdentityAccessToken: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
    post:
      tags:
        - identity
      security:
        - IdentityAccessToken: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/identity/{account_id}/verify:
    get:
      tags:
        - identity
      security: []
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/messaging/conversations:
    post:
      tags:
        - messaging
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        default:
          description: Response
  /products/messaging/conversations/{conversationId}:
    get:
      tags:
        - messaging
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: conversationId
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/messaging/conversations/{conversationId}/archive:
    put:
      tags:
        - messaging
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: conversationId
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/messaging/conversations/{conversationId}/attachments:
    post:
      tags:
        - messaging
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: conversationId
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/messaging/conversations/{conversationId}/attachments/{ingotId}/download:
    get:
      tags:
        - messaging
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: conversationId
          in: path
          required: true
          schema:
            type: string
        - name: ingotId
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/messaging/conversations/{conversationId}/close:
    put:
      tags:
        - messaging
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: conversationId
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/messaging/conversations/{conversationId}/invites:
    post:
      tags:
        - messaging
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: conversationId
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/messaging/conversations/{conversationId}/legal-hold:
    put:
      tags:
        - messaging
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: conversationId
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/messaging/conversations/{conversationId}/messages:
    get:
      tags:
        - messaging
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: conversationId
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
    post:
      tags:
        - messaging
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: conversationId
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/messaging/conversations/{conversationId}/messages/{messageId}/recall:
    post:
      tags:
        - messaging
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: conversationId
          in: path
          required: true
          schema:
            type: string
        - name: messageId
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/messaging/conversations/{conversationId}/messages/{messageId}/receipt:
    get:
      tags:
        - messaging
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: conversationId
          in: path
          required: true
          schema:
            type: string
        - name: messageId
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/messaging/conversations/{conversationId}/opt-out:
    put:
      tags:
        - messaging
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: conversationId
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/messaging/conversations/{conversationId}/participants:
    post:
      tags:
        - messaging
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: conversationId
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/messaging/conversations/{conversationId}/participants/{svid}:
    delete:
      tags:
        - messaging
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: conversationId
          in: path
          required: true
          schema:
            type: string
        - name: svid
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/messaging/conversations/{conversationId}/read:
    post:
      tags:
        - messaging
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: conversationId
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /products/messaging/healthz:
    get:
      tags:
        - messaging
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        default:
          description: Response
  /products/messaging/inbox:
    get:
      tags:
        - messaging
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        default:
          description: Response
  /products/notify/config:
    get:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "200":
          description: The account configuration.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/NotifyConfigResponse"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the message names the offending field."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller may not act on this account. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read Notify configuration
      description: "The account categories, channel defaults, retention, security floor, event webhook, destinations and the domain its email is selected to go out from. `effective` is what sends resolve against; `overrides` is only what this account changed. No credential is ever returned: a signing secret reads as `secret_set`, and the event webhook's, the webhook destination's and the Teams workflow's URL each as `*_set` and `*_host`."
    put:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "200":
          description: The updated configuration.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/NotifyConfigResponse"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the message names the offending field. A promotional category (`marketing` or `product`) made required is refused, naming it in `details.category`, so its email always offers an unsubscribe and honors it. `help_desk_alert` deleted or made required is refused the same way, so each member's own choice on auth.sv decides whether the help desk's alerts reach them. A destination is refused when it lists `security` (`details.category`), lists a category the account cannot send (`details.category`, beside `details.sendable_categories`, the ones it can), or, created, lacks a field (`details.missing`, `details.reason` `destination_incomplete`), which is also how a patch of a destination removed since it was read is refused. A webhook destination's `url`, or `events.webhook_url`, moved to another host or port without a new `secret` beside it is refused naming the secret's field, `details.missing` `['secret']`, `details.reason` `secret_required_on_new_host`: a signing secret never follows its URL to a different host. A Slack destination's `channel_name` in a patch is refused as an unknown field (`details.key`): the save sets it. A Slack destination's channel the SparkVault Slack app cannot post in is refused naming the field in `details.field` and why in `details.reason` (NotifySlackDestination)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "402":
          description: "USAGE_CREDITS_REQUIRED: a ladder names sms or voice once texts and calls are enabled, and the account does not use usage credits, which pay for every text and call; `details.field` names the field (a config write's ladder for one category names `delivery.channel_priority`, and `details.category` the category) and `details.channels` the channels refused, and nothing is sent or stored. A ladder the config already holds drops them at send time instead."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller may not act on this account, or a member who is not an org admin names an admin-only section (`details.sections` names them, `details.required_role` admin). NOTIFY_SUBSCRIPTION_REQUIRED: `email.sending_domain` names a domain other than the one selected, and the account holds no Notify tier (`details.product` notify, `details.action_required` what to do); nothing is set up or stored. NOTIFY_CHANNEL_NOT_AVAILABLE: a ladder names a channel Notify does not deliver (whatsapp, rcs, which Notify never sends, or sms or voice before texts and calls are enabled); `details.field` names the field (a config write's ladder for one category names `delivery.channel_priority`, and `details.category` the category) and `details.channels` the channels refused, and nothing is sent or stored. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: `email.sending_domain` is not one of the organization's own domains."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "DOMAIN_NOT_READY: `email.sending_domain` is not ready for Notify yet; its ownership and DKIM records must both be confirmed (`details.domain`, `details.product` notify). CONFLICT: other saves kept landing first. Each time one does, the patch is validated against the config it left and tried again, and it is refused once it has lost all `details.attempts` tries. Or Notify's sending domain changed while the patch naming it was saved. Either way nothing of the patch is stored: reload the config and patch again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`. RATE_LIMIT_EXCEEDED is also the answer once the organization has made its 10 sending-domain selections this hour; `Retry-After` carries the seconds until the budget reopens. SLACK_RATE_LIMITED: Slack is limiting the SparkVault Slack app, so the Slack destination's channel could not be prepared and nothing is stored; when Slack named a wait, `Retry-After` carries its seconds and `details.resets_at` the moment it ends."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "EMAIL_SETUP_BUSY: another request is setting up the organization's email (`Retry-After` carries 5 seconds), or email setup is busy right now; repeat the request in a moment. SLACK_DESTINATION_UNAVAILABLE: the Slack destination's channel could not be prepared yet, so nothing is stored; `Retry-After` carries the seconds to wait before saving again. INTERNAL_ERROR: this deployment cannot send Notify email."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Update Notify configuration
      description: Deep-merges a partial patch onto the stored overrides, so one category can be written without resending the rest. Send a category key with a null value to delete it. The `security`, `events`, `email` and `destinations` sections are an org admin's to change; any member may change the rest. A patch is validated whole before anything is written, so a refused patch stores nothing. Every save that lands is recorded in the account audit log as `notify_settings_changed`, naming who saved and the sections the patch named, never an endpoint or a secret.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/NotifyConfigPatch"
  /products/notify/destinations/{kind}/test:
    post:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: kind
          in: path
          required: true
          schema:
            type: string
            enum:
              - webhook
              - slack
              - teams
          description: The destination to post to.
      responses:
        "200":
          description: What became of the test post.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/NotifyDestinationTestResult"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: `kind` is not one of the destination kinds (`details.field` kind)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller may not act on this account, or is a member who is not an org admin (`details.sections` destinations, `details.required_role` admin). NOTIFY_SUBSCRIPTION_REQUIRED: the account holds no Notify tier (`details.product` notify, `details.action_required` what to do). PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: the account has no destination of `kind` to test. Add one in the config first."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "NOTIFY_SENDER_NAME_REQUIRED: the organization has no name, and the post shows it; set it in Settings, then test again. NOTIFY_SENDER_NAME_RESERVED: the organization's name reads as SparkVault or as a web address, or holds an at sign or a text-direction control character (`details.reason` reserved_name); rename the organization, then test again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`. RATE_LIMIT_EXCEEDED is also the answer once the account has made its 20 test posts to this kind this hour: `details` carries `limit`, `used` and `resets_at`, and `Retry-After` the seconds until the budget reopens."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Send a test post to a destination
      description: "Posts one fixed test message to the account's destination of `kind`, through the same sender a send's post takes, and answers what became of it, so an admin can check a webhook, a Slack channel or a Teams workflow without a real send. The post shows the title \"Test post from SparkVault Notify\" under the organization's name, held to the name rule a send is held to. A webhook receives a body signed like any other (`X-SparkVault-Signature`), typed `notify.destination.test`, naming no send, with a `delivery_id` of its own: `delivery_id`, `type`, `account_id`, `occurred_at`, `title`, `sender_name` and `body`. The post is made once, within 10 seconds, and never tried again. No send is stored, nothing is metered, and the test never appears in send history. Org admins only, and the account must hold Notify. Each account can test one kind 20 times an hour."
  /products/notify/email-sender:
    get:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "200":
          description: Who the organization's Notify email is from.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/NotifyEmailSender"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the message names the offending field."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller may not act on this account. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read who your Notify email is from
      description: "The address the organization's Notify email goes out from: its handle under send.sv, or the domain of its own that the config's email.sending_domain selects while that domain serves sending, with the selected domain's readiness."
  /products/notify/healthz:
    get:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
  /products/notify/inbox:
    get:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "200":
          description: A page of notifications.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/NotifyInboxPage"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the message names the offending field; a cursor that does not decode is one. INVALID_CURSOR: the cursor decoded but is not a position in this list: a hand-made cursor, or one another list issued. Cursors are never portable between lists; start the list again without one."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller may not act on this account. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: the account record is missing."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List a recipient inbox
      description: "The sender-side view of one recipient's notification list: your Notify inbox, which lists exactly the notifications delivered to them in_app. The row IS the in_app delivery: its ladder carries in_app, because the send named it or your config resolved it and the recipient left In-app on for your site (a `security` send crosses that switch), and it is listed when that step runs: as the send fans out when in_app leads the ladder, and only when the step comes due when it follows email. A notification whose ladder carries no in_app (a send naming email alone, a recipient who switched In-app off for your site on auth.sv on any send but a `security` one, one their own preferences or block refused, one no channel reaches), one whose in_app step has not delivered it (and never will once a stop ended its ladder first), and the per-recipient ceiling's skip are status records only: in no view, and a mark of one answers 404. Filtering happens after the page is read, so a short page with a live cursor means keep paging, not end of list. A notification past its send's history horizon is never listed. Each sealed row whose grant still opens carries the recipient's own pointer (`sparklink_code` and `pointer_url`), for the recipient's client to open, and a plaintext row its body: treat the answer as sensitive and keep it out of logs: on a sealed send at `verification_level: \"none\"` to a recipient addressed by id alone, the pointer opens the content, once, for whoever holds it."
      parameters:
        - name: recipient_id
          in: query
          required: true
          schema:
            type: string
          description: "The recipient whose inbox to read. Read in the form a send keys its recipient by (trimmed, with an email address lowercased the way Identity stores it), so the id or address as the send named it reads the same inbox. A value that is blank once trimmed, longer than 256 UTF-8 bytes, or holding a control character or noncharacter names no inbox and is rejected 400. A SparkVault user id (`usr_…`, as read) names a member's own inbox, which only that member reads, signed in to SparkVault: it is rejected 400 VALIDATION_ERROR before anything is read, and so is any id that only starts as one (`usr_`, `usr_x-1`). An email address is a mailbox whatever its local part."
        - name: state
          in: query
          required: false
          schema:
            type: string
            enum:
              - all
              - unseen
              - unread
              - archived
            default: all
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 50
          description: "A page-size hint: a value above 100 reads as 100, and a missing, zero, negative or non-numeric one as 50."
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: Continuation token from the previous page.
  /products/notify/inbox/state:
    post:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "200":
          description: The page was marked.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/NotifyInboxPageMarked"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the message names the offending field; a cursor that does not decode is one. INVALID_CURSOR: the cursor decoded but is not a position in this list: a hand-made cursor, or one another list issued. Cursors are never portable between lists; start the list again without one."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller may not act on this account. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Mark a recipient inbox in bulk
      description: Mark a page of notifications seen or read. Page size is fixed server-side; keep calling with the returned cursor until it is null. The cursor resumes after the last notification this call marked, and a cursor issued for the other state is a 400 INVALID_CURSOR. A notification past its send's history horizon is skipped. Archiving in bulk is deliberately not offered.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - recipient_id
                - state
              properties:
                recipient_id:
                  type: string
                  description: "The inbox owner. Read in the form a send keys its recipient by (trimmed, with an email address lowercased the way Identity stores it), so the id or address as the send named it reads the same inbox. A value that is blank once trimmed, longer than 256 UTF-8 bytes, or holding a control character or noncharacter names no inbox and is rejected 400. A SparkVault user id (`usr_…`, as read) names a member's own inbox, which only that member reads, signed in to SparkVault: it is rejected 400 VALIDATION_ERROR before anything is read, and so is any id that only starts as one (`usr_`, `usr_x-1`). An email address is a mailbox whatever its local part."
                state:
                  type: string
                  enum:
                    - seen
                    - read
                cursor:
                  type: string
                  description: Continuation token from the previous call.
  /products/notify/inbox/{notificationId}/state:
    post:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: notificationId
          in: path
          required: true
          schema:
            type: string
          description: The notification to mark.
      responses:
        "200":
          description: The notification was marked.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/NotifyInboxMarked"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the message names the offending field."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller may not act on this account. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such notification in this recipient's inbox: none by that id, one past its send's history horizon, or a status record the inbox never lists."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Mark one notification
      description: Set a notification to seen, read, or archived. `created_at` is the row sort key.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - recipient_id
                - created_at
                - state
              properties:
                recipient_id:
                  type: string
                  description: "The inbox owner. Read in the form a send keys its recipient by (trimmed, with an email address lowercased the way Identity stores it), so the id or address as the send named it reads the same inbox. A value that is blank once trimmed, longer than 256 UTF-8 bytes, or holding a control character or noncharacter names no inbox and is rejected 400. A SparkVault user id (`usr_…`, as read) names a member's own inbox, which only that member reads, signed in to SparkVault: it is rejected 400 VALIDATION_ERROR before anything is read, and so is any id that only starts as one (`usr_`, `usr_x-1`). An email address is a mailbox whatever its local part."
                created_at:
                  type: integer
                  description: Unix seconds, from the inbox row.
                state:
                  type: string
                  enum:
                    - seen
                    - read
                    - archived
  /products/notify/projects:
    get:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "200":
          description: Company projects.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - items
                    properties:
                      items:
                        type: array
                        items:
                          $ref: "#/components/schemas/NotifyProject"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: a project field is malformed or unsupported."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: an account credential is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: current company membership is required; project changes require an administrator. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: this account has no such project. Another account's project has the same answer."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the project changed concurrently or its lifecycle does not permit this operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List Notify projects
      description: Lists the company's named Notify projects, including archived projects. Existing account Notify appears as Default when it holds existing configuration, usage or a plan. This list creates no subscription.
    post:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "200":
          description: The new draft project.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/NotifyProject"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: a project field is malformed or unsupported."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: an account credential is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: current company membership is required; project changes require an administrator. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: this account has no such project. Another account's project has the same answer."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the project changed concurrently or its lifecycle does not permit this operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Create a draft Notify project
      description: An administrator creates a named project with independent configuration and recipient state. A draft has no paid allowance and sends nothing until its subscription activates. Creation charges nothing.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - name
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 80
                description:
                  type: string
                  maxLength: 240
                sender_name:
                  type:
                    - string
                    - "null"
                  maxLength: 64
                  description: Project sender display name. Null uses the organization name; reserved platform names are refused.
  /products/notify/projects/purchase:
    post:
      tags:
        - notify
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The project with its current plan, or a hosted checkout URL to complete payment.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - project
                    properties:
                      project:
                        $ref: "#/components/schemas/NotifyProject"
                      checkout_url:
                        type: string
                        format: uri
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: a project field is malformed or unsupported."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: an account credential is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: current company membership is required; project changes require an administrator. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: this account has no such project. Another account's project has the same answer."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the project changed concurrently or its lifecycle does not permit this operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Purchase a new Notify project
      description: An interactive, non-impersonated company administrator confirms the reviewed quote and names the project. The server creates the unpaid purchase record at confirmation, then charges the existing company subscription or returns a hosted checkout URL. The project gains access only after payment is verified. Reuse the preview's project_id to retry without creating another project. An increased charge requires a new review. API keys cannot authorize spending.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - name
                - project_id
                - quoted_amount_due_now_usd
                - proration_date
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 80
                description:
                  type: string
                  maxLength: 240
                sender_name:
                  type:
                    - string
                    - "null"
                  maxLength: 64
                  description: Project sender display name. Null uses the organization name; reserved platform names are refused.
                project_id:
                  type: string
                  pattern: ^ntp_[A-Za-z0-9_-]+$
                  maxLength: 128
                  description: The project_id returned by the purchase preview. Keep it when refreshing the quote or retrying this purchase.
                billing_model:
                  type: string
                  enum:
                    - usage_credits
                    - legacy
                  description: The company billing model. Omit to use the company's current model; a company without a subscription uses usage credits.
                notifications_per_month:
                  type: integer
                  minimum: 1
                  description: A published volume tier, required for an existing legacy company subscription.
                quoted_amount_due_now_usd:
                  type: string
                  description: The exact reviewed amount_due_now_usd decimal string.
                proration_date:
                  type: integer
                  minimum: 0
  /products/notify/projects/purchase/preview:
    post:
      tags:
        - notify
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The purchase quote and unpersisted project identity.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - project_id
                      - monthly_usd
                      - amount_due_now_usd
                      - currency
                      - proration_date
                      - effective_at
                      - checkout_required
                    oneOf:
                      - required:
                          - billing_model
                          - included_monthly_credits
                      - required:
                          - notifications_per_month
                    properties:
                      project_id:
                        type: string
                        pattern: ^(?:default|ntp_[A-Za-z0-9_-]+)$
                        maxLength: 128
                      notifications_per_month:
                        type: integer
                        minimum: 0
                      billing_model:
                        type: string
                        const: usage_credits
                      included_monthly_credits:
                        type: integer
                        minimum: 0
                      monthly_usd:
                        type: string
                        description: Exact decimal USD amount.
                      amount_due_now_usd:
                        type: string
                        description: Exact decimal USD amount to repeat when confirming.
                      currency:
                        type: string
                      proration_date:
                        type: integer
                        minimum: 0
                      effective_at:
                        type:
                          - integer
                          - "null"
                        description: Scheduled downgrade deadline; null for an immediate change.
                      checkout_required:
                        type: boolean
                        description: The company needs hosted checkout to create its first subscription.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: a project field is malformed or unsupported."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: an account credential is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: current company membership is required; project changes require an administrator. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: this account has no such project. Another account's project has the same answer."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the project changed concurrently or its lifecycle does not permit this operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Quote a new Notify project purchase
      description: An interactive, non-impersonated company administrator reviews the monthly price and immediate charge before creating a project. This preview creates no project and charges nothing. No project name is required. Repeat the returned project_id when refreshing a quote or confirming the purchase. API keys cannot authorize spending.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                project_id:
                  type: string
                  pattern: ^ntp_[A-Za-z0-9_-]+$
                  maxLength: 128
                  description: The project_id returned by the purchase preview. Keep it when refreshing the quote or retrying this purchase.
                billing_model:
                  type: string
                  enum:
                    - usage_credits
                    - legacy
                  description: The company billing model. Omit to use the company's current model; a company without a subscription uses usage credits.
                notifications_per_month:
                  type: integer
                  minimum: 1
                  description: A published volume tier, required for an existing legacy company subscription.
  /products/notify/projects/{projectId}:
    get:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            pattern: ^(?:default|ntp_[A-Za-z0-9_-]+)$
            maxLength: 128
          description: A project owned by the authenticated account. `default` addresses its existing Notify data.
      responses:
        "200":
          description: The project.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/NotifyProject"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: a project field is malformed or unsupported."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: an account credential is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: current company membership is required; project changes require an administrator. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: this account has no such project. Another account's project has the same answer."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the project changed concurrently or its lifecycle does not permit this operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read a Notify project
      description: Reads project metadata, billing state and cycle usage. Project ownership is resolved under the authenticated company, never by an account id supplied in the body.
    put:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            pattern: ^(?:default|ntp_[A-Za-z0-9_-]+)$
            maxLength: 128
          description: A project owned by the authenticated account. `default` addresses its existing Notify data.
      responses:
        "200":
          description: The updated project.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/NotifyProject"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: a project field is malformed or unsupported."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: an account credential is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: current company membership is required; project changes require an administrator. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: this account has no such project. Another account's project has the same answer."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the project changed concurrently or its lifecycle does not permit this operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Update Notify project metadata
      description: An administrator updates the project's name, description or sender name. Omitted fields retain their current values. Does not move data or change its subscription.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 80
                description:
                  type: string
                  maxLength: 240
                sender_name:
                  type:
                    - string
                    - "null"
                  maxLength: 64
                  description: Project sender display name. Null uses the organization name; reserved platform names are refused.
  /products/notify/projects/{projectId}/archive:
    post:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            pattern: ^(?:default|ntp_[A-Za-z0-9_-]+)$
            maxLength: 128
          description: A project owned by the authenticated account. `default` addresses its existing Notify data.
      responses:
        "200":
          description: The archived project.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/NotifyProject"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: a project field is malformed or unsupported."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: an account credential is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: current company membership is required; project changes require an administrator. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: this account has no such project. Another account's project has the same answer."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the project changed concurrently or its lifecycle does not permit this operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Archive a Notify project
      description: An administrator archives a named project after its paid plan has ended. Archiving does not erase history or receipts, and historical reads remain available. An archived project sends nothing and cannot be edited or reactivated. Default preserves existing integrations and cannot be archived.
  /products/notify/projects/{projectId}/config:
    get:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            pattern: ^(?:default|ntp_[A-Za-z0-9_-]+)$
            maxLength: 128
          description: A project owned by the authenticated account. `default` addresses its existing Notify data.
      responses:
        "200":
          description: The account configuration.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/NotifyConfigResponse"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the message names the offending field."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller may not act on this account. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read Notify configuration (project)
      description: "This operation is scoped to the named project; its send ids, configuration and recipient state are independent of other projects. Sending, testing a destination and selecting a new sending domain require that named project's own plan (403 NOTIFY_PROJECT_SUBSCRIPTION_REQUIRED); retained reads remain available. The account categories, channel defaults, retention, security floor, event webhook, destinations and the domain its email is selected to go out from. `effective` is what sends resolve against; `overrides` is only what this account changed. No credential is ever returned: a signing secret reads as `secret_set`, and the event webhook's, the webhook destination's and the Teams workflow's URL each as `*_set` and `*_host`."
    put:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            pattern: ^(?:default|ntp_[A-Za-z0-9_-]+)$
            maxLength: 128
          description: A project owned by the authenticated account. `default` addresses its existing Notify data.
      responses:
        "200":
          description: The updated configuration.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/NotifyConfigResponse"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the message names the offending field. A promotional category (`marketing` or `product`) made required is refused, naming it in `details.category`, so its email always offers an unsubscribe and honors it. `help_desk_alert` deleted or made required is refused the same way, so each member's own choice on auth.sv decides whether the help desk's alerts reach them. A destination is refused when it lists `security` (`details.category`), lists a category the account cannot send (`details.category`, beside `details.sendable_categories`, the ones it can), or, created, lacks a field (`details.missing`, `details.reason` `destination_incomplete`), which is also how a patch of a destination removed since it was read is refused. A webhook destination's `url`, or `events.webhook_url`, moved to another host or port without a new `secret` beside it is refused naming the secret's field, `details.missing` `['secret']`, `details.reason` `secret_required_on_new_host`: a signing secret never follows its URL to a different host. A Slack destination's `channel_name` in a patch is refused as an unknown field (`details.key`): the save sets it. A Slack destination's channel the SparkVault Slack app cannot post in is refused naming the field in `details.field` and why in `details.reason` (NotifySlackDestination)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "402":
          description: "USAGE_CREDITS_REQUIRED: a ladder names sms or voice once texts and calls are enabled, and the account does not use usage credits, which pay for every text and call; `details.field` names the field (a config write's ladder for one category names `delivery.channel_priority`, and `details.category` the category) and `details.channels` the channels refused, and nothing is sent or stored. A ladder the config already holds drops them at send time instead."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller may not act on this account, or a member who is not an org admin names an admin-only section (`details.sections` names them, `details.required_role` admin). NOTIFY_SUBSCRIPTION_REQUIRED: `email.sending_domain` names a domain other than the one selected, and the account holds no Notify tier (`details.product` notify, `details.action_required` what to do); nothing is set up or stored. NOTIFY_CHANNEL_NOT_AVAILABLE: a ladder names a channel Notify does not deliver (whatsapp, rcs, which Notify never sends, or sms or voice before texts and calls are enabled); `details.field` names the field (a config write's ladder for one category names `delivery.channel_priority`, and `details.category` the category) and `details.channels` the channels refused, and nothing is sent or stored. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: `email.sending_domain` is not one of the organization's own domains."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "DOMAIN_NOT_READY: `email.sending_domain` is not ready for Notify yet; its ownership and DKIM records must both be confirmed (`details.domain`, `details.product` notify). CONFLICT: other saves kept landing first. Each time one does, the patch is validated against the config it left and tried again, and it is refused once it has lost all `details.attempts` tries. Or Notify's sending domain changed while the patch naming it was saved. Either way nothing of the patch is stored: reload the config and patch again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`. RATE_LIMIT_EXCEEDED is also the answer once the organization has made its 10 sending-domain selections this hour; `Retry-After` carries the seconds until the budget reopens. SLACK_RATE_LIMITED: Slack is limiting the SparkVault Slack app, so the Slack destination's channel could not be prepared and nothing is stored; when Slack named a wait, `Retry-After` carries its seconds and `details.resets_at` the moment it ends."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "EMAIL_SETUP_BUSY: another request is setting up the organization's email (`Retry-After` carries 5 seconds), or email setup is busy right now; repeat the request in a moment. SLACK_DESTINATION_UNAVAILABLE: the Slack destination's channel could not be prepared yet, so nothing is stored; `Retry-After` carries the seconds to wait before saving again. INTERNAL_ERROR: this deployment cannot send Notify email."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Update Notify configuration (project)
      description: This operation is scoped to the named project; its send ids, configuration and recipient state are independent of other projects. Sending, testing a destination and selecting a new sending domain require that named project's own plan (403 NOTIFY_PROJECT_SUBSCRIPTION_REQUIRED); retained reads remain available. Deep-merges a partial patch onto the stored overrides, so one category can be written without resending the rest. Send a category key with a null value to delete it. The `security`, `events`, `email` and `destinations` sections are an org admin's to change; any member may change the rest. A patch is validated whole before anything is written, so a refused patch stores nothing. Every save that lands is recorded in the account audit log as `notify_settings_changed`, naming who saved and the sections the patch named, never an endpoint or a secret.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/NotifyConfigPatch"
  /products/notify/projects/{projectId}/destinations/{kind}/test:
    post:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            pattern: ^(?:default|ntp_[A-Za-z0-9_-]+)$
            maxLength: 128
          description: A project owned by the authenticated account. `default` addresses its existing Notify data.
        - name: kind
          in: path
          required: true
          schema:
            type: string
            enum:
              - webhook
              - slack
              - teams
          description: The destination to post to.
      responses:
        "200":
          description: What became of the test post.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/NotifyDestinationTestResult"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: `kind` is not one of the destination kinds (`details.field` kind)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller may not act on this account, or is a member who is not an org admin (`details.sections` destinations, `details.required_role` admin). NOTIFY_SUBSCRIPTION_REQUIRED: the account holds no Notify tier (`details.product` notify, `details.action_required` what to do). PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: the account has no destination of `kind` to test. Add one in the config first."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "NOTIFY_SENDER_NAME_REQUIRED: the organization has no name, and the post shows it; set it in Settings, then test again. NOTIFY_SENDER_NAME_RESERVED: the organization's name reads as SparkVault or as a web address, or holds an at sign or a text-direction control character (`details.reason` reserved_name); rename the organization, then test again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`. RATE_LIMIT_EXCEEDED is also the answer once the account has made its 20 test posts to this kind this hour: `details` carries `limit`, `used` and `resets_at`, and `Retry-After` the seconds until the budget reopens."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Send a test post to a destination (project)
      description: "This operation is scoped to the named project; its send ids, configuration and recipient state are independent of other projects. Sending, testing a destination and selecting a new sending domain require that named project's own plan (403 NOTIFY_PROJECT_SUBSCRIPTION_REQUIRED); retained reads remain available. Posts one fixed test message to the account's destination of `kind`, through the same sender a send's post takes, and answers what became of it, so an admin can check a webhook, a Slack channel or a Teams workflow without a real send. The post shows the title \"Test post from SparkVault Notify\" under the organization's name, held to the name rule a send is held to. A webhook receives a body signed like any other (`X-SparkVault-Signature`), typed `notify.destination.test`, naming no send, with a `delivery_id` of its own: `delivery_id`, `type`, `account_id`, `occurred_at`, `title`, `sender_name` and `body`. The post is made once, within 10 seconds, and never tried again. No send is stored, nothing is metered, and the test never appears in send history. Org admins only, and the account must hold Notify. Each account can test one kind 20 times an hour."
  /products/notify/projects/{projectId}/email-sender:
    get:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            pattern: ^(?:default|ntp_[A-Za-z0-9_-]+)$
            maxLength: 128
          description: A project owned by the authenticated account. `default` addresses its existing Notify data.
      responses:
        "200":
          description: Who the organization's Notify email is from.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/NotifyEmailSender"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the message names the offending field."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller may not act on this account. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read who your Notify email is from (project)
      description: "This operation is scoped to the named project; its send ids, configuration and recipient state are independent of other projects. Sending, testing a destination and selecting a new sending domain require that named project's own plan (403 NOTIFY_PROJECT_SUBSCRIPTION_REQUIRED); retained reads remain available. The address the organization's Notify email goes out from: its handle under send.sv, or the domain of its own that the config's email.sending_domain selects while that domain serves sending, with the selected domain's readiness."
  /products/notify/projects/{projectId}/inbox:
    get:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            pattern: ^(?:default|ntp_[A-Za-z0-9_-]+)$
            maxLength: 128
          description: A project owned by the authenticated account. `default` addresses its existing Notify data.
        - name: recipient_id
          in: query
          required: true
          schema:
            type: string
          description: "The recipient whose inbox to read. Read in the form a send keys its recipient by (trimmed, with an email address lowercased the way Identity stores it), so the id or address as the send named it reads the same inbox. A value that is blank once trimmed, longer than 256 UTF-8 bytes, or holding a control character or noncharacter names no inbox and is rejected 400. A SparkVault user id (`usr_…`, as read) names a member's own inbox, which only that member reads, signed in to SparkVault: it is rejected 400 VALIDATION_ERROR before anything is read, and so is any id that only starts as one (`usr_`, `usr_x-1`). An email address is a mailbox whatever its local part."
        - name: state
          in: query
          required: false
          schema:
            type: string
            enum:
              - all
              - unseen
              - unread
              - archived
            default: all
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 50
          description: "A page-size hint: a value above 100 reads as 100, and a missing, zero, negative or non-numeric one as 50."
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: Continuation token from the previous page.
      responses:
        "200":
          description: A page of notifications.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/NotifyInboxPage"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the message names the offending field; a cursor that does not decode is one. INVALID_CURSOR: the cursor decoded but is not a position in this list: a hand-made cursor, or one another list issued. Cursors are never portable between lists; start the list again without one."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller may not act on this account. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: the account record is missing."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List a recipient inbox (project)
      description: "This operation is scoped to the named project; its send ids, configuration and recipient state are independent of other projects. Sending, testing a destination and selecting a new sending domain require that named project's own plan (403 NOTIFY_PROJECT_SUBSCRIPTION_REQUIRED); retained reads remain available. The sender-side view of one recipient's notification list: your Notify inbox, which lists exactly the notifications delivered to them in_app. The row IS the in_app delivery: its ladder carries in_app, because the send named it or your config resolved it and the recipient left In-app on for your site (a `security` send crosses that switch), and it is listed when that step runs: as the send fans out when in_app leads the ladder, and only when the step comes due when it follows email. A notification whose ladder carries no in_app (a send naming email alone, a recipient who switched In-app off for your site on auth.sv on any send but a `security` one, one their own preferences or block refused, one no channel reaches), one whose in_app step has not delivered it (and never will once a stop ended its ladder first), and the per-recipient ceiling's skip are status records only: in no view, and a mark of one answers 404. Filtering happens after the page is read, so a short page with a live cursor means keep paging, not end of list. A notification past its send's history horizon is never listed. Each sealed row whose grant still opens carries the recipient's own pointer (`sparklink_code` and `pointer_url`), for the recipient's client to open, and a plaintext row its body: treat the answer as sensitive and keep it out of logs: on a sealed send at `verification_level: \"none\"` to a recipient addressed by id alone, the pointer opens the content, once, for whoever holds it."
  /products/notify/projects/{projectId}/inbox/state:
    post:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            pattern: ^(?:default|ntp_[A-Za-z0-9_-]+)$
            maxLength: 128
          description: A project owned by the authenticated account. `default` addresses its existing Notify data.
      responses:
        "200":
          description: The page was marked.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/NotifyInboxPageMarked"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the message names the offending field; a cursor that does not decode is one. INVALID_CURSOR: the cursor decoded but is not a position in this list: a hand-made cursor, or one another list issued. Cursors are never portable between lists; start the list again without one."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller may not act on this account. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Mark a recipient inbox in bulk (project)
      description: This operation is scoped to the named project; its send ids, configuration and recipient state are independent of other projects. Sending, testing a destination and selecting a new sending domain require that named project's own plan (403 NOTIFY_PROJECT_SUBSCRIPTION_REQUIRED); retained reads remain available. Mark a page of notifications seen or read. Page size is fixed server-side; keep calling with the returned cursor until it is null. The cursor resumes after the last notification this call marked, and a cursor issued for the other state is a 400 INVALID_CURSOR. A notification past its send's history horizon is skipped. Archiving in bulk is deliberately not offered.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - recipient_id
                - state
              properties:
                recipient_id:
                  type: string
                  description: "The inbox owner. Read in the form a send keys its recipient by (trimmed, with an email address lowercased the way Identity stores it), so the id or address as the send named it reads the same inbox. A value that is blank once trimmed, longer than 256 UTF-8 bytes, or holding a control character or noncharacter names no inbox and is rejected 400. A SparkVault user id (`usr_…`, as read) names a member's own inbox, which only that member reads, signed in to SparkVault: it is rejected 400 VALIDATION_ERROR before anything is read, and so is any id that only starts as one (`usr_`, `usr_x-1`). An email address is a mailbox whatever its local part."
                state:
                  type: string
                  enum:
                    - seen
                    - read
                cursor:
                  type: string
                  description: Continuation token from the previous call.
  /products/notify/projects/{projectId}/inbox/{notificationId}/state:
    post:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            pattern: ^(?:default|ntp_[A-Za-z0-9_-]+)$
            maxLength: 128
          description: A project owned by the authenticated account. `default` addresses its existing Notify data.
        - name: notificationId
          in: path
          required: true
          schema:
            type: string
          description: The notification to mark.
      responses:
        "200":
          description: The notification was marked.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/NotifyInboxMarked"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the message names the offending field."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller may not act on this account. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such notification in this recipient's inbox: none by that id, one past its send's history horizon, or a status record the inbox never lists."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Mark one notification (project)
      description: This operation is scoped to the named project; its send ids, configuration and recipient state are independent of other projects. Sending, testing a destination and selecting a new sending domain require that named project's own plan (403 NOTIFY_PROJECT_SUBSCRIPTION_REQUIRED); retained reads remain available. Set a notification to seen, read, or archived. `created_at` is the row sort key.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - recipient_id
                - created_at
                - state
              properties:
                recipient_id:
                  type: string
                  description: "The inbox owner. Read in the form a send keys its recipient by (trimmed, with an email address lowercased the way Identity stores it), so the id or address as the send named it reads the same inbox. A value that is blank once trimmed, longer than 256 UTF-8 bytes, or holding a control character or noncharacter names no inbox and is rejected 400. A SparkVault user id (`usr_…`, as read) names a member's own inbox, which only that member reads, signed in to SparkVault: it is rejected 400 VALIDATION_ERROR before anything is read, and so is any id that only starts as one (`usr_`, `usr_x-1`). An email address is a mailbox whatever its local part."
                created_at:
                  type: integer
                  description: Unix seconds, from the inbox row.
                state:
                  type: string
                  enum:
                    - seen
                    - read
                    - archived
  /products/notify/projects/{projectId}/receipts:
    get:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            pattern: ^(?:default|ntp_[A-Za-z0-9_-]+)$
            maxLength: 128
          description: A project owned by the authenticated account. `default` addresses its existing Notify data.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 50
          description: "A page-size hint: a value above 100 reads as 100, and a missing, zero, negative or non-numeric one as 50."
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: Continuation token from the previous page.
        - name: interaction
          in: query
          required: false
          schema:
            type: string
            enum:
              - view
              - acknowledge
              - sign
              - approve
              - reply
      responses:
        "200":
          description: A page of receipts.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - receipts
                      - cursor
                    properties:
                      receipts:
                        type: array
                        items:
                          $ref: "#/components/schemas/NotifyReceipt"
                      cursor:
                        type:
                          - string
                          - "null"
                        description: Opaque continuation token. Null when the listing is exhausted.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the message names the offending field; a cursor that does not decode is one. INVALID_CURSOR: the cursor decoded but is not a position in this list: a hand-made cursor, or one another list issued. Cursors are never portable between lists; start the list again without one."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller may not act on this account. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List interaction receipts (project)
      description: "This operation is scoped to the named project; its send ids, configuration and recipient state are independent of other projects. Sending, testing a destination and selecting a new sending domain require that named project's own plan (403 NOTIFY_PROJECT_SUBSCRIPTION_REQUIRED); retained reads remain available. Verified-interaction proofs across the account, newest first, with real pagination: a page comes back full unless the list is exhausted. The `interaction` filter narrows after each page is read, so a filtered page can be short or empty while `cursor` is set; follow the cursor until it is null before concluding there are none."
  /products/notify/projects/{projectId}/send:
    post:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            pattern: ^(?:default|ntp_[A-Za-z0-9_-]+)$
            maxLength: 128
          description: A project owned by the authenticated account. `default` addresses its existing Notify data.
        - name: X-Vault-Access-Token
          in: header
          required: false
          schema:
            type: string
            pattern: ^vat_
          description: "A read-write VAT for `ingot.vault_id`. Required on an `ingot` send and ignored on a `content` send. Missing, unknown, or minted by a since-revoked DVAK: 401 AUTHENTICATION_ERROR. Expired: 403 with `details.reason` VAT_EXPIRED (unseal again and retry). Read-only: 403 with `details.reason` VAT_READ_ONLY. Bound to another vault or account: 403 FORBIDDEN."
      responses:
        "200":
          description: Send accepted and queued for fan-out.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/NotifySendResponse"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the message names the offending field. Every refusal of one request is named together in one answer: the ladder's (an unknown category, no channel left, or a sealed send whose only channel is `voice`, since a call cannot carry its link) and each recipient Notify will not take, by index (see NotifyRecipient). A title that reads as SparkVault carries `details.field` title and `details.reason` reserved_name. A `send_id` replayed with a different request is refused here too, and the stored send stands."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials, or an `ingot` send whose `X-Vault-Access-Token` is missing, unknown, or minted by a revoked DVAK."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "402":
          description: "USAGE_CREDITS_REQUIRED: a ladder names sms or voice once texts and calls are enabled, and the account does not use usage credits, which pay for every text and call; `details.field` names the field (a config write's ladder for one category names `delivery.channel_priority`, and `details.category` the category) and `details.channels` the channels refused, and nothing is sent or stored. A ladder the config already holds drops them at send time instead."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller is no longer a member of the organization (read per request, so a removed member's session is refused at once), or an `ingot` send's VAT is expired (`details.reason` VAT_EXPIRED), read-only (VAT_READ_ONLY), or bound to another vault or account. NOTIFY_SUBSCRIPTION_REQUIRED: the account holds no Notify tier, and the send replays no accepted one. LICENSE_REQUIRED: an `ingot` send comes from a member without a Full License. PRODUCT_ACCESS_REQUIRED: an `ingot` send comes from a member without Secure Storage access (`details.products` vaults). NOTIFY_CHANNEL_NOT_AVAILABLE: a ladder names a channel Notify does not deliver (whatsapp, rcs, which Notify never sends, or sms or voice before texts and calls are enabled); `details.field` names the field (a config write's ladder for one category names `delivery.channel_priority`, and `details.category` the category) and `details.channels` the channels refused, and nothing is sent or stored. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: the account record is missing or being deleted, or an `ingot` send names a vault or ingot outside the account."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "NOTIFY_SENDER_NAME_REQUIRED: the organization has no name, and a notification goes out in it; set it in Settings, then send again. NOTIFY_SENDER_NAME_RESERVED: the organization's name reads as SparkVault or as a web address, or holds an at sign or a text-direction control character (`details.reason` reserved_name); rename the organization, then send again. HANDLE_REQUIRED: the send would email someone, and the organization has not chosen its handle, the address its email goes out from (`details.product` notify); choose it in Company Settings, then send again. CONFLICT: a concurrent request on the same `send_id` won the create race and its send is no longer stored; retry the send."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "412":
          description: "PRECONDITION_FAILED: an `ingot` send from a vault whose public file sharing is disabled."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`. NOTIFY_EMAIL_ADMISSION_LIMIT: the account has queued the most email Notify accepts from it in one hour while sending capacity is shared. `details` carries `limit` (the email-bound recipients an hour takes), `window` hour and `resets_at`, and `Retry-After` the seconds until the hour reopens. A send whose recipients do not all fit is refused whole. A send refused for any other reason counts none of them, and one that fails while it seals gives them back."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "NOTIFY_EMAIL_CAPACITY_UNAVAILABLE: your email capacity could not be checked, so nothing was sent; retry with the same send_id. EMAIL_SETUP_BUSY: another request is setting up the organization's email (`Retry-After` carries 5 seconds), or email setup is busy right now; repeat the request in a moment. INTERNAL_ERROR: this deployment cannot send Notify email; nothing was sent."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Send a notification (project)
      description: "This operation is scoped to the named project; its send ids, configuration and recipient state are independent of other projects. Sending, testing a destination and selecting a new sending domain require that named project's own plan (403 NOTIFY_PROJECT_SUBSCRIPTION_REQUIRED); retained reads remain available. Fan out one notification to up to 500 recipients. Requires a Notify subscription: without one the call is refused with 403 NOTIFY_SUBSCRIPTION_REQUIRED, but for a replay of a send already accepted (its `send_id`), which is answered with the stored send when it repeats that request. Supply `send_id` to make retries safe: the call is idempotent on it within the account. An `ingot` send publishes a stored vault file, so, like the vault's own sharing routes, it requires proof the caller holds a key to that vault: a read-write VAT from POST /vaults/{id}/unseal (with the VMK or a read-write DVAK) in `X-Vault-Access-Token`. The send speaks in your organization's name, so the organization needs a name of its own. A send that would email someone (its channels name email and a recipient has an email address) goes out from your organization's own sender (GET /products/notify/email-sender), so it needs the organization's handle, and it is admitted against your hourly share of the platform's sending capacity: the last checks before anything is sealed or stored. A sealed send's policy and content are held to what its grants can carry before that admission, and a send that fails while it seals gives its admitted recipients back, so its corrected send or its retry is admitted in the same hour. A replay of an accepted send is answered from that send without meeting any of them again. An accepted send is also posted once to each of your organization's destinations whose categories list its category (config `destinations`), unless it sets `destinations: false`, and its status reports each one."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/NotifySendRequest"
  /products/notify/projects/{projectId}/sends:
    get:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            pattern: ^(?:default|ntp_[A-Za-z0-9_-]+)$
            maxLength: 128
          description: A project owned by the authenticated account. `default` addresses its existing Notify data.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 50
          description: "A page-size hint: a value above 100 reads as 100, and a missing, zero, negative or non-numeric one as 50."
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: Continuation token from the previous page.
      responses:
        "200":
          description: A page of sends.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - sends
                      - cursor
                    properties:
                      sends:
                        type: array
                        items:
                          $ref: "#/components/schemas/NotifySendSummary"
                      cursor:
                        type:
                          - string
                          - "null"
                        description: Opaque continuation token. Null when the listing is exhausted.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the message names the offending field; a cursor that does not decode is one. INVALID_CURSOR: the cursor decoded but is not a position in this list: a hand-made cursor, or one another list issued. Cursors are never portable between lists; start the list again without one."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller may not act on this account. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "SEND_HISTORY_PROVISIONING: the history index is not queryable on this deployment. Temporary; retry shortly. Sending and delivery are unaffected."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List send history (project)
      description: "This operation is scoped to the named project; its send ids, configuration and recipient state are independent of other projects. Sending, testing a destination and selecting a new sending domain require that named project's own plan (403 NOTIFY_PROJECT_SUBSCRIPTION_REQUIRED); retained reads remain available. The account sends, newest first. Metadata and counters only: the audience, the pointer code, and a plaintext body are never read."
  /products/notify/projects/{projectId}/sends/{sendId}/recall:
    post:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            pattern: ^(?:default|ntp_[A-Za-z0-9_-]+)$
            maxLength: 128
          description: A project owned by the authenticated account. `default` addresses its existing Notify data.
        - name: sendId
          in: path
          required: true
          schema:
            type: string
          description: The send to recall.
      responses:
        "200":
          description: The recall ran; the body reports what it reached.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/NotifyRecallResponse"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: an unknown mode, an empty recipient_ids array, a plaintext send, which mints no grants, or a `content` recall of a send that did not seal its content (an `ingot` send)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller may not act on this account. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such send on this account."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Recall a send (project)
      description: "This operation is scoped to the named project; its send ids, configuration and recipient state are independent of other projects. Sending, testing a destination and selecting a new sending domain require that named project's own plan (403 NOTIFY_PROJECT_SUBSCRIPTION_REQUIRED); retained reads remain available. Close the reveal on a sealed send: revoke the access grants, or destroy the sealed content outright. Idempotent, and partial by design: one recipient failing never stops the rest, and every failure is reported. A plaintext send has no grant to revoke and is refused."
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/NotifyRecallRequest"
  /products/notify/projects/{projectId}/sends/{sendId}/receipts:
    get:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            pattern: ^(?:default|ntp_[A-Za-z0-9_-]+)$
            maxLength: 128
          description: A project owned by the authenticated account. `default` addresses its existing Notify data.
        - name: sendId
          in: path
          required: true
          schema:
            type: string
          description: The send to correlate against.
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: Continuation token from the previous page.
      responses:
        "200":
          description: Receipts matched to this send.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - send_id
                      - receipts
                      - truncated
                      - cursor
                    properties:
                      send_id:
                        type: string
                      receipts:
                        type: array
                        items:
                          allOf:
                            - $ref: "#/components/schemas/NotifyReceipt"
                            - type: object
                              required:
                                - recipient_id
                              properties:
                                recipient_id:
                                  type: string
                      truncated:
                        type: boolean
                        description: This call's page cap stopped the walk before it reached the send's creation; page on with `cursor`. False means `receipts` is the send's whole set.
                      cursor:
                        type:
                          - string
                          - "null"
                        description: Opaque continuation token. Null when the listing is exhausted.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the message names the offending field; a cursor that does not decode is one. INVALID_CURSOR: the cursor decoded but is not a position in this list: a hand-made cursor, or one another list issued. Cursors are never portable between lists; start the list again without one."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller may not act on this account. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such send on this account."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List receipts for one send (project)
      description: "This operation is scoped to the named project; its send ids, configuration and recipient state are independent of other projects. Sending, testing a destination and selecting a new sending domain require that named project's own plan (403 NOTIFY_PROJECT_SUBSCRIPTION_REQUIRED); retained reads remain available. Receipts correlated back to the recipients of a single send. The walk reads back to the send's creation and no further, since no receipt of a send can predate it. One call is bounded: `truncated` true with a cursor means its page cap stopped the walk first, and more of this send's receipts may follow."
  /products/notify/projects/{projectId}/sends/{sendId}/status:
    get:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            pattern: ^(?:default|ntp_[A-Za-z0-9_-]+)$
            maxLength: 128
          description: A project owned by the authenticated account. `default` addresses its existing Notify data.
        - name: sendId
          in: path
          required: true
          schema:
            type: string
          description: The send to inspect.
      responses:
        "200":
          description: Send status.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/NotifySendStatus"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the message names the offending field."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller may not act on this account. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such send on this account."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read send status (project)
      description: This operation is scoped to the named project; its send ids, configuration and recipient state are independent of other projects. Sending, testing a destination and selecting a new sending domain require that named project's own plan (403 NOTIFY_PROJECT_SUBSCRIPTION_REQUIRED); retained reads remain available. Per-recipient delivery state for one send. A recipient reads `delivered` when a channel transport accepted the message, or when they saw or opened it and a later escalation step recorded that; proof a human acted is a receipt.
  /products/notify/projects/{projectId}/subscription:
    post:
      tags:
        - notify
      security:
        - BearerAuth: []
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            pattern: ^(?:default|ntp_[A-Za-z0-9_-]+)$
            maxLength: 128
          description: A project owned by the authenticated account. `default` addresses its existing Notify data.
      responses:
        "200":
          description: The project with its current plan, or a hosted checkout URL to complete payment.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - project
                    properties:
                      project:
                        $ref: "#/components/schemas/NotifyProject"
                      checkout_url:
                        type: string
                        format: uri
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: a project field is malformed or unsupported."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: an account credential is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: current company membership is required; project changes require an administrator. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: this account has no such project. Another account's project has the same answer."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the project changed concurrently or its lifecycle does not permit this operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Purchase or change a Notify project plan
      description: An interactive, non-impersonated company administrator confirms the reviewed quote. Each usage-credit project owns a separate flat subscription item and contributes included credits to the company's shared balance. Existing legacy projects retain their volume plans. A changed quote is refused instead of charged. Default uses the company Billing flow.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - quoted_amount_due_now_usd
                - proration_date
              oneOf:
                - type: object
                  required:
                    - billing_model
                  properties:
                    billing_model:
                      type: string
                      const: usage_credits
                    quoted_amount_due_now_usd:
                      type: string
                      description: The exact reviewed amount_due_now_usd decimal string.
                    proration_date:
                      type: integer
                      minimum: 0
                - type: object
                  required:
                    - notifications_per_month
                  properties:
                    billing_model:
                      type: string
                      const: legacy
                    notifications_per_month:
                      type: integer
                      minimum: 1
                    quoted_amount_due_now_usd:
                      type: string
                      description: The exact reviewed amount_due_now_usd decimal string.
                    proration_date:
                      type: integer
                      minimum: 0
    delete:
      tags:
        - notify
      security:
        - BearerAuth: []
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            pattern: ^(?:default|ntp_[A-Za-z0-9_-]+)$
            maxLength: 128
          description: A project owned by the authenticated account. `default` addresses its existing Notify data.
      responses:
        "200":
          description: The project after cancellation.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - project
                    properties:
                      project:
                        $ref: "#/components/schemas/NotifyProject"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: a project field is malformed or unsupported."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: an account credential is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: current company membership is required; project changes require an administrator. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: this account has no such project. Another account's project has the same answer."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the project changed concurrently or its lifecycle does not permit this operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Cancel a Notify project plan
      description: An interactive, non-impersonated company administrator schedules this named project's plan to end at its current paid period deadline, without a prorated credit or refund. Sending continues through that deadline, then becomes read-only. Other project plans and the company's base plan are independent. Default uses the company Billing flow.
  /products/notify/projects/{projectId}/subscription/preview:
    post:
      tags:
        - notify
      security:
        - BearerAuth: []
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            pattern: ^(?:default|ntp_[A-Za-z0-9_-]+)$
            maxLength: 128
          description: A project owned by the authenticated account. `default` addresses its existing Notify data.
      responses:
        "200":
          description: The plan quote to review before purchasing.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - project_id
                      - monthly_usd
                      - amount_due_now_usd
                      - currency
                      - proration_date
                      - effective_at
                      - checkout_required
                    oneOf:
                      - required:
                          - billing_model
                          - included_monthly_credits
                      - required:
                          - notifications_per_month
                    properties:
                      project_id:
                        type: string
                        pattern: ^(?:default|ntp_[A-Za-z0-9_-]+)$
                        maxLength: 128
                      notifications_per_month:
                        type: integer
                        minimum: 0
                      billing_model:
                        type: string
                        const: usage_credits
                      included_monthly_credits:
                        type: integer
                        minimum: 0
                      monthly_usd:
                        type: string
                        description: Exact decimal USD amount.
                      amount_due_now_usd:
                        type: string
                        description: Exact decimal USD amount to repeat when confirming.
                      currency:
                        type: string
                      proration_date:
                        type: integer
                        minimum: 0
                      effective_at:
                        type:
                          - integer
                          - "null"
                        description: Scheduled downgrade deadline; null for an immediate change.
                      checkout_required:
                        type: boolean
                        description: The company needs hosted checkout to create its first subscription.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: a project field is malformed or unsupported."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: an account credential is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: current company membership is required; project changes require an administrator. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: this account has no such project. Another account's project has the same answer."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the project changed concurrently or its lifecycle does not permit this operation."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Quote a Notify project plan
      description: An interactive, non-impersonated company administrator previews a named project's plan and immediate prorated charge. A company without a current subscription is quoted for hosted checkout (checkout_required). Default uses the existing company Billing flow. API keys cannot authorize spending.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              oneOf:
                - type: object
                  required:
                    - billing_model
                  properties:
                    billing_model:
                      type: string
                      const: usage_credits
                - type: object
                  required:
                    - notifications_per_month
                  properties:
                    billing_model:
                      type: string
                      const: legacy
                    notifications_per_month:
                      type: integer
                      minimum: 1
  /products/notify/projects/{projectId}/suppressions:
    get:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            pattern: ^(?:default|ntp_[A-Za-z0-9_-]+)$
            maxLength: 128
          description: A project owned by the authenticated account. `default` addresses its existing Notify data.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 50
          description: "A page-size hint: a value above 100 reads as 100, and a missing, zero, negative or non-numeric one as 50."
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: Opaque continuation token from a prior page's cursor.
      responses:
        "200":
          description: A page of your suppressions.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/NotifySuppressionListResponse"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the message names the offending field; a cursor that does not decode is one. INVALID_CURSOR: the cursor decoded but is not a position in this list: a hand-made cursor, or one another list issued. Cursors are never portable between lists; start the list again without one."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller may not act on this account. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "SUPPRESSIONS_PROVISIONING: the suppression index is not queryable on this deployment. Temporary; retry shortly. Sending and delivery are unaffected, and clearing a suppression needs no index and always works."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List your email suppressions (project)
      description: "For a named project this operation lists or clears only its own email opt-outs. Company and platform suppressions remain enforced and cannot be cleared through a named project. Default addresses the existing company suppression list. Project-restricted API keys cannot manage suppressions. The addresses that opted out of THIS account's mail, newest first. Account-scoped rows ONLY: a hard bounce, a complaint, and a platform-wide opt-out are recorded as GLOBAL rows carrying no account, and the sparse index this reads does not contain them. That is structural, not a filter: there is no parameter here that reaches a global row or another tenant's."
  /products/notify/projects/{projectId}/suppressions/{email}:
    delete:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            pattern: ^(?:default|ntp_[A-Za-z0-9_-]+)$
            maxLength: 128
          description: A project owned by the authenticated account. `default` addresses its existing Notify data.
        - name: email
          in: path
          required: true
          schema:
            type: string
          description: The address to re-enable. URL-encode it.
      responses:
        "200":
          description: The clear ran; `cleared` reports whether one of your rows was removed.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/NotifySuppressionClearResponse"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the message names the offending field."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller may not act on this account. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Clear one of your email suppressions (project)
      description: "For a named project this operation lists or clears only its own email opt-outs. Company and platform suppressions remain enforced and cannot be cleared through a named project. Default addresses the existing company suppression list. Project-restricted API keys cannot manage suppressions. Re-enable one address for THIS account's mail: the way back from an opt-out, which is otherwise a one-way door. Clearing a row asserts that you have the person's renewed consent; the endpoint cannot check that, and you are the party who can. A GLOBAL suppression is never cleared here: a hard bounce and a platform-wide opt-out are not one tenant's to overrule, and resuming mail to a mailbox that already refused burns the sending reputation every tenant shares. Idempotent: a missing row is a 200 with `cleared: false`, never a 404. A clear is recorded in the account audit log as `notify_suppression_removed`, naming who cleared it and the address masked."
  /products/notify/receipts:
    get:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "200":
          description: A page of receipts.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - receipts
                      - cursor
                    properties:
                      receipts:
                        type: array
                        items:
                          $ref: "#/components/schemas/NotifyReceipt"
                      cursor:
                        type:
                          - string
                          - "null"
                        description: Opaque continuation token. Null when the listing is exhausted.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the message names the offending field; a cursor that does not decode is one. INVALID_CURSOR: the cursor decoded but is not a position in this list: a hand-made cursor, or one another list issued. Cursors are never portable between lists; start the list again without one."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller may not act on this account. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List interaction receipts
      description: "Verified-interaction proofs across the account, newest first, with real pagination: a page comes back full unless the list is exhausted. The `interaction` filter narrows after each page is read, so a filtered page can be short or empty while `cursor` is set; follow the cursor until it is null before concluding there are none."
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 50
          description: "A page-size hint: a value above 100 reads as 100, and a missing, zero, negative or non-numeric one as 50."
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: Continuation token from the previous page.
        - name: interaction
          in: query
          required: false
          schema:
            type: string
            enum:
              - view
              - acknowledge
              - sign
              - approve
              - reply
  /products/notify/send:
    post:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "200":
          description: Send accepted and queued for fan-out.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/NotifySendResponse"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the message names the offending field. Every refusal of one request is named together in one answer: the ladder's (an unknown category, no channel left, or a sealed send whose only channel is `voice`, since a call cannot carry its link) and each recipient Notify will not take, by index (see NotifyRecipient). A title that reads as SparkVault carries `details.field` title and `details.reason` reserved_name. A `send_id` replayed with a different request is refused here too, and the stored send stands."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials, or an `ingot` send whose `X-Vault-Access-Token` is missing, unknown, or minted by a revoked DVAK."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "402":
          description: "USAGE_CREDITS_REQUIRED: a ladder names sms or voice once texts and calls are enabled, and the account does not use usage credits, which pay for every text and call; `details.field` names the field (a config write's ladder for one category names `delivery.channel_priority`, and `details.category` the category) and `details.channels` the channels refused, and nothing is sent or stored. A ladder the config already holds drops them at send time instead."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller is no longer a member of the organization (read per request, so a removed member's session is refused at once), or an `ingot` send's VAT is expired (`details.reason` VAT_EXPIRED), read-only (VAT_READ_ONLY), or bound to another vault or account. NOTIFY_SUBSCRIPTION_REQUIRED: the account holds no Notify tier, and the send replays no accepted one. LICENSE_REQUIRED: an `ingot` send comes from a member without a Full License. PRODUCT_ACCESS_REQUIRED: an `ingot` send comes from a member without Secure Storage access (`details.products` vaults). NOTIFY_CHANNEL_NOT_AVAILABLE: a ladder names a channel Notify does not deliver (whatsapp, rcs, which Notify never sends, or sms or voice before texts and calls are enabled); `details.field` names the field (a config write's ladder for one category names `delivery.channel_priority`, and `details.category` the category) and `details.channels` the channels refused, and nothing is sent or stored. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: the account record is missing or being deleted, or an `ingot` send names a vault or ingot outside the account."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "NOTIFY_SENDER_NAME_REQUIRED: the organization has no name, and a notification goes out in it; set it in Settings, then send again. NOTIFY_SENDER_NAME_RESERVED: the organization's name reads as SparkVault or as a web address, or holds an at sign or a text-direction control character (`details.reason` reserved_name); rename the organization, then send again. HANDLE_REQUIRED: the send would email someone, and the organization has not chosen its handle, the address its email goes out from (`details.product` notify); choose it in Company Settings, then send again. CONFLICT: a concurrent request on the same `send_id` won the create race and its send is no longer stored; retry the send."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "412":
          description: "PRECONDITION_FAILED: an `ingot` send from a vault whose public file sharing is disabled."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`. NOTIFY_EMAIL_ADMISSION_LIMIT: the account has queued the most email Notify accepts from it in one hour while sending capacity is shared. `details` carries `limit` (the email-bound recipients an hour takes), `window` hour and `resets_at`, and `Retry-After` the seconds until the hour reopens. A send whose recipients do not all fit is refused whole. A send refused for any other reason counts none of them, and one that fails while it seals gives them back."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "NOTIFY_EMAIL_CAPACITY_UNAVAILABLE: your email capacity could not be checked, so nothing was sent; retry with the same send_id. EMAIL_SETUP_BUSY: another request is setting up the organization's email (`Retry-After` carries 5 seconds), or email setup is busy right now; repeat the request in a moment. INTERNAL_ERROR: this deployment cannot send Notify email; nothing was sent."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Send a notification
      description: "Fan out one notification to up to 500 recipients. Requires a Notify subscription: without one the call is refused with 403 NOTIFY_SUBSCRIPTION_REQUIRED, but for a replay of a send already accepted (its `send_id`), which is answered with the stored send when it repeats that request. Supply `send_id` to make retries safe: the call is idempotent on it within the account. An `ingot` send publishes a stored vault file, so, like the vault's own sharing routes, it requires proof the caller holds a key to that vault: a read-write VAT from POST /vaults/{id}/unseal (with the VMK or a read-write DVAK) in `X-Vault-Access-Token`. The send speaks in your organization's name, so the organization needs a name of its own. A send that would email someone (its channels name email and a recipient has an email address) goes out from your organization's own sender (GET /products/notify/email-sender), so it needs the organization's handle, and it is admitted against your hourly share of the platform's sending capacity: the last checks before anything is sealed or stored. A sealed send's policy and content are held to what its grants can carry before that admission, and a send that fails while it seals gives its admitted recipients back, so its corrected send or its retry is admitted in the same hour. A replay of an accepted send is answered from that send without meeting any of them again. An accepted send is also posted once to each of your organization's destinations whose categories list its category (config `destinations`), unless it sets `destinations: false`, and its status reports each one."
      parameters:
        - name: X-Vault-Access-Token
          in: header
          required: false
          schema:
            type: string
            pattern: ^vat_
          description: "A read-write VAT for `ingot.vault_id`. Required on an `ingot` send and ignored on a `content` send. Missing, unknown, or minted by a since-revoked DVAK: 401 AUTHENTICATION_ERROR. Expired: 403 with `details.reason` VAT_EXPIRED (unseal again and retry). Read-only: 403 with `details.reason` VAT_READ_ONLY. Bound to another vault or account: 403 FORBIDDEN."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/NotifySendRequest"
  /products/notify/sends:
    get:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "200":
          description: A page of sends.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - sends
                      - cursor
                    properties:
                      sends:
                        type: array
                        items:
                          $ref: "#/components/schemas/NotifySendSummary"
                      cursor:
                        type:
                          - string
                          - "null"
                        description: Opaque continuation token. Null when the listing is exhausted.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the message names the offending field; a cursor that does not decode is one. INVALID_CURSOR: the cursor decoded but is not a position in this list: a hand-made cursor, or one another list issued. Cursors are never portable between lists; start the list again without one."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller may not act on this account. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "SEND_HISTORY_PROVISIONING: the history index is not queryable on this deployment. Temporary; retry shortly. Sending and delivery are unaffected."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List send history
      description: "The account sends, newest first. Metadata and counters only: the audience, the pointer code, and a plaintext body are never read."
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 50
          description: "A page-size hint: a value above 100 reads as 100, and a missing, zero, negative or non-numeric one as 50."
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: Continuation token from the previous page.
  /products/notify/sends/{sendId}/recall:
    post:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: sendId
          in: path
          required: true
          schema:
            type: string
          description: The send to recall.
      responses:
        "200":
          description: The recall ran; the body reports what it reached.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/NotifyRecallResponse"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: an unknown mode, an empty recipient_ids array, a plaintext send, which mints no grants, or a `content` recall of a send that did not seal its content (an `ingot` send)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller may not act on this account. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such send on this account."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Recall a send
      description: "Close the reveal on a sealed send: revoke the access grants, or destroy the sealed content outright. Idempotent, and partial by design: one recipient failing never stops the rest, and every failure is reported. A plaintext send has no grant to revoke and is refused."
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/NotifyRecallRequest"
  /products/notify/sends/{sendId}/receipts:
    get:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: sendId
          in: path
          required: true
          schema:
            type: string
          description: The send to correlate against.
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: Continuation token from the previous page.
      responses:
        "200":
          description: Receipts matched to this send.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - send_id
                      - receipts
                      - truncated
                      - cursor
                    properties:
                      send_id:
                        type: string
                      receipts:
                        type: array
                        items:
                          allOf:
                            - $ref: "#/components/schemas/NotifyReceipt"
                            - type: object
                              required:
                                - recipient_id
                              properties:
                                recipient_id:
                                  type: string
                      truncated:
                        type: boolean
                        description: This call's page cap stopped the walk before it reached the send's creation; page on with `cursor`. False means `receipts` is the send's whole set.
                      cursor:
                        type:
                          - string
                          - "null"
                        description: Opaque continuation token. Null when the listing is exhausted.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the message names the offending field; a cursor that does not decode is one. INVALID_CURSOR: the cursor decoded but is not a position in this list: a hand-made cursor, or one another list issued. Cursors are never portable between lists; start the list again without one."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller may not act on this account. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such send on this account."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List receipts for one send
      description: "Receipts correlated back to the recipients of a single send. The walk reads back to the send's creation and no further, since no receipt of a send can predate it. One call is bounded: `truncated` true with a cursor means its page cap stopped the walk first, and more of this send's receipts may follow."
  /products/notify/sends/{sendId}/status:
    get:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: sendId
          in: path
          required: true
          schema:
            type: string
          description: The send to inspect.
      responses:
        "200":
          description: Send status.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/NotifySendStatus"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the message names the offending field."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller may not act on this account. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such send on this account."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read send status
      description: Per-recipient delivery state for one send. A recipient reads `delivered` when a channel transport accepted the message, or when they saw or opened it and a later escalation step recorded that; proof a human acted is a receipt.
  /products/notify/suppressions:
    get:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "200":
          description: A page of your suppressions.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/NotifySuppressionListResponse"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the message names the offending field; a cursor that does not decode is one. INVALID_CURSOR: the cursor decoded but is not a position in this list: a hand-made cursor, or one another list issued. Cursors are never portable between lists; start the list again without one."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller may not act on this account. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "SUPPRESSIONS_PROVISIONING: the suppression index is not queryable on this deployment. Temporary; retry shortly. Sending and delivery are unaffected, and clearing a suppression needs no index and always works."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List your email suppressions
      description: "The addresses that opted out of THIS account's mail, newest first. Account-scoped rows ONLY: a hard bounce, a complaint, and a platform-wide opt-out are recorded as GLOBAL rows carrying no account, and the sparse index this reads does not contain them. That is structural, not a filter: there is no parameter here that reaches a global row or another tenant's."
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 50
          description: "A page-size hint: a value above 100 reads as 100, and a missing, zero, negative or non-numeric one as 50."
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: Opaque continuation token from a prior page's cursor.
  /products/notify/suppressions/{email}:
    delete:
      tags:
        - notify
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: email
          in: path
          required: true
          schema:
            type: string
          description: The address to re-enable. URL-encode it.
      responses:
        "200":
          description: The clear ran; `cleared` reports whether one of your rows was removed.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/NotifySuppressionClearResponse"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the message names the offending field."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller may not act on this account. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Notify (`details.products`: notify). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Clear one of your email suppressions
      description: "Re-enable one address for THIS account's mail: the way back from an opt-out, which is otherwise a one-way door. Clearing a row asserts that you have the person's renewed consent; the endpoint cannot check that, and you are the party who can. A GLOBAL suppression is never cleared here: a hard bounce and a platform-wide opt-out are not one tenant's to overrule, and resuming mail to a mailbox that already refused burns the sending reputation every tenant shares. Idempotent: a missing row is a 200 with `cleared: false`, never a 404. A clear is recorded in the account audit log as `notify_suppression_removed`, naming who cleared it and the address masked."
  /products/structured-ingots/activity:
    get:
      tags:
        - structured-ingots
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "200":
          description: Aggregate account activity.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - scope
                      - period
                      - interval
                      - as_of
                      - window_start
                      - window_end
                      - totals
                      - series
                    properties:
                      scope:
                        type: string
                        const: account
                      period:
                        type: string
                        enum:
                          - 24h
                          - 7d
                      interval:
                        type: string
                        enum:
                          - hour
                          - day
                      as_of:
                        type: integer
                        format: int64
                        minimum: 0
                        description: Unix timestamp in whole seconds (UTC), not milliseconds.
                      window_start:
                        type: integer
                        format: int64
                        minimum: 0
                        description: Unix timestamp in whole seconds (UTC), not milliseconds.
                      window_end:
                        type: integer
                        format: int64
                        minimum: 0
                        description: Unix timestamp in whole seconds (UTC), not milliseconds.
                      totals:
                        type: object
                        required:
                          - requests
                          - reads
                          - writes
                          - errors
                          - conflicts
                          - average_latency_ms
                          - p95_upper_bound_ms
                          - p95_overflow
                        properties:
                          requests:
                            type: integer
                            minimum: 0
                          reads:
                            type: integer
                            minimum: 0
                          writes:
                            type: integer
                            minimum: 0
                          errors:
                            type: integer
                            minimum: 0
                          conflicts:
                            type: integer
                            minimum: 0
                          average_latency_ms:
                            type:
                              - number
                              - "null"
                            description: Average observed request duration in milliseconds; null for no requests.
                          p95_upper_bound_ms:
                            type:
                              - integer
                              - "null"
                            description: "Fixed histogram upper bound in milliseconds: 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000, 30000 or 60000. Null for no requests or overflow."
                          p95_overflow:
                            type: boolean
                            description: True when the 95th percentile exceeds the largest histogram bound of 60000 milliseconds.
                      series:
                        type: array
                        minItems: 7
                        maxItems: 24
                        items:
                          type: object
                          required:
                            - requests
                            - reads
                            - writes
                            - errors
                            - conflicts
                            - average_latency_ms
                            - p95_upper_bound_ms
                            - p95_overflow
                            - start
                            - end
                          properties:
                            requests:
                              type: integer
                              minimum: 0
                            reads:
                              type: integer
                              minimum: 0
                            writes:
                              type: integer
                              minimum: 0
                            errors:
                              type: integer
                              minimum: 0
                            conflicts:
                              type: integer
                              minimum: 0
                            average_latency_ms:
                              type:
                                - number
                                - "null"
                              description: Average observed request duration in milliseconds; null for no requests.
                            p95_upper_bound_ms:
                              type:
                                - integer
                                - "null"
                              description: "Fixed histogram upper bound in milliseconds: 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000, 30000 or 60000. Null for no requests or overflow."
                            p95_overflow:
                              type: boolean
                              description: True when the 95th percentile exceeds the largest histogram bound of 60000 milliseconds.
                            start:
                              type: integer
                              format: int64
                              minimum: 0
                              description: Unix timestamp in whole seconds (UTC), not milliseconds.
                            end:
                              type: integer
                              format: int64
                              minimum: 0
                              description: Unix timestamp in whole seconds (UTC), not milliseconds.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: period must be 24h or 7d."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: account authentication is required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: a vault-scoped service key cannot read account activity. PRODUCT_ACCESS_REQUIRED: the member holds no access to Structured Ingots (`details.products`: structured_ingots). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read aggregate Structured Ingots activity
      description: Requires account authentication, without a VAT. Vault-scoped service keys cannot read account activity. Reads one bounded account counter ring with no vault listing or per-vault fan-out. No vault identifiers or per-vault breakdown are stored in this aggregate; it includes past activity from vaults subsequently deleted. Counts and storage for the current vault directory are separate metadata, not fields in this response. Returns exactly 24 UTC hourly buckets for 24h or seven UTC calendar-day buckets for 7d, including the current partial bucket. window_end and the current bucket end equal as_of; all timestamps are Unix seconds. Counts authenticated public object/type requests once (GET/HEAD reads, mutation-method writes), including observed refusals; nested Core/Forge calls and activity/discovery requests are excluded. errors counts HTTP 400 to 599 and conflicts counts 409/412. Counters are approximate, collected independently for account and vault views, and have no historical backfill or exact reconciliation guarantee. Never scans objects or returns record names, keys or values. p95 is a histogram upper bound; overflow beyond 60 seconds is explicit. These operational counters are not a billing invoice.
      parameters:
        - name: period
          in: query
          schema:
            type: string
            enum:
              - 24h
              - 7d
            default: 24h
  /products/structured-ingots/usage:
    get:
      tags:
        - structured-ingots
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "200":
          description: A page of eligible vault IDs.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - vault_ids
                      - count
                      - has_more
                    properties:
                      vault_ids:
                        type: array
                        items:
                          type: string
                      count:
                        type: integer
                        description: How many this page holds.
                      has_more:
                        type: boolean
                        description: "More follow. A page can hold fewer than `limit`, or none, while more remain: page on while it is true."
                      next_cursor:
                        type: string
                        description: "Present while `has_more` is true: pass it back as `cursor` for the next page."
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: this query did not issue the cursor for this account. INVALID_CURSOR: the cursor does not name a position in this listing."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Structured Ingots (`details.products`: structured_ingots). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "STRUCTURED_INGOT_USAGE_INITIALIZING: a legacy vault without the enabled flag or a positive count still has an uninitialized published count. Retry shortly; an unknown count is never treated as zero."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List vaults using Structured Ingots
      description: One page of the authenticated account's vaults with structured_ingots_enabled=true or a positive published Structured Ingots count, including sealed vaults. Each request reads at most 500 vault metadata entries and strongly rechecks their product flags, counts and lifecycle; it never reads individual ingots. Enabled vaults remain eligible when empty, when they hold only type catalogs, or before a legacy count is initialized. System vaults and vaults scheduled for deletion are excluded. Page with `next_cursor` until `has_more` is false, even after an empty page. No object names, keys or values are returned. List Vaults and Get Vault also carry `structured_ingots_enabled` and `structured_ingot_count`, which the console uses through its existing shared vault directory.
      parameters:
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: The `next_cursor` a previous page returned. Opaque, and sealed to the query that issued it.
  /products/structured-ingots/{vault_id}:
    get:
      tags:
        - structured-ingots
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: vault_id
          in: path
          required: true
          schema:
            type: string
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 25
          description: "A page-size hint: a value above 200 reads as 200, and a missing, zero, negative or non-numeric one as 25."
        - name: cursor
          in: query
          schema:
            type: string
      responses:
        "200":
          description: A metadata page.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      ingots:
                        type: array
                        items:
                          type: object
                          properties:
                            ingot_id:
                              type: string
                            name:
                              type: string
                            revision:
                              type: string
                              description: Opaque content revision bound to this immutable object ID and publication. Preserve it unchanged; unlike a numeric version it cannot match a replacement object created under the same name.
                            size_bytes:
                              type: integer
                            version:
                              type: "null"
                            key_count:
                              type: "null"
                            created_at:
                              type: integer
                            updated_at:
                              type:
                                - integer
                                - "null"
                      count:
                        type: integer
                      next_cursor:
                        type:
                          - string
                          - "null"
                      has_more:
                        type: boolean
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: invalid shape, limit, projection, binary path or type rule. Type failures identify paths in details.errors without record values."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: account authentication and a live vault session are required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: vault rights, service-key scope or managed-resource authority do not allow this operation. PRODUCT_ACCESS_REQUIRED: the member holds no access to Structured Ingots (`details.products`: structured_ingots). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such owned vault, record, type definition or retained publication."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Browse structured objects
      description: One underlying metadata page without decrypting records. Follow next_cursor while has_more, even after an empty filtered page. Version and key_count are null in summaries. IDs or colon-prefixed Unicode compatibility/caseless normalized names address individual records.
    post:
      tags:
        - structured-ingots
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: vault_id
          in: path
          required: true
          schema:
            type: string
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            type: string
            minLength: 8
            maxLength: 128
            pattern: ^[ -~]+$
      responses:
        "201":
          description: The creation receipt. Matching idempotent retries also return 201; replayed=true identifies an original receipt replay.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      ingot_id:
                        type: string
                      name:
                        type: string
                      version:
                        type: integer
                      revision:
                        type: string
                        description: Opaque content revision bound to this immutable object ID and publication. Preserve it unchanged; unlike a numeric version it cannot match a replacement object created under the same name.
                      key_count:
                        type: integer
                      type:
                        type:
                          - object
                          - "null"
                        required:
                          - type_id
                          - version
                        additionalProperties: false
                        properties:
                          type_id:
                            type: string
                          version:
                            type: integer
                            minimum: 1
                            maximum: 50
                      created_at:
                        type: integer
                      updated_at:
                        type: integer
                      created:
                        type: boolean
                      replayed:
                        type: boolean
                        description: Original creation receipt replay, not a current content read.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: invalid shape, limit, projection, binary path or type rule. Type failures identify paths in details.errors without record values."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: account authentication and a live vault session are required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "402":
          description: "PLAN_REQUIRED or QUOTA_EXCEEDED: content publication requires active plan and available storage/bandwidth."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: vault rights, service-key scope or managed-resource authority do not allow this operation. PRODUCT_ACCESS_REQUIRED: the member holds no access to Structured Ingots (`details.products`: structured_ingots). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such owned vault, record, type definition or retained publication."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: an unrelated create already holds this name, or vault deletion is scheduled."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "412":
          description: "PRECONDITION_FAILED: a stale read or competing publication. Reload before retrying."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "413":
          description: "PAYLOAD_TOO_LARGE: request exceeds 1 MiB."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Create a structured object
      description: "Strict create: never overwrites or renumbers a name. An optional Idempotency-Key binds the normalized name and canonical transformed data/type to this account and vault. Only matching retries can resume their pending creation or replay the original receipt; active replay never uploads again. Retries remain subject to current access and type eligibility, so archiving a type can refuse an earlier typed creation retry. Other collisions return 409. Names follow the platform portable file-name rules and use Unicode compatibility/caseless matching; the __type__ prefix is reserved for type catalogs. Complete data and final encoded publication must fit 1 MiB."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - data
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 255
                data:
                  type: object
                  additionalProperties: true
                  description: JSON object with explicit binary paths when needed. The field name __proto__ is reserved at every nesting depth.
                type:
                  type:
                    - object
                    - "null"
                  required:
                    - type_id
                    - version
                  additionalProperties: false
                  properties:
                    type_id:
                      type: string
                    version:
                      type: integer
                      minimum: 1
                      maximum: 50
                binary_paths:
                  type: array
                  description: Exact paths to canonical base64 binary leaves, relative to data or set. String map keys and integer array indices are distinct.
                  items:
                    type: array
                    minItems: 1
                    items:
                      oneOf:
                        - type: string
                        - type: integer
                          minimum: 0
  /products/structured-ingots/{vault_id}/activity:
    get:
      tags:
        - structured-ingots
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: vault_id
          in: path
          required: true
          schema:
            type: string
        - name: period
          in: query
          schema:
            type: string
            enum:
              - 24h
              - 7d
            default: 24h
      responses:
        "200":
          description: Activity, object count and whole-vault storage.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - vault_id
                      - object_count
                      - vault_storage_bytes
                      - period
                      - interval
                      - as_of
                      - window_start
                      - window_end
                      - totals
                      - series
                    properties:
                      vault_id:
                        type: string
                      object_count:
                        type:
                          - integer
                          - "null"
                        minimum: 0
                        description: Maintained published-object count. Null means a legacy count has not been initialized; it does not mean zero.
                      vault_storage_bytes:
                        type: integer
                        minimum: 0
                      period:
                        type: string
                        enum:
                          - 24h
                          - 7d
                      interval:
                        type: string
                        enum:
                          - hour
                          - day
                      as_of:
                        type: integer
                        format: int64
                        minimum: 0
                        description: Unix timestamp in whole seconds (UTC), not milliseconds.
                      window_start:
                        type: integer
                        format: int64
                        minimum: 0
                        description: Unix timestamp in whole seconds (UTC), not milliseconds.
                      window_end:
                        type: integer
                        format: int64
                        minimum: 0
                        description: Unix timestamp in whole seconds (UTC), not milliseconds.
                      totals:
                        type: object
                        required:
                          - requests
                          - reads
                          - writes
                          - errors
                          - conflicts
                          - average_latency_ms
                          - p95_upper_bound_ms
                          - p95_overflow
                        properties:
                          requests:
                            type: integer
                            minimum: 0
                          reads:
                            type: integer
                            minimum: 0
                          writes:
                            type: integer
                            minimum: 0
                          errors:
                            type: integer
                            minimum: 0
                          conflicts:
                            type: integer
                            minimum: 0
                          average_latency_ms:
                            type:
                              - number
                              - "null"
                            description: Average observed request duration in milliseconds; null for no requests.
                          p95_upper_bound_ms:
                            type:
                              - integer
                              - "null"
                            description: "Fixed histogram upper bound in milliseconds: 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000, 30000 or 60000. Null for no requests or overflow."
                          p95_overflow:
                            type: boolean
                            description: True when the 95th percentile exceeds the largest histogram bound of 60000 milliseconds.
                      series:
                        type: array
                        minItems: 7
                        maxItems: 24
                        items:
                          type: object
                          required:
                            - requests
                            - reads
                            - writes
                            - errors
                            - conflicts
                            - average_latency_ms
                            - p95_upper_bound_ms
                            - p95_overflow
                            - start
                            - end
                          properties:
                            requests:
                              type: integer
                              minimum: 0
                            reads:
                              type: integer
                              minimum: 0
                            writes:
                              type: integer
                              minimum: 0
                            errors:
                              type: integer
                              minimum: 0
                            conflicts:
                              type: integer
                              minimum: 0
                            average_latency_ms:
                              type:
                                - number
                                - "null"
                              description: Average observed request duration in milliseconds; null for no requests.
                            p95_upper_bound_ms:
                              type:
                                - integer
                                - "null"
                              description: "Fixed histogram upper bound in milliseconds: 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000, 30000 or 60000. Null for no requests or overflow."
                            p95_overflow:
                              type: boolean
                              description: True when the 95th percentile exceeds the largest histogram bound of 60000 milliseconds.
                            start:
                              type: integer
                              format: int64
                              minimum: 0
                              description: Unix timestamp in whole seconds (UTC), not milliseconds.
                            end:
                              type: integer
                              format: int64
                              minimum: 0
                              description: Unix timestamp in whole seconds (UTC), not milliseconds.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: invalid shape, limit, projection, binary path or type rule. Type failures identify paths in details.errors without record values."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: account authentication and a live vault session are required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: vault rights, service-key scope or managed-resource authority do not allow this operation. PRODUCT_ACCESS_REQUIRED: the member holds no access to Structured Ingots (`details.products`: structured_ingots). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such owned vault, record, type definition or retained publication."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: this vault is scheduled for deletion or is being deleted."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read bounded Structured Ingots vault activity
      description: Requires account authentication and a live VAT for this vault. Storage is whole-vault storage including type catalogs, history and other files. Returns exactly 24 UTC hourly buckets for 24h or seven UTC calendar-day buckets for 7d, including the current partial bucket. window_end and the current bucket end equal as_of; all timestamps are Unix seconds. Counts authenticated public object/type requests once (GET/HEAD reads, mutation-method writes), including observed refusals; nested Core/Forge calls and activity/discovery requests are excluded. errors counts HTTP 400 to 599 and conflicts counts 409/412. Counters are approximate, collected independently for account and vault views, and have no historical backfill or exact reconciliation guarantee. Never scans objects or returns record names, keys or values. p95 is a histogram upper bound; overflow beyond 60 seconds is explicit. These operational counters are not a billing invoice.
  /products/structured-ingots/{vault_id}/types:
    get:
      tags:
        - structured-ingots
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: vault_id
          in: path
          required: true
          schema:
            type: string
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 25
          description: "A page-size hint: a value above 200 reads as 200, and a missing, zero, negative or non-numeric one as 25."
        - name: cursor
          in: query
          schema:
            type: string
      responses:
        "200":
          description: A catalog metadata page.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      types:
                        type: array
                        items:
                          type: object
                          properties:
                            type_id:
                              type: string
                            name:
                              type: string
                            created_at:
                              type: integer
                            updated_at:
                              type:
                                - integer
                                - "null"
                      count:
                        type: integer
                      next_cursor:
                        type:
                          - string
                          - "null"
                      has_more:
                        type: boolean
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: invalid shape, limit, projection, binary path or type rule. Type failures identify paths in details.errors without record values."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: account authentication and a live vault session are required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: vault rights, service-key scope or managed-resource authority do not allow this operation. PRODUCT_ACCESS_REQUIRED: the member holds no access to Structured Ingots (`details.products`: structured_ingots). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such owned vault, record, type definition or retained publication."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Browse encrypted type catalogs
      description: Metadata only, separate from data-object counts. Follow continuation through empty filtered pages.
    post:
      tags:
        - structured-ingots
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: vault_id
          in: path
          required: true
          schema:
            type: string
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            type: string
            minLength: 8
            maxLength: 128
            pattern: ^[ -~]+$
      responses:
        "201":
          description: The original type creation receipt, including for an idempotent replay.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      type_id:
                        type: string
                      name:
                        type: string
                      version:
                        type: integer
                      latest_version:
                        type: integer
                      archived:
                        type: boolean
                      schema:
                        type: object
                        additionalProperties: true
                        description: "Bounded JSON Schema 2020-12 subset: object root, nested properties/arrays, required fields, numeric and length bounds, scalar enum/const and supported formats. No remote references, arbitrary regex, code, coercion or implicit defaults. Maximum 32 KiB, 100 fields and depth 8."
                      transforms:
                        type: array
                        maxItems: 100
                        items:
                          type: object
                          required:
                            - path
                            - operations
                          properties:
                            path:
                              type: string
                              description: Exact JSON Pointer.
                            operations:
                              type: array
                              minItems: 1
                              maxItems: 3
                              uniqueItems: true
                              items:
                                type: string
                                enum:
                                  - trim
                                  - lowercase
                                  - uppercase
                      created_at:
                        type: integer
                      updated_at:
                        type: integer
                      created:
                        type: boolean
                      replayed:
                        type: boolean
                        description: True when the original creation receipt is replayed; its status is not a current catalog read.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: invalid shape, limit, projection, binary path or type rule. Type failures identify paths in details.errors without record values."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: account authentication and a live vault session are required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "402":
          description: "PLAN_REQUIRED or QUOTA_EXCEEDED: content publication requires active plan and available storage/bandwidth."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: vault rights, service-key scope or managed-resource authority do not allow this operation. PRODUCT_ACCESS_REQUIRED: the member holds no access to Structured Ingots (`details.products`: structured_ingots). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such owned vault, record, type definition or retained publication."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: an unrelated create already holds this name, or vault deletion is scheduled."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "412":
          description: "PRECONDITION_FAILED: a stale read or competing publication. Reload before retrying."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "413":
          description: "PAYLOAD_TOO_LARGE: request exceeds 1 MiB."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Create an optional business type
      description: One encrypted catalog with immutable definitions. Maximum 50 versions and 256 KiB per catalog. Explicit transforms run before validation; schemas and field names remain vault-encrypted. Optional Idempotency-Key binds this account/vault/type-name creation to the same schema and transformations. Matching retries can resume a pending upload or replay the original creation receipt without uploading again. Replays return the original version=1, latest_version=1 and archived=false, even if the catalog has changed; GET the type for its current status. Unrelated name or payload collisions return 409.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - schema
              properties:
                name:
                  type: string
                  pattern: ^[a-z][a-z0-9_]*$
                  maxLength: 64
                schema:
                  type: object
                  additionalProperties: true
                  description: "Bounded JSON Schema 2020-12 subset: object root, nested properties/arrays, required fields, numeric and length bounds, scalar enum/const and supported formats. No remote references, arbitrary regex, code, coercion or implicit defaults. Maximum 32 KiB, 100 fields and depth 8."
                transforms:
                  type: array
                  maxItems: 100
                  items:
                    type: object
                    required:
                      - path
                      - operations
                    properties:
                      path:
                        type: string
                        description: Exact JSON Pointer.
                      operations:
                        type: array
                        minItems: 1
                        maxItems: 3
                        uniqueItems: true
                        items:
                          type: string
                          enum:
                            - trim
                            - lowercase
                            - uppercase
  /products/structured-ingots/{vault_id}/types/{type_id}:
    get:
      tags:
        - structured-ingots
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: vault_id
          in: path
          required: true
          schema:
            type: string
        - name: type_id
          in: path
          required: true
          schema:
            type: string
        - name: version
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 50
          description: Latest definition if omitted.
      responses:
        "200":
          description: The definition and catalog status.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      type_id:
                        type: string
                      name:
                        type: string
                      version:
                        type: integer
                      latest_version:
                        type: integer
                      archived:
                        type: boolean
                      schema:
                        type: object
                        additionalProperties: true
                        description: "Bounded JSON Schema 2020-12 subset: object root, nested properties/arrays, required fields, numeric and length bounds, scalar enum/const and supported formats. No remote references, arbitrary regex, code, coercion or implicit defaults. Maximum 32 KiB, 100 fields and depth 8."
                      transforms:
                        type: array
                        maxItems: 100
                        items:
                          type: object
                          required:
                            - path
                            - operations
                          properties:
                            path:
                              type: string
                              description: Exact JSON Pointer.
                            operations:
                              type: array
                              minItems: 1
                              maxItems: 3
                              uniqueItems: true
                              items:
                                type: string
                                enum:
                                  - trim
                                  - lowercase
                                  - uppercase
                      created_at:
                        type: integer
                      updated_at:
                        type: integer
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: invalid shape, limit, projection, binary path or type rule. Type failures identify paths in details.errors without record values."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: account authentication and a live vault session are required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: vault rights, service-key scope or managed-resource authority do not allow this operation. PRODUCT_ACCESS_REQUIRED: the member holds no access to Structured Ingots (`details.products`: structured_ingots). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such owned vault, record, type definition or retained publication."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read an immutable type definition
    delete:
      tags:
        - structured-ingots
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: vault_id
          in: path
          required: true
          schema:
            type: string
        - name: type_id
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: The catalog is archived.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - type_id
                      - archived
                    properties:
                      type_id:
                        type: string
                      archived:
                        type: boolean
                        const: true
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: invalid shape, limit, projection, binary path or type rule. Type failures identify paths in details.errors without record values."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: account authentication and a live vault session are required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "402":
          description: "PLAN_REQUIRED or QUOTA_EXCEEDED: content publication requires active plan and available storage/bandwidth."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: vault rights, service-key scope or managed-resource authority do not allow this operation. PRODUCT_ACCESS_REQUIRED: the member holds no access to Structured Ingots (`details.products`: structured_ingots). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such owned vault, record, type definition or retained publication."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: an unrelated create already holds this name, or vault deletion is scheduled."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "412":
          description: "PRECONDITION_FAILED: a stale read or competing publication. Reload before retrying."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "413":
          description: "PAYLOAD_TOO_LARGE: request exceeds 1 MiB."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Archive a type catalog
      description: Prevents new assignments while preserving definitions needed by existing pinned objects. Does not physically delete the catalog. Repeating archive returns the same successful status.
  /products/structured-ingots/{vault_id}/types/{type_id}/versions:
    post:
      tags:
        - structured-ingots
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: vault_id
          in: path
          required: true
          schema:
            type: string
        - name: type_id
          in: path
          required: true
          schema:
            type: string
      responses:
        "201":
          description: The new definition.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      type_id:
                        type: string
                      name:
                        type: string
                      version:
                        type: integer
                      latest_version:
                        type: integer
                      archived:
                        type: boolean
                      schema:
                        type: object
                        additionalProperties: true
                        description: "Bounded JSON Schema 2020-12 subset: object root, nested properties/arrays, required fields, numeric and length bounds, scalar enum/const and supported formats. No remote references, arbitrary regex, code, coercion or implicit defaults. Maximum 32 KiB, 100 fields and depth 8."
                      transforms:
                        type: array
                        maxItems: 100
                        items:
                          type: object
                          required:
                            - path
                            - operations
                          properties:
                            path:
                              type: string
                              description: Exact JSON Pointer.
                            operations:
                              type: array
                              minItems: 1
                              maxItems: 3
                              uniqueItems: true
                              items:
                                type: string
                                enum:
                                  - trim
                                  - lowercase
                                  - uppercase
                      created_at:
                        type: integer
                      updated_at:
                        type: integer
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: invalid shape, limit, projection, binary path or type rule. Type failures identify paths in details.errors without record values."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: account authentication and a live vault session are required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "402":
          description: "PLAN_REQUIRED or QUOTA_EXCEEDED: content publication requires active plan and available storage/bandwidth."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: vault rights, service-key scope or managed-resource authority do not allow this operation. PRODUCT_ACCESS_REQUIRED: the member holds no access to Structured Ingots (`details.products`: structured_ingots). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such owned vault, record, type definition or retained publication."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: an unrelated create already holds this name, or vault deletion is scheduled."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "412":
          description: "PRECONDITION_FAILED: a stale read or competing publication. Reload before retrying."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "413":
          description: "PAYLOAD_TOO_LARGE: request exceeds 1 MiB."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Publish another immutable type definition
      description: Existing records keep their pinned definition. An archived catalog cannot publish. expected_version is the current latest definition number.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - expected_version
                - schema
              properties:
                expected_version:
                  type: integer
                  minimum: 1
                  maximum: 50
                schema:
                  type: object
                  additionalProperties: true
                  description: "Bounded JSON Schema 2020-12 subset: object root, nested properties/arrays, required fields, numeric and length bounds, scalar enum/const and supported formats. No remote references, arbitrary regex, code, coercion or implicit defaults. Maximum 32 KiB, 100 fields and depth 8."
                transforms:
                  type: array
                  maxItems: 100
                  items:
                    type: object
                    required:
                      - path
                      - operations
                    properties:
                      path:
                        type: string
                        description: Exact JSON Pointer.
                      operations:
                        type: array
                        minItems: 1
                        maxItems: 3
                        uniqueItems: true
                        items:
                          type: string
                          enum:
                            - trim
                            - lowercase
                            - uppercase
  /products/structured-ingots/{vault_id}/{ingot_id}:
    get:
      tags:
        - structured-ingots
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: vault_id
          in: path
          required: true
          schema:
            type: string
        - name: ingot_id
          in: path
          required: true
          schema:
            type: string
        - name: delivery
          in: query
          schema:
            type: string
            enum:
              - inline
              - spark
        - name: keys_json
          in: query
          schema:
            type: string
          description: URL-encoded JSON array of 1 to 100 exact key names; mutually exclusive with keys.
        - name: keys
          in: query
          schema:
            type: string
          description: Legacy comma-separated projection; use keys_json to preserve commas and whitespace.
        - name: ttl
          in: query
          schema:
            type: integer
            minimum: 60
            maximum: 86400
            default: 900
          description: Spark delivery only, rounded up to a whole minute.
      responses:
        "200":
          description: Metadata, direct values, or legacy Spark references as requested.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      ingot_id:
                        type: string
                      name:
                        type: string
                      version:
                        type: integer
                      revision:
                        type: string
                        description: Opaque content revision bound to this immutable object ID and publication. Preserve it unchanged; unlike a numeric version it cannot match a replacement object created under the same name.
                      key_count:
                        type: integer
                      type:
                        type:
                          - object
                          - "null"
                        required:
                          - type_id
                          - version
                        additionalProperties: false
                        properties:
                          type_id:
                            type: string
                          version:
                            type: integer
                            minimum: 1
                            maximum: 50
                      created_at:
                        type: integer
                      updated_at:
                        type: integer
                      keys:
                        type: array
                        items:
                          type: string
                      values:
                        type: object
                        additionalProperties: true
                        description: JSON object with explicit binary paths when needed. The field name __proto__ is reserved at every nesting depth.
                      missing_keys:
                        type: array
                        items:
                          type: string
                      inline:
                        type: boolean
                      binary_paths:
                        type: array
                        description: Exact paths to canonical base64 binary leaves, relative to data or set. String map keys and integer array indices are distinct.
                        items:
                          type: array
                          minItems: 1
                          items:
                            oneOf:
                              - type: string
                              - type: integer
                                minimum: 0
                      binary_keys:
                        type: array
                        items:
                          type: string
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: invalid shape, limit, projection, binary path or type rule. Type failures identify paths in details.errors without record values."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: account authentication and a live vault session are required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "402":
          description: "PLAN_REQUIRED or QUOTA_EXCEEDED: content reads require active plan and available bandwidth."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: vault rights, service-key scope or managed-resource authority do not allow this operation. PRODUCT_ACCESS_REQUIRED: the member holds no access to Structured Ingots (`details.products`: structured_ingots). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such owned vault, record, type definition or retained publication."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read a structured object or selected fields
      description: Use delivery=inline for direct JSON, with optional exact top-level projection. Omit projection to read the complete record. Binary leaves are base64 strings identified by binary_paths, never inferred from value shape. Without delivery or projection, returns metadata and key names. Legacy selected-field reads return source-vault-bound single-use Sparks; redemption also needs the source VAT. Oversized or nested-binary Spark handoffs must use inline delivery. A read opens the whole encrypted object internally.
    patch:
      tags:
        - structured-ingots
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: vault_id
          in: path
          required: true
          schema:
            type: string
        - name: ingot_id
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: The new object version.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      ingot_id:
                        type: string
                      name:
                        type: string
                      version:
                        type: integer
                      revision:
                        type: string
                        description: Opaque content revision bound to this immutable object ID and publication. Preserve it unchanged; unlike a numeric version it cannot match a replacement object created under the same name.
                      key_count:
                        type: integer
                      type:
                        type:
                          - object
                          - "null"
                        required:
                          - type_id
                          - version
                        additionalProperties: false
                        properties:
                          type_id:
                            type: string
                          version:
                            type: integer
                            minimum: 1
                            maximum: 50
                      created_at:
                        type: integer
                      updated_at:
                        type: integer
                      created:
                        type: boolean
                      replayed:
                        type: boolean
                        description: Original creation receipt replay, not a current content read.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: invalid shape, limit, projection, binary path or type rule. Type failures identify paths in details.errors without record values."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: account authentication and a live vault session are required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "402":
          description: "PLAN_REQUIRED or QUOTA_EXCEEDED: content publication requires active plan and available storage/bandwidth."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: vault rights, service-key scope or managed-resource authority do not allow this operation. PRODUCT_ACCESS_REQUIRED: the member holds no access to Structured Ingots (`details.products`: structured_ingots). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such owned vault, record, type definition or retained publication."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: an unrelated create already holds this name, or vault deletion is scheduled."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "412":
          description: "PRECONDITION_FAILED: a stale read or competing publication. Reload before retrying."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "413":
          description: "PAYLOAD_TOO_LARGE: request exceeds 1 MiB."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Update fields or assign an optional type atomically
      description: Set replaces entire top-level fields, delete removes them, and omitted type preserves the current pin. A new pin assigns an immutable definition; null detaches it. Send expected_revision from the actual content read to protect both object identity and publication, including name reuse. expected_version remains supported for existing integrations; if both guards are sent both must match. Type changes require a guard. Complete merged data is transformed/validated before conditional publication. SDK and console edits use a guard.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                set:
                  type: object
                  additionalProperties: true
                  description: JSON object with explicit binary paths when needed. The field name __proto__ is reserved at every nesting depth.
                delete:
                  type: array
                  items:
                    type: string
                type:
                  type:
                    - object
                    - "null"
                  required:
                    - type_id
                    - version
                  additionalProperties: false
                  properties:
                    type_id:
                      type: string
                    version:
                      type: integer
                      minimum: 1
                      maximum: 50
                binary_paths:
                  type: array
                  description: Exact paths to canonical base64 binary leaves, relative to data or set. String map keys and integer array indices are distinct.
                  items:
                    type: array
                    minItems: 1
                    items:
                      oneOf:
                        - type: string
                        - type: integer
                          minimum: 0
                expected_version:
                  type: integer
                  minimum: 1
                  description: Numeric object version from the last read. A stale version is refused with 412.
                expected_revision:
                  type: string
                  description: revision from the content read being changed. A changed publication or a different object under the same name returns 412. Prefer this guard for read-modify-write operations.
    delete:
      tags:
        - structured-ingots
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: vault_id
          in: path
          required: true
          schema:
            type: string
        - name: ingot_id
          in: path
          required: true
          schema:
            type: string
        - name: expected_revision
          in: query
          schema:
            type: string
            description: revision from the content read being changed. A changed publication or a different object under the same name returns 412. Prefer this guard for read-modify-write operations.
      responses:
        "204":
          description: Object and retained publications scheduled for durable deletion.
        "400":
          description: "VALIDATION_ERROR: invalid shape, limit, projection, binary path or type rule. Type failures identify paths in details.errors without record values."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: account authentication and a live vault session are required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: vault rights, service-key scope or managed-resource authority do not allow this operation. PRODUCT_ACCESS_REQUIRED: the member holds no access to Structured Ingots (`details.products`: structured_ingots). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such owned vault, record, type definition or retained publication."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "412":
          description: "PRECONDITION_FAILED: a stale read or competing publication. Reload before retrying."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Delete a structured object and its history
      description: Use expected_revision to delete only the object publication you inspected. A stale revision cannot delete a replacement object created under the same name. Omitted, deletion remains unconditional for compatibility.
  /products/structured-ingots/{vault_id}/{ingot_id}/info:
    get:
      tags:
        - structured-ingots
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: vault_id
          in: path
          required: true
          schema:
            type: string
        - name: ingot_id
          in: path
          required: true
          schema:
            type: string
        - name: consistent
          in: query
          schema:
            type: string
            enum:
              - "true"
              - "false"
          description: Accepted for compatibility; Structured Ingots point reads are strongly consistent.
      responses:
        "200":
          description: Object record metadata.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      ingot_id:
                        type: string
                      name:
                        type: string
                      revision:
                        type: string
                        description: Opaque content revision bound to this immutable object ID and publication. Preserve it unchanged; unlike a numeric version it cannot match a replacement object created under the same name.
                      size_bytes:
                        type: integer
                      content_type:
                        type: string
                      status:
                        type: string
                      created_at:
                        type: integer
                      updated_at:
                        type:
                          - integer
                          - "null"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: invalid shape, limit, projection, binary path or type rule. Type failures identify paths in details.errors without record values."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: account authentication and a live vault session are required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: vault rights, service-key scope or managed-resource authority do not allow this operation. PRODUCT_ACCESS_REQUIRED: the member holds no access to Structured Ingots (`details.products`: structured_ingots). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such owned vault, record, type definition or retained publication."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read structured object existence and status
      description: Reads the owned record strongly by ID or root-scoped name without opening its content. A 200 means the row exists, not that its body is readable. Match NOT_FOUND details.resource=Ingot before treating a 404 as an absent object; vault and routing failures also use 404.
  /products/structured-ingots/{vault_id}/{ingot_id}/versions:
    get:
      tags:
        - structured-ingots
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: vault_id
          in: path
          required: true
          schema:
            type: string
        - name: ingot_id
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Retained publication metadata.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      ingot_id:
                        type: string
                      version_limit:
                        type: integer
                        minimum: 0
                        maximum: 50
                      versions:
                        type: array
                        maxItems: 50
                        items:
                          type: object
                          properties:
                            version_id:
                              type: string
                            published_at:
                              type: integer
                            size_bytes:
                              type: integer
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: invalid shape, limit, projection, binary path or type rule. Type failures identify paths in details.errors without record values."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: account authentication and a live vault session are required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: vault rights, service-key scope or managed-resource authority do not allow this operation. PRODUCT_ACCESS_REQUIRED: the member holds no access to Structured Ingots (`details.products`: structured_ingots). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such owned vault, record, type definition or retained publication."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List retained object publications
      description: At most 50 retained previous publications, newest first and excluding current content; no historical bodies are decrypted. IDs are opaque and distinct from numeric object versions. Retention is the shared Vault setting at PUT /vaults/{id}/version-history, default zero. A lowered limit applies on the next successful content change.
  /products/structured-ingots/{vault_id}/{ingot_id}/versions/{version_id}/restore:
    post:
      tags:
        - structured-ingots
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: vault_id
          in: path
          required: true
          schema:
            type: string
        - name: ingot_id
          in: path
          required: true
          schema:
            type: string
        - name: version_id
          in: path
          required: true
          schema:
            type: string
      responses:
        "201":
          description: The newly published object version.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      ingot_id:
                        type: string
                      name:
                        type: string
                      version:
                        type: integer
                      revision:
                        type: string
                        description: Opaque content revision bound to this immutable object ID and publication. Preserve it unchanged; unlike a numeric version it cannot match a replacement object created under the same name.
                      key_count:
                        type: integer
                      type:
                        type:
                          - object
                          - "null"
                        required:
                          - type_id
                          - version
                        additionalProperties: false
                        properties:
                          type_id:
                            type: string
                          version:
                            type: integer
                            minimum: 1
                            maximum: 50
                      created_at:
                        type: integer
                      updated_at:
                        type: integer
                      created:
                        type: boolean
                      replayed:
                        type: boolean
                        description: Original creation receipt replay, not a current content read.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: invalid shape, limit, projection, binary path or type rule. Type failures identify paths in details.errors without record values."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: account authentication and a live vault session are required."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "402":
          description: "PLAN_REQUIRED or QUOTA_EXCEEDED: content publication requires active plan and available storage/bandwidth."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: vault rights, service-key scope or managed-resource authority do not allow this operation. PRODUCT_ACCESS_REQUIRED: the member holds no access to Structured Ingots (`details.products`: structured_ingots). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such owned vault, record, type definition or retained publication."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: an unrelated create already holds this name, or vault deletion is scheduled."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "412":
          description: "PRECONDITION_FAILED: a stale read or competing publication. Reload before retrying."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "413":
          description: "PAYLOAD_TOO_LARGE: request exceeds 1 MiB."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Restore retained values as a new current version
      description: Requires expected_revision or the compatibility expected_version, and a still-retained publication. If both guards are supplied both must match. Preserves the current type pin, applies its transforms and validates the complete restored data before publishing. Participates in current retention and quota accounting; never rolls type policy back silently.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              anyOf:
                - required:
                    - expected_revision
                - required:
                    - expected_version
              properties:
                expected_version:
                  type: integer
                  minimum: 1
                  description: Numeric object version from the last read. A stale version is refused with 412.
                expected_revision:
                  type: string
                  description: revision from the content read being changed. A changed publication or a different object under the same name returns 412. Prefer this guard for read-modify-write operations.
  /profile:
    get:
      tags:
        - profile
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "200":
          description: Your profile.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/Profile"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: your user, or the account, no longer exists."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Get your profile
      description: "The signed-in member's own profile: who they are, their role, their organization's name, and whether they are the account owner."
    put:
      tags:
        - profile
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "200":
          description: The profile as the save stored it.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/ProfileSaved"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the name or a part is too long or holds markup, the name is blank, the parts hold no text, the body carries both `name` and parts, or it carries `email`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: your user, or the account, no longer exists."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Change your name
      description: "Change the signed-in member's display name: as one line (`name`), or as its parts (`given_name`, `family_name`), which compose it given name first. Parts state the whole name: a part left out is cleared, and a name given as one line clears both. A body with neither leaves the name as it is. The email does not change here: a body carrying `email` is refused, and the change goes through POST /settings/email/request-change."
    delete:
      tags:
        - profile
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - confirmation
              properties:
                confirmation:
                  type: string
                  minLength: 1
                  maxLength: 320
                  description: Your sign-in email (letter case and surrounding spaces aside).
              additionalProperties: false
      responses:
        "200":
          description: The user is deleted.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/ProfileDeleted"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the confirmation is missing, or is not your sign-in email."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller is the account owner, or the credential is an API key or an impersonated session."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "SEAT_CHANGE_IN_PROGRESS: another billing update for this account is in progress. Try again in a moment."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Delete your user
      description: "A member deletes their own SparkVault user, permanently: their access to the organization, their Delegated Vault Access Keys (DVAKs), sessions and API keys end at once, and the devices they registered for notifications are deregistered. On a web subscription their seat stops renewing (it stays paid for the rest of the period, and nothing is refunded); on a store subscription the license they held passes to another member. The organization's vaults and files stay with its owner. Only from the member's own session (an API key or an impersonated session is refused), confirming with their sign-in email. The account owner cannot delete their user: they delete the account (DELETE /account). A user already gone is answered as deleted."
  /public/sparks:
    post:
      tags:
        - public
      security: []
      responses:
        "201":
          description: The Spark, sealed, and its one-time link.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/PublicSparkSent"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the body is not a JSON object, names an unsupported field or content type, carries invalid base64 or a filename over 255 characters, or the message names the field: `payload` missing, not a string, or over the cap; `ttl_minutes` not a number, out of range, or not a whole number of minutes. Nothing is counted against the allowance."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "ORIGIN_NOT_ALLOWED: the request's `Origin` is not the SparkVault website's, or it names none. One fixed message, quoting no origin; nothing is read or counted."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "415":
          description: "UNSUPPORTED_MEDIA_TYPE: the body is not `application/json`. Nothing is read or counted."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "PUBLIC_SPARK_LIMIT: the daily allowance is spent. One fixed message, the same whichever allowance refused: `Retry-After` carries the seconds, and `details.resets_at` the Unix time, until the next UTC midnight, when every allowance reopens; no count or limit is sent. Nothing is sealed."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Send a public Spark
      description: "Seal read-once text or a file with no credential, and get its one-time x.sv link in the same call: the sender behind sparkvault.com's \"send a secret\" form. It answers pages of the SparkVault website alone: a request whose `Origin` is not one of the website's, or that names none, is refused, and its CORS answers admit the website's origins alone, never with credentials. The body is `application/json` naming `payload`, optional `ttl_minutes`, `content_type` and `filename`. Only `text/plain` and base64 `application/octet-stream` are accepted; no IP binding or link Spark. Every send first spends a small daily allowance of its client's, of its network's and of the platform's, before anything is sealed; a send past any of them is refused with 429 PUBLIC_SPARK_LIMIT, whichever refused it, and a send that fails after spending gives its allowance back. The link opens once and lives exactly as long as the Spark. An account's own Sparks are sent with `POST /sparks`."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PublicSparkRequest"
  /settings/email/request-change:
    post:
      tags:
        - settings
      security:
        - BearerAuth: []
      responses:
        default:
          description: Response
  /settings/email/verify-change:
    post:
      tags:
        - settings
      security:
        - BearerAuth: []
      responses:
        default:
          description: Response
  /sparklinks:
    get:
      tags:
        - sparklinks
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "200":
          description: A page of grants.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - sparklinks
                      - count
                      - has_more
                    properties:
                      sparklinks:
                        type: array
                        items:
                          $ref: "#/components/schemas/SparkLinkState"
                      count:
                        type: integer
                        description: How many this page holds.
                      has_more:
                        type: boolean
                        description: "More follow. A page can hold fewer than `limit`, or none, while more remain: page on while it is true."
                      next_cursor:
                        type: string
                        description: "Present while `has_more` is true: pass it back as `cursor` for the next page."
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: an unknown `type`, an `asset_id` that is no ingot or Spark id, or a `cursor` this list did not issue for the same query."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Sparks for a `type` of `spark`, Secure Storage for `ingot`, and either with no `type`; a member who holds none of the products the route serves is refused first, naming them all. `details.products` names the products, any one of which admits the request. A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List SparkLinks
      description: "A page of the account's SparkLink grants, newest first; with `asset_id`, the grants of that one file or Spark. A grant an app or Identity holds is listed to its holder alone, and one a product manages (its recipient's delivery) to no one. A Spark's grant belongs to Sparks and a file's to Secure Storage: with no `type`, a member who holds one of the two is listed that product's grants alone."
      parameters:
        - name: X-Vault-Access-Token
          in: header
          required: false
          schema:
            type: string
            pattern: ^vat_
          description: A VAT for one of your vaults. Ingot rows of that vault carry their `link_code` and `link_url`; every other ingot row carries null for both. A VAT that is expired, revoked, or another account's fails the request (401 or 403).
        - name: type
          in: query
          required: false
          schema:
            type: string
            enum:
              - spark
              - ingot
        - name: asset_id
          in: query
          required: false
          schema:
            type: string
            pattern: ^(ing|spk)_[A-Za-z0-9_-]+$
          description: Only the grants of this one ingot or Spark (a file's durable share and its one-time links), in no order. Anything but an ingot or Spark id is 400 VALIDATION_ERROR.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 50
          description: "A page-size hint: a value above 100 reads as 100, and a missing, zero, negative or non-numeric one as 50."
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: The `next_cursor` a previous page returned, with the same `type` and `asset_id`.
  /sparklinks/{code}:
    get:
      tags:
        - sparklinks
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: code
          in: path
          required: true
          schema:
            type: string
          description: The link code.
        - name: X-Vault-Access-Token
          in: header
          required: false
          schema:
            type: string
            pattern: ^vat_
          description: "Required for an ingot link: a VAT for its vault (read-only suffices). Without one, 401; another vault's, 403."
      responses:
        "200":
          description: The grant.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/SparkLinkState"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials, or an ingot link read with no VAT."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: a product manages the grant (its recipient's delivery, reached only through that product), or the VAT is another vault's. PRODUCT_ACCESS_REQUIRED: the member holds no access to the grant's product: Sparks for a Spark's grant, Secure Storage for a file's; a member who holds none of the products the route serves is refused first, naming them all. `details.products` names the products, any one of which admits the request. A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no grant of the account has this code, or an app or Identity holds it."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read a SparkLink
      description: One grant of the account, as the list rows are.
    delete:
      tags:
        - sparklinks
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: code
          in: path
          required: true
          schema:
            type: string
          description: The link code.
        - name: X-Vault-Access-Token
          in: header
          required: false
          schema:
            type: string
            pattern: ^vat_
          description: "Required for an ingot link: a read-write VAT for its vault. Without one, 401; another vault's, 403; a read-only one, 403 with `details.reason` VAT_READ_ONLY."
      responses:
        "200":
          description: The grant, deleted.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - deleted
                      - link_code
                    properties:
                      deleted:
                        type: boolean
                        const: true
                      link_code:
                        type: string
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials, or an ingot link deleted with no VAT."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: a product manages the grant (its recipient's delivery, reached only through that product); the VAT is another vault's or read-only; or the seat cannot write. PRODUCT_ACCESS_REQUIRED: the member holds no access to the grant's product: Sparks for a Spark's grant, Secure Storage for a file's; a member who holds none of the products the route serves is refused first, naming them all. `details.products` names the products, any one of which admits the request. A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no grant of the account has this code, or an app or Identity holds it."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the vault's sharing settings changed while the request was made; try again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Delete a SparkLink
      description: Delete one grant, which then opens nothing, and record who deleted it in the account's audit log. Its file or Spark is untouched, but a Spark stops listing the link.
  /sparks:
    get:
      tags:
        - sparks
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "200":
          description: A page of Sparks.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - sparks
                      - count
                      - has_more
                    properties:
                      sparks:
                        type: array
                        items:
                          $ref: "#/components/schemas/SparkSummary"
                      count:
                        type: integer
                        description: How many this page holds.
                      has_more:
                        type: boolean
                        description: "More follow. A page can hold fewer than `limit`, or none, while more remain: page on while it is true."
                      next_cursor:
                        type: string
                        description: "Present while `has_more` is true: pass it back as `cursor` for the next page."
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: a `status` other than `active` or `ash`; a `kindling` that is no kindling id; a `cursor` this list did not issue for the same query."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Sparks, or, for the Sparks of a `kindling` (SparkSync), Secure Storage or Structured Ingots; a member who holds none of the products the route serves is refused first, naming them all. `details.products` names the products, any one of which admits the request. A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List the account's Sparks
      description: A page of the account's Sparks, newest first, without their payloads. A Spark an app or Identity holds (its sign-in ceremony state) is listed only to its holder. Page with `cursor` until `has_more` is false.
      parameters:
        - name: status
          in: query
          required: false
          schema:
            type: string
            enum:
              - active
              - ash
          description: "Only the Sparks in this state when the list answers, each listed with it as its `status`. `active`: content still live, so not burned, not deleted and not past `expires_at` (a Spark a recipient is reading is active). `ash`: burned by a recipient's read or answer, or by a recall of its content; a Spark its owner deleted is reported `deleted`, never in `ash`. `expired` and `deleted` Sparks are listed only unfiltered."
        - name: kindling
          in: query
          required: false
          schema:
            type: string
            pattern: ^kdl_[0-9a-f]{32}$
          description: "Only the Sparks of this kindling: `kdl_` and 32 lowercase hex digits."
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 100
          description: "A page-size hint: a value above 500 reads as 500, and a missing, zero, negative or non-numeric one as 100."
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: The `next_cursor` a previous page returned, with the same `status` and `kindling`. Opaque, and sealed to the query that issued it.
    post:
      tags:
        - sparks
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "200":
          description: The Spark, sealed.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/SparkCreated"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the body is not a JSON object, or the message names the field: `payload` missing, not a string, over the cap, or (for a binary type) not valid base64; `content_type` not exactly one media type; a link Spark's URL not http or https; `filename` not a string or too long; `ttl_minutes` not a number, out of range, or not a whole number of minutes; `kindling` not a kindling id; a link Spark that names `kindling` or `with_kindling`, which no kindling carries."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the session has no user of an organization yet. PRODUCT_ACCESS_REQUIRED: the member holds no access to Sparks, or, for a create that names `kindling` or `with_kindling` (SparkSync), Secure Storage or Structured Ingots; a member who holds none of the products the route serves is refused first, naming them all. `details.products` names the products, any one of which admits the request. A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Create a Spark
      description: "Seal a read-once secret. It burns when it is read, and expires unread after `ttl_minutes`, a whole number of minutes. A `text/uri-list` Spark is a link Spark: it is created with its public x.sv link, which never outlives it."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SparkCreateRequest"
  /sparks/shared/{id}/meta:
    get:
      tags:
        - sparks
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
        - {}
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The Spark (`spk_…`).
      responses:
        "200":
          description: The Spark can be read.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - spark_id
                      - status
                      - expires_at
                      - time_remaining
                      - has_filename
                      - content_type
                    properties:
                      spark_id:
                        type: string
                        pattern: ^spk_
                      status:
                        type: string
                        const: active
                      expires_at:
                        type: integer
                        description: Unix seconds.
                      time_remaining:
                        type: integer
                        description: Seconds until it expires.
                      has_filename:
                        type: boolean
                      content_type:
                        type: string
        "403":
          description: "FORBIDDEN: to its owner, because a product manages the Spark."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: 'NOT_FOUND: the Spark cannot be read by this caller: "This secret is not available" to anyone but its owner, who hears "This secret has already been viewed" or "This secret has expired".'
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Check a shared Spark
      description: Whether a Spark can still be read, and how long it has left, without reading it. Answers its owner, and anyone its link opens to with no proof; every other caller, and every Spark that cannot be read, gets one opaque 404, so the route never says which Spark ids exist. Its owner hears why a Spark cannot be read.
  /sparks/{id}:
    get:
      tags:
        - sparks
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The Spark (`spk_…`).
      responses:
        "200":
          description: The Spark, read and burned.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/SparkRead"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the Spark is burned (read once) or expired, or another request read it first. PRODUCT_ACCESS_REQUIRED: the member holds no access to the product the Spark belongs to: Secure Storage or Structured Ingots for a Spark in a kindling (SparkSync), Secure Notify for a reply to a Secure Notify request, Structured Ingots for a Structured Ingots value, Sparks for any other; a member who holds none of the products the route serves is refused first, naming them all. `details.products` names the products, any one of which admits the request. A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no Spark has this id, or an app or Identity holds it."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: another request is reading the Spark; try again in a moment."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read a Spark
      description: "Read a Spark once: the answer carries its payload, and the read burns it, so no request reads it again. A Spark an app or Identity holds is read only by its holder."
    delete:
      tags:
        - sparks
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The Spark (`spk_…`).
      responses:
        "204":
          description: The Spark is burned and its links deleted.
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: a product manages the Spark, so it is recalled through the product. PRODUCT_ACCESS_REQUIRED: the member holds no access to Sparks (`details.products`: sparks). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no Spark of the account has this id, or an app or Identity holds it."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Delete a Spark
      description: "Burn a Spark before it is read: its sealed content is destroyed, and every link to it is deleted, each recorded in the account's audit log as deleted by the caller. The Spark stays listed as `deleted` until its record is removed, a day after it would have expired. Deleting a Spark already burned or deleted answers 204 too, and completes a delete whose link removal failed."
  /sparks/{id}/share:
    get:
      tags:
        - sparks
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The Spark (`spk_…`).
      responses:
        "200":
          description: "The Spark's link, or `shared: false`."
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    oneOf:
                      - $ref: "#/components/schemas/SparkShare"
                      - type: object
                        required:
                          - shared
                          - spark_id
                        properties:
                          shared:
                            type: boolean
                            const: false
                          spark_id:
                            type: string
                            pattern: ^spk_
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: a product manages the Spark. PRODUCT_ACCESS_REQUIRED: the member holds no access to Sparks (`details.products`: sparks). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no Spark of the account has this id, or an app or Identity holds it."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read a Spark's sharing
      description: Whether the Spark is shared, and its link's settings and status when it is. A Spark's link is answered from the grant itself, read by the code the Spark records, so a change the owner just made is always seen.
    patch:
      tags:
        - sparks
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The Spark (`spk_…`).
      responses:
        "200":
          description: The Spark's link, as the request left it.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    allOf:
                      - $ref: "#/components/schemas/SparkShare"
                    type: object
                    required:
                      - delivered_to
                    properties:
                      delivered_to:
                        type: array
                        items:
                          type: string
                        description: The invitees this request delivered the link to.
                      already_shared:
                        type: boolean
                        const: true
                        description: "Present when the Spark was already shared: the settings were applied to its link in place."
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: an unknown `visibility`; `invites` not an array, naming more than one identity, naming one with a visibility other than invite_only, or an invalid identity; an invite_only link with no invitee; a phone number while the account's Identity settings verify none; `expires_in_seconds` not a whole number from 60; a change to a link already opened (\"Only active SparkLinks can be updated\"); `link_code` without a link code's shape."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: 'FORBIDDEN: the Spark is burned or expired, its link is past its own expiry ("This SparkLink has expired"), a product manages it, or an app or Identity holds it. PRODUCT_ACCESS_REQUIRED: the member holds no access to Sparks (`details.products`: sparks). A company admin grants access.'
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no Spark of the account has this id, or an app or Identity holds it."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the Spark's link is not the one `link_code` names, because it was turned off, or replaced by another share, after it was read. Nothing was changed. Or the link changed or was removed while the request was made, or another request shared the Spark first. Read the share and try again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "INVITE_RESEND_LIMIT: the link's invitation was already sent five times this hour, resends included; an attempt that sent nothing (a message limit refused it, or the invitee's address declined it) is not counted. EMAIL_RATE_LIMIT (or the phone's own limit code): the invitee has been sent as many messages as they can receive for now. EMAIL_ACCOUNT_RATE_LIMIT, SMS_ACCOUNT_RATE_LIMIT or SMS_PLATFORM_BUDGET_SPENT: messages from this sender are unavailable for now. With each of these the link is in place as the request left it, but its invitation was not delivered; `Retry-After` and `details.resets_at` say when to resend it. RATE_LIMIT_EXCEEDED: the account's request limit; nothing was changed."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "502":
          description: "INVITATION_DELIVERY_FAILED: the invitation could not be delivered; the link stays in place."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Share a Spark
      description: "Share a Spark through a SparkLink, or change the settings of the link it has. The first share creates the link: `visibility` defaults to `public`, and `expires_in_seconds` sets its lifetime. A Spark already shared keeps its link and its code: the settings are applied to it in place (`already_shared: true`), an omitted `visibility` keeps the current one, an omitted `invites` keeps the current invitee, `expires_in_seconds` is ignored, and a request that changes nothing writes nothing. `invites` names the one identity an `invite_only` link is delivered to, and is refused with any other visibility. `delivered_to` names the invitees this request delivered the link to; a request that invites no one new delivers nothing, and POST /sparks/{id}/share/resend sends an invitation again. `link_code` names the link the change was asked of, so a change asked of a link turned off or replaced since is refused rather than applied to the link that took its place. A Spark a product manages or an app or Identity holds is never shared here."
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                link_code:
                  type: string
                  pattern: ^[A-Za-z0-9_-]{22}$
                  description: The `link_code` of the link this request was asked of, as the share answered it. When it is not the Spark's link now (that link was turned off, or replaced by another share), the request is refused 409 and changes nothing. Omitted, the request acts on the Spark's link now.
                visibility:
                  type: string
                  enum:
                    - public
                    - authenticated
                    - invite_only
                  description: "`public` on a first share; an omitted visibility keeps the link's current one."
                invites:
                  type: array
                  items:
                    type: string
                  maxItems: 1
                  description: "invite_only only: the one email address or phone number the link is delivered to. A phone number is invited only while the account's Identity settings verify one, by SMS or voice."
                expires_in_seconds:
                  type: integer
                  minimum: 60
                  description: "First share only: the link's lifetime in whole seconds, capped at the Spark's own expiry."
    delete:
      tags:
        - sparks
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The Spark (`spk_…`).
        - name: link_code
          in: query
          required: false
          schema:
            type: string
            pattern: ^[A-Za-z0-9_-]{22}$
          description: "The `link_code` of the link this unshare was asked of, as the share answered it. When the Spark's link now is another one (a share replaced it), the request is refused 409 and deletes nothing. A link already turned off answers `shared: false`, as an unshare that names none does, so a retried unshare is never refused. Omitted, the request deletes the Spark's link now."
      responses:
        "200":
          description: The Spark, unshared.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - shared
                      - message
                    properties:
                      shared:
                        type: boolean
                        const: false
                      message:
                        type: string
                        enum:
                          - SparkLink deleted successfully
                          - Spark was not shared
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: `link_code` without a link code's shape."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: a product manages the Spark. PRODUCT_ACCESS_REQUIRED: the member holds no access to Sparks (`details.products`: sparks). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no Spark of the account has this id, or an app or Identity holds it."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the Spark's link is another one than `link_code` names, because a share replaced it after it was read. Nothing was deleted; read the share and try again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Unshare a Spark
      description: "Delete the Spark's link, which then opens nothing, and record who deleted it in the account's audit log, once, however many requests remove it together. The Spark itself is untouched. Idempotent: a Spark with no link answers `shared: false` too, the link `link_code` names included, so a retried unshare is never refused. A `link_code` naming a link another share replaced since is refused, so the link that took its place is never deleted."
  /sparks/{id}/share/resend:
    post:
      tags:
        - sparks
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The Spark (`spk_…`).
      responses:
        "200":
          description: The invitation, delivered again.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - resent
                      - spark_id
                      - identity
                      - identity_type
                      - sent_at
                    properties:
                      resent:
                        type: boolean
                        const: true
                      spark_id:
                        type: string
                        pattern: ^spk_
                      identity:
                        type: string
                        description: The invitee the link was delivered to.
                      identity_type:
                        type: string
                        enum:
                          - email
                          - phone
                      sent_at:
                        type: integer
                        description: Unix seconds.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: `link_code` without a link code's shape."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the Spark is burned or expired, or its link is spent or past its own expiry, so it opens nothing. PRODUCT_ACCESS_REQUIRED: the member holds no access to Sparks (`details.products`: sparks). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no Spark has this id, an app or Identity holds it, or its link is not invite-only."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the Spark's link is not the one `link_code` names, because it was turned off, or replaced by another share, after it was read. Nothing was changed, and nothing was sent; read the share and try again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "INVITE_RESEND_LIMIT: the link's invitation was already sent five times this hour, its share's deliveries included. EMAIL_RATE_LIMIT (or the phone's own limit code): the invitee has been sent as many messages as they can receive for now. EMAIL_ACCOUNT_RATE_LIMIT, SMS_ACCOUNT_RATE_LIMIT or SMS_PLATFORM_BUDGET_SPENT: messages from this sender are unavailable for now. In each case nothing was sent, and `Retry-After` and `details.resets_at` say when to resend. RATE_LIMIT_EXCEEDED: the account's request limit."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "502":
          description: "INVITATION_DELIVERY_FAILED: the invitation could not be delivered; the link stays in place."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Resend a Spark Invitation
      description: "Deliver an invite-only Spark's link to its invitee again, by email or SMS, changing nothing about the link. A share writes the link before it delivers the invitation, so one whose delivery failed (502 INVITATION_DELIVERY_FAILED) leaves the link in place, and a share repeated with the same invitee delivers nothing (its `delivered_to` is empty): this is how the invitation goes out again. One link's invitation is sent at most five times an hour, its share's deliveries included; an attempt that sent nothing (a message limit refused it, or the invitee's address declined it) is not counted. `link_code` names the link the resend was asked of, so a link replaced since is never delivered in its place."
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                link_code:
                  type: string
                  pattern: ^[A-Za-z0-9_-]{22}$
                  description: The `link_code` of the link this request was asked of, as the share answered it. When it is not the Spark's link now (that link was turned off, or replaced by another share), the request is refused 409 and changes nothing. Omitted, the request acts on the Spark's link now.
  /unsubscribe:
    get:
      tags:
        - unsubscribe
      security: []
      responses:
        default:
          description: Response
    post:
      tags:
        - unsubscribe
      security: []
      responses:
        default:
          description: Response
  /users:
    get:
      tags:
        - users
      security:
        - BearerAuth: []
      responses:
        "200":
          description: A page of users.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/OrganizationUserPage"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: `product` is not a product a user can be granted, or is sent with `search`, `search` is over 320 characters, `status` is not one a user holds, or the cursor was issued for another listing. INVALID_CURSOR: the cursor opened but is not a position in this listing."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller is not an org admin, or the credential is not an interactive session."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "503":
          description: "ROSTER_INDEX_PROVISIONING: the user list is still being set up for this deployment; a `product` listing answers meanwhile."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List your organization's users
      description: "A page of the organization's users (org admins only), in name order, case and accents set aside (a user with no name by their email address), each with the license they hold now, any change scheduled for the end of the paid period, and the products they may use. A search lists the users whose name begins with it, in name order, then those whose email address begins with it, in address order; each user once. `product` lists the users who may use that product instead, narrowed by `status` when one is sent (it takes no search): each page is in name order, and the pages are not, so a user on a later page can sort before one on an earlier page. The first page of a listing that is neither a search nor a `product` listing carries `total_count`."
      parameters:
        - name: product
          in: query
          required: false
          schema:
            type: string
            enum:
              - vaults
              - sparks
              - identity
              - structured_ingots
              - help_desk
              - notify
          description: "A product: the users granted its use."
        - name: search
          in: query
          required: false
          schema:
            type: string
            maxLength: 320
          description: The beginning of a user's name or of their email address.
        - name: status
          in: query
          required: false
          schema:
            type: string
            enum:
              - active
              - invited
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 50
          description: "A page-size hint: a value above 200 reads as 200, and a missing, zero, negative or non-numeric one as 50."
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: The `next_cursor` a previous page returned, with the same product, search and status.
  /users/accept-invite:
    get:
      tags:
        - users
      security: []
      responses:
        default:
          description: Response
    post:
      tags:
        - users
      security: []
      responses:
        default:
          description: Response
  /users/dvak-revocation/preview:
    post:
      tags:
        - users
      security:
        - BearerAuth: []
      responses:
        "200":
          description: The vaults the change would leave without a key.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/VaultsLeftWithoutKey"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: `user_ids` is missing, empty, holds a blank or non-string id, or names more than 10,000 members."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller is not an org admin, or the credential is not an interactive session."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Preview the vaults taking members' keys away would leave without a key
      description: "Removing a member or taking their license away revokes every Delegated Vault Access Key (DVAK) they hold (org admins only). This names the vaults that change would leave with no live DVAK, read as it would find the keys now, so the admin can be warned before confirming. Read-only: nothing is revoked. An id the organization holds no member for holds no key of its vaults and adds nothing."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - user_ids
              properties:
                user_ids:
                  type: array
                  minItems: 1
                  maxItems: 10000
                  items:
                    type: string
                    minLength: 1
                  description: The members the change names.
  /users/invite:
    post:
      tags:
        - users
      security:
        - BearerAuth: []
      responses:
        default:
          description: Response
      summary: Invite a user to your organization
      description: "Invite a person to the organization by email (org admins only): they are a user with status `invited` until they accept the emailed invitation. An address a user of any organization holds is refused. `products` grants the invitee products as they are invited, with the invite or not at all; they act on them only once they accept. A licensed invite (`seat_type` `full`) assigns the license as any license change does, charged no more than `quoted_charge`; when the license is refused, the invite and its product grants are withdrawn and the refusal is the answer. When the withdrawal itself does not land, the refusal keeps its status and code, its message adds that the invitation stands without a license (the withdrawal was refused) or may still stand (it got no answer, and may yet land), and its `details` add `invitation` (`stands` or `unconfirmed`) and the invitee's `user_id`; no invitation email is sent, and the member list shows the invitation to license or remove. A refusal answered with a server error carries no message or details, so the member list is where it shows. The answer is the invited user (`user_id`, `email`, `name`, `given_name`, `family_name`, `role`, `status`, `products`, `invited_at`) and whether their invitation email went out (`email_sent`, `email_error`, `email_declined`): an email that fails or is declined never fails the invite, which stands either way."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - email
              properties:
                email:
                  type: string
                  description: The address they will sign in with.
                role:
                  type: string
                  enum:
                    - admin
                    - user
                  default: user
                seat_type:
                  type: string
                  enum:
                    - full
                    - unlicensed
                  default: unlicensed
                quoted_charge:
                  type: object
                  description: What the confirmation of a licensed invite told the admin it charges now.
                  properties:
                    full:
                      type: integer
                      minimum: 0
                    period_end:
                      type: integer
                      description: "Unix seconds: when the charged billing period ends."
                    prorated_at:
                      type: integer
                      description: "Unix seconds: the second the figure was quoted for."
                    amount_usd:
                      type: string
                      description: The quoted figure in dollars, to the cent ("52.67").
                name:
                  type: string
                  description: Their name as one line; or send its parts instead.
                given_name:
                  type: string
                family_name:
                  type: string
                products:
                  type: array
                  items:
                    type: string
                    enum:
                      - vaults
                      - sparks
                      - identity
                      - structured_ingots
                      - help_desk
                      - notify
                  description: The products to grant them the use of; a product named twice is granted once. Absent, every product but `help_desk`, which is granted only when named; none for an empty list. An admin (`role` admin) is granted every product whatever this names.
  /users/me/license-request:
    post:
      tags:
        - users
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        default:
          description: Response
  /users/products/{product}:
    put:
      tags:
        - users
      security:
        - BearerAuth: []
      parameters:
        - name: product
          in: path
          required: true
          schema:
            type: string
            enum:
              - vaults
              - sparks
              - identity
              - structured_ingots
              - help_desk
              - notify
      responses:
        "200":
          description: "What the grant did: at least one user named was granted, unchanged or not found."
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/ProductAccessGranted"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: `product` is not a product a user can be granted, or `user_ids` is not a list of 1 to 100 user ids."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller is not an org admin, or the credential is not an interactive session."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: every user named failed because other changes to their access kept landing first, so nothing changed; `details` is the answer a 200 would carry (`product`, `granted`, `unchanged`, `not_found`, `failed`). Try again."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: "INTERNAL_ERROR: every user named failed, at least one for a reason other than a conflict, so nothing is known to have changed. Repeating the request is safe."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Grant users access to a product
      description: "Let up to 100 users of the organization, active or invited, use a product (org admins only), named by `user_ids`. Access only: it changes no license and no billing. An invited user holds the access before they accept, and the product acts on it only once they have. Each user is granted on their own, and the answer says what happened to each: a user who holds the access already is unchanged, and a user whose grant could not be made is in `failed` while every other user's grant stands. When every user named failed, nothing is known to have changed and the request itself is refused: 409 when each failure was `CONFLICT`, 500 otherwise. Repeating the request is safe."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - user_ids
              properties:
                user_ids:
                  type: array
                  minItems: 1
                  maxItems: 100
                  items:
                    type: string
                    pattern: ^usr_[A-Za-z0-9_-]+$
                    maxLength: 128
                  description: The users the change names. A user named twice is changed once.
    delete:
      tags:
        - users
      security:
        - BearerAuth: []
      parameters:
        - name: product
          in: path
          required: true
          schema:
            type: string
            enum:
              - vaults
              - sparks
              - identity
              - structured_ingots
              - help_desk
              - notify
      responses:
        "200":
          description: "What the revocation did: at least one user named was revoked or unchanged."
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/ProductAccessRevoked"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: `product` is not a product a user can be granted, or `user_ids` is not a list of 1 to 100 user ids."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "AUTHENTICATION_ERROR: missing or invalid credentials."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller is not an org admin, or the credential is not an interactive session."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "ADMIN_HOLDS_EVERY_PRODUCT: every user named is an org admin, who holds every product, so nothing changed. CONFLICT: every user named failed as an admin or because other changes to their access kept landing first, at least one the latter, so nothing changed; try again. Either way `details` is the answer a 200 would carry (`product`, `revoked`, `unchanged`, `failed`, `removed_roles`)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "429":
          description: "RATE_LIMIT_EXCEEDED: the account exceeded 5000 requests this minute. `Retry-After` carries the seconds to wait, and `details` carries limit/resets_at, plus `used` whenever the request was counted. A request refused because the limiter itself was unavailable reports no `used`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: "INTERNAL_ERROR: every user named failed, at least one for a reason other than a conflict, so nothing is known to have changed. Repeating the request is safe."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Revoke users' access to a product
      description: "Take up to 100 users' access to a product away (org admins only), named by `user_ids`. Access only: it changes no license and no billing. An org admin holds every product, so an admin named is in `failed` (`ADMIN_HOLDS_EVERY_PRODUCT`) and keeps it. Each user is revoked on their own, and the answer says what happened to each: a user who does not hold the access is unchanged, and a user whose revocation could not be made is in `failed` while every other user's revocation stands. When every user named failed, nothing is known to have changed and the request itself is refused: 409 `ADMIN_HOLDS_EVERY_PRODUCT` when each named an admin, 409 `CONFLICT` when each failed as an admin or a conflict, 500 otherwise. Repeating the request is safe."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - user_ids
              properties:
                user_ids:
                  type: array
                  minItems: 1
                  maxItems: 100
                  items:
                    type: string
                    pattern: ^usr_[A-Za-z0-9_-]+$
                    maxLength: 128
                  description: The users the change names. A user named twice is changed once.
  /users/{id}:
    patch:
      tags:
        - users
      security:
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
    delete:
      tags:
        - users
      security:
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /users/{id}/resend-invite:
    post:
      tags:
        - users
      security:
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        default:
          description: Response
  /vaults:
    get:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "200":
          description: A page of vaults.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - vaults
                      - count
                      - has_more
                    properties:
                      vaults:
                        type: array
                        items:
                          $ref: "#/components/schemas/VaultSummary"
                      count:
                        type: integer
                        description: How many this page holds.
                      has_more:
                        type: boolean
                        description: "More follow. A page can hold fewer than `limit`, or none, while more remain: page on while it is true."
                      next_cursor:
                        type: string
                        description: "Present while `has_more` is true: pass it back as `cursor` for the next page."
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: a `cursor` this list did not issue for the same query."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage or Structured Ingots (`details.products`: vaults, structured_ingots). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List the account's vaults
      description: A page of the account's vaults, newest first. Page with `cursor` until `has_more` is false.
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 100
          description: "A page-size hint: a value above 500 reads as 500, and a missing, zero, negative or non-numeric one as 100."
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: The `next_cursor` a previous page returned, with the same `status`. Opaque, and sealed to the query that issued it.
        - name: status
          in: query
          required: false
          schema:
            type: string
          description: "Only vaults stored in this status (`active`, `deletion_scheduled`): the stored status, which a vault in use answers as `sealed`. Omitted: every vault but one being deleted."
    post:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
  /vaults/{id}:
    get:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The vault ID.
      responses:
        "200":
          description: The vault.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - vault_id
                      - name
                      - ingot_count
                      - structured_ingot_count
                      - structured_ingots_enabled
                      - ingot_version_limit
                      - structured_ingot_version_limit
                      - storage_bytes
                      - last_unsealed_at
                      - unseal_count
                      - reseal_idle_seconds
                      - reseal_max_seconds
                      - reseal_defaults
                    properties:
                      vault_id:
                        type: string
                      name:
                        type: string
                      description:
                        type: string
                        description: Absent when the vault has none.
                      status:
                        type: string
                        description: "`sealed` or `unsealed` for a vault in use (`unsealed` while any session has it open), or `deletion_scheduled` while its deletion waits out the seven-day window."
                      ingot_count:
                        type: integer
                      structured_ingot_count:
                        type:
                          - integer
                          - "null"
                        minimum: 0
                        maximum: 9007199254740991
                        description: Number of published Structured Ingots in the vault. New vaults start at 0; null means an older vault's count is not initialized, never that it is empty. No object names, keys or values are included.
                      structured_ingots_enabled:
                        type: boolean
                        description: Durable Structured Ingots activation; remains true after the final object is deleted. Legacy positive counts also imply activation.
                      ingot_version_limit:
                        type: integer
                        minimum: 0
                        maximum: 50
                        default: 0
                        description: Previous versions retained per user file or structured object, in addition to its current version. Zero disables retention. The limit applies on each ingot's next successful content change; retained content counts toward storage usage. Internal app records retain their own lifecycle.
                      structured_ingot_version_limit:
                        type: integer
                        minimum: 0
                        maximum: 50
                        default: 0
                        description: Compatibility alias of ingot_version_limit. Use ingot_version_limit for new integrations.
                        deprecated: true
                      storage_bytes:
                        type: integer
                      created_at:
                        type: integer
                        description: Unix seconds.
                      last_unsealed_at:
                        type:
                          - integer
                          - "null"
                        description: Unix seconds; null when it was never unsealed.
                      unseal_count:
                        type: integer
                      reseal_idle_seconds:
                        type:
                          - integer
                          - "null"
                        description: Seconds without a qualifying file action before resealing. Null inherits the system default; 0 disables inactivity resealing.
                      reseal_max_seconds:
                        type:
                          - integer
                          - "null"
                        description: Maximum seconds unsealed regardless of activity; null inherits the system default.
                      reseal_defaults:
                        type: object
                        required:
                          - idle_seconds
                          - max_seconds
                        properties:
                          idle_seconds:
                            type: integer
                          max_seconds:
                            type: integer
                      deletion_requested_at:
                        type: integer
                        description: "With `deletion_scheduled`: Unix seconds."
                      deletion_scheduled_for:
                        type: integer
                        description: "With `deletion_scheduled`: Unix seconds, the deadline."
                      deletion_requested_by:
                        type: string
                        description: "With `deletion_scheduled`: the admin who scheduled it."
                      deletion_schedule_id:
                        type: string
                        description: "With `deletion_scheduled`: the schedule a cancel names."
                      deletion_notice_unreached:
                        type:
                          - array
                          - "null"
                        items:
                          $ref: "#/components/schemas/UnreachedAdmin"
                        description: "With `deletion_scheduled`, answered to a company administrator or owner signed in, never to a member or an API key: each administrator the schedule's notice could not reach, empty when it reached every one; null while its notices are still being sent."
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage or Structured Ingots (`details.products`: vaults, structured_ingots). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such vault on this account, or its irreversible cleanup has started."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Get a vault
      description: The vault's metadata, read strongly. A vault whose irreversible cleanup has started answers 404; one scheduled for deletion answers with its schedule and, to a company administrator or owner signed in, the administrators its notice could not reach.
    put:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
    delete:
      tags:
        - vaults
      security:
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The vault to delete.
        - name: X-Vault-Deletion-Mode
          in: header
          required: true
          schema:
            type: string
            enum:
              - schedule
          description: Must be schedule. Confirms that the client retains the vault and its saved keys during the cancellation window; older clients expecting immediate deletion are refused before any change.
        - name: X-Confirm-Name-B64
          in: header
          required: true
          schema:
            type: string
            pattern: ^[A-Za-z0-9+/]+={0,2}$
          description: The vault name as standard base64 of its UTF-8 bytes, so any name travels in a header. It must decode to the vault name exactly (case-sensitive); a mismatch, or a value that is not base64 of UTF-8, is refused 400 VALIDATION_ERROR.
      responses:
        "202":
          description: Deletion is scheduled; a request after permanent cleanup starts returns status deleting.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - vault_id
                      - status
                    properties:
                      vault_id:
                        type: string
                      status:
                        type: string
                        enum:
                          - deletion_scheduled
                          - deleting
                      deletion_requested_at:
                        type: integer
                        description: "Unix seconds: when deletion was scheduled."
                      deletion_scheduled_for:
                        type: integer
                        description: "Unix seconds: the deadline for cancellation, seven days after the request."
                      deletion_requested_by:
                        type: string
                        description: The initiating company administrator.
                      deletion_schedule_id:
                        type: string
                        description: Identifies this schedule; required to cancel it.
                      deletion_notice_unreached:
                        type:
                          - array
                          - "null"
                        items:
                          $ref: "#/components/schemas/UnreachedAdmin"
                        description: "With `deletion_scheduled`: each company administrator the schedule's notice could not reach, empty when it reached every one; null while its notices are still being sent (a failed send waits for its retry), when the vault's read names them once they are."
                      started_at:
                        type: integer
                        description: "Unix seconds: when irreversible cleanup started (status deleting only)."
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the client does not declare X-Vault-Deletion-Mode: schedule, or the name confirmation is missing, is not base64 of UTF-8, or is not the vault name exactly."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "LICENSE_REQUIRED: scheduling deletion needs a Full License. FORBIDDEN: the caller is not a company administrator or owner, or the vault is a system vault (`details.is_system`), which goes only with its account. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such vault on this account."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "VAULT_IN_USE_BY_HELP_DESK: the help desk keeps its requests in this vault and is active (`details.reason` help_desk_active), or one of those requests is under legal hold (`details.reason` legal_hold)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Schedule vault deletion
      description: "A company administrator or owner schedules permanent deletion seven days ahead. The vault stays visible, but immediately refuses content access, unsealing, uploads, downloads and shared links, including existing access tokens. Other active company administrators are emailed. One whose address the mail service declines (a suppressed address) is not, and the deletion does not wait for that notice: the answer names each one (`deletion_notice_unreached`), as the vault's read does to a company administrator, and until the deadline the notice is tried again at the address each holds then. An administrator can cancel the specific schedule before deletion_scheduled_for through POST /vaults/{id}/deletion/cancel. Repeating this request returns the existing schedule without extending its deadline. After the deadline, irreversible background cleanup removes the vault, ingots, folders, keys, sessions, links and audit trail. A vault the platform keeps for a product (the Messaging vault) is refused: it goes only with its account. The company's Help Desk vault, which every desk keeps its requests in, is refused while any desk is active, and while any of its requests is under legal hold; its cleanup deletes every desk's requests, customers and knowledge-base articles stored under it, with the published help centers and the desks' jobs, and keeps the desks with their settings, roles and addresses, which start over empty on the vault they are next activated on."
  /vaults/{id}/access-log-retention:
    get:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
    put:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
  /vaults/{id}/audit-logs:
    get:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The vault.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 25
          description: "A page-size hint: a value above 100 reads as 100, and a missing, zero, negative or non-numeric one as 25."
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: The `next_cursor` a previous page returned, with the same `event_types`. Opaque, and sealed to the query that issued it.
        - name: event_types
          in: query
          required: false
          schema:
            type: string
          description: "Only these event types, comma-separated, each one of the scope's `event_types`. Omitted: every event."
      responses:
        "200":
          description: A page of the trail.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - entries
                      - count
                      - has_more
                      - vault_id
                      - event_types
                    properties:
                      entries:
                        type: array
                        items:
                          $ref: "#/components/schemas/AuditLogEntry"
                      count:
                        type: integer
                        description: How many this page holds.
                      has_more:
                        type: boolean
                        description: "More follow. A page can hold fewer than `limit`, or none, while more remain: page on while it is true."
                      next_cursor:
                        type: string
                        description: "Present while `has_more` is true: pass it back as `cursor` for the next page."
                      vault_id:
                        type: string
                      event_types:
                        type: array
                        items:
                          type: string
                        description: Every event type the vault scope records.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: a `cursor` this list did not issue for the same query."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such vault on this account."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read a vault's audit trail
      description: A page of the vault's audit entries, newest first, their metadata opened under the vault's session. Page with `cursor` until `has_more` is false.
  /vaults/{id}/contents:
    get:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The vault.
        - name: folder_id
          in: query
          required: false
          schema:
            type: string
          description: "The folder to list. Omitted: the vault root."
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 100
          description: "A page-size hint: a value above 500 reads as 500, and a missing, zero, negative or non-numeric one as 100."
        - name: page_token
          in: query
          required: false
          schema:
            type: string
          description: The `next_page_token` a previous page returned, sent with the same `folder_id`, `sort_order` and `include_system`. Opaque; it opens only for that listing of that vault, for the account it was issued to.
        - name: sort_order
          in: query
          required: false
          schema:
            type: string
            enum:
              - desc
              - asc
            default: desc
          description: The ingots' creation order.
        - name: sort_by
          in: query
          required: false
          schema:
            type: string
            enum:
              - created
          description: Only `created`, the one order the listing reads; any other value is refused.
        - name: include_system
          in: query
          required: false
          schema:
            type: string
            enum:
              - "true"
              - "false"
            default: "false"
          description: "`true` lists the vault's protected system folders and ingots too."
      responses:
        "200":
          description: One page of the folder's children.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/FolderContentsPage"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: a `sort_by` other than `created` or a `sort_order` other than `desc` or `asc` (`details.field` names it), or a `page_token` that is not a page of this listing (`details.field` `page_token`). INVALID_CURSOR: the token opened but no longer names a position in this listing. Either way, list again from the first page."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such vault on this account, or no folder `folder_id` in it (a folder being deleted, or inside one being deleted, included)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List a folder's contents
      description: "One page of a folder's children, or of the vault root's when `folder_id` is omitted. The children are one sequence across pages: every subfolder first, in an order that holds from page to page and is not by name, then the ingots in creation order, newest first unless `sort_order` is `asc`. A page holds at most `limit` children, so one page can hold the last subfolders and the first ingots, and it can hold fewer, or none, without being the last: follow `next_page_token` until it is null. Every page carries the folder and its breadcrumb. Sort by name, size or type on the client, over the children it holds. A file moved into the folder while you page appears on a later page only when it was created before the ingots already listed (after them under `asc`); one moved out before its page is read does not appear; no child appears twice."
  /vaults/{id}/deletion/cancel:
    post:
      tags:
        - vaults
      security:
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The vault whose pending deletion should be canceled.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - deletion_schedule_id
              properties:
                deletion_schedule_id:
                  type: string
                  pattern: ^[a-f0-9]{32}$
      responses:
        "200":
          description: Deletion canceled; the response data contains the restored vault.
        "400":
          description: "VALIDATION_ERROR: deletion_schedule_id is missing or malformed."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the caller is not a company administrator or owner. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such vault on this account."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "VAULT_DELETION_NOT_CANCELLABLE: the schedule changed or its deadline has passed; CONFLICT: the vault changed concurrently."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Cancel scheduled vault deletion
      description: A company administrator or owner cancels the deletion currently shown in vault settings before its deadline. The matching schedule ID is required so a stale client cannot cancel a newer deletion request. Restores the vault and permits normal access again; it does not restore content after permanent cleanup begins.
  /vaults/{id}/dvaks:
    get:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The vault ID.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 25
          description: "A page-size hint: a value above 100 reads as 100, and a missing, zero, negative or non-numeric one as 25."
        - name: cursor
          in: query
          required: false
          schema:
            type: string
            minLength: 1
            maxLength: 512
          description: The `next_cursor` a previous page returned, with the same `status`.
        - name: status
          in: query
          required: false
          schema:
            type: string
            enum:
              - active
              - revoked
      responses:
        "200":
          description: A page of DVAKs.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - dvaks
                      - count
                      - has_more
                    properties:
                      dvaks:
                        type: array
                        items:
                          $ref: "#/components/schemas/DvakSummary"
                      count:
                        type: integer
                        description: DVAKs in this page.
                      has_more:
                        type: boolean
                        description: More pages exist. With a `status` filter a page can hold fewer DVAKs than `limit`, or none, while more remain.
                      next_cursor:
                        type: string
                        description: Opaque continuation token, present while `has_more` is true.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: a `cursor` this list did not issue for the same `status`, or a `status` other than `active` or `revoked`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: DVAK management requires the admin role. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such vault on this account."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List a vault DVAKs
      description: "Every DVAK issued for the vault, newest first, including the system keys minted for vault features. Tokens are never returned: a row carries the last 4 characters, which is what revocation takes. Page with `cursor` (the previous page's `next_cursor`, read with the same `status`) until `has_more` is false."
    post:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - vmk
              properties:
                vmk:
                  type: string
                  description: The Vault Master Key, verified before the DVAK is issued.
                dvak_type:
                  type: string
                  enum:
                    - user
                    - nhi
                  default: user
                  description: "Who holds the key: a team member, or a non-human identity."
                authorized_user_id:
                  type:
                    - string
                    - "null"
                  description: The only user who may redeem the key. Required for a user DVAK.
                nhi_description:
                  type:
                    - string
                    - "null"
                  description: "Who or what uses the key: a bot, a service or an AI agent, or a person who unseals through an integration such as HubSpot or Salesforce. Required for an NHI DVAK."
                access_level:
                  type: string
                  enum:
                    - read
                    - read_write
                  default: read_write
                  description: The level the minted key grants. A user recipient must hold a Full License; read access remains a key permission.
              additionalProperties: false
      responses:
        "200":
          description: The DVAK was issued. Store `dvak_token` now.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/DvakCreateResponse"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: a missing `vmk`, an unknown `dvak_type` or `access_level`, an `authorized_user_id` that is missing, not a member of this account, or a member holding no license, or a missing `nhi_description` on an NHI key."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: DVAK management requires the admin role. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such vault on this account."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "412":
          description: "PRECONDITION_FAILED: the VMK does not open this vault."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Create a DVAK
      description: "Issue a Delegated Vault Access Key: a revocable credential that unseals this vault in place of the VMK, so the VMK itself never has to be shared. Requires the admin role and the VMK, which is verified before the key is minted. The token comes back once and is never retrievable again. Afterwards only its last 4 characters are visible, which is also how it is revoked."
  /vaults/{id}/dvaks/{last4}:
    delete:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: last4
          in: path
          required: true
          schema:
            type: string
            minLength: 4
            maxLength: 4
            description: The last 4 characters of the DVAK token, from the list response.
      responses:
        "200":
          description: The DVAK is revoked and the VATs it minted no longer work.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - last_4_chars
                      - status
                      - revoked_at
                    properties:
                      last_4_chars:
                        type: string
                      status:
                        type: string
                        enum:
                          - revoked
                      revoked_at:
                        type: integer
                        description: Unix seconds.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: the DVAK is already revoked, or `last4` is not exactly 4 characters."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: DVAK management requires the admin role, or the DVAK is a system grant (`details.dvak_type` system), which only the feature that holds it retires. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no vault, or no DVAK with those last 4 characters on it."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: two active DVAKs share these last 4 characters, so the key to revoke cannot be determined."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Revoke a DVAK
      description: "Retire one DVAK by the last 4 characters of its token. Revocation is immediate and total: the key can no longer unseal, and every VAT it has already minted is refused from that moment, because each use of a VAT re-checks the key behind it, so access ends now rather than when those sessions would have expired. Requires the admin role. A system grant (`dvak_type` system) is refused: it is retired only with the feature that holds it, by disabling that feature."
  /vaults/{id}/folders:
    get:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The vault.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 100
          description: "A page-size hint: a value above 500 reads as 500, and a missing, zero, negative or non-numeric one as 100."
        - name: page_token
          in: query
          required: false
          schema:
            type: string
          description: The `next_page_token` a previous page returned, sent with the same `include_system`. Opaque; it opens only for that vault's folder list, for the account it was issued to. Refused with `path`.
        - name: path
          in: query
          required: false
          schema:
            type: string
          description: "Answer only the folder at this path: slash-delimited from the vault root (e.g. `Clients/Northfield`), in the syntax and with the validation of an upload's `folder_path`, each name matched in any case and in either Unicode form. A comma is part of a name (`Reyes, Maya`); a `path` sent twice reads as its values joined with a comma. Omitted: one page of the vault's folders."
        - name: include_system
          in: query
          required: false
          schema:
            type: string
          description: "`true` includes system folders, in the list and as segments of a `path`; any other value, or none, leaves them out."
      responses:
        "200":
          description: One page of the folders; with `path`, the folder at that path or none.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - folders
                    properties:
                      folders:
                        type: array
                        description: This page's folders; with `path`, the folder at that path or none.
                        items:
                          $ref: "#/components/schemas/Folder"
                      next_page_token:
                        type:
                          - string
                          - "null"
                        description: The next page's token; null on the last page. Absent with `path`, which answers whole. A page can hold fewer folders than `limit`, or none, and not be the last.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: `path` is empty, names no segment, is deeper than the folder depth limit, or a segment is not a valid folder name (the refusal an upload's `folder_path` meets). Or a `page_token` that is not a page of this vault's folder list, or one sent with `path` (`details.field` `page_token`). INVALID_CURSOR: the token opened but no longer names a position in the list. Either way, list again from the first page."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such vault on this account, or the vault is being deleted."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "VAULT_DELETION_SCHEDULED: the vault is scheduled for deletion; cancel the deletion to read its contents."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List a vault's folders, or find one by path
      description: "One page of the vault's folders, at most `limit` of them, in an order that holds from page to page and is not by name: follow `next_page_token` until it is null. A page can hold fewer folders, or none, without being the last. Sort by name on the client, over the folders it holds. To show one folder's subfolders, list its contents (`GET /vaults/{id}/contents`), which pages them first, rather than the vault's folders. With `path`, only the folder at that path, never paged: the same `folders` list holding that one folder, or no folder when a segment names none (an empty list, not a 404). The path is written and validated as an upload's `folder_path` is, and read from the vault root one segment at a time: each segment is the folder that holds that name, in any case and in either Unicode form, under the folder before it. A folder being deleted is in neither answer."
    post:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The vault.
      responses:
        "200":
          description: The folder made, or with `path` the deepest folder it names, as every folder read answers it.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    allOf:
                      - $ref: "#/components/schemas/Folder"
                      - type: object
                        properties:
                          created:
                            type: boolean
                            description: "With `path`: whether the walk made a folder."
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: no name, a name that is not a valid folder name, both `name` and `path`, or a `path` that is empty, names no segment, reaches past the folder depth limit, or holds a segment that is not a valid folder name."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: a read-only vault session, or `parent_id` is a system folder. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such vault on this account, or no folder `parent_id` in this vault."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: with `name`, a folder under `parent_id` already holds it, or `parent_id` or a folder the path names is being deleted; `VAULT_DELETION_SCHEDULED`: the vault is scheduled for deletion."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Create a folder, or find or make the folders a path names
      description: "With `name`: a folder of that name under `parent_id` (the vault root when absent or null), refused when a folder there already holds the name, in any case and in either Unicode form (composed or decomposed). With `path`: the folders it names under `parent_id`, each segment the folder holding that name, matched the same way, under the one before it, or a new folder, as an upload placed by `folder_path` finds or makes them; the answer is the deepest one, and `created` says whether any was made. A name is stored composed (NFC). A tree of folders is made this way, each folder by its path under a folder named by id: a folder's own name may hold a `/`, which a path from the vault root would read as two folders. A read-only vault session can do neither."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: The new folder's name. Not with `path`.
                path:
                  type: string
                  description: Slash-delimited folder names, first segment first (e.g. `Q3/Board`), in the syntax and with the validation of an upload's `folder_path`, its depth counted from the vault root through `parent_id`. Not with `name`.
                parent_id:
                  type:
                    - string
                    - "null"
                  description: The folder to create under; the vault root when absent or null.
  /vaults/{id}/folders/{fid}:
    get:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: fid
          in: path
          required: true
          schema:
            type: string
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
    put:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: fid
          in: path
          required: true
          schema:
            type: string
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
    delete:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: fid
          in: path
          required: true
          schema:
            type: string
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
  /vaults/{id}/ingots:
    get:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The vault.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 100
          description: "A page-size hint: a value above 200 reads as 200, and a missing, zero, negative or non-numeric one as 100."
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: The `next_cursor` a previous page returned, with the same `managed_by`. Opaque, and sealed to the query that issued it.
        - name: managed_by
          in: query
          required: false
          schema:
            type: string
            maxLength: 64
          description: Filter a bounded metadata page by managing app or product. This grants no content access. Keep the same filter when following its bound cursor.
        - name: sort_by
          in: query
          required: false
          schema:
            type: string
            enum:
              - name
              - size
              - size_bytes
              - content_type
              - created
              - created_at
              - access_count
              - bandwidth
              - total_bandwidth_bytes
          description: "Orders the page's ingots, and only that page's. Omitted: the vault index's order."
        - name: sort_order
          in: query
          required: false
          schema:
            type: string
            enum:
              - asc
              - desc
            default: asc
      responses:
        "200":
          description: A page of ingots.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - ingots
                      - count
                      - has_more
                    properties:
                      ingots:
                        type: array
                        items:
                          $ref: "#/components/schemas/Ingot"
                      count:
                        type: integer
                        description: How many this page holds.
                      has_more:
                        type: boolean
                        description: "More follow. A page can hold fewer than `limit`, or none, while more remain: page on while it is true."
                      next_cursor:
                        type: string
                        description: "Present while `has_more` is true: pass it back as `cursor` for the next page."
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: a `cursor` this list did not issue for the same query."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List a vault's ingots
      description: "A page of the vault's ingots, in the vault index's order. `sort_by` orders only the ingots of the page it answers, never the list across pages: for one order across the vault, search (`GET /vaults/{id}/ingots/search`) or list a folder's contents (`GET /vaults/{id}/contents`). Page with `cursor` until `has_more` is false. An optional managed_by filter narrows each metadata page; a filtered page may be empty and still have a continuation cursor. Filtering grants no content access."
    post:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
  /vaults/{id}/ingots/hash-check:
    post:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
  /vaults/{id}/ingots/search:
    get:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The vault.
        - name: q
          in: query
          required: false
          schema:
            type: string
          description: "A part of the ingot's file name, matched ignoring letter case, accents and Unicode compatibility forms: `resume` matches `Résumé.pdf`, `strasse` matches `Straße.txt`, `IMG_9883` matches `2026-10-23_10-52-15_IMG_9883.HEIC`. A whole name matches too; to read one ingot by its exact name, use `GET /vaults/{id}/ingots/{ingot_id}` with `:` and the name. Matched as text, never a pattern, its spaces included; a comma is part of the text. At most 255 characters."
        - name: file_type
          in: query
          required: false
          schema:
            type: string
            maxLength: 255
          description: "A family, a media type's top-level type (`image`, `video`, `audio`, `text`, `application`, `font`, `model`, …; the sound formats platforms type outside the audio tree, `application/ogg` and `video/x-ms-wma`, are in `audio`), or one exact type (`application/pdf`), in lowercase. An exact type matches an ingot of that type with or without parameters: `application/json` matches `application/json;charset=utf-8`, never `application/json-patch+json`. Read by its syntax, never against a list: a family no ingot belongs to matches nothing."
        - name: folder_id
          in: query
          required: false
          schema:
            type: string
          description: "Only the ingots directly in this folder. Omitted: the whole vault."
        - name: min_size
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
          description: The fewest bytes a match holds.
        - name: max_size
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
          description: The most bytes a match holds.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 50
          description: "A page-size hint: a value above 200 reads as 200, and a missing, zero, negative or non-numeric one as 50."
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: The `next_cursor` a previous page returned, with the same filters and `sort_order`.
        - name: sort_order
          in: query
          required: false
          schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
      responses:
        "200":
          description: A page of matching ingots.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/IngotSearchPage"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: `q` holds a character no name can hold (a noncharacter, or a character no Unicode version assigns yet) or is over 255 characters, or `file_type` is neither a family nor an exact type in lowercase (`details.field` names it), a size is not a number or is negative, `min_size` is over `max_size`, or the cursor was issued for another query. INVALID_CURSOR: the cursor opened but is not a position in this search; search again without it."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no folder `folder_id` in this vault."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Search a vault's ingots
      description: "A page of the vault's ingots matching every filter sent: a part of a name (`q`), a type (`file_type`), a folder and a size range. Names and types are stored sealed, so no index holds a part of a name or a type: `q` or `file_type` reads the vault's ingots in creation order (the folder's own with `folder_id`), at most 400 a page, opening each name and type; a size range without either reads them by size. `sort_order` orders the creation and size reads, `desc` (the default) reading the newest or largest first. The filters a read does not answer narrow what it holds, so a page can hold fewer ingots than `limit`, or none, while `has_more` is true: follow `next_cursor` until it is false, never stop on the count. An ingot's type is its `content_type`; an ingot a product manages matches no type."
  /vaults/{id}/ingots/thumbnail-links:
    post:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - ingot_ids
              additionalProperties: false
              properties:
                ingot_ids:
                  type: array
                  minItems: 1
                  maxItems: 50
                  uniqueItems: true
                  items:
                    type: string
                    minLength: 1
                    maxLength: 128
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
  /vaults/{id}/ingots/{ingot_id}:
    get:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: ingot_id
          in: path
          required: true
          schema:
            type: string
        - name: consistent
          in: query
          schema:
            type: string
            enum:
              - "true"
              - "false"
            default: "true"
          description: Explicit false permits an eventually consistent ID read.
        - name: folder_id
          in: query
          schema:
            type: string
          description: Folder ID, or ROOT for the vault root. Scopes name lookup and verifies the folder of an ID lookup.
      responses:
        "200":
          description: The owned ingot metadata.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/Ingot"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: invalid name or folder scope."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no ingot in the requested vault and folder."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: the unscoped name is ambiguous; use a folder scope or immutable ID."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read ingot metadata
      description: ID reads are strongly consistent by default. A name scoped with folder_id resolves through strongly consistent name claims. Without a folder scope, legacy name lookup uses an eventually consistent index and refuses names found in multiple folders. No object body is decrypted.
    put:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: ingot_id
          in: path
          required: true
          schema:
            type: string
        - name: folder_id
          in: query
          schema:
            type: string
          description: Folder ID or ROOT to scope a name lookup.
      responses:
        "200":
          description: A replacement upload. Its upload_id becomes the content version only after successful publication.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      ingot_id:
                        type: string
                      upload_id:
                        type: string
                      forge_url:
                        type: string
                      expires_at:
                        type: integer
                      name:
                        type: string
                      size_bytes:
                        type: integer
                      content_type:
                        type: string
                      status:
                        type: string
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: invalid input or inconsistent preconditions."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "412":
          description: "PRECONDITION_FAILED: the object or its publication changed, or a guarded replacement is already in progress."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Stage a replacement of ingot content
      description: The old publication remains readable until the replacement publishes. expected_revision identifies the immutable ingot and the publication inspected; a mismatch returns 412, including when a deleted name now identifies a different ingot. The precondition is also enforced at final publication. Existing expected_content_version and expected_updated_at guards remain supported. When editing downloaded content, derive the revision from the actual Forge response, as the SDK downloadWithRevision method does; a download URL mint may precede a newer publication.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - size_bytes
              properties:
                size_bytes:
                  type: integer
                  minimum: 1
                  maximum: 5497558138880
                name:
                  type: string
                content_type:
                  type: string
                content_hmac:
                  type: string
                expected_updated_at:
                  type: integer
                expected_content_version:
                  type:
                    - string
                    - "null"
                expected_revision:
                  type: string
                  description: Opaque revision returned by the content read being replaced.
    patch:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: ingot_id
          in: path
          required: true
          schema:
            type: string
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
    delete:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The vault.
        - name: ingot_id
          in: path
          required: true
          schema:
            type: string
          description: The ingot's id, or `:` followed by its name in the vault.
        - name: folder_id
          in: query
          schema:
            type: string
          description: Folder ID or ROOT to scope a name lookup.
        - name: expected_revision
          in: query
          schema:
            type: string
          description: Delete only this immutable object and content publication. A mismatch returns 412 before cleanup is authorized. Mutually exclusive with upload_id.
        - name: upload_id
          in: query
          required: false
          schema:
            type: string
            pattern: ^tus_[0-9a-f]{32}$
          description: The `upload_id` the ingot's create answered. Deletes the ingot only while it is that upload's unfinished file.
      responses:
        "204":
          description: Deleted.
        "400":
          description: "VALIDATION_ERROR: malformed upload_id or expected_revision, duplicate parameters, or both deletion guards supplied."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such ingot in this vault, or the vault is gone or being deleted."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "VAULT_DELETION_SCHEDULED: the vault is scheduled for deletion; cancel the deletion to change its contents. CONFLICT: the ingot kept changing while it was being deleted; retry the delete."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "412":
          description: "PRECONDITION_FAILED: sent with `upload_id`, the ingot is no longer that upload's unfinished file. The upload published it, or a later upload of it is in progress; nothing was deleted. With expected_revision, the object identity or publication changed; no deletion cleanup was authorized."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Delete an ingot
      description: "Permanently delete an ingot: its content, every SparkLink for it, its audit trail, and an upload staged onto it, whose Forge URL and upload session Forge refuses from then on (`410 UPLOAD_GONE`) and whose reserved storage is released. With `upload_id`, the upload the ingot's create answered, the ingot is deleted only while it is still that upload's unfinished file: the upload is ended before anything else, and an ingot it published before the delete reached it, or that a later upload of it took over, is left whole (`412`). This is how a client that gives an upload up (its user cancelled it, or it failed for good) ends it with the file its create made, never a file the upload published."
  /vaults/{id}/ingots/{ingot_id}/audit-logs:
    get:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The vault.
        - name: ingot_id
          in: path
          required: true
          schema:
            type: string
          description: The ingot.
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            default: 25
          description: "A page-size hint: a value above 100 reads as 100, and a missing, zero, negative or non-numeric one as 25."
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: The `next_cursor` a previous page returned, with the same `event_types`. Opaque, and sealed to the query that issued it.
        - name: event_types
          in: query
          required: false
          schema:
            type: string
          description: "Only these event types, comma-separated, each one of the scope's `event_types`. Omitted: every event."
      responses:
        "200":
          description: A page of the trail.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - entries
                      - count
                      - has_more
                      - vault_id
                      - ingot_id
                      - event_types
                    properties:
                      entries:
                        type: array
                        items:
                          $ref: "#/components/schemas/AuditLogEntry"
                      count:
                        type: integer
                        description: How many this page holds.
                      has_more:
                        type: boolean
                        description: "More follow. A page can hold fewer than `limit`, or none, while more remain: page on while it is true."
                      next_cursor:
                        type: string
                        description: "Present while `has_more` is true: pass it back as `cursor` for the next page."
                      vault_id:
                        type: string
                      ingot_id:
                        type: string
                      event_types:
                        type: array
                        items:
                          type: string
                        description: Every event type the ingot scope records.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: a `cursor` this list did not issue for the same query."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such vault on this account."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Read an ingot's audit trail
      description: A page of the ingot's audit entries, newest first, their metadata opened under the vault's session. Page with `cursor` until `has_more` is false.
  /vaults/{id}/ingots/{ingot_id}/download:
    post:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The vault.
        - name: ingot_id
          in: path
          required: true
          schema:
            type: string
          description: The ingot id, or a colon followed by its name.
        - name: folder_id
          in: query
          schema:
            type: string
          description: Folder ID or ROOT to scope a name lookup. ID reads used for authorization are strongly consistent.
      responses:
        "200":
          description: A time-limited Forge URL and metadata at authorization time.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    properties:
                      status:
                        const: ready
                      ingot_id:
                        type: string
                      download_url:
                        type: string
                      name:
                        type: string
                      size_bytes:
                        type: integer
                      content_type:
                        type: string
                      content_version:
                        type:
                          - string
                          - "null"
                      revision:
                        type: string
                        description: Revision at authorization time. For a single-use URL, Forge may serve a newer publication. Use SDK downloadWithRevision to bind a precondition to the bytes actually received.
                      original_filename:
                        type:
                          - string
                          - "null"
                      expires_at:
                        type: integer
                      stream:
                        type: boolean
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Authorize an ingot download
      description: Issue a Forge download URL under a live VAT. Successful authorization counts as session activity by default. Automatic display and prefetch requests should send count_as_activity false so navigation does not extend the vault session. This flag only suppresses renewal; authorization and existing transfer limits are unchanged.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                stream:
                  type: boolean
                  default: false
                  description: Issue a reusable streaming URL instead of a single-use download URL.
                count_as_activity:
                  type: boolean
                  default: true
                  description: False for automatic display or prefetch; suppresses VAT inactivity renewal only.
  /vaults/{id}/ingots/{ingot_id}/sharing:
    get:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: ingot_id
          in: path
          required: true
          schema:
            type: string
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
    put:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: ingot_id
          in: path
          required: true
          schema:
            type: string
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
  /vaults/{id}/ingots/{ingot_id}/sharing/invite:
    post:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: ingot_id
          in: path
          required: true
          schema:
            type: string
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
  /vaults/{id}/ingots/{ingot_id}/sharing/invite/{invite_id}:
    delete:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: ingot_id
          in: path
          required: true
          schema:
            type: string
        - name: invite_id
          in: path
          required: true
          schema:
            type: string
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
  /vaults/{id}/ingots/{ingot_id}/sharing/invite/{invite_id}/resend:
    post:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: ingot_id
          in: path
          required: true
          schema:
            type: string
        - name: invite_id
          in: path
          required: true
          schema:
            type: string
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
  /vaults/{id}/ingots/{ingot_id}/sparklinks:
    post:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            pattern: ^vlt_[A-Za-z0-9_-]+$
        - name: ingot_id
          in: path
          required: true
          schema:
            type: string
            pattern: ^ing_[A-Za-z0-9_-]+$
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - expires_in_seconds
              properties:
                expires_in_seconds:
                  type: integer
                  minimum: 300
                  maximum: 86400
              additionalProperties: false
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
  /vaults/{id}/ingots/{ingot_id}/sparklinks/{code}/deliver:
    post:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            pattern: ^vlt_[A-Za-z0-9_-]+$
        - name: ingot_id
          in: path
          required: true
          schema:
            type: string
            pattern: ^ing_[A-Za-z0-9_-]+$
        - name: code
          in: path
          required: true
          schema:
            type: string
            pattern: ^[A-Za-z0-9_-]{22}$
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - identity
              properties:
                identity:
                  type: string
                  minLength: 1
                  maxLength: 320
              additionalProperties: false
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
  /vaults/{id}/ingots/{ingot_id}/versions:
    get:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The vault.
        - name: ingot_id
          in: path
          required: true
          schema:
            type: string
          description: The ingot ID, or a colon followed by its name.
        - name: folder_id
          in: query
          schema:
            type: string
          description: Folder ID or ROOT to scope a name lookup.
      responses:
        "200":
          description: Retained publication metadata.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - ingot_id
                      - version_limit
                      - versions
                    properties:
                      ingot_id:
                        type: string
                      version_limit:
                        type: integer
                        minimum: 0
                        maximum: 50
                        default: 0
                        description: Previous versions retained per user file or structured object, in addition to its current version. Zero disables retention. The limit applies on each ingot's next successful content change; retained content counts toward storage usage. Internal app records retain their own lifecycle.
                      versions:
                        type: array
                        maxItems: 50
                        items:
                          type: object
                          required:
                            - version_id
                            - published_at
                            - size_bytes
                          properties:
                            version_id:
                              type: string
                              description: Opaque immutable publication identifier.
                            published_at:
                              type: integer
                              description: Unix seconds when this content was published.
                            size_bytes:
                              type: integer
                              minimum: 1
                              description: Original content size in bytes.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "403":
          description: "FORBIDDEN: this app-managed record cannot be accessed through the file history API. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such owned ingot."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: List retained ingot publications
      description: Previous publications of a user file, newest first, excluding the current publication. At most 50 entries; no historical body is decrypted. version_limit is the vault policy for the next successful content change, so a recently lowered limit may be smaller than this list. Structured objects use their product history endpoint; other managed app records do not expose general vault history.
  /vaults/{id}/ingots/{ingot_id}/versions/{version_id}/download:
    post:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The vault.
        - name: ingot_id
          in: path
          required: true
          schema:
            type: string
          description: The ingot ID, or a colon followed by its name.
        - name: version_id
          in: path
          required: true
          schema:
            type: string
          description: A version_id returned by the history list.
        - name: folder_id
          in: query
          schema:
            type: string
          description: Folder ID or ROOT to scope a name lookup.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                for_restore:
                  type: boolean
                stream:
                  type: boolean
              additionalProperties: false
      responses:
        "200":
          description: A time-limited Forge URL bound to the retained publication.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - status
                      - download_url
                      - ingot_id
                      - size_bytes
                      - content_version
                      - revision
                      - expires_at
                      - stream
                    properties:
                      status:
                        const: ready
                      download_url:
                        type: string
                      ingot_id:
                        type: string
                      name:
                        type: string
                      content_type:
                        type: string
                      stream:
                        type: boolean
                      size_bytes:
                        type: integer
                        minimum: 1
                      content_version:
                        type: string
                        description: The requested version_id.
                      revision:
                        type: string
                        description: Opaque revision of this historical publication.
                      expires_at:
                        type: integer
                        description: URL expiry in Unix seconds.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: invalid version_id."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: this app-managed record cannot be accessed through the file history API, or for_restore requires write access. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: the ingot or retained publication does not exist."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Authorize a retained ingot download
      description: Issue a Forge URL for exactly one retained publication under a live VAT. Successful authorization counts as session activity. Forge checks that the live ingot still retains this publication on use; a pruned or deleted publication is refused, never replaced by current bytes. The URL uses the ingot's current name and the historical content type where recorded. Check X-Content-Version on the Forge response against version_id, as SDK downloadVersion does. stream=true permits reusable Range requests for this publication.
  /vaults/{id}/reseal-settings:
    put:
      tags:
        - vaults
      security:
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The vault ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - reseal_idle_seconds
                - reseal_max_seconds
              additionalProperties: false
              properties:
                reseal_idle_seconds:
                  type:
                    - integer
                    - "null"
                  minimum: 0
                  maximum: 86400
                  description: Seconds without a qualifying file action before resealing. Null inherits the system default; 0 disables inactivity extensions. Applies on next unseal.
                reseal_max_seconds:
                  type:
                    - integer
                    - "null"
                  minimum: 60
                  maximum: 86400
                  description: Maximum seconds unsealed, regardless of activity. Null inherits the system default. Applies on next unseal.
      responses:
        "200":
          description: The saved vault settings.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - vault_id
                      - reseal_idle_seconds
                      - reseal_max_seconds
                      - reseal_defaults
                    properties:
                      vault_id:
                        type: string
                      reseal_idle_seconds:
                        type:
                          - integer
                          - "null"
                        description: Null inherits; 0 disables inactivity resealing.
                      reseal_max_seconds:
                        type:
                          - integer
                          - "null"
                        description: Null inherits the system maximum; at most 86400.
                      reseal_defaults:
                        type: object
                        required:
                          - idle_seconds
                          - max_seconds
                        properties:
                          idle_seconds:
                            type: integer
                          max_seconds:
                            type: integer
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: missing settings or timeouts outside the published bounds."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: requires a company administrator or owner signed in. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such vault on this account."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "VAULT_DELETION_SCHEDULED: settings cannot change while deletion is scheduled."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Set vault reseal times
      description: Set two vault values for future unseals. Null inherits system defaults (3600 seconds inactivity and 86400 seconds maximum); inactivity 0 disables extensions. Positive values start at 60 seconds and neither can exceed 86400. Inactivity cannot exceed the maximum. Requires a company administrator or owner signed in. AAL2 timeouts inherit defaults; AAL3 timeouts use 900/43200; Paranoid uses 0/3600. Presets fill these fields and do not assert NIST certification. Existing sessions retain their limits until the next unseal.
  /vaults/{id}/seal:
    post:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The vault to seal.
      responses:
        "204":
          description: Every session has ended and its existing private transfer credentials are revoked.
        "403":
          description: "LICENSE_REQUIRED: sealing a vault needs a Full License. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such vault on this account."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Seal a vault
      description: "End every session of the vault: each Vault Access Token minted for it stops working at once, for every member, device and integration that held one. Existing VAT-derived transfer credentials are also revoked: Forge refuses further transfer access with 403 VAULT_TRANSFER_REVOKED, even after a later unseal. Opening the vault again takes its key and new transfers need fresh authorization. Fully received, accepted uploads may still finish publication. Explicit public shares and system grants remain independent; manage those grants separately. To end only your own session, use DELETE /vaults/{id}/session."
  /vaults/{id}/session:
    delete:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The vault the session opens.
      responses:
        "204":
          description: "The session has ended: its VAT no longer opens the vault."
        "401":
          description: "AUTHENTICATION_ERROR: no VAT, or one that names no session (already ended, or never issued), with `details.reason` VAT_INVALID. The session is over."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: a VAT bound to another vault or account, which ends nothing. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage or Structured Ingots (`details.products`: vaults, structured_ingots). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: End your vault session
      description: "End the session the presented Vault Access Token names, and no other session of the vault: other members, devices and integrations keep theirs. Ending a session only takes access away, so any holder of a VAT that names a session of the vault may end it: a read-only one, an expired one, and one whose vault is locked for deletion included. Already-issued transfers retain their independent lifetimes. To end every session and revoke private transfer access, use POST /vaults/{id}/seal."
  /vaults/{id}/session/extend:
    post:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
          VaultAccessToken: []
        - BearerAuth: []
          VaultAccessToken: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The vault whose session is extended.
      responses:
        "200":
          description: The confirmed timing of the same session.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - vault_id
                      - expires_at
                      - hard_expires_at
                      - idle_timeout_seconds
                      - ttl_seconds
                      - can_extend
                    properties:
                      vault_id:
                        type: string
                      expires_at:
                        type: integer
                      hard_expires_at:
                        type: integer
                      idle_timeout_seconds:
                        type: integer
                      ttl_seconds:
                        type: integer
                        description: Seconds remaining when the server answered.
                      can_extend:
                        type: boolean
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "401":
          description: "AUTHENTICATION_ERROR: invalid or revoked VAT; details.reason VAT_INVALID."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: expired VAT (details.reason VAT_EXPIRED), or account/vault mismatch. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage or Structured Ingots (`details.products`: vaults, structured_ingots). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "CONFLICT: details.reason VAT_EXTENSION_UNAVAILABLE for a fixed session or a deadline already at the maximum; unseal again. A vault scheduled for deletion answers VAULT_DELETION_SCHEDULED."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Extend the current vault session
      description: An intentional action that extends only the presented, live VAT by its inactivity window, never beyond its original hard deadline. Uses the same VAT and requires no vault key. This must be a deliberate action, never navigation, polling or an automatic heartbeat. Read-only VATs may extend their own sessions. Paranoid, legacy fixed sessions and a current deadline already at the maximum cannot extend; unseal again with the key to start a new session.
  /vaults/{id}/sharing:
    get:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
    put:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
  /vaults/{id}/sharing/disable:
    post:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
  /vaults/{id}/sharing/enable:
    post:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
  /vaults/{id}/structured-ingot-settings:
    put:
      tags:
        - vaults
      security:
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The vault ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - version_limit
              additionalProperties: false
              properties:
                version_limit:
                  type: integer
                  minimum: 0
                  maximum: 50
                  description: Previous versions to retain per file or structured object, in addition to its current version. Zero disables retention. Applies on each object's next successful change.
      responses:
        "200":
          description: The saved retention setting.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - vault_id
                      - version_limit
                    properties:
                      vault_id:
                        type: string
                      version_limit:
                        type: integer
                        minimum: 0
                        maximum: 50
                        default: 0
                        description: Previous versions retained per user file or structured object, in addition to its current version. Zero disables retention. The limit applies on each ingot's next successful content change; retained content counts toward storage usage. Internal app records retain their own lifecycle.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: version_limit must be an integer from 0 to 50."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: requires a company administrator or owner signed in. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such vault on this account."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "VAULT_DELETION_SCHEDULED: settings cannot change while deletion is scheduled."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Set vault version history retention (compatibility alias)
      description: Compatibility alias of PUT /vaults/{id}/version-history. Retain 0 to 50 previous versions per user file or structured object, in addition to its current version. Vaults default to zero. Requires a company administrator or owner signed in. Each successful content change uses the current setting and prunes older versions beyond it. Lowering or disabling the setting takes effect on each ingot's next change, without scanning the vault. Retained versions count toward storage usage. Internal app records keep their own lifecycle. This setting does not enable Structured Ingots.
      deprecated: true
  /vaults/{id}/thumbnails:
    get:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
    put:
      tags:
        - vaults
      security:
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - enabled
              additionalProperties: false
              properties:
                enabled:
                  type: boolean
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
  /vaults/{id}/thumbnails/prompted:
    post:
      tags:
        - vaults
      security:
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
  /vaults/{id}/unseal:
    post:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                vmk:
                  type: string
                  description: The Vault Master Key. A DVAK token presented here is accepted too, and read as a DVAK.
                dvak_token:
                  type: string
                  pattern: ^dvak_[A-Za-z0-9_-]{43}$
                  description: A DVAK token issued for this vault, exactly as the create response returned it.
                ttl_seconds:
                  type: integer
                  minimum: 1
                  maximum: 86400
                  description: Optional additional fixed lifetime limit in seconds. The vault reseal settings apply when omitted, and cannot be exceeded.
              additionalProperties: false
      responses:
        "200":
          description: The vault is unsealed and a VAT is issued.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: "#/components/schemas/VaultUnsealResponse"
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: neither key, both keys, a `dvak_token` that is not a well-formed token, a `ttl_seconds` outside the published range, a vault being deleted, a vault whose row holds no key material (`kem_ciphertext`), or a DVAK unseal of a vault without DVAK support."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: "UNAUTHORIZED: the DVAK is unknown or has been revoked."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: the DVAK is issued to a different user. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage or Structured Ingots (`details.products`: vaults, structured_ingots). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such vault on this account."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "412":
          description: "PRECONDITION_FAILED: the key does not open this vault."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Unseal a vault
      description: Exchange the key you hold for a short-lived Vault Access Token (VAT). Supply exactly ONE of `vmk` (the Vault Master Key returned when the vault was created) or `dvak_token`, a DVAK token issued for this vault, named exactly as the create response returned it. Sending both, or neither, is rejected 400. A DVAK token placed in `vmk` is accepted too and read as a DVAK. Unsealing with a DVAK mints a VAT that inherits that key's access level; unsealing with the VMK mints a read_write VAT. From there the VAT is the credential every ingot operation carries. Vault Settings default to one hour without a qualifying file action and 24 hours maximum per unseal. Upload/download authorization and file/folder mutations extend only the session used, never its hard deadline; listings, search, polling and thumbnails do not. Successful VAT-resolved responses report X-Vault-Session-Expires-At, X-Vault-Session-Hard-Expires-At, X-Vault-Session-Remaining-Seconds, X-Vault-Session-Hard-Remaining-Seconds and X-Vault-Session-Idle-Timeout-Seconds. Deadlines are Unix seconds; remaining durations are measured at response time. Structured Ingots relays the same headers, including empty 204 responses. Reporting timing does not renew access. Bind updates to the exact VAT sent. Already-issued transfer credentials keep their own lifetimes after the individual session ends or expires; transfer progress alone does not extend it. The vault-wide POST /vaults/{id}/seal revokes private transfer access as well as every VAT.
  /vaults/{id}/upload:
    get:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
    put:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
  /vaults/{id}/upload/portal/disable:
    post:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
  /vaults/{id}/upload/portal/enable:
    post:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
  /vaults/{id}/upload/widget/disable:
    post:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
  /vaults/{id}/upload/widget/enable:
    post:
      tags:
        - vaults
      security:
        - ApiKeyAuth: []
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        "403":
          description: "PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        default:
          description: Response
  /vaults/{id}/version-history:
    put:
      tags:
        - vaults
      security:
        - BearerAuth: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The vault ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - version_limit
              additionalProperties: false
              properties:
                version_limit:
                  type: integer
                  minimum: 0
                  maximum: 50
                  description: Previous versions to retain per file or structured object, in addition to its current version. Zero disables retention. Applies on each object's next successful change.
      responses:
        "200":
          description: The saved retention setting.
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    type: object
                    required:
                      - vault_id
                      - version_limit
                    properties:
                      vault_id:
                        type: string
                      version_limit:
                        type: integer
                        minimum: 0
                        maximum: 50
                        default: 0
                        description: Previous versions retained per user file or structured object, in addition to its current version. Zero disables retention. The limit applies on each ingot's next successful content change; retained content counts toward storage usage. Internal app records retain their own lifecycle.
                  meta:
                    $ref: "#/components/schemas/ResponseMeta"
        "400":
          description: "VALIDATION_ERROR: version_limit must be an integer from 0 to 50."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "403":
          description: "FORBIDDEN: requires a company administrator or owner signed in. PRODUCT_ACCESS_REQUIRED: the member holds no access to Secure Storage (`details.products`: vaults). A company admin grants access."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "404":
          description: "NOT_FOUND: no such vault on this account."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "409":
          description: "VAULT_DELETION_SCHEDULED: settings cannot change while deletion is scheduled."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
      summary: Set vault version history retention
      description: Retain 0 to 50 previous versions per user file or structured object, in addition to its current version. Vaults default to zero. Requires a company administrator or owner signed in. Each successful content change uses the current setting and prunes older versions beyond it. Lowering or disabling the setting takes effect on each ingot's next change, without scanning the vault. Retained versions count toward storage usage. Internal app records keep their own lifecycle. This setting does not enable Structured Ingots.
components:
  schemas:
    ResponseMeta:
      type: object
      description: Envelope metadata present on every successful response.
      properties:
        api_version:
          type: string
        request_id:
          type: string
        response_ms:
          type: integer
        timestamp:
          type: integer
          description: Unix seconds.
        pools:
          type: object
          description: Storage and bandwidth capacity snapshot for the account.
        billing:
          type: object
          properties:
            past_due:
              type: boolean
        quota:
          type: object
          description: This minute of the account request budget. Present on authenticated success responses that passed the throttle; absent otherwise.
          properties:
            limit:
              type: integer
            used:
              type: integer
            remaining:
              type: integer
            resets_at:
              type: integer
              description: Unix seconds.
    ErrorResponse:
      type: object
      description: The envelope of every error answer (apps/api/src/lib/error-response.js).
      required:
        - error
        - meta
      properties:
        error:
          type: object
          required:
            - code
            - message
            - details
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type:
                - object
                - "null"
              description: What the refusal names, as each response documents it; null when it names nothing, and on every 5xx. Any NOT_FOUND may name the `resource` it could not find and its `id` here.
        meta:
          type: object
          required:
            - api_version
            - request_id
          properties:
            api_version:
              type: string
            request_id:
              type: string
              description: This request, as SparkVault support looks it up.
    VaultUnsealResponse:
      type: object
      required:
        - vat
        - vault_id
        - issued_at
        - expires_at
        - ttl_seconds
        - hard_expires_at
        - idle_timeout_seconds
      properties:
        vat:
          type: string
          description: The Vault Access Token (VAT). Send it as `X-Vault-Access-Token` on every ingot operation until it expires.
        vault_id:
          type: string
        issued_at:
          type: integer
          description: Unix seconds.
        expires_at:
          type: integer
          description: Current deadline in Unix seconds; qualifying file actions may extend it within hard_expires_at.
        hard_expires_at:
          type: integer
          description: Fixed maximum deadline in Unix seconds, unchanged by activity.
        idle_timeout_seconds:
          type: integer
          description: Seconds without a qualifying file action before resealing; 0 disables inactivity extensions.
        can_extend:
          type: boolean
          description: Whether this live session has an inactivity window and room before its fixed maximum.
        ttl_seconds:
          type: integer
          description: Seconds until the initial expiration, bounded by both the vault inactivity window and its maximum.
        warning:
          type: string
          description: Reminder that the VAT is a credential.
    DvakSummary:
      type: object
      description: One DVAK as the listing reports it. The token itself is never returned again.
      required:
        - last_4_chars
        - dvak_type
        - status
      properties:
        last_4_chars:
          type: string
          description: The last 4 characters of the token, which is how a DVAK is identified and revoked.
        authorized_user_id:
          type:
            - string
            - "null"
          description: Set on a user DVAK.
        authorized_user_email:
          type:
            - string
            - "null"
          description: Set on a user DVAK.
        dvak_type:
          type: string
          enum:
            - user
            - nhi
            - system
        system_purpose:
          type:
            - string
            - "null"
          description: The vault feature a system DVAK serves. Null on a user or NHI DVAK.
        nhi_description:
          type:
            - string
            - "null"
          description: Set on an NHI DVAK.
        access_level:
          type: string
          enum:
            - read
            - read_write
          description: The level a VAT minted from this key inherits. Every key states its own.
        status:
          type: string
          enum:
            - active
            - revoked
        created_at:
          type:
            - integer
            - "null"
          description: Unix seconds.
        last_used_at:
          type:
            - integer
            - "null"
          description: Unix seconds of the most recent unseal. Null if never used.
        use_count:
          type: integer
    DvakCreateResponse:
      type: object
      required:
        - dvak_token
        - dvak_type
        - access_level
        - last_4_chars
        - created_at
      properties:
        dvak_token:
          type: string
          description: The full DVAK token. Returned once, at creation, and never again. Store it before you move on.
        dvak_type:
          type: string
          enum:
            - user
            - nhi
        authorized_user_id:
          type:
            - string
            - "null"
          description: Set on a user DVAK.
        authorized_user_email:
          type:
            - string
            - "null"
          description: Set on a user DVAK.
        nhi_description:
          type:
            - string
            - "null"
          description: Set on an NHI DVAK.
        access_level:
          type: string
          enum:
            - read
            - read_write
          description: The access level actually granted to this key. Read access is a key permission, independent of the member license.
        last_4_chars:
          type: string
        created_at:
          type: integer
          description: Unix seconds.
        warning:
          type: string
          description: Reminder that the token is not shown again.
    SparkCreateRequest:
      type: object
      required:
        - payload
      properties:
        payload:
          type: string
          description: UTF-8 text for a text media type, base64 for every other. At most 256000 bytes as sent.
        content_type:
          type: string
          default: text/plain
          description: "Exactly one media type. `text/uri-list` makes a link Spark: the payload is the http or https URL it opens, and the answer carries its x.sv link."
        ttl_minutes:
          type: integer
          minimum: 1
          maximum: 1440
          default: 1440
          description: "How long the Spark lives unread: a whole number of minutes. A fraction is refused with 400 VALIDATION_ERROR, never rounded."
        filename:
          type: string
          description: "The name a recipient saves the payload under, at most 255 characters. Stored in the shared file-name form: a character no file system accepts is replaced, and a name that shows only dots or spaces is none. A download saves under it, kept as it is when the first word of the extension it shows (up to an ASCII space, in any case) is one the MIME registry knows, whatever `content_type`, or holds a character none of the registry's extensions is spelled with, which may draw as one (a blank glyph, a letter of another script), and otherwise completed with the extension `content_type`'s files are named with: the first the registry lists for it, or, for the few types whose first is not the one desktops name their files with, the one they do (`.mp3` for `audio/mpeg`, `.mov` for `video/quicktime`), never one a saved copy must never open as; a read answers that name as `download_filename`."
        kindling:
          type: string
          pattern: ^kdl_[0-9a-f]{32}$
          description: "Join an existing kindling: the `kindling` an earlier create answered, `kdl_` and 32 lowercase hex digits."
        with_kindling:
          type: boolean
          description: Start a new kindling, which the answer carries. Ignored when `kindling` is given.
        bound_ip:
          type: string
          description: "A link Spark only: the client IP address its link opens for."
    SparkCreated:
      type: object
      required:
        - spark_id
        - size_bytes
        - status
        - created_at
        - expires_at
        - ttl_minutes
      properties:
        spark_id:
          type: string
          pattern: ^spk_
        size_bytes:
          type: integer
          description: "Bytes sealed: the payload's UTF-8 bytes, or for a binary type the bytes its base64 decodes to."
        status:
          type: string
          const: active
        created_at:
          type: integer
          description: Unix seconds.
        expires_at:
          type: integer
          description: "Unix seconds: `created_at` plus `ttl_minutes` whole minutes."
        ttl_minutes:
          type: integer
          minimum: 1
          maximum: 1440
        filename:
          type: string
          description: The name as stored, when the create named one.
        kindling:
          type: string
          pattern: ^kdl_[0-9a-f]{32}$
          description: The kindling the Spark joined or started.
        link_url:
          type: string
          description: "A link Spark only: its x.sv link."
        link_code:
          type: string
          description: "A link Spark only: the code in `link_url`."
    PublicSparkRequest:
      type: object
      required:
        - payload
      additionalProperties: false
      description: A public Spark accepts text or a base64-encoded file, its optional filename and its lifetime. Other fields are refused.
      properties:
        payload:
          type: string
          minLength: 1
          description: "The secret as UTF-8 text or base64 file bytes: at most 256000 bytes on the wire."
        content_type:
          type: string
          enum:
            - text/plain
            - application/octet-stream
          default: text/plain
          description: Text, or a file encoded as base64. Redirecting link Sparks are forbidden.
        filename:
          type: string
          maxLength: 255
          description: Optional download filename, normalized by the shared filename rule.
        ttl_minutes:
          type: integer
          minimum: 1
          maximum: 1440
          default: 1440
          description: "How long the Spark and its link live unopened: a whole number of minutes. A fraction is refused with 400 VALIDATION_ERROR, never rounded."
    PublicSparkSent:
      type: object
      required:
        - share_url
        - expires_at
      additionalProperties: false
      properties:
        share_url:
          type: string
          format: uri
          description: "The Spark's one-time x.sv link: the first open reveals the secret and burns it."
        expires_at:
          type: integer
          description: "Unix seconds: when the Spark and its link expire unopened."
    SparkRead:
      type: object
      description: "A Spark as its read answers it: the payload, once. The read burns the Spark."
      required:
        - spark_id
        - payload
        - content_type
        - download_filename
        - size_bytes
        - status
        - created_at
        - burned_at
        - was_active
      properties:
        spark_id:
          type: string
          pattern: ^spk_
        payload:
          type: string
          description: UTF-8 text for a text media type, base64 for every other.
        content_type:
          type: string
          description: The Spark's one media type, `text/plain` when its create named none.
        download_filename:
          type: string
          description: "The name the payload saves under: `filename`, or `download` for a Spark with none, kept as it is when the first word of the extension it shows (up to an ASCII space, in any case) is one the MIME registry knows, whatever `content_type`, or holds a character none of the registry's extensions is spelled with, which may draw as one (a blank glyph, a letter of another script), and otherwise completed with the extension `content_type`'s files are named with: the first the registry lists for it, or, for the few types whose first is not the one desktops name their files with, the one they do (`.mp3` for `audio/mpeg`, `.mov` for `video/quicktime`), never one a saved copy must never open as. A client that saves the payload names the file by it, and hands a browser its bytes as `application/octet-stream` unless `content_type` is a raster image, audio, video or PDF format (never SVG, a playlist or a stream redirector): a browser renames a saved copy by the type it is handed, by its own table (Chrome saves `Invoice` typed `application/x-msdownload` as `Invoice.exe`, and Firefox `Invoice.pdf` typed `image/svg+xml` as `Invoice.svg`), and neither completes or replaces an extension of a copy handed as `application/octet-stream`."
        filename:
          type: string
          description: The name as stored, when the create named one.
        size_bytes:
          type: integer
          description: "Bytes sealed: the payload's UTF-8 bytes, or for a binary type the bytes its base64 decodes to."
        status:
          type: string
          const: ash
          description: The read burned it.
        created_at:
          type: integer
          description: Unix seconds.
        burned_at:
          type: integer
          description: "Unix seconds: the burn."
        was_active:
          type: boolean
          const: true
          description: "The Spark was active when read: a read answers no other."
    Ingot:
      type: object
      description: "An ingot as a listing, a search and a read answer it: its metadata, never its content."
      required:
        - ingot_id
        - name
        - download_filename
        - size_bytes
        - content_type
        - status
        - folder_id
        - managed_by
        - upload_source
        - created_at
        - updated_at
        - access_count
        - total_bandwidth_bytes
        - content_hmac
        - content_version
      properties:
        ingot_id:
          type: string
        name:
          type: string
        download_filename:
          type: string
          description: "The name a download of it saves under, as Forge names it: `name`, kept as it is when the first word of the extension it shows (up to an ASCII space, in any case) is one the MIME registry knows, whatever `content_type`, or holds a character none of the registry's extensions is spelled with, which may draw as one (a blank glyph, a letter of another script), and otherwise completed with the extension `content_type`'s files are named with: the first the registry lists for it, or, for the few types whose first is not the one desktops name their files with, the one they do (`.mp3` for `audio/mpeg`, `.mov` for `video/quicktime`), never one a saved copy must never open as. A client that saves a copy it already holds names the file by it, and hands a browser its bytes as `application/octet-stream` unless `content_type` is a raster image, audio, video or PDF format (never SVG, a playlist or a stream redirector): a browser renames a saved copy by the type it is handed, by its own table (Chrome saves `Invoice` typed `application/x-msdownload` as `Invoice.exe`, and Firefox `Invoice.pdf` typed `image/svg+xml` as `Invoice.svg`), and neither completes or replaces an extension of a copy handed as `application/octet-stream`."
        size_bytes:
          type: integer
        content_type:
          type: string
          description: "The ingot's type: one media type, its `type/subtype` in lowercase and any parameters as `;name=value` (`text/plain;charset=utf-8`). An upload sent with a type that is not exactly one media type, or with `application/octet-stream`, is stored as the type registered for its name's extension, else `application/octet-stream`, and so is a create sent with no type. A replacement sent with no type keeps the ingot's type, and is typed by its name that way only when that type is `application/octet-stream` or not exactly one media type."
        status:
          type: string
          enum:
            - uploading
            - active
          description: "`uploading` until the upload that created the ingot publishes; a replacement leaves it `active`."
        folder_id:
          type:
            - string
            - "null"
          description: The folder it is in; null at the vault root.
        managed_by:
          type:
            - string
            - "null"
          description: The product that manages it; null for a file. A product's ingot is read and changed only through that product.
        upload_source:
          type:
            - string
            - "null"
          description: "Who uploaded it: the uploader's email, `API: {key name}` for an API key, `Secure Upload Portal` for an anonymous upload through the vault's public upload page, or `Embedded Widget` for one through its embedded upload widget; null when unknown."
        created_at:
          type: integer
          description: Unix seconds.
        updated_at:
          type: integer
          description: "Unix seconds: its last write. A whole-content PUT may name it as `expected_updated_at`."
        access_count:
          type: integer
          description: How many times it was downloaded.
        total_bandwidth_bytes:
          type: integer
          description: The bytes served for it.
        content_hmac:
          type:
            - string
            - "null"
          description: The uploading client's vault-keyed HMAC of the content; null when none was sent.
        content_version:
          type:
            - string
            - "null"
          description: Changes only when new content is published; a read-modify-write PUT names it as `expected_content_version`.
        revision:
          type: string
          description: Opaque identity of this ingot and content publication. Supply unchanged as expected_revision for a guarded replacement or delete; a recreated name cannot match the old object revision.
    SparkSummary:
      type: object
      description: "A Spark as the list answers it: its metadata, never its payload."
      required:
        - spark_id
        - account_id
        - content_type
        - size_bytes
        - status
        - created_at
        - expires_at
        - burned_at
        - time_remaining
      properties:
        spark_id:
          type: string
        account_id:
          type: string
        content_type:
          type: string
        size_bytes:
          type: integer
        status:
          type: string
          enum:
            - active
            - ash
            - expired
            - deleted
          description: "Its state when the list answers, the one `?status` lists it in. `active`: its content is live (a Spark a recipient is reading is active). `ash`: a recipient read or answered it, or its content was recalled; it stays `ash` past `expires_at`. `expired`: past `expires_at` and never burned. `deleted`: its owner deleted it, and it is never reported `ash`."
        created_at:
          type: integer
          description: Unix seconds.
        expires_at:
          type: integer
          description: Unix seconds.
        burned_at:
          type:
            - integer
            - "null"
          description: When it turned `ash`; null for every other `status`, `deleted` included, though a delete burns the content too.
        time_remaining:
          type: integer
          description: Seconds until it expires; 0 once it has.
        filename:
          type: string
          description: Present when the Spark carries one.
        kindling:
          type: string
          description: Present when the Spark belongs to a kindling (`kdl_…`).
        link_url:
          type: string
          description: "Its `https://x.sv/{code}` link, while it has one: a link Spark's from its create, any other Spark's from its share until it is unshared. A deleted Spark keeps the link it had, which opens nothing."
    SparkShare:
      type: object
      description: A shared Spark's link, as the share routes answer it.
      required:
        - shared
        - spark_id
        - share_url
        - link_code
        - visibility
        - invites
        - status
        - expires_at
        - created_at
      properties:
        shared:
          type: boolean
          const: true
        spark_id:
          type: string
          pattern: ^spk_
        share_url:
          type: string
          description: The link's `https://x.sv/{code}` URL.
        link_code:
          type: string
          description: The code in `share_url`; a change to the link's settings never changes it.
        visibility:
          type: string
          enum:
            - public
            - authenticated
            - invite_only
        invites:
          type: array
          items:
            type: string
          description: An invite_only link's one invitee (an email address or a phone number); empty for any other visibility.
        status:
          type: string
          enum:
            - active
            - consumed
            - expired
          description: "`consumed` once the link was opened: a Spark's link opens once. `expired` once a link never opened opens nothing: from its `expires_at` on, or once its Spark is burned (read by its id) or reaches its own expiry. A change to its settings or a resend of its invitation is then refused 403."
        expires_at:
          type: integer
          description: "Unix seconds: never after the Spark's own expiry."
        created_at:
          type: integer
          description: Unix seconds.
    SparkLinkState:
      type: object
      description: A SparkLink grant, as its owner sees it.
      required:
        - link_code
        - link_url
        - link_type
        - visibility
        - verification_level
        - interaction
        - status
        - single_use
        - invites
        - created_at
      properties:
        link_code:
          type:
            - string
            - "null"
          description: The code. In a list, null on an ingot row whose vault the request's VAT does not unlock.
        link_url:
          type:
            - string
            - "null"
          description: "Its URL: `https://x.sv/{code}` for a single-use link, a files.sv URL for a file's durable share. In a list, null wherever `link_code` is."
        link_type:
          type: string
          enum:
            - spark
            - ingot
        asset_id:
          type: string
          description: The Spark (`spk_…`) or ingot (`ing_…`) it opens.
        vault_id:
          type: string
          description: An ingot link's vault.
        visibility:
          type: string
          enum:
            - public
            - authenticated
            - invite_only
        verification_level:
          type: string
          description: The proof a recipient presents before it opens.
        interaction:
          type: string
          description: "What opening it asks of the recipient: `view`, or an answer."
        reveal_freshness:
          type:
            - integer
            - "null"
          description: Seconds within which the recipient's verification must fall; null for none.
        status:
          type: string
          enum:
            - active
            - consumed
        single_use:
          type: boolean
          description: "Whether it opens once: every Spark link and a file's one-time link."
        invites:
          type: array
          items:
            type: string
          description: The identities an invite_only link admits.
        bound_ip:
          type: string
          description: The client address it opens from alone, when it is bound to one.
        session_length:
          type: integer
          description: A file link's viewing session, in seconds.
        verified_by:
          type: string
          description: Who verified to open it, once someone did.
        verified_at:
          type: integer
          description: Unix seconds.
        expires_at:
          type: integer
          description: Unix seconds.
        created_at:
          type: integer
          description: Unix seconds.
    VaultSummary:
      type: object
      required:
        - vault_id
        - name
        - status
        - ingot_count
        - structured_ingot_count
        - structured_ingots_enabled
        - ingot_version_limit
        - structured_ingot_version_limit
        - storage_bytes
        - created_at
      properties:
        vault_id:
          type: string
        name:
          type: string
        status:
          type: string
          description: "`sealed` for a vault in use (its stored status is `active`; GET /vaults/{id} answers whether a session has it open), or `deletion_scheduled`."
        ingot_count:
          type: integer
        structured_ingot_count:
          type:
            - integer
            - "null"
          minimum: 0
          maximum: 9007199254740991
          description: Number of published Structured Ingots in the vault. New vaults start at 0; null means an older vault's count is not initialized, never that it is empty. No object names, keys or values are included.
        structured_ingots_enabled:
          type: boolean
          description: Durable Structured Ingots activation; remains true after the final object is deleted. Legacy positive counts also imply activation.
        ingot_version_limit:
          type: integer
          minimum: 0
          maximum: 50
          default: 0
          description: Previous versions retained per user file or structured object, in addition to its current version. Zero disables retention. The limit applies on each ingot's next successful content change; retained content counts toward storage usage. Internal app records retain their own lifecycle.
        structured_ingot_version_limit:
          type: integer
          minimum: 0
          maximum: 50
          default: 0
          description: Compatibility alias of ingot_version_limit. Use ingot_version_limit for new integrations.
          deprecated: true
        storage_bytes:
          type: integer
        created_at:
          type: integer
          description: Unix seconds.
        deletion_requested_at:
          type: integer
          description: "With `deletion_scheduled`: Unix seconds."
        deletion_scheduled_for:
          type: integer
          description: "With `deletion_scheduled`: Unix seconds, the deadline."
        deletion_requested_by:
          type: string
          description: "With `deletion_scheduled`: the admin who scheduled it."
        deletion_schedule_id:
          type: string
          description: "With `deletion_scheduled`: the schedule a cancel names."
    UnreachedAdmin:
      type: object
      description: "A company administrator a vault deletion's notice could not reach: the mail service declined their address, which it does not send to while the address stays suppressed, and the deletion does not wait for that notice. Until the deadline the notice is tried again at the address the administrator holds then, so one who moves to another address, or whose address the mail service sends to again, is emailed and named no longer."
      required:
        - user_id
        - name
        - email
        - reason
      properties:
        user_id:
          type: string
        name:
          type:
            - string
            - "null"
          description: The name the company's roster shows them by; null when they have none.
        email:
          type: string
          description: The address the mail service declined their notice for, which their roster entry still holds.
        reason:
          type: string
          description: "Why: `deliverability` (the address bounced or was reported as spam) or `consent` (email to the address is blocked)."
    ApiKeySummary:
      type: object
      description: An API key as the list answers it. The key itself is never returned again.
      required:
        - api_key_id
        - name
        - key_preview
        - status
        - created_at
        - last_used_at
        - expires_at
        - revoked_at
      properties:
        api_key_id:
          type: string
        name:
          type: string
        key_type:
          type: string
          enum:
            - structured_ingots_service
          description: Present for account-owned Structured Ingots service keys.
        structured_ingots_scope:
          type: object
          required:
            - vault_id
            - access_level
          properties:
            vault_id:
              type: string
            access_level:
              type: string
              enum:
                - read
                - read_write
        key_preview:
          type: string
          description: The key's first and last characters, `sv_live_ab...wxyz`.
        status:
          type: string
          enum:
            - active
            - expired
            - revoked
        created_at:
          type: integer
          description: Unix seconds.
        last_used_at:
          type:
            - integer
            - "null"
          description: Unix seconds; null when never used.
        expires_at:
          type:
            - integer
            - "null"
          description: Unix seconds; null for a key that never expires.
        revoked_at:
          type:
            - integer
            - "null"
          description: Unix seconds; null while not revoked.
        notify_project_id:
          type: string
          description: Present only on a key restricted to this Notify project. `default` addresses the existing account Notify; named projects use ntp_ ids. Omitted keys retain company-wide authority.
    AuditLogEntry:
      type: object
      required:
        - timestamp
        - event_type
        - actor_id
        - ip_address
        - user_agent
        - metadata
      properties:
        timestamp:
          type: integer
          description: Unix seconds.
        event_type:
          type: string
          description: One of the scope's `event_types`.
        actor_id:
          type:
            - string
            - "null"
          description: A user (`usr_…`), an API key (`key_…`), `system`, or null when no one is attributable.
        actor_type:
          type: string
          enum:
            - user
            - api_key
          description: Present when the actor still exists in the account.
        actor_display:
          type: string
          description: The user's email or the key's name, present when the actor resolved.
        ip_address:
          type:
            - string
            - "null"
        user_agent:
          type:
            - string
            - "null"
        metadata:
          type:
            - object
            - "null"
          description: What the event carries; null when it carries nothing.
        encrypted:
          type: boolean
          const: true
          description: Present when the entry's metadata is sealed under a vault key this request did not hold; its `metadata` is then null.
        vault_id:
          type: string
          description: Present on a vault or ingot entry.
        ingot_id:
          type: string
          description: Present on an ingot entry.
    ActivityEvent:
      type: object
      required:
        - event_id
        - event_type
        - description
        - icon
        - reference_id
        - vault_id
        - timestamp
        - datetime
      properties:
        event_id:
          type: string
        event_type:
          type: string
          description: "`spark_created` for a Spark's creation; every other entry is the ledger entry's own type."
        description:
          type: string
        icon:
          type: string
        reference_id:
          type: string
          description: The resource the operation was about.
        vault_id:
          type:
            - string
            - "null"
        timestamp:
          type: integer
          description: Unix seconds.
        datetime:
          type: string
          format: date-time
    LedgerEntry:
      type: object
      description: "A usage ledger entry: a tracked operation or transfer. Usage, never money."
      required:
        - type
        - reference_id
        - bytes
        - vault_id
        - name
        - description
        - created_at
      properties:
        type:
          type: string
          description: The entry type, e.g. `spark_create`, `entropy_generate`.
        reference_id:
          type: string
          description: The resource it was about, also the entry's idempotency key.
        bytes:
          type:
            - integer
            - "null"
          description: Bytes moved, for a transfer; null otherwise.
        vault_id:
          type:
            - string
            - "null"
        name:
          type:
            - string
            - "null"
        description:
          type:
            - string
            - "null"
        created_at:
          type: integer
          description: Unix seconds.
    Folder:
      type: object
      required:
        - folder_id
        - name
        - parent_id
        - pinned
        - created_at
        - updated_at
      properties:
        folder_id:
          type: string
        name:
          type: string
        parent_id:
          type:
            - string
            - "null"
          description: The folder it is in; null at the vault root.
        pinned:
          type: boolean
        created_at:
          type: integer
          description: Unix seconds.
        updated_at:
          type: integer
          description: Unix seconds.
    FolderContentsPage:
      type: object
      required:
        - folder
        - breadcrumb
        - folders
        - ingots
        - next_page_token
      properties:
        folder:
          description: The folder listed, on every page; null at the vault root.
          oneOf:
            - type: object
              required:
                - folder_id
                - name
                - parent_id
              properties:
                folder_id:
                  type: string
                name:
                  type: string
                parent_id:
                  type:
                    - string
                    - "null"
            - type: "null"
        breadcrumb:
          type: array
          description: The vault root (`folder_id` null), then each folder down to the one listed, on every page.
          items:
            type: object
            required:
              - folder_id
              - name
            properties:
              folder_id:
                type:
                  - string
                  - "null"
              name:
                type: string
        folders:
          type: array
          items:
            $ref: "#/components/schemas/Folder"
          description: This page's part of the folder's subfolders, in an order that holds across pages and is not by name.
        ingots:
          type: array
          items:
            $ref: "#/components/schemas/Ingot"
          description: "This page's part of the folder's ingots, in creation order: newest first, or oldest first under `sort_order=asc`."
        next_page_token:
          type:
            - string
            - "null"
          description: The next page's token; null on the last page. A page can hold fewer children than `limit`, or none, and not be the last.
    IngotSearchPage:
      type: object
      required:
        - ingots
        - count
        - has_more
        - filters
      properties:
        ingots:
          type: array
          items:
            $ref: "#/components/schemas/Ingot"
        count:
          type: integer
          description: How many ingots this page holds, which can be fewer than `limit`, or none, while more remain.
        has_more:
          type: boolean
        next_cursor:
          type: string
          description: The next page's cursor; absent on the last page.
        filters:
          type: object
          description: "The filters the search applied, as sent: `q`, `file_type`, `folder_id`, `min_size`, `max_size`."
    NotifyRecipient:
      description: "A bare string, or an object naming the handles you know the recipient by. A bare string is an email address, an E.164 phone number (reached only by sms and voice), or a SparkVault id: an Identity id (ing_…), or the SparkVault user id (usr_…) of an active member of your organization; any other string is rejected 400 rather than accepted as a send every channel would skip. A member addressed by their SparkVault user id is also reached, on a ladder naming `push` or `web_push`, on the devices they registered with SparkVault, each notification titled with your organization's name first. Address a recipient by your OWN id as `{ \"id\": \"…\", \"email\": \"…\" }`: the email is where the email channel delivers and what a sealed send's grant is verified against. An id that is an email address, with no `email` beside it, is that address: `{ \"id\": \"pat@example.com\" }`, the bare \"pat@example.com\" and `{ \"email\": \"pat@example.com\" }` are one recipient, emailed and verified alike. An id that is an E.164 phone number, with no `phone` beside it, is that phone the same way. A recipient's KEY is its id, else its email, in canonical form (trimmed, with an email address lowercased the way Identity stores it): it names their row in your Notify inbox, recipients are deduplicated by it, and the status rollup and the send's receipts report it as `recipient_id`. Two ids that name one email address stay two recipients, each with an inbox row, and the per-recipient ceiling counts them as one person. REFUSED with one 400 that names every such entry by its index: a SparkVault user id (usr_…) that is not an active member of your organization (another account's member, one still invited, or no member at all), and any id that only starts as one (`usr_`, `usr_x-1`), which names no member; a recipient with no email address that a phone number would key (a bare number, `{ \"phone\": … }`, or an id that is an E.164 number) on a send whose channels name neither sms nor voice, since nothing else reaches a phone; and, on a SEALED send, a recipient whose only handle is a phone (`{ \"id\": …, \"phone\": … }`), since no grant is scoped to a phone. ON A SEALED SEND an id that is no email address carries no address to verify against, so `{ \"id\": … }` alone works only under `verification_level: \"none\"` (see NotifySendPolicy). A recipient's key is at most 256 bytes of UTF-8 with no control character, or the send is rejected 400 naming its index: an email address longer than that is a valid address but not a key, so give that recipient an id of your own."
      oneOf:
        - type: string
        - type: object
          minProperties: 1
          properties:
            id:
              type: string
              maxLength: 256
              description: "Your own id for the recipient, an Identity id (ing_…), or the SparkVault user id (usr_…) of an active member of your organization: it keys their row in your Notify inbox. Any other SparkVault user id is refused 400. An id that is an email address, with no `email` beside it, is also the address the recipient is emailed at and verified against. At most 256 UTF-8 bytes, with no control character and no noncharacter (U+FFFE, U+FFFF); one past that is rejected 400 naming the entry. The bound counts bytes, so `maxLength` (characters) is reached only by an ASCII id: one with wider characters is refused below it."
            email:
              type: string
              format: email
            phone:
              type: string
              description: E.164. What sms and voice text and call, once enabled. A recipient keyed by a phone alone needs a plaintext send whose channels name one of them; a sealed send also needs an email address.
    NotifySendPolicy:
      type: object
      description: 'Access policy for a SEALED send. Unset fields, and fields sent as null, fall back to the account config security defaults, and the policy names only the fields below: any other is rejected 400 before anything is sealed, as is a policy that is not an object. The shipped default `security.verification_level` is "identifier", NOT "none". A sealed send delivers a pointer to a named recipient, so with no verification that pointer is a bearer token: anyone who sees the link opens the content. CONSEQUENCE: a sealed send to a recipient with no email address (`{ "id": "cust_8812" }` alone) and no explicit policy is rejected 400 because the grant could not be scoped to anyone, so any verified identity would satisfy it. Either address the recipient by email as well, or state `verification_level: "none"` deliberately. A plaintext send must leave this trivial (verification_level "none", interaction "view", no freshness bar and no action_hash). The interaction and the verification level are otherwise independent, with one coupling: anything past "view" needs at least "identifier".'
      additionalProperties: false
      properties:
        verification_level:
          type: string
          enum:
            - none
            - identifier
            - passkey
          description: 'How hard the recipient must prove who they are before the content unseals. "none" opens to whoever holds the link, for a recipient addressed by id alone: a recipient addressed by email gets a grant scoped to that address, which is always held to at least "identifier"; "identifier" makes them prove control of the address the send was already addressed to; "passkey" binds the reveal to a device they physically hold. Enforced on the method the recipient ACHIEVED, so a passkey-level grant is never satisfied by an identifier session.'
        interaction:
          type: string
          enum:
            - view
            - acknowledge
            - sign
            - approve
            - reply
          description: 'The ceremony the SparkLink requires. Anything past "view" needs a verification_level of at least "identifier": `{ "verification_level": "none", "interaction": "approve" }` is rejected 400, because a grant that renders an action bar the identity gate then refuses is dead on arrival.'
        reveal_freshness_minutes:
          type: integer
          minimum: 1
          description: Require a verification no older than this many minutes. Omitted (or null), it is the account config `security.reveal_freshness_minutes`, where 0 means no freshness bar.
        action_hash:
          type: string
          pattern: ^[0-9a-f]{64}$
          description: 'SHA-256 (64 lowercase hex) of the canonical bytes of the thing being approved or signed. Stamped onto the grant and returned verbatim as the receipt `action_hash` claim: the only way to bind a receipt to YOUR document. Supply it on every "approve" and "sign" send. Omit it and the ceremony still completes, but the receipt carries a server-derived digest of the grant itself, which no hash recomputed from your own copy can match.'
    NotifySendRequest:
      type: object
      required:
        - recipients
        - category
      description: Exactly one of `content` or `ingot` must be supplied.
      properties:
        send_id:
          type: string
          minLength: 1
          maxLength: 128
          pattern: ^[A-Za-z0-9_.:-]+$
          description: "Idempotency key, unique within the account. Server-generated (ntsnd_…) when omitted. Replaying one returns the original send with `idempotent: true` and fans out nothing further, even once the account's Notify tier has ended. A replay is the same send when it repeats what the recipient meets, sealed or plaintext alike: the delivery mode, title, category, instructions, policy, `channels`, `escalation.delays`, `destinations`, every recipient with each handle it names, and the content (its payload, content_type, filename and ttl_minutes) or the ingot. The title, instructions and a plaintext payload are compared as the send stores them, without their text-direction controls, and a sealed payload as written. A replay that differs in any of them is refused 400 VALIDATION_ERROR, and the stored send stands. `type` and `history_ttl_days` are not compared: a replay that differs only there is answered idempotent, and the stored send keeps its own."
        recipients:
          type: array
          minItems: 1
          maxItems: 500
          items:
            $ref: "#/components/schemas/NotifyRecipient"
        content:
          type: object
          required:
            - payload
          properties:
            payload:
              type: string
              description: "Sealed: up to 256000 bytes, sealed as written. Plaintext: its text-direction control characters (U+202A to U+202E, U+2066 to U+2069) are removed, and what remains is stored: up to 16384 bytes, free of U+FFFE and U+FFFF, which no delivery channel can carry. Every channel shows it as text, a text/html body flattened (each link shown as its label and its target), and none shows a text-direction control."
            content_type:
              type: string
              default: text/plain
              description: Plaintext sends accept only text/plain or text/html.
            filename:
              type: string
            ttl_minutes:
              type: integer
              minimum: 1
              maximum: 1440
              default: 1440
              description: "Sealed content lifetime: a whole number of minutes. A fraction is refused with 400 VALIDATION_ERROR."
        ingot:
          type: object
          required:
            - ingot_id
            - vault_id
          description: "Send an existing encrypted asset from a vault of the caller's account that has public file sharing enabled; the sender needs a Full License and must present a read-write VAT for `vault_id` in `X-Vault-Access-Token`. Sealed only, one recipient only, and view-only: the recipient opens it in the file viewer, which has no action bar, so a `policy.interaction` other than `view` is rejected."
          properties:
            ingot_id:
              type: string
              pattern: ^ing_
            vault_id:
              type: string
              pattern: ^vlt_
        delivery:
          type: string
          enum:
            - sealed
            - plaintext
          default: sealed
          description: "Sealed hands the recipient a pointer to encrypted content behind the policy. Plaintext puts the body inline: no ceremony, no ingot, and at most 50 recipients."
        policy:
          $ref: "#/components/schemas/NotifySendPolicy"
        channels:
          type: array
          items:
            type: string
            enum:
              - in_app
              - email
              - sms
              - push
              - web_push
              - voice
          description: "Overrides the account config channel resolution; order is the escalation order, and duplicates collapse to their first position. in_app is delivered by the notification's row in your Notify inbox, which your app reads through the inbox API: the inbox lists a recipient's row when their in_app step runs, at once when in_app leads the ladder and only when that step comes due when it follows email (a stop that ends the ladder first, such as an unsubscribe on a non-critical send or a recall, leaves it unlisted). So a send naming email alone lists nothing there, and neither does one to a recipient who switched In-app off for your site on auth.sv (any send but a `security` one, which crosses that switch); email goes out from your organization's own sender (GET /products/notify/email-sender). push and web_push reach the devices a member of your organization, addressed by their SparkVault user id, registered with SparkVault (its phone app and browser push), titled with your organization's name first; a recipient with none has them dropped from their ladder, so they never hold up the next step. sms texts and voice calls the recipient's `phone` once texts and calls are enabled, only a phone registered with SparkVault (one a SparkVault Identity holds), in the United States for a text and the United States or Canada for a call, and never one the person switched texts or calls off for on your site, whatever the category. A text opens with your organization's name and carries a plaintext send's title and body, or a sealed send's title, instructions and link; a call speaks the same words without the link. Each is funded from your usage credits when it goes out: a text by the segment, a call by the call. A recipient with no phone has them dropped from their ladder. A name that is no Notify channel at all is rejected with 400 VALIDATION_ERROR quoting the bad value and the valid set: naming channels states an intent, so a typo has to be heard about rather than dropped into a ladder you never asked for. A channel Notify does not deliver (whatsapp, rcs, which Notify never sends, or sms or voice before texts and calls are enabled) is refused with 403 NOTIFY_CHANNEL_NOT_AVAILABLE naming it. A value that is not an array (a single string such as \"email\") is the same 400; only an omitted, null or empty list means the account config ladder. Channels resolved from the account CONFIG are narrowed silently to the ones above instead: they are validated on write, and a standing default must never break a live send."
        escalation:
          type: object
          required:
            - delays
          properties:
            delays:
              type: array
              minItems: 1
              items:
                type: number
                minimum: 0
                maximum: 86400
              description: Cumulative SECONDS from send time, one per channel step. Normalized to the resolved channel count, clamped non-decreasing; step 0 always fires immediately. No step may be later than 24 hours (the longest a sealed grant lives); a later value is a 400.
        title:
          type: string
          description: "Channel-agnostic display title: its text-direction control characters (U+202A to U+202E, U+2066 to U+2069) are removed, and it is folded to one line (control characters, and the noncharacters U+FFFE and U+FFFF no delivery channel can carry, become spaces). At most 200 characters are kept: a longer title is cut to 199 and an ellipsis, never rejected, so the bound is stated here rather than as a schema bound a validating client would refuse it by. A title that reads as SparkVault is refused 400 (`details.field` title, `details.reason` reserved_name): your notification goes out in your organization's name."
        category:
          type: string
          description: Required. One of the account configured categories, a preset's (alert, secure, conversation, approval, signature), or help_desk_alert, the help desk's staff alerts; these six are accepted even after the account deletes a preset's (help_desk_alert cannot be deleted). It decides whether the recipient may mute the send, whether it is on the compliance floor, whether it must seal, which channel ladder resolves, and whether its email may offer a one-click unsubscribe. Omitting it returns 400 naming the categories this account accepts.
        type:
          type: string
          maxLength: 64
          description: Display classifier, stored on every recipient's inbox row and returned as a string by the inbox and status reads. Folded to one line like `title`; a non-string, or a longer value, is a 400 rather than cut short.
        instructions:
          type: string
          description: "Non-secret text shown alongside a sealed send, without its text-direction control characters (U+202A to U+202E, U+2066 to U+2069), which are removed before its length is measured: at most 500 characters remain, or the send is refused 400. The bound is stated here rather than as a schema bound, which a validating client would apply to the text with its controls. Never the sealed content itself, and free of U+FFFE and U+FFFF, which no delivery channel can carry."
        history_ttl_days:
          type: integer
          minimum: 1
          maximum: 3650
          description: Inbox-row retention in days. Omitted (or null), it is the account history config, then 30; any other value outside the range is a 400, never replaced. Plaintext rows are capped at 7 days.
        destinations:
          type: boolean
          default: true
          description: "false keeps this one send out of the organization's destinations (its webhook, Slack channel and Teams workflow): none is posted to, and the send status reports `destinations: []`. Omitted, null or true, the send is posted to every destination that routes its category. Any other value is refused 400 VALIDATION_ERROR. A replay is compared on it (`send_id`), omitted, null and true alike."
    NotifySendResponse:
      type: object
      required:
        - send_id
        - recipients
        - status
      properties:
        send_id:
          type: string
        recipients:
          type: integer
          description: Recipients accepted after deduplication.
        status:
          type: string
          enum:
            - pending
          description: 'Always "pending": the stored, WRITE-ONCE acceptance marker. It says the send was accepted and fan-out will be driven asynchronously, and it never advances: a send accepted a second ago and one that finished an hour ago both read "pending" here. It is not a lifecycle. Poll `.../sends/{sendId}/status` (or read `state` on the send-history list) for the derived delivery state.'
        idempotent:
          type: boolean
          enum:
            - true
          description: Present only when this send_id already existed. Absent on a fresh send.
    NotifyInboxRow:
      type: object
      required:
        - notification_id
        - send_id
        - created_at
        - sealed
        - locked
        - recalled
      properties:
        notification_id:
          type: string
        notify_project_id:
          type: string
          description: Named project attribution. Absent for Default.
        send_id:
          type: string
        created_at:
          type: integer
          description: Unix seconds; the row sort key.
        title:
          type:
            - string
            - "null"
        category:
          type:
            - string
            - "null"
        type:
          type:
            - string
            - "null"
        seen_at:
          type:
            - integer
            - "null"
        read_at:
          type:
            - integer
            - "null"
        archived_at:
          type:
            - integer
            - "null"
        sparklink_code:
          type: string
          description: "Pointer to the sealed content, present only while its grant still opens: absent on a plaintext send, and once the recipient opened it (answered it, on a send that asks for an acknowledgement, a signature, an approval or a reply), once it expired or its grant is gone, and once the send is recalled."
        pointer_url:
          type: string
          description: "The URL the pointer opens (the SparkLink reveal page). Present exactly when `sparklink_code` is: open it as given rather than building a URL from the code."
        sealed:
          type: boolean
          description: True for a sealed send's row, for good, whether or not its reveal still opens. A row is plain text, its `body` the whole message, only when `sealed` is false and it is not `recalled`; a sealed row's `body` is the sender's instructions about the reveal.
        locked:
          type: boolean
          description: "True while sealed content waits behind a SparkLink reveal that still opens, exactly when `sparklink_code` is present. False on a plaintext row, and once nothing is left to reveal: opened, answered, expired, gone or recalled. A `sealed` row that is not locked has nothing left to open: show it as no longer available rather than its instructions."
        recalled:
          type: boolean
          description: "True when the sender took the notification back: the reveal is revoked and the pointer withheld, so show it as no longer available. The display fields stay readable."
        body:
          type: string
          description: "The row's cleartext line, to show as text: a plaintext send's inline content (a `text/html` body flattened to text, each link shown as `label (target)`, as the email shows it), or a sealed send's non-secret `instructions`. Absent when the send carried neither."
    NotifyInboxPage:
      type: object
      description: A page of notifications, newest first.
      required:
        - notifications
        - cursor
      properties:
        notifications:
          type: array
          items:
            $ref: "#/components/schemas/NotifyInboxRow"
        cursor:
          type:
            - string
            - "null"
          description: Opaque continuation token. Null when the listing is exhausted.
    NotifyFeedRow:
      description: "One notification of the signed-in person's own feed: an inbox row, and who it is from."
      allOf:
        - $ref: "#/components/schemas/NotifyInboxRow"
        - type: object
          required:
            - from
          properties:
            from:
              description: "Who the notification is from, by the inbox that holds it: `sparkvault` for SparkVault's own, and `organization` for the person's own organization's, with its name as its notifications show it. `name` is null when the organization has no name, or one that reads as SparkVault's: show it as their organization, never as SparkVault."
              oneOf:
                - type: object
                  required:
                    - type
                  properties:
                    type:
                      type: string
                      enum:
                        - sparkvault
                - type: object
                  required:
                    - type
                    - name
                  properties:
                    type:
                      type: string
                      enum:
                        - organization
                    name:
                      type:
                        - string
                        - "null"
                    project_id:
                      type: string
                      description: Present for a named project.
                    project_name:
                      type:
                        - string
                        - "null"
                      description: The named project's current display name.
    NotifyFeedPage:
      type: object
      description: A page of the signed-in person's notifications, newest first.
      required:
        - notifications
        - cursor
      properties:
        notifications:
          type: array
          items:
            $ref: "#/components/schemas/NotifyFeedRow"
        cursor:
          type:
            - string
            - "null"
          description: Opaque continuation token. Null when the listing is exhausted.
    NotifyInboxMarked:
      type: object
      description: One notification as its mark left it.
      required:
        - notification_id
        - state
        - updated_at
      properties:
        notification_id:
          type: string
        state:
          type: string
          enum:
            - seen
            - read
            - archived
        updated_at:
          type: integer
          description: Unix seconds.
    NotifyInboxPageMarked:
      type: object
      description: One page of a bulk mark.
      required:
        - updated
        - cursor
      properties:
        updated:
          type: integer
          description: Rows marked on this page.
        cursor:
          type:
            - string
            - "null"
          description: Opaque continuation token. Null when the listing is exhausted.
    NotifyChannelOutcome:
      type: object
      properties:
        outcome:
          type:
            - string
            - "null"
          description: "delivered/retryable/deferred/skipped/not_implemented are what an adapter reports: deferred is an email, text or call step that could not go yet, tried again at retry_at for its reason. failed is written when a step exhausts its retries (retryable would read as still-in-flight forever), when a deferred step cannot go within 24 hours of the send, and when a text, call or email was handed on and its answer was lost: it may have reached the person, so it is never sent again. Each way the ladder moves on to its next channel. A text or call whose wait would end after its next channel is due is skipped instead, with the reason it would have waited for, and the ladder goes on to that channel. bounced is written when the provider later repudiates a delivery it had accepted, and it REPLACES the delivered entry."
          enum:
            - delivered
            - retryable
            - deferred
            - skipped
            - not_implemented
            - failed
            - bounced
            - null
        at:
          type:
            - integer
            - "null"
          description: Unix seconds the outcome was recorded.
        step:
          type:
            - integer
            - "null"
          description: Escalation step that produced it.
        retry_at:
          type:
            - integer
            - "null"
          description: For a deferred step, Unix seconds it is tried again; null on every other outcome.
        reason:
          type:
            - string
            - "null"
          enum:
            - platform_rate
            - platform_hourly
            - account_hourly
            - provider_throttled
            - sending_paused
            - sender_identity_unverified
            - sending_domain_unverified
            - phone_account_rate
            - phone_platform_budget
            - phone_destination_rate
            - phone_provider_throttled
            - phone_unavailable
            - phone_opted_out
            - possibly_delivered
            - null
          description: "For a deferred step, why it waits. An email: the platform's per-second rate or its hourly email lane, your account's hourly email share, the provider refusing for its rate, the provider's sending paused, the platform's own mail domain the email goes out from not verified for sending, or your organization's own sending domain not verified for sending (the step waits while the domain is checked again). A text or call (the `phone_` reasons): your account's hourly or daily share of texts and calls, the platform's daily budget for them, the recipient's phone reached too recently or too often this hour, the provider refusing for its rate, or texts and calls unavailable for now. For a skipped text or call, phone_opted_out: the phone texted STOP to the number every organization's texts and calls go out from, so nothing went out; the recipient's other text and call steps are skipped the same way, the ladder carries on to its other channels, and it is never an unsubscribe from your organization. Texting START to that number lifts it. For a skipped text or call, a `phone_` reason too: the step would have waited for it until after its next channel was due, so it was passed over and the ladder went on to that channel. For a failed text, call or email, possibly_delivered: its answer was lost after it was handed on, so it may have reached the person; it is never sent again, and a new send to that recipient could reach them twice. Null on every other outcome."
    NotifyStatusRecipient:
      type: object
      required:
        - recipient_id
        - state
        - enqueued
        - channel_outcomes
        - delivered
        - undeliverable
        - failed
      properties:
        recipient_id:
          type: string
          description: "The recipient's key (see NotifyRecipient): their id, else their email, trimmed, with an email address lowercased the way Identity stores it."
        state:
          type: string
          enum:
            - pending
            - delivered
            - undeliverable
            - failed
            - suppressed
            - rate_limited
            - recalled
          description: "The one answer for this recipient, derived from the row. pending = still in flight: the escalation ladder has a step left to run and nothing has settled them, whatever its steps so far recorded short of a delivery. delivered = a channel accepted it and no provider has repudiated that, or the recipient opened the sealed content or marked the notification seen and a later escalation step recorded that before any recall. undeliverable = the ladder ran its course and every channel attempted declined (no handle, bounced, not implemented), or no offered channel could reach them; a hard bounce of their only delivery moves them here at once, even with a step left to run (or to failed, if another channel gave up), until a later step delivers it or records that they opened or marked it seen. A recipient whose grant expired before a channel reached them reads undeliverable too, unless a channel had already failed. Their address may be fine: the grant can expire before their first step goes, or while their email retries or is deferred, and then `channel_outcomes` record no decline. failed = the ladder ran its course (or their grant expired, or a hard bounce of their only delivery settled them), every attempt ended, and a channel gave up: it exhausted its retries, their deferred email, text or call could not go within 24 hours of the send, or a text or call's answer was lost after the carrier took it (it may have reached them); our transport gave up, the address may be fine. suppressed = taken out of the ladder by a decision, not a fault: the PERSON chose silence (global off, category mute, every offered channel opted out, they blocked your site on a sealed send, or they unsubscribed the address the send was made to), or your account was suspended or began deleting before a queued step came due; `suppressed_reason` says which. rate_limited = skipped by the per-recipient abuse ceiling for that minute, decided once per send and recipient. recalled = the sender took it back and nothing on the row outranks the recall: a delivery, a suppression (an opt-out, or no channel that could reach them), a rate-limit skip, and a ladder that ran its course with every channel declining or giving up before the recall each keep their own state. A recall that stops a ladder before it runs its course reads recalled, whatever its earlier steps recorded (a recipient whose first channel skipped them, then recalled before their next channel, reads recalled)."
        enqueued:
          type: boolean
          description: Fan-out accepted this recipient and enqueued the first delivery step.
        seen_at:
          type:
            - integer
            - "null"
        read_at:
          type:
            - integer
            - "null"
        archived_at:
          type:
            - integer
            - "null"
        suppressed_at:
          type:
            - integer
            - "null"
          description: When the recipient was taken out of the ladder. NOT always an opt-out. Read `suppressed_reason` to tell an opt-out from an unreachable address or your account's stop; `state` already separates an unreachable address (undeliverable) from a suppression.
        suppressed_reason:
          type:
            - string
            - "null"
          enum:
            - no_channels
            - unreachable
            - global_off
            - category_muted
            - all_channels_opted_out
            - site_blocked
            - identifier_unsubscribed
            - account_unavailable
            - null
          description: Why, as a fixed token (never a transport string, so nothing recipient-identifying rides it). `no_channels` (the send offered no channel at all) and `unreachable` (every offered channel lacks a handle for them) both roll up to state "undeliverable". `global_off`, `category_muted`, `all_channels_opted_out`, `site_blocked` (the person blocked your site on auth.sv, so a sealed send could never open for them), `identifier_unsubscribed` and `account_unavailable` (your account was suspended or began deleting before a queued step came due) all roll up to state "suppressed".
        rate_limited_at:
          type:
            - integer
            - "null"
          description: When the per-recipient ceiling skipped them, decided once per send and recipient. Only a delivery that raced the refusal (a retried fan-out that read them admitted before it landed) clears it, and then they read as any driven recipient.
        channel_outcomes:
          type: object
          description: "Latest outcome per channel. A channel is keyed once: a later attempt overwrites the earlier one. A deferred entry is left out once the recipient's record holds a stop its step meets when it wakes (they saw the notification, it was recalled, or their ladder already ended undelivered), since that step sends nothing. A stop held on no record (their grant spent or expired, your account stopped) is met only when the step wakes, and until then the entry stays. Provider detail strings are deliberately withheld: they can echo the recipient contact."
          additionalProperties:
            $ref: "#/components/schemas/NotifyChannelOutcome"
        delivered:
          type: boolean
          description: "At least one channel transport ACCEPTED the message. It is not proof a human saw it: that is seen_at/read_at, and for a ceremony, a receipt. A transport fact only: `state` is delivered for a recipient who opened or saw the notification even when every channel declined."
        undeliverable:
          type: boolean
          description: "Something was attempted, nothing delivered, and every recorded outcome declined (skipped, not_implemented, or bounced). A still-retrying recipient is neither delivered nor undeliverable. A transport fact about the attempts so far: while the ladder has a step left to run it can be true with `state` still pending."
        failed:
          type: boolean
          description: "Every attempt is terminal, nothing delivered, and at least one channel's outcome is failed: it exhausted its retries, was deferred and could not go within 24 hours of the send, or was a text or call whose answer was lost. A transport fact about the attempts so far, like `undeliverable`."
    NotifyStatusDestination:
      type: object
      required:
        - kind
        - state
        - at
        - reason
        - target
        - target_name
      properties:
        kind:
          type: string
          enum:
            - webhook
            - slack
            - teams
        state:
          type: string
          enum:
            - pending
            - delivered
            - skipped
            - failed
            - recalled
            - unknown
          description: "`pending` until the post settles, including while it waits to be tried again; `delivered` once the destination accepted it; `skipped` when nothing was posted and trying again would not post it; `failed` when it was given up on; `recalled` when the whole send was recalled before the post settled; `unknown` when the send's delivery record is gone."
        at:
          type:
            - integer
            - "null"
          description: Unix seconds the state was recorded; null for a post no attempt has recorded anything for yet.
        reason:
          type:
            - string
            - "null"
          description: "Why the post was skipped or failed, null otherwise: one of `account_inactive`, `destination_removed`, `destination_unrouted`, `unsafe_url`, `redirect_refused`, `slack_not_installed`, `slack_reauthorization_required`, `channel_not_found`, `is_archived`, `not_in_channel`, `display_not_shown`, `rejected_unrecognized`, `possibly_delivered`, `attempts_exhausted`, or `status_` and the HTTP status a webhook or Teams workflow refused it with (`status_404`), or `rejected_` and the error code Slack refused it with. `possibly_delivered` means the post was sent and its answer was lost: it may have landed, and it is never tried again, since that could post it twice."
        target:
          type:
            - string
            - "null"
          description: "Where the post went: the webhook's host, the Slack channel id, or the Teams workflow's host. Null when no attempt recorded one."
        target_name:
          type:
            - string
            - "null"
          description: The Slack channel's name beside its id in `target`, as the Slack destination's `channel_name` read when the post was decided. Null for a webhook or Teams post, whose host names itself, and for a Slack post whose destination held no name.
    NotifyDestinationTestResult:
      type: object
      required:
        - kind
        - state
        - reason
      properties:
        kind:
          type: string
          enum:
            - webhook
            - slack
            - teams
        state:
          type: string
          enum:
            - delivered
            - skipped
            - failed
          description: "`delivered` once the destination accepted the test post; `skipped` when nothing was posted and posting again would not post it until the destination or its receiver changes; `failed` when the post reached no answer that settles it. A test post is made once and never tried again."
        reason:
          type:
            - string
            - "null"
          description: "Null when delivered. Beside `skipped`, the skip reason a send status reports (NotifyStatusDestination `reason`). Beside `failed`, `possibly_delivered` when the post was sent and its answer was lost, so it may have landed; otherwise the fault a send's post would be tried again on: `network`, `timeout`, `unsent`, `deadline_reached`, `status_` and a status a retry can clear (`status_503`), or the Slack app's own: `slack_rate_limited`, `slack_token_refresh_in_progress`, `slack_unavailable`, `installation_unavailable`."
    NotifySendStatus:
      type: object
      required:
        - send_id
        - status
        - delivery
        - recalled_at
        - recipients
        - counts
        - destinations
      properties:
        send_id:
          type: string
        status:
          type: string
          enum:
            - unknown
            - pending
            - sending
            - delivered
            - partial
            - failed
          description: "DERIVED, never stored, and derived by the SAME function the send-history list and the status rollup both call, so the two surfaces can never disagree about what a state means. unknown = no result can be claimed: there is no audience denominator (recipient_count absent or 0; the list reads it when the send row carries no recipient_count, and the status view, which counts the audience itself, only for a send with no recipients), or the list can no longer read the counters (the send is past its history horizon, and its counters were removed first), so no result is claimed rather than a wrong one; pending = accepted, nothing handed to delivery yet; sending = in flight; delivered = every recipient settled delivered, whether a channel accepted it or their engagement was recorded (see the per-recipient `state`); partial = every recipient resolved, some delivered and some not; failed = every recipient resolved and none delivered. A whole-audience recall resolves every recipient a channel had not already reached, so a recalled send reads partial, or failed when nothing had been delivered. The list feeds it the send's best-effort counters; the status view recomputes them from the authoritative per-recipient rows, so when the two differ the status view is the one to trust. Use the per-recipient `state` for why a given recipient did not get it."
        channels:
          type: array
          items:
            type: string
            enum:
              - in_app
              - email
              - sms
              - push
              - web_push
              - voice
              - whatsapp
              - rcs
        created_at:
          type: integer
        title:
          type:
            - string
            - "null"
        category:
          type:
            - string
            - "null"
        type:
          type:
            - string
            - "null"
        delivery:
          type: string
          enum:
            - sealed
            - plaintext
          description: How the send carries its message. Only a sealed send minted a link per recipient, so only a sealed send can be recalled; a plaintext send delivered its body inline.
        recalled_at:
          type:
            - integer
            - "null"
          description: Unix seconds of a whole-audience recall; null when there was none. A targeted recall of named recipients never sets it; a named recipient reads `recalled` in their `state` unless their row records something recall does not undo (one a channel already reached stays `delivered`).
        recipients:
          type: array
          items:
            $ref: "#/components/schemas/NotifyStatusRecipient"
        destinations:
          type: array
          description: "Each of your organization's destinations the send was routed to when it was accepted (config `destinations`), in the order webhook, slack, teams; empty when none was. Reported beside the recipients, never part of them: `status` and `counts` are the recipients' alone."
          items:
            $ref: "#/components/schemas/NotifyStatusDestination"
        counts:
          type: object
          description: "The seven state counters PARTITION the audience: pending + delivered + undeliverable + failed + suppressed + rate_limited + recalled === total. enqueued/seen/read/archived/deferred are independent progress markers and do not partition anything."
          required:
            - total
            - enqueued
            - seen
            - read
            - archived
            - deferred
            - pending
            - delivered
            - undeliverable
            - failed
            - suppressed
            - rate_limited
            - recalled
          properties:
            total:
              type: integer
              description: Recipients on the send, not rows returned.
            enqueued:
              type: integer
            seen:
              type: integer
            read:
              type: integer
            archived:
              type: integer
            deferred:
              type: integer
              description: "Recipients with a deferred email, text or call step, whatever their state: one no other channel reached reads pending until the step runs, and one another channel already reached reads delivered. A wait is not counted once the recipient's record holds a stop its step meets when it wakes (they saw the notification, it was recalled, or their ladder already ended undelivered): that step sends nothing. A stop held on no record (their grant spent or expired, your account stopped) is met only when the step wakes, and the wait is counted until then."
            pending:
              type: integer
            delivered:
              type: integer
            undeliverable:
              type: integer
            failed:
              type: integer
            suppressed:
              type: integer
            rate_limited:
              type: integer
            recalled:
              type: integer
    NotifyReceipt:
      type: object
      description: A verified-interaction receipt. A ceremony's (acknowledge, sign, approve, reply) is portable proof carrying `signed_token`; an open's (`sparklink_accessed`) is an unsigned access record. An acknowledge records `sparklink_signed`, as a sign does; `interaction` tells them apart. Every field is always present; unknown values are null.
      required:
        - event_type
        - occurred_at
        - interaction
      properties:
        event_type:
          type: string
          enum:
            - sparklink_accessed
            - sparklink_signed
            - sparklink_approved
            - sparklink_denied
            - sparklink_replied
        occurred_at:
          type:
            - integer
            - "null"
          description: Unix seconds.
        interaction:
          type:
            - string
            - "null"
          enum:
            - view
            - acknowledge
            - sign
            - approve
            - reply
            - null
        identity:
          type:
            - string
            - "null"
          description: The verified identity that performed the interaction.
        asset_id:
          type:
            - string
            - "null"
        vault_id:
          type:
            - string
            - "null"
        link_code:
          type:
            - string
            - "null"
          description: Masked pointer code (6-char display prefix; it can collide across sends).
        link_code_hash:
          type:
            - string
            - "null"
          description: "The correlation key an event webhook quotes: 32 hex chars, 128 bits of SHA-256 over the full grant code. Match an interaction event to its receipt on THIS, never on `link_code`. Never the grant itself."
        link_type:
          type:
            - string
            - "null"
        verification_level:
          type:
            - string
            - "null"
          enum:
            - none
            - identifier
            - passkey
            - out_of_band
            - dual_control
            - null
          description: 'The level the recipient satisfied: the one the grant enforced, so the address-scoped recipient of a "none" send reports "identifier". Wider than the set a send may ASK for: out_of_band and dual_control cannot be requested, but a stored grant that names either is enforced at the strength it names, so a receipt can report it.'
        action_hash:
          type:
            - string
            - "null"
          description: SHA-256 of the canonicalized action an approve (approved or declined) or a sign bound. Null on every other receipt.
        signed_token:
          type:
            - string
            - "null"
          description: Ed25519 (EdDSA) JWT attesting the interaction. Verify against the account JWKS at https://auth.sparkvault.com/{account_id}/.well-known/jwks.json. Null on a view receipt.
        decision:
          type:
            - string
            - "null"
          description: "An approve ceremony's outcome: \"approved\" or \"denied\"."
        thread_id:
          type:
            - string
            - "null"
        reply_spark_id:
          type:
            - string
            - "null"
        send_id:
          type:
            - string
            - "null"
          description: "The send whose grant produced this receipt, stamped at mint time. Null for a standalone SparkLink, and on a per-send receipt (`.../sends/{sendId}/receipts`), which is read from the audit row: the send there is the one the path names."
        title:
          type:
            - string
            - "null"
          description: The send's display title, under the same conditions as send_id.
        receipt_id:
          type:
            - string
            - "null"
          description: The receipt row id. Null on a per-send receipt.
    NotifySendSummary:
      type: object
      description: "Metadata for one send: display fields, the recall marker and the delivery counters only, never the audience, the pointer code, or a plaintext body. Read `.../sends/{sendId}/status` for per-recipient detail."
      required:
        - send_id
        - state
      properties:
        send_id:
          type:
            - string
            - "null"
        notify_project_id:
          type: string
          description: Named project id; absent for Default.
        created_at:
          type:
            - integer
            - "null"
          description: Unix seconds.
        title:
          type:
            - string
            - "null"
        category:
          type:
            - string
            - "null"
        delivery:
          type:
            - string
            - "null"
          enum:
            - sealed
            - plaintext
            - null
        display_sender_name:
          type:
            - string
            - "null"
          description: The "from" the recipient saw. Display only; nothing routes on it.
        recipient_count:
          type:
            - integer
            - "null"
        enqueued_count:
          type:
            - integer
            - "null"
        delivered_count:
          type:
            - integer
            - "null"
        failed_count:
          type:
            - integer
            - "null"
          description: "Recipients resolved without delivery: every attempted channel declined or gave up, they were suppressed or rate limited, or they were recalled before a channel reached them (counted when the next step of their ladder stops on the revoked grant)."
        recalled_at:
          type:
            - integer
            - "null"
          description: "Unix seconds of a whole-audience recall; null when there was none (a targeted recall of named recipients never sets it: those recipients resolve through `failed_count`, and the status endpoint names them `recalled`). A recalled send scores every recipient a channel had not already reached as resolved, so `state` reads `partial`, or `failed` when nothing had been delivered: this field is what tells that recall apart from a delivery failure."
        state:
          type: string
          enum:
            - unknown
            - pending
            - sending
            - delivered
            - partial
            - failed
          description: "DERIVED, never stored, and derived by the SAME function the send-history list and the status rollup both call, so the two surfaces can never disagree about what a state means. unknown = no result can be claimed: there is no audience denominator (recipient_count absent or 0; the list reads it when the send row carries no recipient_count, and the status view, which counts the audience itself, only for a send with no recipients), or the list can no longer read the counters (the send is past its history horizon, and its counters were removed first), so no result is claimed rather than a wrong one; pending = accepted, nothing handed to delivery yet; sending = in flight; delivered = every recipient settled delivered, whether a channel accepted it or their engagement was recorded (see the per-recipient `state`); partial = every recipient resolved, some delivered and some not; failed = every recipient resolved and none delivered. A whole-audience recall resolves every recipient a channel had not already reached, so a recalled send reads partial, or failed when nothing had been delivered. The list feeds it the send's best-effort counters; the status view recomputes them from the authoritative per-recipient rows, so when the two differ the status view is the one to trust. Use the per-recipient `state` for why a given recipient did not get it."
        destinations:
          type:
            - array
            - "null"
          description: The state of each of your organization's destinations the send was routed to, in the order webhook, slack, teams (empty when none was), with the reason beside a skipped or failed one, as the status endpoint reports them there; null when the send's delivery record is gone (`state` unknown).
          items:
            type: object
            required:
              - kind
              - state
              - reason
            properties:
              kind:
                type: string
                enum:
                  - webhook
                  - slack
                  - teams
              state:
                type: string
                enum:
                  - pending
                  - delivered
                  - skipped
                  - failed
                  - recalled
                  - unknown
              reason:
                type:
                  - string
                  - "null"
                description: "Why the post was skipped or failed, null otherwise: one of `account_inactive`, `destination_removed`, `destination_unrouted`, `unsafe_url`, `redirect_refused`, `slack_not_installed`, `slack_reauthorization_required`, `channel_not_found`, `is_archived`, `not_in_channel`, `display_not_shown`, `rejected_unrecognized`, `possibly_delivered`, `attempts_exhausted`, or `status_` and the HTTP status a webhook or Teams workflow refused it with (`status_404`), or `rejected_` and the error code Slack refused it with. `possibly_delivered` means the post was sent and its answer was lost: it may have landed, and it is never tried again, since that could post it twice."
    NotifyRecallRequest:
      type: object
      description: Omit `recipient_ids` to recall the whole audience.
      properties:
        recipient_ids:
          type: array
          minItems: 1
          items:
            type: string
          description: Recall only these recipients, each read as a recipient key (trimmed, with an email address lowercased the way Identity stores it; see NotifyRecipient). Ids not on the send come back in `not_found`, in that form, rather than failing the call.
        mode:
          type: string
          enum:
            - grant
            - content
          default: grant
          description: "`grant` revokes the access grants, leaving the content intact for any other share. `content` destroys the sealed content itself, which only a send that sealed its content has: a content recall of an `ingot` send (a file from the owner's vault) is a 400, refused before anything is revoked or stopped."
    NotifyRecallResponse:
      type: object
      required:
        - send_id
        - mode
        - recalled
        - failed
        - not_found
        - failures
      properties:
        send_id:
          type: string
        mode:
          type: string
          enum:
            - grant
            - content
        recalled:
          type: integer
          description: "Grants revoked. Idempotent: an already-revoked grant counts as recalled."
        failed:
          type: integer
        not_found:
          type: array
          items:
            type: string
          description: Requested recipient ids that are not on this send.
        failures:
          type: array
          description: One entry per recipient whose recall failed. The rest still ran.
          items:
            type: object
            properties:
              recipient_id:
                type: string
              error:
                type: string
                description: "The error code the API answers this failure with on its own: a refusal's code (such as `VALIDATION_ERROR`), else `INTERNAL_ERROR` or a public server error code (such as `CRYPTOGRAPHIC_ERROR`). Never the error's text."
    NotifyEventsConfig:
      type: object
      description: "Outbound event webhook. Events are POSTed as JSON with an `X-SparkVault-Signature` header carrying the hex HMAC-SHA256 of the raw body under `secret`, and a `User-Agent` that begins `SparkVault/`. Best effort: one retry, then dropped, so polling remains the source of truth. Nothing is sent until both fields are stored. A patch names only what it changes and the secret it leaves out stays as stored, except that a `webhook_url` on another host or port needs a new `secret` beside it (400 naming `events.secret`, `details.missing: ['secret']`, `details.reason: secret_required_on_new_host`): a secret never follows its URL to a different host. A patch of `events: null` removes the webhook, URL and secret together, and no event is sent from then on; a null for either field alone is refused 400."
      properties:
        webhook_url:
          type: string
          format: uri
          maxLength: 2048
          writeOnly: true
          description: "https only, on a public host. Loopback, private, link-local, and CGNAT addresses are rejected. Never returned on a read, since a catch hook's URL carries its own token: a response reports `webhook_url_set` and `webhook_url_host` instead."
        webhook_url_set:
          type: boolean
          readOnly: true
          description: Whether an event webhook URL is stored. Replaces `webhook_url` on every read.
        webhook_url_host:
          type: string
          readOnly: true
          description: The stored event webhook URL's host, so an editor can say where events go.
        secret:
          type: string
          minLength: 16
          maxLength: 256
          writeOnly: true
          description: Never returned on a read. A response reports `secret_set` instead.
        secret_set:
          type: boolean
          readOnly: true
          description: Whether a signing secret is stored. Replaces `secret` on every read.
    NotifyWebhookDestination:
      type: object
      description: "Your own HTTPS endpoint. Each routed send is POSTed to `url` once as JSON, signed like the event webhook: an `X-SparkVault-Signature` header carrying the hex HMAC-SHA256 of the raw body under `secret`, beside a `User-Agent` that begins `SparkVault/`. A post that may not have landed is tried again with the same `delivery_id`, so drop a repeat you already received. A redirect is never followed. Created with all three fields; a patch to one that exists names only what it changes, and the URL and secret it leaves out stay as stored, except that a `url` on another host or port needs a new `secret` beside it (400 naming `destinations.webhook.secret`, `details.missing: ['secret']`, `details.reason: secret_required_on_new_host`): a secret never follows its URL to a different host."
      properties:
        url:
          type: string
          format: uri
          maxLength: 2048
          writeOnly: true
          description: "https only, on a public host. Loopback, private, link-local, and CGNAT addresses are rejected. Never returned on a read, since a catch hook's URL carries its own token: a response reports `url_set` and `url_host` instead."
        url_set:
          type: boolean
          readOnly: true
          description: Whether an endpoint URL is stored. Replaces `url` on every read.
        url_host:
          type: string
          readOnly: true
          description: The stored endpoint URL's host, so an editor can say which endpoint it is.
        secret:
          type: string
          minLength: 16
          maxLength: 256
          writeOnly: true
          description: Never returned on a read. A response reports `secret_set` instead.
        secret_set:
          type: boolean
          readOnly: true
          description: Whether a signing secret is stored. Replaces `secret` on every read.
        categories:
          type: array
          minItems: 1
          maxItems: 50
          uniqueItems: true
          items:
            type: string
          description: "The categories whose sends the destination receives one post of. Each is a category a send can carry once the patch lands (one of the account's categories, one the same patch creates, a preset category, or help_desk_alert), or one the destination already lists; a refused one is named in `details.category`, beside the categories a destination may list in `details.sendable_categories`. Never `security`: a person's security notices go only to that person, never to a shared channel, and naming it is refused 400."
    NotifySlackDestination:
      type: object
      description: "A channel in your organization's Slack workspace, posted to through its SparkVault Slack app installation. A save naming `channel_id` (even the one already saved) prepares the channel first: the app reads it and joins a public one it is not in yet, and a private channel needs the app invited first. A channel the app cannot post in is refused 400 in plain words, with `details.reason` naming why (`slack_not_installed`, `slack_reauthorization_required`, `channel_not_found`, `is_archived`, `not_in_private_channel`, `not_a_channel` for a group direct message, or `rejected_` and Slack's error code), and nothing is stored. Created with both fields; a patch to one that exists names only what it changes."
      properties:
        channel_id:
          type: string
          pattern: ^[CG][A-Z0-9]{1,63}$
          description: The channel's Slack id, as GET /apps/slack/channels lists it.
        channel_name:
          type:
            - string
            - "null"
          readOnly: true
          description: The channel's name, without its `#`, as Slack named it when the last save naming `channel_id` prepared it, so every such save refreshes it. Set by the save, never by a patch (one naming it is refused 400). Null until a save naming `channel_id` captures it.
        categories:
          type: array
          minItems: 1
          maxItems: 50
          uniqueItems: true
          items:
            type: string
          description: "The categories whose sends the destination receives one post of. Each is a category a send can carry once the patch lands (one of the account's categories, one the same patch creates, a preset category, or help_desk_alert), or one the destination already lists; a refused one is named in `details.category`, beside the categories a destination may list in `details.sendable_categories`. Never `security`: a person's security notices go only to that person, never to a shared channel, and naming it is refused 400."
    NotifyTeamsDestination:
      type: object
      description: A Microsoft Teams channel, posted to through a Teams workflow's webhook URL. The URL is itself the credential that posts to the channel, so it is never returned on a read. Created with both fields; a patch to one that exists names only what it changes, and the URL it leaves out stays as stored.
      properties:
        webhook_url:
          type: string
          format: uri
          maxLength: 2048
          writeOnly: true
          description: "https only, on a public host. Loopback, private, link-local, and CGNAT addresses are rejected. Never returned on a read: a response reports `webhook_url_set` and `webhook_url_host` instead."
        webhook_url_set:
          type: boolean
          readOnly: true
          description: Whether a workflow URL is stored. Replaces `webhook_url` on every read.
        webhook_url_host:
          type: string
          readOnly: true
          description: The stored workflow URL's host, so an editor can say which workflow it is.
        categories:
          type: array
          minItems: 1
          maxItems: 50
          uniqueItems: true
          items:
            type: string
          description: "The categories whose sends the destination receives one post of. Each is a category a send can carry once the patch lands (one of the account's categories, one the same patch creates, a preset category, or help_desk_alert), or one the destination already lists; a refused one is named in `details.category`, beside the categories a destination may list in `details.sendable_categories`. Never `security`: a person's security notices go only to that person, never to a shared channel, and naming it is refused 400."
    NotifyConfigCategory:
      type: object
      properties:
        label:
          type: string
          maxLength: 60
        description:
          type: string
          maxLength: 200
        required:
          type: boolean
          description: Recipients cannot mute a required category or switch it off with the site; a channel they refused still removes that channel (only the reserved `security` category crosses a per-channel refusal).
    NotifyEffectiveConfig:
      type: object
      description: Platform defaults with the account overrides applied.
      properties:
        delivery:
          type: object
          properties:
            default_channels:
              type: array
              minItems: 1
              items:
                type: string
                enum:
                  - in_app
                  - email
                  - sms
                  - push
                  - web_push
                  - voice
                  - whatsapp
                  - rcs
            channel_priority:
              type: object
              description: Per-category channel order.
              additionalProperties:
                type: array
                items:
                  type: string
                  enum:
                    - in_app
                    - email
                    - sms
                    - push
                    - web_push
                    - voice
                    - whatsapp
                    - rcs
            realtime_fallback_delay:
              type: object
              properties:
                email_minutes:
                  type: integer
                  minimum: 0
                  maximum: 1440
            escalation_enabled:
              type: boolean
        reliability:
          type: object
          properties:
            rate_limit_per_recipient_per_minute:
              type: integer
              minimum: 1
              maximum: 600
              description: "Delivery ceiling per recipient per minute, enforced at fan-out per person: a recipient counts against its own id and each email address or phone number it names, so recipients that share an address share its budget. Cannot be disabled."
        history:
          type: object
          properties:
            history_ttl_days:
              type: integer
              minimum: 1
              maximum: 3650
            receipt_retention_days:
              type: integer
              minimum: 1
              maximum: 3650
        security:
          type: object
          properties:
            verification_level:
              type: string
              enum:
                - none
                - identifier
                - passkey
            reveal_freshness_minutes:
              type: integer
              minimum: 0
              description: 0 means off.
            mandatory_seal_categories:
              type: array
              items:
                type: string
              description: Categories that may never be sent plaintext.
        events:
          $ref: "#/components/schemas/NotifyEventsConfig"
        email:
          type: object
          properties:
            sending_domain:
              type:
                - string
                - "null"
              description: The organization's own domain its Notify email is selected to go out from, or null for its handle host. GET /products/notify/email-sender says whether it serves sending now.
        destinations:
          type: object
          description: "Your organization's send-level destinations, each under its kind and present only once configured. Each receives one post of every send whose category it lists, never one per recipient: the send's title, your organization's name, the category's label, and the plaintext body, or for a sealed send its instructions. Never the sealed content, its link, or who the recipients are. Posts are not counted against your plan."
          properties:
            webhook:
              $ref: "#/components/schemas/NotifyWebhookDestination"
            slack:
              $ref: "#/components/schemas/NotifySlackDestination"
            teams:
              $ref: "#/components/schemas/NotifyTeamsDestination"
        categories:
          type: object
          additionalProperties:
            $ref: "#/components/schemas/NotifyConfigCategory"
    NotifyConfigPatch:
      type: object
      description: Partial update, deep-merged onto the stored overrides. Unknown sections and fields are rejected.
      properties:
        delivery:
          type: object
          properties:
            default_channels:
              type: array
              minItems: 1
              uniqueItems: true
              items:
                type: string
                enum:
                  - in_app
                  - email
                  - sms
                  - push
                  - web_push
                  - voice
            channel_priority:
              type: object
              description: One channel ladder per category, each naming at least one channel and each channel at most once. A new key must name a category a send can carry once the patch lands (one of the account's categories, one the same patch creates, a preset category, or help_desk_alert); a stored key stays patchable after its category is deleted. A null value removes that ladder; help_desk_alert's ladder is seeded (in_app, push, web_push, email), and removing it leaves that category on default_channels. The map a patch leaves holds at most 50 ladders, help_desk_alert's seeded one included until it is removed. A refused ladder is named by its category in `details.category`, and a key no send can carry is answered with the keys a ladder may name in `details.sendable_categories`.
              additionalProperties:
                oneOf:
                  - type: array
                    minItems: 1
                    uniqueItems: true
                    items:
                      type: string
                      enum:
                        - in_app
                        - email
                        - sms
                        - push
                        - web_push
                        - voice
                  - type: "null"
            realtime_fallback_delay:
              type: object
              properties:
                email_minutes:
                  type: integer
                  minimum: 0
                  maximum: 1440
            escalation_enabled:
              type: boolean
        reliability:
          type: object
          properties:
            rate_limit_per_recipient_per_minute:
              type: integer
              minimum: 1
              maximum: 600
        history:
          type: object
          properties:
            history_ttl_days:
              type: integer
              minimum: 1
              maximum: 3650
            receipt_retention_days:
              type: integer
              minimum: 1
              maximum: 3650
        security:
          type: object
          properties:
            verification_level:
              type: string
              enum:
                - none
                - identifier
                - passkey
            reveal_freshness_minutes:
              type: integer
              minimum: 0
            mandatory_seal_categories:
              type: array
              maxItems: 50
              uniqueItems: true
              description: "Category keys (a new one must match ^[a-z0-9_]{1,40}$), each at most once, and never `help_desk_alert`: the help desk sends its alerts to your staff plaintext, naming a request number at most."
              items:
                type: string
        events:
          description: Admin only. A null removes the event webhook, URL and secret together.
          oneOf:
            - $ref: "#/components/schemas/NotifyEventsConfig"
            - type: "null"
        email:
          type: object
          description: Admin only.
          properties:
            sending_domain:
              type:
                - string
                - "null"
              description: A domain of the organization's own that its Notify email goes out from, as notify@{domain}, while its ownership is verified and its email sending is ready; null sends from the organization's handle, notify@{handle}.send.sv. A domain the organization does not hold is refused 404, and one not ready for Notify 409 DOMAIN_NOT_READY. Each change to a domain that passes those checks spends one of the organization's 10 sending-domain selections an hour, shared with the help desk's `custom_domain` (429 once they are spent); a refused change, naming the domain already selected, or null spends none.
        destinations:
          type: object
          description: Admin only. A null removes the destination of its kind; an object creates it (naming every field) or patches the one stored.
          properties:
            webhook:
              oneOf:
                - $ref: "#/components/schemas/NotifyWebhookDestination"
                - type: "null"
            slack:
              oneOf:
                - $ref: "#/components/schemas/NotifySlackDestination"
                - type: "null"
            teams:
              oneOf:
                - $ref: "#/components/schemas/NotifyTeamsDestination"
                - type: "null"
        categories:
          type: object
          description: "Keyed topic map. A null value deletes the topic. New keys must match ^[a-z0-9_]{1,40}$, and the map a patch leaves holds at most 50 topics, the seeded ones it keeps included (a deleted seeded topic frees its place). The reserved `security` category can be neither deleted nor made optional, the promotional categories `marketing` and `product` cannot be made required: their email always carries an unsubscribe link, and `help_desk_alert` can be neither deleted nor made required: each member decides on auth.sv, under it, whether the help desk's alerts reach them."
          additionalProperties:
            oneOf:
              - $ref: "#/components/schemas/NotifyConfigCategory"
              - type: "null"
    NotifyConfigResponse:
      type: object
      required:
        - effective
        - overrides
        - version
      properties:
        effective:
          $ref: "#/components/schemas/NotifyEffectiveConfig"
        overrides:
          type: object
          description: The stored delta verbatim, including the tombstone (a null) of each deleted seeded category, which keeps that default from returning. Any other delete leaves no entry. A credential (a signing secret, a Teams workflow URL) reads as it does in `effective`, never as stored, and so does a Slack destination's `channel_name`.
        version:
          type: integer
          minimum: 0
          description: "The version of the stored configuration this answer shows: 0 before anything is saved, one higher with each save that lands. Two answers of overlapping saves can arrive in either order; the one with the higher version is the newer configuration."
    NotifyEmailSender:
      type: object
      description: "Who the organization's Notify email is from: `\"{organization name}\" <from_address>`, carrying a notice that names SparkVault Notify. A reply reaches no one when the email goes out from the handle host, or from a domain of the organization's own that is set up as a help-desk web host (its `web.status` anything but not_requested) or receives the help desk's email; from a domain that only sends, a reply goes wherever that domain's own MX records route it."
      required:
        - state
        - from_address
        - handle_host
        - sending_domain
        - sending_host
        - domain_readiness
      properties:
        state:
          type: string
          enum:
            - ready
            - handle_required
            - platform_sender
          description: "ready: the email goes out from from_address. handle_required: the organization holds no handle, so a send that would email someone is refused 409 HANDLE_REQUIRED until it chooses one. platform_sender: SparkVault's own account, whose Notify email is platform mail."
        from_address:
          type:
            - string
            - "null"
          description: "The address in effect: notify@{handle}.send.sv, or notify@{domain} while the selected domain serves sending; SparkVault's platform address for platform_sender; null for handle_required."
        handle_host:
          type:
            - string
            - "null"
          description: The organization's host under send.sv, which the email falls back to whenever the selected domain stops serving. Null unless the state is ready.
        sending_domain:
          type:
            - string
            - "null"
          description: The domain the config selects, whether or not it serves sending now. Null for platform_sender.
        sending_host:
          type:
            - string
            - "null"
          description: "The host the email goes out from now: the selected domain while it serves sending, else the handle host. Null unless the state is ready."
        domain_readiness:
          oneOf:
            - $ref: "#/components/schemas/DomainReadiness"
            - type: "null"
          description: The selected domain's readiness; null with no selection, and while the organization does not hold the selected domain's claim.
    NotifySuppression:
      type: object
      description: One address that opted out of THIS account's mail. The stored row is keyed by a composite of the account and the address; that internal key never leaves the API, because echoing it would invite a caller to construct one naming an account that is not theirs.
      required:
        - email
        - type
        - source
      properties:
        email:
          type: string
          description: The suppressed address, normalized (lower-cased, trimmed).
        type:
          type: string
          enum:
            - unsubscribe
          description: "Always `unsubscribe`: an opt-out is the one suppression recorded for an account. A bounce and a complaint are facts about the ADDRESS, recorded GLOBALLY, so they are not in this index at all."
        source:
          type: string
          enum:
            - user_request
          description: "What recorded the row: the person, unsubscribing from your mail."
        reason:
          type:
            - string
            - "null"
          description: Free-form detail, when the recording path supplied one.
        created_at:
          type:
            - integer
            - "null"
          description: Unix seconds the row was written.
    NotifySuppressionListResponse:
      type: object
      required:
        - suppressions
        - cursor
      properties:
        suppressions:
          type: array
          items:
            $ref: "#/components/schemas/NotifySuppression"
          description: Newest first.
        cursor:
          type:
            - string
            - "null"
          description: Opaque continuation token, with the same cursor contract `/sends` and `/receipts` use. Pass it back as `cursor` to read the next page, and loop until it comes back null. It carries the whole page pointer, so it is never assembled from a field on a row.
    NotifySuppressionClearResponse:
      type: object
      required:
        - cleared
        - email
      properties:
        cleared:
          type: boolean
          description: "True when one of THIS account's rows was removed. False when there was nothing of yours to clear, including when the only suppression on that address is GLOBAL. That case is a 200, never a 404: a 404 would reveal whether an address is globally suppressed, which is not this caller's business."
        email:
          type: string
          description: The normalized address the call acted on.
    StoreSubscription:
      type: object
      description: "A subscription bought through the App Store or Google Play that still bills the account. SparkVault cannot cancel a store subscription: only its buyer can, in the store."
      required:
        - kind
        - channel
        - id
      properties:
        kind:
          type: string
          enum:
            - base
            - addon
          description: "base: the license; addon: a capacity add-on."
        channel:
          type: string
          enum:
            - appstore
            - play
        id:
          type:
            - string
            - "null"
          description: The store's id for it (App Store original transaction id, Google Play purchase token), when known.
    AccountDeletionStarted:
      type: object
      required:
        - message
        - account_id
        - started_at
        - stripe_subscriptions_cancelled
        - store_subscriptions
      properties:
        message:
          type: string
        account_id:
          type: string
        started_at:
          type: integer
          description: "Unix seconds: when the deletion started."
        stripe_subscriptions_cancelled:
          type: array
          items:
            type: string
          description: The Stripe subscriptions this request ended, at once and with nothing refunded. Empty when the deletion was already in progress.
        store_subscriptions:
          type: array
          items:
            $ref: "#/components/schemas/StoreSubscription"
          description: The store subscriptions that keep billing until their buyer cancels them in the store.
    ProfileDeleted:
      type: object
      required:
        - message
      properties:
        message:
          type: string
    SessionUser:
      type: object
      description: "The signed-in member, as every answer that starts or renews their session carries them: POST /auth/identity/token, /auth/identity/verify, /auth/refresh and /auth/complete-signup."
      required:
        - user_id
        - email
        - role
        - is_account_owner
        - products
      properties:
        user_id:
          type: string
        email:
          type: string
          description: Their sign-in email.
        name:
          type:
            - string
            - "null"
          description: Their display name. Absent or null when they have none.
        role:
          type: string
          enum:
            - owner
            - admin
            - user
        is_account_owner:
          type: boolean
          description: "Whether this member is the account owner: the member whose sign-in email is the account's email, whatever their role. Only the owner may change the account email or delete the account."
        products:
          type: array
          items:
            type: string
            enum:
              - vaults
              - sparks
              - identity
              - structured_ingots
              - help_desk
              - notify
          description: "The products they may use, in a fixed order: every product for an org admin, otherwise those an org admin granted them. Access only: a product grant is not a license."
    Account:
      type: object
      description: The organization's account, as GET /account answers it.
      required:
        - account_id
        - email
        - organization_name
        - organization_handle
        - time_zone
        - email_file_names
        - created_at
        - status
        - logo_url
        - logo_dark_url
        - custom_domains
      properties:
        account_id:
          type: string
        email:
          type: string
          description: "The account's email: its owner's sign-in email."
        organization_name:
          type: string
        organization_handle:
          type:
            - string
            - "null"
          description: The organization's handle (its sign-in page answers at https://auth.sv/{handle}). Null until an org admin claims one.
        time_zone:
          type: string
          description: The IANA time zone the organization's reports count days in, such as America/New_York. UTC until an org admin sets one.
        email_file_names:
          type: boolean
          description: "Whether the emails the platform sends about a file name it: the public-upload notification, a file's SparkLink invitation and the attachments of a help desk update. False, each says a file was uploaded, shared or attached without naming it. True until an org admin turns it off."
        created_at:
          type: integer
          description: Unix seconds.
        status:
          type: string
          enum:
            - active
            - suspended
            - deleting
        logo_url:
          type:
            - string
            - "null"
          description: The logo for light backgrounds. Null when none is uploaded.
        logo_dark_url:
          type:
            - string
            - "null"
          description: The logo for dark backgrounds. Null when none is uploaded.
        custom_domains:
          type: array
          description: The domains the organization has proven it owns.
          items:
            type: object
            required:
              - domain
              - verification_method
              - txt_name
              - txt_value
              - created_at
              - verified_at
            properties:
              domain:
                type: string
              verification_method:
                type: string
                enum:
                  - dns_txt
              txt_name:
                type: string
                description: The DNS TXT record name the proof was read from.
              txt_value:
                type: string
                description: The value that record holds.
              created_at:
                type: integer
                description: Unix seconds.
              verified_at:
                type: integer
                description: Unix seconds.
    SessionStarted:
      type: object
      description: A session for the person Identity verified. A registered member gets a full session, with `user` and `account`; a verified email with no member yet gets an identity-only session, whose access token authorizes only POST /auth/complete-signup, with `user` and `account` null.
      required:
        - access_token
        - user
        - account
      properties:
        access_token:
          type: string
        refresh_token:
          type: string
          description: "For a native or server client. A browser request (one carrying `Origin` or `Referer`, or `X-SV-Client: web`) receives it in the `__Host-sv_refresh` HttpOnly cookie instead, never in the body."
        user:
          oneOf:
            - $ref: "#/components/schemas/SessionUser"
            - type: "null"
        account:
          oneOf:
            - $ref: "#/components/schemas/Account"
            - type: "null"
    SessionRefreshed:
      type: object
      required:
        - access_token
        - token_type
        - expires_in
        - session_type
        - user
        - account
      properties:
        access_token:
          type: string
        refresh_token:
          type: string
          description: "The next refresh token: each refresh token is used once. For a native or server client. A browser request (one carrying `Origin` or `Referer`, or `X-SV-Client: web`) receives it in the `__Host-sv_refresh` HttpOnly cookie instead, never in the body."
        token_type:
          type: string
          enum:
            - Bearer
        expires_in:
          type: integer
          description: Seconds until the access token expires.
        session_type:
          type: string
          enum:
            - full
            - identity_only
        user:
          oneOf:
            - $ref: "#/components/schemas/SessionUser"
            - type: "null"
          description: The member as they stand now. Null for an identity-only session.
        account:
          oneOf:
            - $ref: "#/components/schemas/Account"
            - type: "null"
          description: The account as it stands now. Null for an identity-only session.
    SignupCompleted:
      type: object
      description: The full session of the new account's owner.
      required:
        - access_token
        - user
        - account
      properties:
        access_token:
          type: string
        refresh_token:
          type: string
          description: "For a native or server client. A browser request (one carrying `Origin` or `Referer`, or `X-SV-Client: web`) receives it in the `__Host-sv_refresh` HttpOnly cookie instead, never in the body."
        user:
          $ref: "#/components/schemas/SessionUser"
        account:
          $ref: "#/components/schemas/Account"
    Profile:
      type: object
      description: The signed-in member's own profile, with their organization's name.
      required:
        - user_id
        - account_id
        - email
        - role
        - organization_name
        - is_account_owner
        - products
      properties:
        user_id:
          type: string
        account_id:
          type: string
        email:
          type: string
          description: Their sign-in email.
        name:
          type:
            - string
            - "null"
          description: Their display name. Absent or null when they have none.
        given_name:
          type:
            - string
            - "null"
          description: The given name their name was composed from; null when it was given as one line.
        family_name:
          type:
            - string
            - "null"
          description: The family name their name was composed from; null when it was given as one line.
        role:
          type: string
          enum:
            - owner
            - admin
            - user
        created_at:
          type: integer
          description: "Unix seconds: when they joined."
        last_login_at:
          type: integer
          description: "Unix seconds: their last sign-in."
        organization_name:
          type: string
        is_account_owner:
          type: boolean
          description: "Whether this member is the account owner: the member whose sign-in email is the account's email, whatever their role. Only the owner may change the account email or delete the account."
        products:
          type: array
          items:
            type: string
            enum:
              - vaults
              - sparks
              - identity
              - structured_ingots
              - help_desk
              - notify
          description: "The products they may use, in a fixed order: every product for an org admin, otherwise those an org admin granted them. Access only: a product grant is not a license."
    OrganizationHandleAvailability:
      type: object
      description: Whether the organization could claim a handle now.
      required:
        - handle
        - available
        - reason
      properties:
        handle:
          type: string
          description: The handle asked about, as sent.
        available:
          type: boolean
        reason:
          type:
            - string
            - "null"
          enum:
            - taken
            - reserved
            - invalid
            - null
          description: Why the handle cannot be claimed; null when it is available.
    OrganizationHandleImpact:
      type: object
      description: "One address a handle change moves. The old address keeps working: an old web address redirects to the new one, and the old mail domain keeps receiving."
      required:
        - kind
        - from
        - to
      properties:
        kind:
          type: string
          enum:
            - auth_host
            - help_desk_host
            - help_desk_email_domain
            - notify_email_domain
          description: "auth_host: the hosted sign-in page. help_desk_host: the help desk's address, while the desk is active. help_desk_email_domain: the help desk's mail domain under the handle, while the desk is active and its email goes out or comes back under it (a custom domain that both sends and receives keeps the desk's email where it is). notify_email_domain: Notify's mail domain under the handle, while the organization's Notify email goes out under it (a custom domain Notify sends from keeps its email where it is)."
        from:
          type: string
          description: The address before the change.
        to:
          type: string
          description: The address after it.
    OrganizationHandleClaimed:
      type: object
      description: The handle the organization holds after the request, and what the request moved.
      required:
        - organization_handle
        - impacts
      properties:
        organization_handle:
          type: string
        impacts:
          type: array
          items:
            $ref: "#/components/schemas/OrganizationHandleImpact"
          description: Empty for a first claim.
    OrganizationUser:
      type: object
      description: A user of the organization as its user list answers them.
      required:
        - user_id
        - email
        - name
        - given_name
        - family_name
        - role
        - status
        - seat_type
        - seat_change
        - last_login_at
        - products
      properties:
        user_id:
          type: string
        email:
          type: string
          description: Their sign-in email.
        name:
          type:
            - string
            - "null"
          description: Their display name; null when they have none.
        given_name:
          type:
            - string
            - "null"
          description: The given name their name was composed from; null when it was given as one line.
        family_name:
          type:
            - string
            - "null"
          description: The family name their name was composed from; null when it was given as one line.
        role:
          type: string
          enum:
            - owner
            - admin
            - user
        status:
          type: string
          enum:
            - active
            - invited
          description: Invited until they accept the invitation.
        seat_type:
          type: string
          enum:
            - full
            - unlicensed
          description: The license they hold now.
        seat_change:
          type:
            - object
            - "null"
          description: A license change scheduled for the end of the paid period; null when none is ahead.
          required:
            - seat_type
            - effective_at
          properties:
            seat_type:
              type: string
              enum:
                - full
                - unlicensed
            effective_at:
              type: integer
              description: "Unix seconds: when it takes effect."
        created_at:
          type: integer
          description: "Unix seconds: when they were invited or joined."
        last_login_at:
          type:
            - integer
            - "null"
          description: "Unix seconds: their last sign-in; null before the first."
        products:
          type: array
          items:
            type: string
            enum:
              - vaults
              - sparks
              - identity
              - structured_ingots
              - help_desk
              - notify
          description: "The products they may use, in a fixed order: every product for an org admin, otherwise those an org admin granted them (PUT /users/products/{product}). Access only: a product grant is not a license, and the license they hold is `seat_type`."
    OrganizationUserPage:
      type: object
      required:
        - users
        - count
        - has_more
        - next_cursor
        - total_count
      properties:
        users:
          type: array
          items:
            $ref: "#/components/schemas/OrganizationUser"
        count:
          type: integer
          description: How many users this page holds.
        has_more:
          type: boolean
        next_cursor:
          type:
            - string
            - "null"
          description: The next page's cursor; null on the last page.
        total_count:
          type:
            - integer
            - "null"
          description: "How many users the listing holds, on its first page (no `cursor`): the organization's users, of `status` when one is sent. Null on every later page, for a search, and for a `product` listing."
    ProductAccessFailure:
      type: object
      description: A user whose change could not be made. The change for every other user named stands.
      required:
        - user_id
        - code
      properties:
        user_id:
          type: string
        code:
          type: string
          description: "Why, as the change for this user alone would have been refused: ADMIN_HOLDS_EVERY_PRODUCT, the user is an org admin, who holds every product and whose access cannot be revoked; CONFLICT, other changes to the same access kept landing first; INTERNAL_ERROR, the change could not be stored, or whether it was cannot be told. Repeating the request is safe: a user it already changed is answered unchanged."
    ProductAccessGranted:
      type: object
      description: "What granting a product did, user by user: each user the request named is in exactly one list."
      required:
        - product
        - granted
        - unchanged
        - not_found
        - failed
      properties:
        product:
          type: string
          enum:
            - vaults
            - sparks
            - identity
            - structured_ingots
            - help_desk
            - notify
        granted:
          type: array
          items:
            type: string
          description: The users this request granted the product.
        unchanged:
          type: array
          items:
            type: string
          description: The users who held it already.
        not_found:
          type: array
          items:
            type: string
          description: Ids that name no user of the organization, active or invited.
        failed:
          type: array
          items:
            $ref: "#/components/schemas/ProductAccessFailure"
    ProductAccessRevoked:
      type: object
      description: "What revoking a product did, user by user: each user the request named is in exactly one list."
      required:
        - product
        - revoked
        - unchanged
        - failed
        - removed_roles
      properties:
        product:
          type: string
          enum:
            - vaults
            - sparks
            - identity
            - structured_ingots
            - help_desk
            - notify
        revoked:
          type: array
          items:
            type: string
          description: "The users whose access, as this request read it, is gone: taken away by this request or, when it raced another revocation, possibly by that one."
        unchanged:
          type: array
          items:
            type: string
          description: The users who did not hold it, or whose access another revocation took away first. An id that names no user of the organization holds nothing, and is here.
        failed:
          type: array
          items:
            $ref: "#/components/schemas/ProductAccessFailure"
        removed_roles:
          type: array
          description: The roles in the product the revocation took away with the access.
          items:
            type: object
            required:
              - desk_id
              - role
            properties:
              desk_id:
                type: string
              role:
                type: string
    VaultsLeftWithoutKey:
      type: object
      required:
        - vaults_left_without_key
      properties:
        vaults_left_without_key:
          type: array
          description: "The vaults that would hold no live Delegated Vault Access Key once every key of the named members is revoked: no other member, integration or platform feature would hold one. Unless someone kept a vault's master key, nobody could open it again. In name order."
          items:
            type: object
            required:
              - vault_id
              - name
            properties:
              vault_id:
                type: string
                description: The vault's id (`vlt_…`).
              name:
                type: string
                description: The vault's name.
    DomainStatus:
      type: object
      description: "One of the organization's Company Domains: the entry it added, whether it still holds the domain's claim, what the domain can do, the records it publishes, each with what the last DNS check found, and that check. A domain whose claim is missing or another organization's answers `claimed: false` and reads as the entry's own verified state, never another organization's capabilities; nothing else in the answer tells the two apart."
      required:
        - domain
        - claimed
        - zone_apex
        - ownership
        - email
        - web
        - email_sending_ready
        - email_receiving_ready
        - web_ready
        - help_desk_selectable
        - notify_selectable
        - records
        - diagnosis
      properties:
        domain:
          type: string
          description: The domain, lowercase.
        verification_method:
          type: string
          enum:
            - dns_txt
        txt_name:
          type: string
          description: "The ownership record's name: `_sparkvault.{domain}`."
        txt_value:
          type: string
          description: The ownership record's value.
        created_at:
          type: integer
          description: Unix seconds.
        verified_at:
          type: integer
          description: "Unix seconds: when the ownership record was proven."
        claimed:
          type: boolean
          description: "Whether the organization holds the domain's claim. False: the claim that proves the organization owns the domain is missing or another organization's; remove the domain and add it again to prove ownership."
        zone_apex:
          type:
            - boolean
            - "null"
          description: Whether the domain is its own DNS zone; null until a check learns it. A zone apex cannot carry a help desk; Notify can send from one.
        ownership:
          type: object
          properties:
            status:
              type: string
              enum:
                - verified
                - lapsed
            last_checked_at:
              type:
                - integer
                - "null"
            last_ok_at:
              type:
                - integer
                - "null"
            lapse_started_at:
              type:
                - integer
                - "null"
              description: The first check that found the ownership record missing; missing for 24 hours, ownership lapses.
        email:
          type: object
          properties:
            sending:
              type: object
              properties:
                status:
                  type: string
                  enum:
                    - not_requested
                    - pending_dns
                    - ready
                    - degraded
                    - failed
                    - paused
                ready_at:
                  type:
                    - integer
                    - "null"
                last_checked_at:
                  type:
                    - integer
                    - "null"
                error:
                  type:
                    - string
                    - "null"
                  description: "Why sending is where it is: dkim_failed, identity_missing or setup_failed (failed), dkim_record_missing, verification_interrupted or verification_pending (degraded or waiting), products_lapsed (paused while the organization holds neither the Secure Help Desk nor Notify, whose capability it is; a check once it holds either resumes sending)."
            receiving:
              type: object
              properties:
                status:
                  type: string
                  enum:
                    - not_requested
                    - pending_dns
                    - probing
                    - ready
                    - degraded
                ready_at:
                  type:
                    - integer
                    - "null"
                last_checked_at:
                  type:
                    - integer
                    - "null"
                error:
                  type:
                    - string
                    - "null"
            mail_from:
              type: object
              properties:
                status:
                  type: string
                  enum:
                    - off
                    - pending
                    - ready
                    - failed
                domain:
                  type:
                    - string
                    - "null"
        web:
          type: object
          properties:
            status:
              type: string
              enum:
                - not_requested
                - pending
                - ready
                - moved
            target:
              type: string
              description: The CNAME target every help-desk domain points at.
            last_checked_at:
              type:
                - integer
                - "null"
        email_sending_ready:
          type: boolean
        email_receiving_ready:
          type: boolean
        web_ready:
          type: boolean
        help_desk_selectable:
          type: boolean
          description: "Whether the mail product `help_desk` may select the domain: its ownership verified and its web host live, on a domain that is not a zone apex."
        notify_selectable:
          type: boolean
          description: "Whether the mail product `notify` may select the domain: its ownership verified and its email sending ready, a zone apex included."
        records:
          type: array
          description: Every record the domain publishes for what it set up, in the order the console shows them.
          items:
            type: object
            required:
              - id
              - host
              - type
              - value
              - purpose
              - status
            properties:
              id:
                type: string
                description: ownership, dkim1 to dkim3, web, mail_from_mx or mail_from_spf.
              host:
                type: string
              type:
                type: string
                enum:
                  - TXT
                  - CNAME
                  - MX
              value:
                type: string
              purpose:
                type: string
              status:
                type: string
                enum:
                  - ok
                  - propagating
                  - missing
                  - wrong
                  - proxied
                  - unreachable
                  - not_checked
        diagnosis:
          type:
            - object
            - "null"
          description: "The last check: the zone it found and, per record, what each authoritative nameserver answered (`observed_by_nameserver`, with an `error` naming a nameserver that did not answer). Null before any check."
    DomainReadiness:
      type: object
      description: "A domain's readiness: each capability ready, and whether each mail product may select it."
      required:
        - email_sending_ready
        - email_receiving_ready
        - web_ready
        - help_desk_selectable
        - notify_selectable
      properties:
        email_sending_ready:
          type: boolean
        email_receiving_ready:
          type: boolean
        web_ready:
          type: boolean
        help_desk_selectable:
          type: boolean
          description: "Whether the mail product `help_desk` may select the domain: its ownership verified and its web host live, on a domain that is not a zone apex."
        notify_selectable:
          type: boolean
          description: "Whether the mail product `notify` may select the domain: its ownership verified and its email sending ready, a zone apex included."
    DomainAnswer:
      type: object
      required:
        - domain
        - email_setup_available
      properties:
        domain:
          $ref: "#/components/schemas/DomainStatus"
        email_setup_available:
          type: boolean
          description: "Whether email setup is offered: the organization holds the Secure Help Desk or Notify, and the platform can set it up."
    DomainList:
      type: object
      required:
        - domains
        - email_setup_available
      properties:
        domains:
          type: array
          items:
            $ref: "#/components/schemas/DomainStatus"
        email_setup_available:
          type: boolean
          description: "Whether email setup is offered: the organization holds the Secure Help Desk or Notify, and the platform can set it up."
    DomainRemoved:
      type: object
      required:
        - deleted
        - domain
      properties:
        deleted:
          type: boolean
          const: true
        domain:
          type: string
    ProfileSaved:
      type: object
      description: The signed-in member's profile as the save stored it.
      required:
        - user_id
        - account_id
        - email
        - updated_at
        - is_account_owner
      properties:
        user_id:
          type: string
        account_id:
          type: string
        email:
          type: string
          description: Their sign-in email.
        name:
          type:
            - string
            - "null"
          description: Their display name. Absent or null when they have none.
        given_name:
          type:
            - string
            - "null"
          description: The given name their name was composed from; null when it was given as one line.
        family_name:
          type:
            - string
            - "null"
          description: The family name their name was composed from; null when it was given as one line.
        updated_at:
          type: integer
          description: "Unix seconds: when the save landed."
        is_account_owner:
          type: boolean
          description: "Whether this member is the account owner: the member whose sign-in email is the account's email, whatever their role. Only the owner may change the account email or delete the account."
    HelpDeskOperatorDisplay:
      type: object
      description: How the desk shows its operators to customers.
      required:
        - name_format
        - avatar_mode
        - generic_label
      properties:
        name_format:
          type: string
          enum:
            - first_last_initial
            - full_name
            - generic
          description: "first_last_initial: the first name and last initial each operator sets (prefilled from their name); full_name: the member's name; generic: `generic_label` for everyone. An operator with no name to show shows `generic_label`."
        avatar_mode:
          type: string
          enum:
            - authsv
            - generic
          description: "authsv: each operator's Secure Identity avatar; generic: one silhouette for everyone."
        generic_label:
          type: string
          maxLength: 40
          description: The name shown where no operator's name is.
    HelpDeskVisitorIdentifier:
      type: object
      additionalProperties: false
      description: First-party anonymous opaque visitor ID. Existing cookie formats are preserved. Cookie-only storage; never an authentication credential. Parent scope requires a custom domain.
      properties:
        enabled:
          type: boolean
          default: true
        domain_scope:
          type: string
          enum:
            - host
            - parent
          default: host
        cookie_name:
          type: string
          maxLength: 64
          default: hdid
          pattern: ^[a-zA-Z_][a-zA-Z0-9_.-]{0,63}$
    HelpDeskPageAnalytics:
      type: object
      additionalProperties: false
      properties:
        webhook_url:
          type:
            - string
            - "null"
          format: uri
          maxLength: 2048
          description: Public HTTPS destination for server-side page-request JSON containing url and persistent_id. Null disables forwarding. Best-effort delivery with one transient retry.
        path_prefixes:
          type: array
          maxItems: 50
          items:
            type: string
            maxLength: 512
          description: Optional paths including descendants at segment boundaries. Empty includes every successful HTML page.
    HelpDeskSettings:
      type: object
      description: A help desk's settings, as its settings page reads them.
      required:
        - vault_id
        - activated_at
        - deactivated_at
        - customer_auth_preference
        - operator_display
        - status_after_reply
        - auto_assign_on_first_reply
        - customer_can_mark_resolved
        - email_content_mode
        - accept_email_replies
        - custom_domain
        - customer_upload_limit_bytes
        - feedback_positive_url
        - feedback_negative_url
        - branding
        - version
        - external_identity
        - external_guest_email
        - ticket_access_control
      properties:
        vault_id:
          type:
            - string
            - "null"
          description: The vault the desk's requests are sealed in.
        activated_at:
          type:
            - integer
            - "null"
          description: "Unix seconds: the last activation. Null while the first one has not finished."
        deactivated_at:
          type:
            - integer
            - "null"
          description: "Unix seconds: the deactivation since the last activation. Null while the desk is active."
        customer_auth_preference:
          type: string
          enum:
            - email_pin
            - external_sso
          description: "How customers sign in: email_pin (the help desk's email sign-in) or external_sso (a trusted company session). A new desk starts with email_pin. GET /products/help-desk/settings/status says how they sign in now."
        external_identity:
          oneOf:
            - $ref: "#/components/schemas/HelpDeskExternalIdentityConfig"
            - type: "null"
        ticket_access_control:
          $ref: "#/components/schemas/KnowledgeBaseAccessControl"
          description: Additional ticket-portal policy. Saves apply immediately to all customer API access, including existing customer sessions. Independent of knowledge-base publication and email intake.
        external_guest_email:
          type: boolean
          description: Explicitly permit guests to verify an email address in company-session mode. Never a fallback for an unavailable verifier.
        operator_display:
          $ref: "#/components/schemas/HelpDeskOperatorDisplay"
        status_after_reply:
          type: string
          enum:
            - waiting_on_customer
            - open
          description: The status an operator's public reply moves a request to.
        auto_assign_on_first_reply:
          type: boolean
          description: Whether the first operator to reply on an unassigned request is assigned it.
        customer_can_mark_resolved:
          type: boolean
          description: Whether customers may close their own requests as resolved.
        visitor_identifier:
          $ref: "#/components/schemas/HelpDeskVisitorIdentifier"
        analytics:
          $ref: "#/components/schemas/HelpDeskPageAnalytics"
        ticket_confirmation_message:
          type:
            - string
            - "null"
          maxLength: 1000
          description: Optional plain-text message shown after a request is confirmed as submitted, in the SDK form and customer portal. Null uses the default confirmation. This public desk configuration is rendered as text, without HTML or template interpolation; the ticket number and actual delivery instructions remain separate.
        ticket_contact_note:
          type:
            - string
            - "null"
          maxLength: 160
          description: Optional one-line plain-text note shown beside the support view's ticket button, under suggested articles, in the SDK support widget and customer portal. Null shows no note. Held in single-line form (no control characters, whitespace collapsed) and without text-direction control characters. This public desk configuration is rendered as text, without HTML or template interpolation.
        feedback_positive_url:
          type:
            - string
            - "null"
          format: uri
          maxLength: 2048
          description: Optional HTTPS follow-up link shown after a customer saves positive feedback. Null keeps the customer in the help desk.
        feedback_negative_url:
          type:
            - string
            - "null"
          format: uri
          maxLength: 2048
          description: Optional HTTPS follow-up link shown after a customer saves negative feedback. No ticket or customer data is appended.
        email_content_mode:
          type: string
          enum:
            - full
            - notify_only
          description: "full: update emails carry the message; notify_only: they say only that the request changed, and link to it."
        accept_email_replies:
          type: boolean
          description: Whether customers may answer by replying to an update email.
        accept_email_tickets:
          type: boolean
          description: Whether authenticated new mail to a queue address may open a ticket. Password and network policies still require the portal; employee-only intake requires current company membership.
        custom_domain:
          type:
            - string
            - "null"
          description: The organization's own domain the desk answers at, beside its help.sv address; null for none.
        customer_upload_limit_bytes:
          type:
            - integer
            - "null"
          minimum: 0
          description: Maximum total pending and attached upload bytes per customer across all requests. Null (the default) leaves customer usage unlimited within the account storage plan.
        branding:
          type: object
          required:
            - color
          properties:
            color:
              type:
                - string
                - "null"
              description: "The portal's accent color, as #rrggbb; null for the default."
            icon_url:
              type:
                - string
                - "null"
              readOnly: true
              description: The desk's browser icon (POST /products/help-desk/settings/icon); null for none. Read-only here.
        version:
          type: integer
          description: The version a change is made against (PUT /products/help-desk/settings).
    HelpDeskSettingsChange:
      type: object
      required:
        - patch
        - version
      properties:
        patch:
          type: object
          additionalProperties: false
          description: The settings to change, any of them. `operator_display` and `branding` merge into what they hold. A field sent with the value it holds changes nothing.
          properties:
            customer_auth_preference:
              type: string
              enum:
                - email_pin
                - external_sso
            external_identity:
              oneOf:
                - $ref: "#/components/schemas/HelpDeskExternalIdentityConfig"
                - type: "null"
              description: Complete public verifier configuration; null revokes it. Changes invalidate existing customer sessions.
            external_guest_email:
              type: boolean
            ticket_access_control:
              $ref: "#/components/schemas/KnowledgeBaseAccessControlInput"
            operator_display:
              type: object
              additionalProperties: false
              properties:
                name_format:
                  type: string
                  enum:
                    - first_last_initial
                    - full_name
                    - generic
                avatar_mode:
                  type: string
                  enum:
                    - authsv
                    - generic
                generic_label:
                  type: string
                  maxLength: 40
            status_after_reply:
              type: string
              enum:
                - waiting_on_customer
                - open
            auto_assign_on_first_reply:
              type: boolean
            customer_can_mark_resolved:
              type: boolean
            visitor_identifier:
              $ref: "#/components/schemas/HelpDeskVisitorIdentifier"
            analytics:
              $ref: "#/components/schemas/HelpDeskPageAnalytics"
            ticket_confirmation_message:
              type:
                - string
                - "null"
              maxLength: 1000
              description: Optional plain-text submission confirmation, up to 1000 characters. Null, an empty string or whitespace restores the default. No HTML or template interpolation is applied. Shown only after confirmed submission, beside factual ticket and delivery details.
            ticket_contact_note:
              type:
                - string
                - "null"
              maxLength: 160
              description: "Optional plain-text note beside the support view's ticket button. Saved in single-line form: every control character, tabs and line breaks included, becomes a space, runs of whitespace collapse to one space, and the ends are trimmed. The 160-character limit applies to that form. Text-direction control characters (U+202A to U+202E, U+2066 to U+2069) are refused. Null, an empty string or whitespace removes the note. No HTML or template interpolation is applied."
            feedback_positive_url:
              type:
                - string
                - "null"
              format: uri
              maxLength: 2048
              description: An absolute HTTPS URL without credentials, or null to remove the follow-up link.
            feedback_negative_url:
              type:
                - string
                - "null"
              format: uri
              maxLength: 2048
              description: An absolute HTTPS URL without credentials, or null to remove the follow-up link.
            email_content_mode:
              type: string
              enum:
                - full
                - notify_only
            accept_email_replies:
              type: boolean
            accept_email_tickets:
              type: boolean
            custom_domain:
              type:
                - string
                - "null"
              description: One of the organization's domains prepared for the help desk (POST /domains/{domain}/help-desk), or null for none.
            customer_upload_limit_bytes:
              type:
                - integer
                - "null"
              minimum: 0
              maximum: 1125899906842624
            branding:
              type: object
              additionalProperties: false
              properties:
                color:
                  type:
                    - string
                    - "null"
                  description: "A color as #rrggbb, or null for the default."
        version:
          type: integer
          minimum: 1
          description: The `version` of the settings the change was made against.
    HelpDeskActivationState:
      type: string
      enum:
        - active
        - deactivated
        - never_activated
      description: "Where the desk stands in its activation. active: activated with its vault's key, and neither deactivated nor archived since. deactivated: activated before and off now (deactivated, or archived); it activates again with the vault its requests are in. never_activated: no activation has completed yet (none made, or one cut short)."
    HelpDeskStatus:
      type: object
      description: "Where the desk stands: its activation, whether it takes customers now, and the addresses it uses."
      required:
        - activation
        - serving
        - effective_auth_mode
        - hosts
        - domain_readiness
        - external_identity_ready
        - alerts_delivery
      properties:
        activation:
          $ref: "#/components/schemas/HelpDeskActivationState"
        serving:
          type: boolean
          description: "Whether the desk takes customers now: active, its organization in good standing, and the help desk held."
        effective_auth_mode:
          type:
            - string
            - "null"
          enum:
            - email_pin
            - external_sso
            - external_unavailable
            - null
          description: "How customers sign in now. external_unavailable: the desk asks for the company session and its configuration is incomplete, so customers cannot sign in until it is complete or the desk changes to the email sign-in. Null until the desk's first activation completes, so customers sign in no way at all yet."
        hosts:
          oneOf:
            - type: object
              required:
                - canonicalHost
                - sendingHost
                - receivingHost
              properties:
                canonicalHost:
                  type: string
                  description: The portal's address in links and email.
                sendingHost:
                  type: string
                  description: The domain the desk's email is sent from.
                receivingHost:
                  type: string
                  description: The domain mail to the desk, replies included, goes to.
            - type: "null"
          description: canonicalHost is the selected custom domain while it serves the web (its ownership verified and its web ready), otherwise the desk's hosted address; sendingHost and receivingHost are one host, the selected domain while it both sends and receives, otherwise {handle}.help.sv, where the desk's mailbox keeps receiving either way. Null until the organization holds a handle.
        mailbox:
          type: string
          description: The desk's own mailbox, the local part its email uses. Present for a desk with one.
        contact_email:
          type:
            - string
            - "null"
          format: email
          description: "The desk's address as its email uses it now: its mailbox at receivingHost. Present with `mailbox`; null until the organization holds a handle."
        domain_readiness:
          oneOf:
            - $ref: "#/components/schemas/DomainReadiness"
            - type: "null"
          description: The readiness of the selected custom domain (`custom_domain` in the settings); null when the desk selects none, and while the organization does not hold its claim.
        external_identity_ready:
          type: boolean
          description: Whether a valid public company-session verifier is configured. An unavailable verifier never changes to guest email automatically.
        alerts_delivery:
          type: string
          enum:
            - notify
            - email
          description: "How the desk's alerts to the people who work it go out. `notify`: the organization holds Notify, so each alert is a send from its own Notify in the `help_desk_alert` category, delivered on its ladder for that category and under each person's choices for the organization as any send in the category is, and metered as its other Notify sends are. `email`: one plain email to each person from SparkVault, withheld from a person who turned the organization's notifications off, muted help desk alerts or turned email off, and nothing in the console's notifications or on a device."
    HelpDeskActivation:
      type: object
      required:
        - vault_id
        - vmk
      properties:
        vault_id:
          type: string
          description: "The vault the desk's requests are sealed in: one of the organization's own."
        vmk:
          type: string
          description: That vault's key. Presenting it is the consent; it is verified, never stored.
    HelpDeskQueue:
      type: object
      description: One of the desk's queues. Queues route requests; every role holder of the desk works every queue.
      required:
        - queue_id
        - name
        - alias
        - assignment_mode
        - version
        - created_at
        - updated_at
      properties:
        queue_id:
          type: string
        name:
          type: string
          maxLength: 60
          description: Unique on the desk whatever its case.
        alias:
          type:
            - string
            - "null"
          description: The mail alias the queue claimed, its requests' mail going out from it; null for the desk's own address.
        assignment_mode:
          type: string
          enum:
            - claim
            - balanced
          description: "claim: operators take new requests themselves; balanced: each goes to an available operator."
        version:
          type: integer
          description: What a change is made against.
        created_at:
          type: integer
        updated_at:
          type: integer
    HelpDeskQueueChange:
      type: object
      additionalProperties: false
      required:
        - version
      description: At least one of `name`, `alias` and `assignment_mode`, against the `version` loaded.
      properties:
        version:
          type: integer
          minimum: 1
        name:
          type: string
          minLength: 1
          maxLength: 60
        alias:
          type:
            - string
            - "null"
          description: "Only on a desk whose queues may claim an alias (`queue_aliases`: a desk with no mailbox of its own): 1 to 31 lowercase letters, digits and single hyphens, starting with a letter, and neither a reserved mailbox name nor one that reads as SparkVault; unique on the company mail host. Null, or the default alias `support`, returns the queue to the desk's address, which no queue claims. A desk written to at its own mailbox refuses this field (400 VALIDATION_ERROR, field alias); change its mailbox through the desk descriptor."
        assignment_mode:
          type: string
          enum:
            - claim
            - balanced
    HelpDeskRoutingRule:
      type: object
      description: "A routing rule. Its conditions are its domain condition (the requester's address is at one of `domains`, or under one with `include_subdomains`) and each of its keywords (the word or phrase appears in the subject or the first 32 KiB of the body, whole words, letter case ignored). `match: all` needs every condition, `match: any` one."
      required:
        - rule_id
        - name
        - enabled
        - match
        - domains
        - include_subdomains
        - keywords
        - actions
      properties:
        rule_id:
          type: string
        name:
          type: string
          maxLength: 80
        enabled:
          type: boolean
        match:
          type: string
          enum:
            - all
            - any
        domains:
          type: array
          maxItems: 50
          items:
            type: string
        include_subdomains:
          type: boolean
        keywords:
          type: array
          maxItems: 50
          items:
            type: string
            maxLength: 64
        actions:
          $ref: "#/components/schemas/HelpDeskRoutingActions"
    HelpDeskRoutingActions:
      type: object
      description: "What a matching rule does to a new request: `queue_id` always named, and at least one action taken."
      required:
        - queue_id
      properties:
        queue_id:
          type:
            - string
            - "null"
          description: The desk's queue the request goes to; null leaves its queue as it is.
        set_priority:
          type: string
          enum:
            - urgent
            - high
            - normal
            - low
    HelpDeskRoutingRuleInput:
      type: object
      additionalProperties: false
      description: "A rule as an admin sends it: one without `rule_id` is new. A rule with no domain and no keyword matches every request; placed last, it is the desk's catch-all."
      required:
        - name
        - match
        - actions
      properties:
        rule_id:
          type:
            - string
            - "null"
          description: The rule this is; absent or null for a new rule.
        name:
          type: string
          maxLength: 80
        enabled:
          type: boolean
          default: true
        match:
          type: string
          enum:
            - all
            - any
        domains:
          type: array
          maxItems: 50
          items:
            type: string
        include_subdomains:
          type: boolean
          default: false
        keywords:
          type: array
          maxItems: 50
          items:
            type: string
            maxLength: 64
        actions:
          $ref: "#/components/schemas/HelpDeskRoutingActions"
    HelpDeskRoutingRules:
      type: object
      required:
        - version
        - rules
        - shadowed_rule_ids
      properties:
        version:
          type: integer
          description: The version a save is made against; 0 before the first save.
        rules:
          type: array
          items:
            $ref: "#/components/schemas/HelpDeskRoutingRule"
          description: "In order: the first enabled rule that matches wins."
        shadowed_rule_ids:
          type: array
          items:
            type: string
          description: Enabled rules an earlier enabled rule always wins over, so they never match.
    HelpDeskRoutingTestResult:
      type: object
      required:
        - matched_index
      properties:
        matched_index:
          type:
            - integer
            - "null"
          description: The position, in the list sent, of the first enabled rule the sample matches; null when none does.
    HelpDeskOperatorListed:
      type: object
      description: "A member as the desk's operators list shows them: a role holder of the desk (scope desk), or a member with Help Desk access (scope product)."
      required:
        - user_id
        - name
        - email
        - avatar_handle
        - role
        - role_version
        - full_license
        - available
        - display_first
        - display_last_initial
        - open_assigned_count
        - version
      properties:
        user_id:
          type: string
        name:
          type:
            - string
            - "null"
        email:
          type: string
        role:
          type:
            - string
            - "null"
          enum:
            - manager
            - agent
            - trainee
            - null
          description: Their role on the desk; null for none. A role counts only for an active member who holds Help Desk access.
        role_version:
          type:
            - integer
            - "null"
          minimum: 1
          description: "Their role's version: what PUT /products/help-desk/operators/{user_id}/role takes as `version`; null when they hold none."
        member_status:
          type: string
          enum:
            - active
            - invited
          description: "scope product only: whether they are an active member or invited and not joined yet (an invited member holds no role)."
        available:
          type: boolean
          description: "Whether they take new requests: new requests on the desk, and customers' messages on its unassigned requests, alert them, and balanced assignment gives them new requests. Both also need a Full License (full_license)."
        display_first:
          type:
            - string
            - "null"
          description: The first name derived from the operator's name (their auth.sv name, else their member name); null when they have no name, so customers see the generic label.
        display_last_initial:
          type:
            - string
            - "null"
        avatar_handle:
          type:
            - string
            - "null"
          description: The opaque address of their avatar on the desk's portal; null before the desk first needed one.
        open_assigned_count:
          type:
            - integer
            - "null"
          description: Their open assigned requests, to the desk's configurer (a company administrator or its Manager); null to anyone else.
        full_license:
          type: boolean
          description: "Whether they hold a Full License, which content writes take: new-request alerts reach, and balanced assignment picks, only members who do."
        version:
          type: integer
          minimum: 0
          description: Their desk preferences' version; 0 before the desk first needed them.
    HelpDeskOperatorsPage:
      type: object
      required:
        - operators
        - count
        - has_more
        - next_cursor
      properties:
        operators:
          type: array
          items:
            $ref: "#/components/schemas/HelpDeskOperatorListed"
        count:
          type: integer
        has_more:
          type: boolean
        next_cursor:
          type:
            - string
            - "null"
          description: Opaque continuation token. Null when the listing is exhausted.
    HelpDeskOperatorSelf:
      type: object
      description: The signed-in operator's own desk preferences and role on the desk.
      required:
        - user_id
        - name
        - available
        - single_key_shortcuts
        - display_first
        - display_last_initial
        - avatar_handle
        - role
        - version
      properties:
        user_id:
          type: string
        name:
          type:
            - string
            - "null"
          readOnly: true
          description: "The operator's name: their auth.sv name, else their member name; null when they have neither."
        available:
          type: boolean
        single_key_shortcuts:
          type: boolean
        role:
          type: string
          enum:
            - manager
            - agent
            - trainee
          readOnly: true
          description: Their role on the desk, which its configurer sets (PUT /products/help-desk/operators/{user_id}/role).
        version:
          type: integer
          minimum: 0
        display_first:
          type:
            - string
            - "null"
          readOnly: true
        display_last_initial:
          type:
            - string
            - "null"
          readOnly: true
        avatar_handle:
          type:
            - string
            - "null"
          description: The opaque address of their avatar on the desk's portal; null before the desk first needed one.
    HelpDeskOperatorSelfChange:
      type: object
      additionalProperties: false
      properties:
        available:
          type: boolean
        single_key_shortcuts:
          type: boolean
    HelpDeskDesk:
      description: The desk a portal host is, or where a changed address moved to.
      oneOf:
        - type: object
          required:
            - kind
            - desk_id
            - handle
            - canonical_host
            - sending_host
            - organization_name
            - branding
            - auth_mode
            - external_identity
            - ticket_access_control
            - customer_can_mark_resolved
            - customer_can_attach_files
            - knowledge_base_enabled
            - portal_client
          properties:
            kind:
              type: string
              const: desk
            desk_id:
              type: string
              description: "The desk: every customer route names it in its path."
            handle:
              type: string
            visitor_identifier:
              $ref: "#/components/schemas/HelpDeskVisitorIdentifier"
            analytics:
              type: object
              properties:
                enabled:
                  type: boolean
            canonical_host:
              type: string
              description: The desk's address in links and email.
            sending_host:
              type: string
              description: The host the desk's email comes from, its sign-in codes included.
            organization_name:
              type:
                - string
                - "null"
            branding:
              type: object
              required:
                - color
                - logo_url
                - logo_dark_url
              properties:
                color:
                  type:
                    - string
                    - "null"
                logo_url:
                  type:
                    - string
                    - "null"
                  description: The organization's logo for light backgrounds, on the host the lookup named (`https://{host}/_hd/logo/{image id}`); null when it uploaded none.
                logo_dark_url:
                  type:
                    - string
                    - "null"
                  description: The organization's logo for dark backgrounds, on the host the lookup named (`https://{host}/_hd/logo/{image id}`); null when it uploaded none.
                icon_url:
                  type:
                    - string
                    - "null"
                  description: The desk's browser icon, a square PNG on the image host; null when it uploaded none.
            auth_mode:
              type: string
              enum:
                - email_pin
                - external_sso
                - external_unavailable
              description: "How customers sign in now: email_pin, the help desk's email sign-in; external_sso, the company session; external_unavailable, a company session whose configuration is incomplete, which pauses the portal's sign-in and never offers the email sign-in in its place. A Help Desk sign-in's session stands in every mode."
            external_identity:
              oneOf:
                - $ref: "#/components/schemas/HelpDeskExternalIdentityPublic"
                - type: "null"
              description: Public company sign-in handoff information; null unless auth_mode is external_sso. Includes no verification key or credential.
            customer_can_mark_resolved:
              type: boolean
            ticket_confirmation_message:
              type:
                - string
                - "null"
              maxLength: 1000
              description: Optional public plain-text message for confirmed request submission, shared by the SDK form and customer portal. Null or omission uses the default. Render as text without HTML or template interpolation; keep factual ticket and delivery details separate.
            ticket_contact_note:
              type:
                - string
                - "null"
              maxLength: 160
              description: Optional public one-line plain-text note shown beside the support view's ticket button, under suggested articles. Null or omission shows no note. Held in single-line form (no control characters, whitespace collapsed) and without text-direction control characters. Render as text without HTML or template interpolation.
            customer_can_attach_files:
              type: boolean
              description: "Whether the desk takes files from its customers, uploaded or emailed: false while its upload allowance per customer is 0, which turns customer uploads off (an upload is refused with `details.reason` `customer_uploads_off`). No figure is given."
            knowledge_base_enabled:
              type: boolean
              description: Whether the published knowledge base is enabled and not paused by a lifecycle change. False by default; the portal can link to the static root when true.
            ticket_access_control:
              type: object
              required:
                - mode
              properties:
                mode:
                  type: string
                  enum:
                    - public
                    - password
                    - ip_allowlist
                    - identity
                company_id:
                  type: string
                ip_allowed:
                  type: boolean
                  description: Whether the current visitor IP passes the policy. The configured IP list is never disclosed.
              description: The portal access layer. Public means no additional restriction; customers still authenticate to read their own requests.
            portal_client:
              type: string
              const: help-desk-portal
              description: The X-SV-Client value the portal sends.
        - type: object
          required:
            - kind
            - moved_to
          properties:
            kind:
              type: string
              const: moved
            moved_to:
              type: string
              description: "The desk's address now: the organization changed its handle."
    HelpDeskCustomer:
      type: object
      description: The signed-in customer, as the portal shows them.
      required:
        - requester_id
        - email
        - display_name
        - assurance
        - needs_display_name
      properties:
        requester_id:
          type: string
        email:
          type: string
          description: The customer contact address; empty when their sign-in asserted none. Company-session contacts, and people the organization's own identity provider signed in without confirming their address, may be unproved; check email_verified before representing them as verified.
        display_name:
          type:
            - string
            - "null"
          description: The name the desk shows the customer by; null until they give one.
        assurance:
          type: string
          enum:
            - identity
            - email_pin
            - external_sso
            - federated
          description: "How the customer authenticated: Secure Identity, an emailed code, a trusted company session, or the organization's own identity provider through its Secure Identity (`federated`, for every session it signed in, whatever requester the session acts as, together with `federated: true`). Company-session assurance alone does not prove mailbox ownership."
        email_verified:
          type: boolean
          description: "Present for company-session customers, as the trusted company server asserted mailbox ownership, and false for any customer whose address nobody verified: a company-session contact the company did not verify, or a person the organization's own identity provider signed in without confirming their address, who sees only the requests they open that way. False means the address is shown for display alone and request update emails cannot be enabled."
        email_updates:
          type: boolean
          description: "Whether the desk emails the customer updates on their requests. Present only where that choice is the desk's own switch: emailed-code and company-session customers, and any address no Secure Identity sign-in of its own has linked. Unproved company contacts remain disabled until mailbox proof is present; a Secure Identity customer sets preferences on auth.sv instead."
        federated:
          type: boolean
          description: "Present and true for a session the organization's own identity provider signed in, whose `assurance` is `federated`. Such a session changes none of the address's update email choices: they follow signing in with the address itself and the links in its emails."
        needs_display_name:
          type: boolean
          description: "True until the customer gives a name: the portal asks for one first."
    HelpDeskPinChallenge:
      type: object
      description: "A started emailed-code sign-in: the same shape whatever the address and the desk's sign-in mode."
      required:
        - challenge_id
        - expires_at
        - binding_secret
      properties:
        challenge_id:
          type: string
          description: Names the challenge at verify.
        expires_at:
          type: integer
          description: Epoch seconds the code expires at.
        binding_secret:
          type: string
          description: "Held in memory by the page that started the sign-in and sent back with the code: a verify from a page that does not hold it is refused. Answered once, never stored as given."
    HelpDeskSession:
      type: object
      description: A customer's session at the desk, however they signed in.
      required:
        - token
        - expires_at
        - ttl_seconds
        - customer
      properties:
        token:
          type: string
          description: The help desk session token (`hdt_…`), the bearer of every signed-in request.
        expires_at:
          type: integer
          description: Epoch seconds the session ends at the latest. Company sessions have a 15-minute absolute maximum; other customer sessions end earlier once unused for 30 days.
        ttl_seconds:
          type: integer
          minimum: 1
          description: "The session's lifetime from this answer, in seconds: the time `expires_at` names. A client times the session on its own clock from when this answer lands, since a device clock off from the server's would misread `expires_at`."
        customer:
          $ref: "#/components/schemas/HelpDeskCustomer"
    HelpDeskRequester:
      type:
        - object
        - "null"
      description: The ticket's requester, their address and name opened for the desk; null once the desk holds no row for them.
      required:
        - requester_id
        - display_name
        - email
        - assurance
      properties:
        requester_id:
          type: string
        display_name:
          type:
            - string
            - "null"
        email:
          type: string
        assurance:
          type: string
          enum:
            - identity
            - email_pin
            - email
            - external_sso
            - federated
            - chat
          description: "The identity source: native sign-in, desk email code, authenticated incoming mail, company session, the organization's own identity provider (`federated`), or the profile an employee's company chat request came with (`chat`, until a Secure Identity or emailed-code sign-in records its own). Incoming mail and chat requests create no browser session; company-session assurance alone does not establish mailbox proof."
        email_verified:
          type: boolean
          const: false
          description: "Present, false, for a requester whose address nobody verified: a company-session contact the company did not verify, or a person the organization's own identity provider signed in without confirming their address. The address is shown for display alone: no routing rule matches its domain, and the desk emails it nothing."
    HelpDeskQueueRow:
      type: object
      description: A ticket as the queue lists it.
      required:
        - ticket_id
        - number
        - status
        - close_reason
        - hold_until
        - priority
        - queue_id
        - assignee_id
        - requester_id
        - subject
        - preview
        - created_at
        - last_activity_at
        - last_customer_message_at
        - first_operator_reply_at
        - last_operator_reply_at
        - merged_into
        - merged_into_number
        - muted
        - awaiting_first_response
        - version
        - requester
      properties:
        ticket_id:
          type: string
        number:
          type: integer
          description: The ticket's number at the desk (#1042).
        status:
          type: string
          enum:
            - open
            - waiting_on_customer
            - on_hold
            - closed
        close_reason:
          type:
            - string
            - "null"
          enum:
            - resolved
            - duplicate
            - spam
            - null
        hold_until:
          type:
            - integer
            - "null"
          description: When a hold ends (epoch seconds).
        priority:
          type: string
          enum:
            - urgent
            - high
            - normal
            - low
        queue_id:
          type:
            - string
            - "null"
          description: The desk's queue it is in; null for none.
        assignee_id:
          type:
            - string
            - "null"
        requester_id:
          type: string
        subject:
          type: string
        preview:
          type: string
          description: The start of the ticket's first message, as plain text.
        created_at:
          type: integer
        last_activity_at:
          type:
            - integer
            - "null"
        last_customer_message_at:
          type:
            - integer
            - "null"
        first_operator_reply_at:
          type:
            - integer
            - "null"
        last_operator_reply_at:
          type:
            - integer
            - "null"
        merged_into:
          type:
            - string
            - "null"
        merged_into_number:
          type:
            - integer
            - "null"
        muted:
          type: boolean
          description: Whether its requester turned its update emails off.
        awaiting_first_response:
          type: boolean
        version:
          type: integer
          description: The version a change is made against.
        requester:
          $ref: "#/components/schemas/HelpDeskRequester"
        presence:
          type: array
          items:
            $ref: "#/components/schemas/HelpDeskPresenceEntry"
          description: Who is on the ticket now (the queue only).
    HelpDeskTicket:
      description: A ticket as an operator reads it.
      allOf:
        - $ref: "#/components/schemas/HelpDeskQueueRow"
        - type: object
          required:
            - source
            - routing_rule_id
            - last_public_activity_at
            - first_closed_at
            - closed_at
            - reopen_count
            - merged_at
            - legal_hold
            - email_undeliverable
            - held_count
            - feedback
          properties:
            source:
              type: string
              enum:
                - portal
                - chat
                - email
                - operator
              description: "Where the request was opened: by its customer in the portal, a chat or an email, or by an operator for the customer."
            routing_rule_id:
              type:
                - string
                - "null"
            source_article:
              type: object
              additionalProperties: false
              description: Optional published article the requester had already read. Resolved by the server and visible only to operators; it is separate from the customer message.
              required:
                - id
                - kind
                - release_id
                - title
                - url
              properties:
                id:
                  type: string
                kind:
                  type: string
                  enum:
                    - article
                    - faq
                release_id:
                  type: string
                title:
                  type: string
                url:
                  type: string
                  format: uri
                  description: Canonical help-center URL from the published index.
            last_public_activity_at:
              type:
                - integer
                - "null"
            first_closed_at:
              type:
                - integer
                - "null"
            closed_at:
              type:
                - integer
                - "null"
            reopen_count:
              type: integer
            merged_at:
              type:
                - integer
                - "null"
              description: "When it was merged: the merge can be undone for 86400 seconds after."
            legal_hold:
              type:
                - object
                - "null"
              description: The legal hold on it, while held.
            email_undeliverable:
              type:
                - object
                - "null"
              description: The bounce that marked its requester's address undeliverable.
            held_count:
              type: integer
              description: Emails held for an operator on it.
            feedback:
              $ref: "#/components/schemas/HelpDeskOperatorFeedback"
    HelpDeskQueuePage:
      type: object
      required:
        - items
        - next_cursor
      properties:
        items:
          type: array
          items:
            $ref: "#/components/schemas/HelpDeskQueueRow"
        next_cursor:
          type:
            - string
            - "null"
          description: Opaque continuation token. Null when the listing is exhausted.
        partial:
          type: boolean
          description: "Present when the page was cut short by the read budget: follow next_cursor for the rest."
    HelpDeskQueueCounts:
      type: object
      required:
        - open
        - waiting_on_customer
        - on_hold
        - unassigned
        - mine
      properties:
        open:
          type: integer
        waiting_on_customer:
          type: integer
        on_hold:
          type: integer
        unassigned:
          type: integer
          description: Live tickets nobody holds.
        mine:
          type: integer
          description: The signed-in operator's live tickets.
    HelpDeskEvent:
      type: object
      description: One event of a ticket's timeline, as an operator reads it.
      required:
        - event_id
        - seq
        - type
        - visibility
        - created_at
        - actor
        - body
        - attachments
        - data
      properties:
        event_id:
          type: string
        seq:
          type: integer
          description: Its place in the ticket's timeline.
        type:
          type: string
          enum:
            - ticket_created
            - customer_message
            - operator_reply
            - status_changed
            - reopened
            - resolved_by_customer
            - merged_into
            - merged_from
            - internal_note
            - reply_review_submitted
            - reply_review_rejected
            - reply_review_approved
            - reply_review_reassigned
            - reply_review_discarded
            - feedback_changed
            - assigned
            - queue_changed
            - priority_changed
            - routing_applied
            - email_held
            - email_released
            - email_discarded
            - email_rejected
            - email_replayed
            - email_undeliverable
            - email_declined
            - auto_response_sent
            - attachment_deleted
            - attachment_refused
            - requester_blocked
            - requester_unblocked
            - legal_hold_set
            - legal_hold_cleared
            - storage_full
        visibility:
          type: string
          enum:
            - public
            - internal
          description: "internal: never shown to the customer."
        created_at:
          type: integer
        actor:
          type: object
          required:
            - kind
          properties:
            kind:
              type: string
              enum:
                - customer
                - operator
                - system
                - rule
            id:
              type: string
            label:
              type:
                - string
                - "null"
            avatar_handle:
              type:
                - string
                - "null"
        body:
          type:
            - object
            - "null"
          description: A message's body as its safe-markup document tree; null for any other event, and for a message whose body cannot be read now.
        attachments:
          type: array
          items:
            type: object
            required:
              - attachment_id
              - name
              - size
              - content_type
              - disposition
              - scan
            properties:
              attachment_id:
                type: string
              name:
                type: string
              size:
                type: integer
              content_type:
                type: string
              disposition:
                type: string
                enum:
                  - inline
                  - attachment
              scan:
                type: string
                enum:
                  - pass
                  - not_scanned
                description: "`pass` when the mail scan passed the email that brought the file; `not_scanned` for an upload, for an email part the scan could not judge, and for a file read from inside an opaque-signed S/MIME body, which the mail scan is not known to open."
        data:
          type: object
          description: What the event records, by its type (docs/HELP_DESK.md → Timeline events).
    HelpDeskTimelinePage:
      type: object
      required:
        - events
        - next_cursor
      properties:
        events:
          type: array
          items:
            $ref: "#/components/schemas/HelpDeskEvent"
          description: Newest first.
        next_cursor:
          type:
            - string
            - "null"
          description: Opaque continuation token. Null when the listing is exhausted.
    HelpDeskTicketWrite:
      type: object
      description: "What a change did: the ticket as written and the events it appended."
      required:
        - ticket
        - events
      properties:
        ticket:
          $ref: "#/components/schemas/HelpDeskTicket"
        events:
          type: array
          items:
            $ref: "#/components/schemas/HelpDeskEvent"
        review:
          $ref: "#/components/schemas/HelpDeskReplyReview"
          description: Present when a reply is held for review or a review is decided. A pending review has sent no customer reply.
    HelpDeskReplyReview:
      type: object
      description: A private operator reply and its review state. Never included in customer responses or exports.
      required:
        - review_id
        - ticket_id
        - ticket_number
        - operator_id
        - status
        - created_at
        - submitted_at
        - updated_at
        - status_after
        - version
        - body
        - body_markup
        - attachments
        - feedback
        - discard
      properties:
        review_id:
          type: string
          description: The hdev_ id of the initial submission.
        ticket_id:
          type: string
        ticket_number:
          type: integer
        operator_id:
          type: string
          description: The rep whose name the approved reply is sent under.
        status:
          type: string
          enum:
            - pending
            - rejected
            - approved
            - discarded
        created_at:
          type: integer
        submitted_at:
          type: integer
        updated_at:
          type: integer
        status_after:
          type: string
          enum:
            - waiting_on_customer
            - open
        version:
          type: integer
          minimum: 1
        body:
          type:
            - object
            - "null"
          description: The safe-markup AST; null if the sealed body is unavailable.
        body_markup:
          type:
            - string
            - "null"
          description: The safe-markup source for rewriting the reply.
        attachments:
          type: array
          items:
            type: object
            properties:
              attachment_id:
                type: string
              name:
                type: string
              size:
                type: integer
              content_type:
                type: string
              disposition:
                type: string
              scan:
                type: string
        feedback:
          type:
            - object
            - "null"
          properties:
            comment:
              type: string
            reviewer_id:
              type: string
            created_at:
              type: integer
        discard:
          type:
            - object
            - "null"
          description: Why a Manager of the desk discarded this review without sending it. Kept only in private review history.
          properties:
            reason:
              type: string
            operator_id:
              type: string
            created_at:
              type: integer
    HelpDeskReplyReviewsPage:
      type: object
      required:
        - reviews
        - next_cursor
        - count
        - has_more
      properties:
        reviews:
          type: array
          items:
            $ref: "#/components/schemas/HelpDeskReplyReview"
        next_cursor:
          type:
            - string
            - "null"
          description: Opaque continuation token. Null when the listing is exhausted.
        count:
          type: integer
        has_more:
          type: boolean
    HelpDeskTicketPatch:
      type: object
      additionalProperties: false
      description: The fields to change; one that names the value already held changes nothing.
      properties:
        status:
          type: string
          enum:
            - open
            - waiting_on_customer
            - on_hold
            - closed
        close_reason:
          type: string
          enum:
            - resolved
            - spam
          description: With status closed. A duplicate closes by merging.
        hold_until:
          type: integer
          description: "With status on_hold: when the hold ends (epoch seconds), within a year."
        priority:
          type: string
          enum:
            - urgent
            - high
            - normal
            - low
        queue_id:
          type:
            - string
            - "null"
          description: One of the desk's queues; null for none.
        assignee_id:
          type:
            - string
            - "null"
          description: An active member with a Full License; null for nobody.
    HelpDeskPresenceEntry:
      type: object
      required:
        - user_id
        - state
      properties:
        user_id:
          type: string
        state:
          type: string
          enum:
            - viewing
            - replying
    HelpDeskAttachmentUpload:
      type: object
      required:
        - attachment_id
        - ingot_id
        - forge_url
        - expires_at
        - max_bytes
        - pending_until
      properties:
        attachment_id:
          type: string
          description: What the message that carries the file (an operator's reply, or a customer's reply or request as it is sent) names in `attachments` once the upload is stored.
        ingot_id:
          type: string
        forge_url:
          type: string
          description: Where the browser streams the file (the SDK's resumable upload).
        expires_at:
          type: integer
          description: When `forge_url` stops taking the upload (epoch seconds).
        max_bytes:
          type: integer
        pending_until:
          type: integer
          description: "When the upload, sent in no message by then, is deleted (epoch seconds, the server's clock): its reap timer fires. A message attaches it until thirty minutes before the upload is a day old."
        version:
          type: integer
          description: "An operator's upload only: the ticket's `version` once the upload is recorded on it, exactly one past the version it held then. An operator holding the version just before (theirs + 1 is this) carries this one on; any other value means the ticket changed meanwhile: load it again. A customer is answered none."
    HelpDeskSavedReply:
      type: object
      required:
        - saved_reply_id
        - title
        - body_markup
        - scope
        - queue_id
        - created_by
        - created_at
        - updated_at
        - version
      properties:
        saved_reply_id:
          type: string
        title:
          type: string
        body_markup:
          type: string
          description: Safe markup holding `{customer.first_name}`, `{ticket.number}` and `{operator.display_name}` placeholders.
        scope:
          type: string
          enum:
            - org
            - queue
        queue_id:
          type:
            - string
            - "null"
        created_by:
          type: string
        created_at:
          type: integer
        updated_at:
          type: integer
        version:
          type: integer
    HelpDeskSavedReplyInput:
      type: object
      required:
        - title
        - body_markup
        - scope
      properties:
        title:
          type: string
          maxLength: 80
        body_markup:
          type: string
          description: Safe markup, at most 65536 bytes.
        scope:
          type: string
          enum:
            - org
            - queue
          description: "org: shared across the desk; every role holder of the desk uses it, and its Managers keep it. queue: filed under one of the desk's queues; every role holder of the desk uses it, and its Managers and Agents keep it."
        queue_id:
          type: string
          description: "With scope queue: one of the desk's queues."
    HelpDeskFeedback:
      type: object
      description: One current rating per request. The first vote freezes its public reply, author and reporting day; later changes replace that sample.
      required:
        - eligible
        - lookup_complete
        - rating
        - submitted_at
        - updated_at
        - version
        - reply_event_id
      properties:
        eligible:
          type: boolean
          description: Whether this request has an eligible published operator reply and accepts feedback.
        lookup_complete:
          type: boolean
          description: False when the bounded legacy reply lookup could not finish. The ticket remains readable, but feedback is temporarily unavailable rather than reported as unrated.
        rating:
          type:
            - string
            - "null"
          enum:
            - positive
            - negative
            - null
        submitted_at:
          type:
            - integer
            - "null"
          description: First submission time; subsequent vote changes keep the original reporting day.
        updated_at:
          type:
            - integer
            - "null"
        version:
          type: integer
          minimum: 0
          description: Zero when unrated; increments only when the saved rating changes, including within the same second.
        reply_event_id:
          type:
            - string
            - "null"
          description: The public operator reply being rated. Existing feedback keeps its original reply.
    HelpDeskCustomerFeedback:
      allOf:
        - $ref: "#/components/schemas/HelpDeskFeedback"
        - type: object
          required:
            - destination_url
          properties:
            destination_url:
              type:
                - string
                - "null"
              format: uri
              description: The configured HTTPS follow-up link for the saved rating, or null. Never supplied by the customer or populated before a vote is saved.
    HelpDeskOperatorFeedback:
      allOf:
        - $ref: "#/components/schemas/HelpDeskFeedback"
        - type: object
          required:
            - operator_id
          properties:
            operator_id:
              type:
                - string
                - "null"
              description: The original public reply author credited at first submission; null when unrated.
    HelpDeskCustomerTicket:
      type: object
      description: "One of the customer's requests, as its customer reads it: the status in their words is read from `status`, `close_reason` and `awaiting_first_response`. Nothing the desk keeps for itself (who works the request, its queue, priority, preview or ids) is in it."
      required:
        - number
        - subject
        - status
        - close_reason
        - awaiting_first_response
        - created_at
        - last_public_activity_at
        - last_customer_message_at
        - last_operator_reply_at
        - muted
      properties:
        number:
          type: integer
          minimum: 1
          description: "The request's number at the desk: every route names the request by it."
        subject:
          type: string
        status:
          type: string
          enum:
            - open
            - waiting_on_customer
            - on_hold
            - closed
        close_reason:
          type:
            - string
            - "null"
          enum:
            - resolved
            - duplicate
            - null
          description: "Why a closed request closed: resolved, or merged into another request (duplicate); null for one that is not closed, and for one closed for a reason its customer is not shown."
        awaiting_first_response:
          type: boolean
          description: True until the desk first answers the request.
        created_at:
          type: integer
          description: Epoch seconds the request was opened.
        last_public_activity_at:
          type:
            - integer
            - "null"
          description: Epoch seconds the request last changed in a way its customer sees; null when the answer does not say.
        last_customer_message_at:
          type:
            - integer
            - "null"
          description: Epoch seconds of the newest message the customer sent on this request, the time that message shows in the request's timeline; null when the customer has sent none (a request the desk opened for them).
        last_operator_reply_at:
          type:
            - integer
            - "null"
          description: Epoch seconds of the newest reply the desk sent the customer on this request, the time that reply shows in the request's timeline; null until the desk replies. Only a reply the customer reads in that timeline sets it, never an internal note.
        muted:
          type: boolean
          description: True while the request's update emails are turned off.
        feedback:
          $ref: "#/components/schemas/HelpDeskCustomerFeedback"
          description: On the request detail only. Never includes operator member IDs.
        can_resolve:
          type: boolean
          description: "On the request's own page (GET /hd/desks/{desk_id}/tickets/{number}) alone: whether the customer may mark the request resolved now. A list of requests does not carry it."
    HelpDeskCustomerEvent:
      type: object
      description: "An update on a request its customer may see. Only public events are listed, each through one field allowlist: never an operator's member id, an email's ids or an internal note."
      required:
        - event_id
        - seq
        - type
        - created_at
        - actor
        - body
        - attachments
      properties:
        event_id:
          type: string
        seq:
          type: integer
          minimum: 1
          description: "Orders the request's events: one that came later carries a larger `seq`."
        type:
          type: string
          enum:
            - ticket_created
            - customer_message
            - operator_reply
            - status_changed
            - reopened
            - resolved_by_customer
            - merged_into
            - merged_from
        created_at:
          type: integer
          description: Epoch seconds.
        actor:
          type: object
          required:
            - kind
            - label
            - avatar_handle
          properties:
            kind:
              type: string
              enum:
                - customer
                - operator
                - system
                - rule
            label:
              type:
                - string
                - "null"
              description: The name the desk shows the actor by.
            avatar_handle:
              type:
                - string
                - "null"
              description: An operator's avatar address on the desk (GET /hd/desks/{desk_id}/avatars/{avatar_handle}); null for none.
        body:
          type:
            - object
            - "null"
          description: A message's text, as its safe-markup document (`@sparkvault/app-sdk/safe-markup`); null for an event that carries no message, and for a message that cannot be read right now.
        attachments:
          type: array
          items:
            type: object
            required:
              - attachment_id
              - name
              - size
              - disposition
              - picture
              - scan
            properties:
              attachment_id:
                type: string
              name:
                type: string
              size:
                type: integer
                description: Bytes.
              disposition:
                type: string
                enum:
                  - inline
                  - attachment
                description: "How a browser is handed the file: inline only for a type Chrome and Firefox both show as a page from a single-use link (a JPEG, PNG, GIF, WebP, AVIF or BMP image, or a PDF); anything else downloads, every recording included."
              picture:
                type: boolean
                description: "Whether the file is a picture a browser shows inline: a JPEG, PNG, GIF, WebP, AVIF or BMP image, every inline file but a PDF. Derived from the type the file is stored under, which a customer is not shown."
              scan:
                type: string
                enum:
                  - pass
                  - not_scanned
                description: "`pass` when the mail scan passed the email that brought the file; `not_scanned` for an upload, for an email part the scan could not judge, and for a file read from inside an opaque-signed S/MIME body, which the mail scan is not known to open."
        status:
          type: object
          description: "On a status change: the status the request moved from and to."
          properties:
            from:
              type:
                - string
                - "null"
            to:
              type:
                - string
                - "null"
        merged:
          type: object
          description: "On a merge: the number of the other request."
          properties:
            number:
              type:
                - integer
                - "null"
        left_out:
          type: object
          description: "On a message its customer emailed: the files the email carried that the request left out, the first 20 listed in the order the email carried them and every one counted. A file is named by its type and its size, never by its name."
          required:
            - files
            - count
          properties:
            files:
              type: array
              maxItems: 20
              items:
                type: object
                required:
                  - reason
                  - content_type
                  - size
                properties:
                  reason:
                    type: string
                    enum:
                      - empty
                      - too_long
                      - unsafe_name
                      - refused_extension
                      - executable
                      - script
                      - markup
                      - empty_content
                      - too_many
                      - customer_upload_limit
                      - customer_uploads_off
                    description: "Why it was left out: the attachment policy's refusal of its name or its first bytes, `empty_content` for a file of no bytes, `too_many` past the 20 files an email adds to a request, or the customer's upload allowance: `customer_upload_limit` for a file past it, and `customer_uploads_off` at a desk whose allowance is 0, which takes no files from customers. No figure is given."
                  content_type:
                    type: string
                    description: "For a file the upload allowance refused, the type a request stores a file of its name as; for one the attachment policy left out, the media type its email declared for it, lowercased and without its parameters: application/octet-stream when it declared none well-formed."
                  size:
                    type: integer
                    description: Bytes.
            count:
              type: integer
              minimum: 1
              description: Every file left out, those listed among them.
    HelpDeskCustomerTimelinePage:
      type: object
      required:
        - events
        - next_cursor
      properties:
        events:
          type: array
          items:
            $ref: "#/components/schemas/HelpDeskCustomerEvent"
        next_cursor:
          type:
            - string
            - "null"
          description: Opaque continuation token. Null when the listing is exhausted.
    HelpDeskDownloadLink:
      type: object
      required:
        - url
        - expires_at
        - disposition
      properties:
        url:
          type: string
          format: uri
          description: A single-use link to the file. An inline file's link asks Forge to show it (`disposition=inline`), in a tab of its own.
        expires_at:
          type: integer
          description: Epoch seconds the link expires.
        disposition:
          type: string
          enum:
            - inline
            - attachment
          description: Inline only for a type Chrome and Firefox both show as a page from a single-use link (a JPEG, PNG, GIF, WebP, AVIF or BMP image, or a PDF); anything else downloads, every recording included.
    HelpDeskRequesterDetails:
      type: object
      description: A requester as an operator reads them, their address and name opened.
      required:
        - requester_id
        - email
        - display_name
        - assurance
        - ticket_count
      properties:
        requester_id:
          type: string
        email:
          type:
            - string
            - "null"
          description: Their address; null once they are erased, and empty when their sign-in asserted none.
        display_name:
          type:
            - string
            - "null"
          description: The name they gave; null until they give one, and once they are erased.
        assurance:
          type: string
          enum:
            - identity
            - email_pin
            - email
            - external_sso
            - federated
            - chat
          description: "The requester identity source: `federated` is the organization's own identity provider, and `chat` the profile an employee's company chat request came with, until a Secure Identity or emailed-code sign-in records its own. Incoming mail and chat requests create no browser session; company-session assurance alone does not prove mailbox ownership."
        email_verified:
          type: boolean
          const: false
          description: "Present, false, for a requester whose address nobody verified: a company-session contact the company did not verify, or a person the organization's own identity provider signed in without confirming their address, whose address is shown as asserted and whose requests no incoming mail joins. The address is shown for display alone: no routing rule matches its domain, and the desk emails it nothing."
        ticket_count:
          type: integer
          minimum: 0
          description: How many requests they have made at the desk.
        blocked:
          type: object
          description: Present while they are blocked.
          required:
            - at
            - by
          properties:
            at:
              type: integer
            by:
              type:
                - string
                - "null"
              description: The Manager who blocked them.
            reason:
              type:
                - string
                - "null"
              description: The Manager's note, if any.
        erased_at:
          type: integer
          description: When their data was erased; present only once it is.
    HelpDeskJobStarted:
      type: object
      required:
        - job_id
      properties:
        job_id:
          type: string
          description: "The job: GET /products/help-desk/jobs/{job_id} reports it. Asking again while it is queued or running answers the same job."
    HelpDeskJob:
      type: object
      description: An asynchronous job. It runs until `state` is done or failed, and is deleted 7 days after, an export's files with it. A queued or running job that nothing has moved for 30 minutes is ended failed, `stopped`, when it is next read.
      required:
        - job_id
        - kind
        - state
        - params
        - progress
        - created_at
        - updated_at
      properties:
        job_id:
          type: string
        kind:
          type: string
          enum:
            - export_requester
            - erase_requester
            - apply_rules
            - kb_publish
        state:
          type: string
          enum:
            - queued
            - running
            - done
            - failed
        params:
          type: object
          description: "What the job acts on: `requester_id` for a requester's export or erasure; nothing for the routing re-apply."
          properties:
            requester_id:
              type: string
        progress:
          type: object
          required:
            - done
          properties:
            done:
              type: integer
              description: "Tickets done so far: exported, erased, or checked against the rules."
            total:
              type:
                - integer
                - "null"
              description: About how many there are to do, when known.
        result:
          description: What a done job did.
          oneOf:
            - type: object
              description: "An export: newline-delimited JSON (one object a line) in files sealed in the desk's vault, with the requester's own fields, each of their requests and the public timeline of each, as the requester reads it. `download_url` is a single-use link, good for 24 hours, to the last file, whose last line lists every earlier file with a link of its own. Each attachment carries a single-use link of its own."
              required:
                - ingot_id
                - download_url
                - expires_at
                - parts
                - size_bytes
                - tickets
                - events
                - attachments
                - unlinked_attachments
              properties:
                ingot_id:
                  type: string
                download_url:
                  type: string
                expires_at:
                  type: integer
                parts:
                  type: integer
                  description: The files the export is.
                size_bytes:
                  type: integer
                tickets:
                  type: integer
                events:
                  type: integer
                attachments:
                  type: integer
                unlinked_attachments:
                  type: integer
                  description: "Attachments listed without a link: deleted after the export read their page. A file deleted before is on no timeline, so the export does not list it."
            - type: object
              description: An erasure.
              required:
                - tickets
                - events
                - ingots
                - export_parts
              properties:
                tickets:
                  type: integer
                events:
                  type: integer
                ingots:
                  type: integer
                  description: Message, attachment and email files deleted.
                export_parts:
                  type: integer
                  description: Files of earlier exports of the requester deleted.
            - type: object
              description: A routing re-apply.
              required:
                - checked
                - routed
              properties:
                checked:
                  type: integer
                routed:
                  type: integer
                  description: Tickets a rule changed.
        error:
          type: string
          description: Why a failed job stopped, in words for whoever reads the job.
        failure:
          type: object
          description: Why a failed job stopped, for the console to act on.
          required:
            - reason
          properties:
            reason:
              type: string
              enum:
                - legal_hold
                - desk_inactive
                - storage_full
                - bandwidth_exhausted
                - no_active_plan
                - funding_required
                - requester_gone
                - requester_erased
                - not_started
                - stopped
                - publication_refused
                - publication_missing
                - publication_cancelled
            ticket_ids:
              type: array
              items:
                type: string
              description: "For `legal_hold`: the requester's tickets under legal hold (at most 100)."
        created_at:
          type: integer
        updated_at:
          type: integer
    HelpDeskLegalHold:
      type: object
      required:
        - set_at
        - by
        - reason
      properties:
        set_at:
          type: integer
        by:
          type:
            - string
            - "null"
          description: The admin who placed it.
        reason:
          type: string
    HelpDeskLegalHolds:
      type: object
      required:
        - tickets
      properties:
        tickets:
          type: array
          description: Most recently held first.
          items:
            type: object
            required:
              - ticket_id
              - number
              - legal_hold
            properties:
              ticket_id:
                type: string
              number:
                type: integer
              subject:
                type: string
                description: "Absent while the desk is deactivated: its vault cannot be read."
              legal_hold:
                $ref: "#/components/schemas/HelpDeskLegalHold"
        partial:
          type: boolean
          const: true
          description: Present when the list was cut short by the read budget.
    HelpDeskAnalyticsFigures:
      type: object
      description: A period's headline figures. Times are whole seconds; null for a time with nothing to measure.
      required:
        - created
        - closed
        - reopened
        - median_frt_s
        - p90_frt_s
        - mean_frt_s
        - median_res_s
        - p90_res_s
        - mean_res_s
        - backlog_end
        - sample
        - feedback_positive
        - feedback_negative
        - feedback_total
        - satisfaction_pct
      properties:
        created:
          type: integer
          description: Tickets created; spam and duplicates are left out.
        closed:
          type: integer
          description: Tickets resolved.
        reopened:
          type: integer
        feedback_positive:
          type: integer
          minimum: 0
          description: Tickets with positive customer feedback, attributed to the first submission day.
        feedback_negative:
          type: integer
          minimum: 0
          description: Tickets with negative customer feedback, attributed to the first submission day.
        feedback_total:
          type: integer
          minimum: 0
          description: Positive plus negative ratings. Changing a vote replaces the previous sample.
        satisfaction_pct:
          type:
            - number
            - "null"
          minimum: 0
          maximum: 100
          description: Positive ratings divided by all ratings, times 100. Null when there are no ratings; never an average of operator percentages.
        median_frt_s:
          type:
            - integer
            - "null"
          description: "Median first response time: creation to the first public operator reply, on the tickets customers opened."
        p90_frt_s:
          type:
            - integer
            - "null"
        mean_frt_s:
          type:
            - integer
            - "null"
        median_res_s:
          type:
            - integer
            - "null"
          description: Median time from creation to the first resolution.
        p90_res_s:
          type:
            - integer
            - "null"
        mean_res_s:
          type:
            - integer
            - "null"
        backlog_end:
          type:
            - integer
            - "null"
          description: Tickets not closed at the end of the period; null for one queue's report.
        sample:
          type: object
          required:
            - frt
            - res
          properties:
            frt:
              type: integer
              description: First responses the times stand on.
            res:
              type: integer
              description: Resolutions the times stand on.
    HelpDeskOperatorFigures:
      type: object
      required:
        - assigned
        - replies
        - closed
        - reopened
        - median_frt_s
        - mean_frt_s
        - median_res_s
        - mean_res_s
        - first_responses
        - resolutions
        - feedback_positive
        - feedback_negative
        - feedback_total
        - satisfaction_pct
      properties:
        assigned:
          type: integer
        replies:
          type: integer
          description: Public replies sent to customers.
        closed:
          type: integer
          description: Tickets they resolved.
        reopened:
          type: integer
          description: Reopens of tickets assigned to them.
        median_frt_s:
          type:
            - integer
            - "null"
          description: On the tickets they replied to first.
        mean_frt_s:
          type:
            - integer
            - "null"
        median_res_s:
          type:
            - integer
            - "null"
          description: On the tickets they resolved.
        mean_res_s:
          type:
            - integer
            - "null"
        first_responses:
          type: integer
          description: Sample size for first-response readings.
        resolutions:
          type: integer
          description: Sample size for resolution readings.
        feedback_positive:
          type: integer
          minimum: 0
          description: Positive ratings credited to the author of the rated public reply.
        feedback_negative:
          type: integer
          minimum: 0
        feedback_total:
          type: integer
          minimum: 0
        satisfaction_pct:
          type:
            - number
            - "null"
          minimum: 0
          maximum: 100
          description: Positive share of this operator's ratings; null when unrated.
    HelpDeskAnalyticsReport:
      type: object
      description: One range's analytics, in calendar time and the organization's time zone. Durations are counted in 15 buckets bounded at 60, 300, 900, 1800, 3600, 7200, 14400, 28800, 86400, 172800, 259200, 604800, 1209600, 2592000 seconds, the last open.
      required:
        - kpis
        - previous
        - series
        - frt_buckets
        - res_buckets
        - heatmap
        - queues
        - operators
      properties:
        kpis:
          $ref: "#/components/schemas/HelpDeskAnalyticsFigures"
        previous:
          $ref: "#/components/schemas/HelpDeskAnalyticsFigures"
          description: The same figures for the period of equal length just before.
        series:
          type: array
          description: Every day of the range.
          items:
            type: object
            required:
              - day
              - created
              - closed
              - backlog
              - feedback_positive
              - feedback_negative
              - feedback_total
              - satisfaction_pct
            properties:
              day:
                type: string
                description: YYYY-MM-DD
              created:
                type: integer
              closed:
                type: integer
              backlog:
                type:
                  - integer
                  - "null"
                description: Tickets not closed at the end of the day; null for one queue's report.
              feedback_positive:
                type: integer
                minimum: 0
              feedback_negative:
                type: integer
                minimum: 0
              feedback_total:
                type: integer
                minimum: 0
              satisfaction_pct:
                type:
                  - number
                  - "null"
                minimum: 0
                maximum: 100
        frt_buckets:
          type: array
          items:
            type: integer
          description: First responses per bucket.
        res_buckets:
          type: array
          items:
            type: integer
          description: Resolutions per bucket.
        heatmap:
          type: array
          description: "Tickets created by weekday (Monday first) and hour (midnight first): seven rows of 24."
          items:
            type: array
            items:
              type: integer
        queues:
          type: array
          description: Each queue's tickets, most created first.
          items:
            type: object
            required:
              - queue_id
              - created
              - closed
              - feedback_positive
              - feedback_negative
              - feedback_total
              - satisfaction_pct
            properties:
              queue_id:
                type: string
              created:
                type: integer
              closed:
                type: integer
              feedback_positive:
                type: integer
                minimum: 0
              feedback_negative:
                type: integer
                minimum: 0
              feedback_total:
                type: integer
                minimum: 0
              satisfaction_pct:
                type:
                  - number
                  - "null"
                minimum: 0
                maximum: 100
        operators:
          type: array
          description: Each operator's work.
          items:
            type: object
            allOf:
              - $ref: "#/components/schemas/HelpDeskOperatorFigures"
            required:
              - user_id
              - name
              - email
            properties:
              user_id:
                type: string
              name:
                type:
                  - string
                  - "null"
                description: Null for a member since removed, as is `email`.
              email:
                type:
                  - string
                  - "null"
              previous:
                $ref: "#/components/schemas/HelpDeskOperatorFigures"
                description: "Present for an operator_id query: this operator in the preceding period of equal length."
              series:
                type: array
                description: "Present for an operator_id query: every account-local day, oldest first, including days with no activity."
                items:
                  type: object
                  allOf:
                    - $ref: "#/components/schemas/HelpDeskOperatorFigures"
                  required:
                    - day
                  properties:
                    day:
                      type: string
                      format: date
        partial:
          type: boolean
          const: true
          description: "Present when the read budget cut the report short: it counts the days it read."
    KnowledgeBaseAccessControlInput:
      type: object
      properties:
        mode:
          type: string
          enum:
            - public
            - password
            - ip_allowlist
            - identity
        allowed_ips:
          type: array
          minItems: 1
          maxItems: 100
          items:
            type: string
            maxLength: 64
          description: IPv4/IPv6 addresses or CIDR networks. Required in ip_allowlist mode.
        company_id:
          type: string
          description: SparkVault account ID. Identity access requires a verified employee email and active membership at this company. Other companies must admit the help center origin in Identity.
        password:
          type: string
          minLength: 12
          maxLength: 256
          writeOnly: true
          description: One universal password. Omit to retain the saved password while in password mode. Never returned.
      required:
        - mode
      additionalProperties: false
      description: Access policy for all knowledge base pages, search data and assets. Saved as a draft until publication. Only send the fields for the selected mode.
    KnowledgeBaseAccessControl:
      type: object
      properties:
        mode:
          type: string
          enum:
            - public
            - password
            - ip_allowlist
            - identity
        allowed_ips:
          type: array
          minItems: 1
          maxItems: 100
          items:
            type: string
            maxLength: 64
          description: IPv4/IPv6 addresses or CIDR networks. Required in ip_allowlist mode.
        company_id:
          type: string
          description: SparkVault account ID. Identity access requires a verified employee email and active membership at this company. Other companies must admit the help center origin in Identity.
        password_set:
          type: boolean
          readOnly: true
          description: Whether password mode has a saved password; no password or verifier is exposed.
      required:
        - mode
      additionalProperties: false
    KnowledgeBaseCustomTheme:
      type: object
      properties:
        version:
          type: integer
          const: 1
        name:
          type: string
          minLength: 1
          maxLength: 80
        base:
          type: string
          description: "The layout the theme builds on: default (SparkVault), or a preset reserved for this company. Saving a custom theme on a base the company may not use is refused with 400 (field custom_theme)."
        css:
          type: string
          maxLength: 65536
          description: Validated theme CSS, at most 64 KiB in UTF-8. Uploaded images may be referenced with kb-asset:<asset_id>; external fetches and executable content are not accepted.
        templates:
          type: object
          properties:
            layout:
              type: string
              maxLength: 32768
              description: HTML fragment with supported theme macros; at most 32 KiB in UTF-8. Empty inherits the base theme.
            home:
              type: string
              maxLength: 32768
              description: HTML fragment with supported theme macros; at most 32 KiB in UTF-8. Empty inherits the base theme.
            category:
              type: string
              maxLength: 32768
              description: HTML fragment with supported theme macros; at most 32 KiB in UTF-8. Empty inherits the base theme.
            article:
              type: string
              maxLength: 32768
              description: HTML fragment with supported theme macros; at most 32 KiB in UTF-8. Empty inherits the base theme.
          additionalProperties: false
      required:
        - version
        - name
        - base
      additionalProperties: false
      description: Versioned custom theme with bounded HTML fragments, platform-owned search/content slots and validated CSS. Omitted CSS and templates inherit the base. Combined theme JSON is limited to 160 KiB in UTF-8; at most 32 referenced images, all owned by this help desk.
    KnowledgeBaseImportSource:
      type: object
      properties:
        external_id:
          type: string
          maxLength: 200
        source_hash:
          type: string
          maxLength: 128
        source_path:
          type:
            - string
            - "null"
        source_created_at:
          type:
            - string
            - "null"
          format: date-time
        source_updated_at:
          type:
            - string
            - "null"
          format: date-time
        source_published_at:
          type:
            - string
            - "null"
          format: date-time
        source_metrics:
          type: object
          properties:
            views:
              type: integer
              minimum: 0
            helpful:
              type: integer
              minimum: 0
            not_helpful:
              type: integer
              minimum: 0
        related_external_ids:
          type: array
          maxItems: 30
          items:
            type: string
            maxLength: 200
      required:
        - external_id
        - source_hash
    KnowledgeBaseArticleInput:
      type: object
      properties:
        title:
          type: string
          maxLength: 160
        slug:
          type: string
          maxLength: 80
          pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
        summary:
          type: string
          maxLength: 500
        body_markdown:
          type: string
          description: Nonempty Markdown, at most 500 KiB in UTF-8. Stored as an immutable encrypted revision.
        category_id:
          type:
            - string
            - "null"
        seo_title:
          type:
            - string
            - "null"
          maxLength: 160
        seo_description:
          type:
            - string
            - "null"
          maxLength: 500
        seo_keywords:
          type: array
          maxItems: 30
          items:
            type: string
            maxLength: 80
        related_article_ids:
          type: array
          maxItems: 30
          items:
            type: string
            maxLength: 128
        source:
          anyOf:
            - $ref: "#/components/schemas/KnowledgeBaseImportSource"
            - type: "null"
        path:
          type:
            - string
            - "null"
          maxLength: 512
          description: Optional safe root-relative published path; authentication, portal and internal paths are reserved.
        cover_image_url:
          type:
            - string
            - "null"
          maxLength: 2048
      required:
        - title
        - slug
        - body_markdown
      additionalProperties: false
    KnowledgeBaseArticlePatch:
      type: object
      properties:
        title:
          type: string
          maxLength: 160
        slug:
          type: string
          maxLength: 80
          pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
        summary:
          type: string
          maxLength: 500
        body_markdown:
          type: string
          description: Nonempty Markdown, at most 500 KiB in UTF-8. Stored as an immutable encrypted revision.
        category_id:
          type:
            - string
            - "null"
        seo_title:
          type:
            - string
            - "null"
          maxLength: 160
        seo_description:
          type:
            - string
            - "null"
          maxLength: 500
        seo_keywords:
          type: array
          maxItems: 30
          items:
            type: string
            maxLength: 80
        related_article_ids:
          type: array
          maxItems: 30
          items:
            type: string
            maxLength: 128
        source:
          anyOf:
            - $ref: "#/components/schemas/KnowledgeBaseImportSource"
            - type: "null"
        path:
          type:
            - string
            - "null"
          maxLength: 512
          description: Optional safe root-relative published path; authentication, portal and internal paths are reserved.
        cover_image_url:
          type:
            - string
            - "null"
          maxLength: 2048
      additionalProperties: false
    KnowledgeBaseArticle:
      type: object
      properties:
        title:
          type: string
          maxLength: 160
        slug:
          type: string
          maxLength: 80
          pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
        summary:
          type: string
          maxLength: 500
        body_markdown:
          type: string
          description: Nonempty Markdown, at most 500 KiB in UTF-8. Stored as an immutable encrypted revision.
        category_id:
          type:
            - string
            - "null"
        seo_title:
          type:
            - string
            - "null"
          maxLength: 160
        seo_description:
          type:
            - string
            - "null"
          maxLength: 500
        seo_keywords:
          type: array
          maxItems: 30
          items:
            type: string
            maxLength: 80
        related_article_ids:
          type: array
          maxItems: 30
          items:
            type: string
            maxLength: 128
        source:
          anyOf:
            - $ref: "#/components/schemas/KnowledgeBaseImportSource"
            - type: "null"
        path:
          type:
            - string
            - "null"
          maxLength: 512
          description: Optional safe root-relative published path; authentication, portal and internal paths are reserved.
        cover_image_url:
          type:
            - string
            - "null"
          maxLength: 2048
        article_id:
          type: string
        version:
          type: integer
          minimum: 0
          description: The version last read; a stale version is refused with 409.
        current_revision_id:
          type: string
        published_revision_id:
          type:
            - string
            - "null"
        source_revision_id:
          type:
            - string
            - "null"
        has_unpublished_changes:
          type: boolean
        archived:
          type: boolean
        created_at:
          type: integer
          minimum: 0
        updated_at:
          type: integer
          minimum: 0
        asset_bindings:
          type: object
          readOnly: true
          additionalProperties:
            type: string
            pattern: ^hdkbm_[a-f0-9]{32}$
          description: Server-pinned image reference to immutable asset id for this revision. Returned in article detail and revision reads, omitted from workspace summaries; clients cannot set it. Restoring preserves its historical media.
        unresolved_images:
          type: array
          maxItems: 2001
          items:
            type: string
            maxLength: 2048
          description: "The body and cover image references this revision's asset_bindings leave unresolved, each once: images never uploaded, such as an external address. Publishing the revision is refused with 400 while any remain; upload each image and reference it from the library. A reserved preset's own known-broken imported source images are left out: a theme on that base publishes them as placeholders, and a publication under another theme refuses them while rendering."
      required:
        - article_id
        - title
        - slug
        - version
        - current_revision_id
        - published_revision_id
        - has_unpublished_changes
    KnowledgeBaseSourceSummary:
      type: object
      properties:
        external_id:
          type: string
          maxLength: 200
        source_hash:
          type: string
          maxLength: 128
      required:
        - external_id
        - source_hash
      additionalProperties: false
    KnowledgeBaseArticleSummary:
      type: object
      properties:
        article_id:
          type: string
        title:
          type: string
          maxLength: 160
        slug:
          type: string
          maxLength: 80
          pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
        category_id:
          type:
            - string
            - "null"
        version:
          type: integer
          minimum: 0
          description: The version last read; a stale version is refused with 409.
        current_revision_id:
          type: string
        published_revision_id:
          type:
            - string
            - "null"
        has_unpublished_changes:
          type: boolean
        source_revision_id:
          type:
            - string
            - "null"
        created_at:
          type: integer
          minimum: 0
        updated_at:
          type: integer
          minimum: 0
        archived:
          type: boolean
        source:
          anyOf:
            - $ref: "#/components/schemas/KnowledgeBaseSourceSummary"
            - type: "null"
        pinned:
          type:
            - integer
            - "null"
          minimum: 1
          description: The article's rank among the desk's pinned articles, first = 1; null when it is not pinned.
      required:
        - article_id
        - title
        - slug
        - category_id
        - version
        - current_revision_id
        - published_revision_id
        - has_unpublished_changes
        - source_revision_id
        - created_at
        - updated_at
        - archived
        - source
        - pinned
      additionalProperties: false
      description: Compact workspace entry. Read the article detail or revision endpoint for Markdown, SEO, paths, related articles, media bindings and complete source provenance.
    KnowledgeBaseCategorySummary:
      type: object
      properties:
        name:
          type: string
          maxLength: 160
        slug:
          type: string
          maxLength: 80
          pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
        description:
          type: string
          maxLength: 1000
        parent_id:
          type:
            - string
            - "null"
        position:
          type: integer
          minimum: 0
          maximum: 1000000
        source:
          anyOf:
            - $ref: "#/components/schemas/KnowledgeBaseSourceSummary"
            - type: "null"
        path:
          type:
            - string
            - "null"
          maxLength: 512
        category_id:
          type: string
        version:
          type: integer
          minimum: 0
          description: The version last read; a stale version is refused with 409.
        source_version:
          type:
            - integer
            - "null"
          minimum: 1
      required:
        - name
        - slug
        - description
        - parent_id
        - position
        - source
        - path
        - category_id
        - version
        - source_version
      additionalProperties: false
    KnowledgeBaseCategoryInput:
      type: object
      properties:
        name:
          type: string
          maxLength: 160
        slug:
          type: string
          maxLength: 80
          pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
        description:
          type: string
          maxLength: 1000
        parent_id:
          type:
            - string
            - "null"
        position:
          type: integer
          minimum: 0
          maximum: 1000000
        source:
          anyOf:
            - $ref: "#/components/schemas/KnowledgeBaseImportSource"
            - type: "null"
        path:
          type:
            - string
            - "null"
          maxLength: 512
      required:
        - name
        - slug
      additionalProperties: false
    KnowledgeBaseCategoryPatch:
      type: object
      properties:
        name:
          type: string
          maxLength: 160
        slug:
          type: string
          maxLength: 80
          pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
        description:
          type: string
          maxLength: 1000
        parent_id:
          type:
            - string
            - "null"
        position:
          type: integer
          minimum: 0
          maximum: 1000000
        source:
          anyOf:
            - $ref: "#/components/schemas/KnowledgeBaseImportSource"
            - type: "null"
        path:
          type:
            - string
            - "null"
          maxLength: 512
      additionalProperties: false
    KnowledgeBaseCategory:
      type: object
      properties:
        name:
          type: string
          maxLength: 160
        slug:
          type: string
          maxLength: 80
          pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
        description:
          type: string
          maxLength: 1000
        parent_id:
          type:
            - string
            - "null"
        position:
          type: integer
          minimum: 0
          maximum: 1000000
        source:
          anyOf:
            - $ref: "#/components/schemas/KnowledgeBaseImportSource"
            - type: "null"
        path:
          type:
            - string
            - "null"
          maxLength: 512
        category_id:
          type: string
        version:
          type: integer
          minimum: 0
          description: The version last read; a stale version is refused with 409.
      required:
        - category_id
        - name
        - slug
        - version
    KnowledgeBaseFaqInput:
      type: object
      properties:
        question:
          type: string
          minLength: 1
          maxLength: 150
          description: One line.
        answer:
          type: string
          minLength: 1
          maxLength: 2000
          description: "Plain text with paragraphs (a blank line), line breaks and links: [text](https://…), [text](/a/help-center/path) or a bare https address. At most 800 visible characters, where link text counts and link addresses do not."
        slug:
          type: string
          maxLength: 80
          pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
          description: The entry's anchor on the FAQ page (/faq/#slug), unique among the desk's entries.
      required:
        - question
        - answer
        - slug
      additionalProperties: false
    KnowledgeBaseFaqPatch:
      type: object
      properties:
        question:
          type: string
          minLength: 1
          maxLength: 150
          description: One line.
        answer:
          type: string
          minLength: 1
          maxLength: 2000
          description: "Plain text with paragraphs (a blank line), line breaks and links: [text](https://…), [text](/a/help-center/path) or a bare https address. At most 800 visible characters, where link text counts and link addresses do not."
        slug:
          type: string
          maxLength: 80
          pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
          description: The entry's anchor on the FAQ page (/faq/#slug), unique among the desk's entries.
      additionalProperties: false
    KnowledgeBaseFaq:
      type: object
      properties:
        question:
          type: string
          minLength: 1
          maxLength: 150
          description: One line.
        answer:
          type: string
          minLength: 1
          maxLength: 2000
          description: "Plain text with paragraphs (a blank line), line breaks and links: [text](https://…), [text](/a/help-center/path) or a bare https address. At most 800 visible characters, where link text counts and link addresses do not."
        slug:
          type: string
          maxLength: 80
          pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
          description: The entry's anchor on the FAQ page (/faq/#slug), unique among the desk's entries.
        faq_id:
          type: string
        version:
          type: integer
          minimum: 0
          description: The version last read; a stale version is refused with 409.
        created_at:
          type: integer
          minimum: 0
        updated_at:
          type: integer
          minimum: 0
      required:
        - faq_id
        - question
        - answer
        - slug
        - version
        - created_at
        - updated_at
      additionalProperties: false
    KnowledgeBaseSettingsPatch:
      type: object
      properties:
        access_control:
          $ref: "#/components/schemas/KnowledgeBaseAccessControlInput"
        title:
          type: string
          maxLength: 160
        description:
          type: string
          maxLength: 1000
        theme:
          type: string
          description: "The help center layout: default (SparkVault), custom (the saved custom_theme), or a preset reserved for this company. Choosing a layout the company may not use is refused with 400 (field theme); a publication refuses a saved one the same way, as a lasting refusal."
        branding_credit:
          type: boolean
        custom_theme:
          anyOf:
            - $ref: "#/components/schemas/KnowledgeBaseCustomTheme"
            - type: "null"
          description: Saved custom theme, retained when choosing a preset. Required when theme is custom. Changes remain private until publication; all settings together must fit within 240 KiB of UTF-8 JSON.
        search_enabled:
          type: boolean
          default: true
          description: Include the help center's own article search. Changes are staged until publication; false omits search widgets and the search page from the new release, which keeps its static search index for the support widget's answer suggestions.
        accent_color:
          type: string
          pattern: ^#[0-9a-fA-F]{6}$
        logo_asset_id:
          type:
            - string
            - "null"
        seo_title:
          type:
            - string
            - "null"
          maxLength: 160
        seo_description:
          type:
            - string
            - "null"
          maxLength: 500
        redirects:
          type: array
          maxItems: 2000
          items:
            type: object
            properties:
              from:
                type: string
              to:
                type: string
              status:
                type: integer
                const: 301
            required:
              - from
              - to
        faq_enabled:
          type: boolean
          default: false
          description: Publish the FAQ page at /faq/ with a header link to it, once it holds an entry. Changes are staged until publication. Refused while a category or article publishes at /faq/.
        faq_title:
          type:
            - string
            - "null"
          maxLength: 80
          description: The FAQ page's heading and title; null uses "Frequently asked questions".
        faq_description:
          type:
            - string
            - "null"
          maxLength: 300
          description: The FAQ page's introduction and meta description; null describes each page by its questions.
        feedback:
          anyOf:
            - type: object
              properties:
                prompt:
                  type: string
                  maxLength: 120
                yes_label:
                  type: string
                  maxLength: 40
                  description: The Yes control's words. On text buttons they are its accessible name; the default, Yes, is announced as "Yes, this resolved my question". On icons a label other than the default names the control.
                no_label:
                  type: string
                  maxLength: 40
                  description: The No control's words, named as yes_label's are; the default, No, is announced as "No, I still need help".
                style:
                  type:
                    - string
                    - "null"
                  enum:
                    - buttons
                    - icons
                    - null
                  description: "buttons draws the labels as text buttons, icons draws thumbs. Null or unset draws the theme's own: thumbs in the Privacy Bee theme, text buttons in every other."
                on_yes:
                  type: object
                  properties:
                    action:
                      type: string
                      enum:
                        - thanks
                        - review_prompt
                      default: review_prompt
                      description: review_prompt offers the desk's Positive feedback URL (General settings) after a Yes vote when one is set; thanks never offers a review. Each release records the action it was published with, and both vote routes, the help center's and the support widget's, decide by it.
                    review_prompt:
                      type: string
                      maxLength: 160
                    thanks_message:
                      type: string
                      maxLength: 200
                  additionalProperties: false
                on_no:
                  type: object
                  properties:
                    action:
                      type: string
                      enum:
                        - thanks
                        - comment
                        - open_ticket
                      default: open_ticket
                      description: open_ticket opens the ticket form; thanks thanks the reader in the platform's own words, never on_yes.thanks_message; comment asks what was missing in one note field.
                    ticket_prefill:
                      type: boolean
                      default: true
                  additionalProperties: false
              additionalProperties: false
            - type: "null"
          description: Article helpful-vote follow-up. Null publishes the default prompt, labels and follow-ups in the theme's own control style, as a setting with every field unset does. A field the setting does not hold is refused with 400 VALIDATION_ERROR naming it. A Yes vote's review link is the desk's Positive feedback URL, the one ticket Good ratings use, never a value of this setting. Changes apply on the next publication.
      additionalProperties: false
    KnowledgeBaseRevision:
      type: object
      properties:
        title:
          type: string
          maxLength: 160
        slug:
          type: string
          maxLength: 80
          pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
        summary:
          type: string
          maxLength: 500
        body_markdown:
          type: string
          description: Nonempty Markdown, at most 500 KiB in UTF-8. Stored as an immutable encrypted revision.
        category_id:
          type:
            - string
            - "null"
        seo_title:
          type:
            - string
            - "null"
          maxLength: 160
        seo_description:
          type:
            - string
            - "null"
          maxLength: 500
        seo_keywords:
          type: array
          maxItems: 30
          items:
            type: string
            maxLength: 80
        related_article_ids:
          type: array
          maxItems: 30
          items:
            type: string
            maxLength: 128
        source:
          anyOf:
            - $ref: "#/components/schemas/KnowledgeBaseImportSource"
            - type: "null"
        path:
          type:
            - string
            - "null"
          maxLength: 512
          description: Optional safe root-relative published path; authentication, portal and internal paths are reserved.
        cover_image_url:
          type:
            - string
            - "null"
          maxLength: 2048
        revision_id:
          type: string
        created_at:
          type: integer
          minimum: 0
        created_by:
          type: string
        asset_bindings:
          type: object
          readOnly: true
          additionalProperties:
            type: string
            pattern: ^hdkbm_[a-f0-9]{32}$
          description: Server-pinned image reference to immutable asset id for this revision. Returned in article detail and revision reads, omitted from workspace summaries; clients cannot set it. Restoring preserves its historical media.
      required:
        - revision_id
        - created_at
        - created_by
        - title
        - body_markdown
    KnowledgeBaseRevisionSummary:
      type: object
      properties:
        revision_id:
          type: string
        created_at:
          type: integer
          minimum: 0
        created_by:
          type: string
        is_published:
          type: boolean
      required:
        - revision_id
        - created_at
        - created_by
        - is_published
    KnowledgeBaseAsset:
      type: object
      properties:
        asset_id:
          type: string
        url:
          type: string
          description: Private draft reference kb-asset:<asset_id>; publication rewrites it to an immutable public image URL.
        filename:
          type: string
        content_type:
          type: string
          enum:
            - image/png
            - image/jpeg
            - image/gif
            - image/webp
            - image/avif
        size:
          type: integer
          minimum: 0
        sha256:
          type: string
        source_url:
          type:
            - string
            - "null"
        source_urls:
          type: array
          items:
            type: string
      required:
        - asset_id
        - url
        - filename
        - content_type
        - size
        - sha256
    KnowledgeBaseWorkspace:
      type: object
      properties:
        desk_id:
          type: string
        company_id:
          type: string
          description: "The company's account ID: whose reserved layouts, if any, the desk may use."
        version:
          type: integer
          minimum: 0
          description: The version last read; a stale version is refused with 409.
        public_url:
          type: string
          format: uri
        serving:
          type: boolean
          description: "Whether the desk serves its customers now, as GET /products/help-desk/settings/status reports it: false while its subscription lapsed, or its purchased desk count does not cover it. Whether its help center is online is publication.online."
        permissions:
          type: object
          properties:
            can_edit:
              type: boolean
            can_disable:
              type: boolean
            can_cancel:
              type: boolean
          required:
            - can_edit
            - can_disable
            - can_cancel
          description: "The caller's authority now, from the membership, role and license checks each write enforces: editing needs a Full License; disabling and cancelling a publication do not."
        settings:
          type: object
          properties:
            access_control:
              $ref: "#/components/schemas/KnowledgeBaseAccessControl"
            title:
              type: string
              maxLength: 160
            description:
              type: string
              maxLength: 1000
            theme:
              type: string
              description: "The help center layout: default (SparkVault), custom (the saved custom_theme), or a preset reserved for this company. Choosing a layout the company may not use is refused with 400 (field theme); a publication refuses a saved one the same way, as a lasting refusal."
            branding_credit:
              type: boolean
            custom_theme:
              anyOf:
                - $ref: "#/components/schemas/KnowledgeBaseCustomTheme"
                - type: "null"
              description: Saved custom theme, retained when choosing a preset. Required when theme is custom. Changes remain private until publication; all settings together must fit within 240 KiB of UTF-8 JSON.
            search_enabled:
              type: boolean
              default: true
              description: Include the help center's own article search. Changes are staged until publication; false omits search widgets and the search page from the new release, which keeps its static search index for the support widget's answer suggestions.
            accent_color:
              type: string
              pattern: ^#[0-9a-fA-F]{6}$
            logo_asset_id:
              type:
                - string
                - "null"
            seo_title:
              type:
                - string
                - "null"
              maxLength: 160
            seo_description:
              type:
                - string
                - "null"
              maxLength: 500
            redirects:
              type: array
              maxItems: 2000
              items:
                type: object
                properties:
                  from:
                    type: string
                  to:
                    type: string
                  status:
                    type: integer
                    const: 301
                required:
                  - from
                  - to
            faq_enabled:
              type: boolean
              default: false
              description: Publish the FAQ page at /faq/ with a header link to it, once it holds an entry. Changes are staged until publication. Refused while a category or article publishes at /faq/.
            faq_title:
              type:
                - string
                - "null"
              maxLength: 80
              description: The FAQ page's heading and title; null uses "Frequently asked questions".
            faq_description:
              type:
                - string
                - "null"
              maxLength: 300
              description: The FAQ page's introduction and meta description; null describes each page by its questions.
            feedback:
              anyOf:
                - type: object
                  properties:
                    prompt:
                      type: string
                      maxLength: 120
                    yes_label:
                      type: string
                      maxLength: 40
                      description: The Yes control's words. On text buttons they are its accessible name; the default, Yes, is announced as "Yes, this resolved my question". On icons a label other than the default names the control.
                    no_label:
                      type: string
                      maxLength: 40
                      description: The No control's words, named as yes_label's are; the default, No, is announced as "No, I still need help".
                    style:
                      type:
                        - string
                        - "null"
                      enum:
                        - buttons
                        - icons
                        - null
                      description: "buttons draws the labels as text buttons, icons draws thumbs. Null or unset draws the theme's own: thumbs in the Privacy Bee theme, text buttons in every other."
                    on_yes:
                      type: object
                      properties:
                        action:
                          type: string
                          enum:
                            - thanks
                            - review_prompt
                          default: review_prompt
                          description: review_prompt offers the desk's Positive feedback URL (General settings) after a Yes vote when one is set; thanks never offers a review. Each release records the action it was published with, and both vote routes, the help center's and the support widget's, decide by it.
                        review_prompt:
                          type: string
                          maxLength: 160
                        thanks_message:
                          type: string
                          maxLength: 200
                      additionalProperties: false
                    on_no:
                      type: object
                      properties:
                        action:
                          type: string
                          enum:
                            - thanks
                            - comment
                            - open_ticket
                          default: open_ticket
                          description: open_ticket opens the ticket form; thanks thanks the reader in the platform's own words, never on_yes.thanks_message; comment asks what was missing in one note field.
                        ticket_prefill:
                          type: boolean
                          default: true
                      additionalProperties: false
                  additionalProperties: false
                - type: "null"
              description: Article helpful-vote follow-up. Null publishes the default prompt, labels and follow-ups in the theme's own control style, as a setting with every field unset does. A field the setting does not hold is refused with 400 VALIDATION_ERROR naming it. A Yes vote's review link is the desk's Positive feedback URL, the one ticket Good ratings use, never a value of this setting. Changes apply on the next publication.
            enabled:
              type: boolean
        publication:
          type: object
          properties:
            state:
              type: string
              enum:
                - idle
                - publishing
                - failed
            operation_id:
              type:
                - string
                - "null"
            job_id:
              type:
                - string
                - "null"
            active_release_id:
              type:
                - string
                - "null"
            published_at:
              type:
                - integer
                - "null"
            online:
              type:
                - boolean
                - "null"
              description: "Whether the public help center serves active_release_id now, as the edge reads its publication pointer. A lapse or a deactivation takes an enabled help center offline and keeps settings.enabled; the desk's activation serves it again, and the subscription's return does, best effort. While serving is true and settings.enabled is true, online false with no publication or lifecycle_pause under way means that return did not happen: POST /products/help-desk/knowledge-base/enable serves the last release again. Null when the pointer could not be read (its storage failed or did not answer within a second): unknown, never a reason to enable."
            error:
              type:
                - string
                - "null"
              description: "Why a failed publication stopped, in words the desk's configurer acts on: for a refusal of the desk's content or of a publication limit, what to change (the article, image, path or redirect it names); for anything else, a general sentence. Null unless state is failed."
            retryable:
              type: boolean
              description: "Whether the pending publication can be retried: it never reached its background job, or it failed on something a retry can get past. A refused publication meets the same refusal again, so it is false: cancel the publication, fix what error names, then publish again."
            lifecycle_paused:
              type: boolean
            lifecycle_pause:
              anyOf:
                - type: object
                  properties:
                    reason:
                      type: string
                      description: The help desk change that paused publication.
                    affected_domain:
                      type:
                        - string
                        - "null"
                    running:
                      type: boolean
                      description: Whether that change is still in progress; false means it stopped unfinished and must be completed.
                  required:
                    - reason
                    - affected_domain
                    - running
                - type: "null"
              description: The unfinished help desk change holding publication while lifecycle_paused is true; null otherwise.
          required:
            - state
            - operation_id
            - job_id
            - active_release_id
            - published_at
            - online
            - error
            - retryable
            - lifecycle_paused
            - lifecycle_pause
        categories:
          type: array
          items:
            $ref: "#/components/schemas/KnowledgeBaseCategorySummary"
          maxItems: 200
        articles:
          type: array
          items:
            $ref: "#/components/schemas/KnowledgeBaseArticleSummary"
          maxItems: 2000
          description: "The active articles: the pinned ones first, by rank, then the rest by title."
        faq:
          type: array
          items:
            $ref: "#/components/schemas/KnowledgeBaseFaq"
          maxItems: 500
          description: The FAQ entries in their published order.
      required:
        - desk_id
        - company_id
        - version
        - public_url
        - serving
        - permissions
        - settings
        - publication
        - categories
        - articles
        - faq
    KnowledgeBasePublicationOperation:
      type: object
      properties:
        operation_id:
          type: string
        job_id:
          type: string
        state:
          type: string
      required:
        - operation_id
        - job_id
        - state
    KnowledgeBaseAnalyticsFigures:
      type: object
      properties:
        views:
          type: integer
          minimum: 0
        searches:
          type: integer
          minimum: 0
        no_results:
          type: integer
          minimum: 0
        helpful_yes:
          type: integer
          minimum: 0
        helpful_no:
          type: integer
          minimum: 0
        tickets_opened:
          type: integer
          minimum: 0
        helpful_total:
          type: integer
          minimum: 0
        helpful_pct:
          type:
            - number
            - "null"
          minimum: 0
          maximum: 100
        not_helpful_pct:
          type:
            - number
            - "null"
          minimum: 0
          maximum: 100
        no_results_pct:
          type:
            - number
            - "null"
          minimum: 0
          maximum: 100
      required:
        - views
        - searches
        - no_results
        - helpful_yes
        - helpful_no
        - tickets_opened
        - helpful_total
        - helpful_pct
        - not_helpful_pct
        - no_results_pct
    KnowledgeBaseAnalytics:
      type: object
      properties:
        from:
          type: string
          format: date
        to:
          type: string
          format: date
        time_zone:
          type: string
        partial:
          type: boolean
        kpis:
          $ref: "#/components/schemas/KnowledgeBaseAnalyticsFigures"
        previous:
          $ref: "#/components/schemas/KnowledgeBaseAnalyticsFigures"
        series:
          type: array
          items:
            type: object
            properties:
              day:
                type: string
                format: date
              views:
                type: integer
                minimum: 0
              searches:
                type: integer
                minimum: 0
              no_results:
                type: integer
                minimum: 0
              helpful_yes:
                type: integer
                minimum: 0
              helpful_no:
                type: integer
                minimum: 0
              tickets_opened:
                type: integer
                minimum: 0
            required:
              - day
              - views
              - searches
              - no_results
              - helpful_yes
              - helpful_no
              - tickets_opened
        articles:
          type: array
          items:
            type: object
            properties:
              article_id:
                type: string
              title:
                type: string
              slug:
                type: string
              views:
                type: integer
                minimum: 0
              searches:
                type: integer
                minimum: 0
              no_results:
                type: integer
                minimum: 0
              helpful_yes:
                type: integer
                minimum: 0
              helpful_no:
                type: integer
                minimum: 0
              tickets_opened:
                type: integer
                minimum: 0
              helpful_total:
                type: integer
                minimum: 0
              helpful_pct:
                type:
                  - number
                  - "null"
                minimum: 0
                maximum: 100
              not_helpful_pct:
                type:
                  - number
                  - "null"
                minimum: 0
                maximum: 100
              no_results_pct:
                type:
                  - number
                  - "null"
                minimum: 0
                maximum: 100
        categories:
          type: array
          items:
            type: object
            properties:
              category_id:
                type: string
              name:
                type: string
              views:
                type: integer
                minimum: 0
              searches:
                type: integer
                minimum: 0
              no_results:
                type: integer
                minimum: 0
              helpful_yes:
                type: integer
                minimum: 0
              helpful_no:
                type: integer
                minimum: 0
              tickets_opened:
                type: integer
                minimum: 0
              helpful_total:
                type: integer
                minimum: 0
              helpful_pct:
                type:
                  - number
                  - "null"
                minimum: 0
                maximum: 100
              not_helpful_pct:
                type:
                  - number
                  - "null"
                minimum: 0
                maximum: 100
              no_results_pct:
                type:
                  - number
                  - "null"
                minimum: 0
                maximum: 100
        imported_totals:
          anyOf:
            - type: object
              properties:
                views:
                  type: integer
                  minimum: 0
                helpful_yes:
                  type: integer
                  minimum: 0
                helpful_no:
                  type: integer
                  minimum: 0
              required:
                - views
                - helpful_yes
                - helpful_no
            - type: "null"
          description: Source lifetime counts have no date history and never enter the selected range or previous period.
      required:
        - from
        - to
        - time_zone
        - partial
        - kpis
        - previous
        - series
        - articles
        - categories
        - imported_totals
    KnowledgeBaseWidgetConfig:
      type: object
      properties:
        visitor_identifier:
          $ref: "#/components/schemas/HelpDeskVisitorIdentifier"
        available:
          type: boolean
        release_id:
          anyOf:
            - type: string
              pattern: ^[a-f0-9]{64}$
            - type: "null"
        canonical_origin:
          anyOf:
            - type: string
              format: uri
            - type: "null"
        search_enabled:
          type: boolean
        authorized:
          type: boolean
        access:
          type: object
          properties:
            mode:
              type: string
              enum:
                - public
                - password
                - ip_allowlist
                - identity
            company_id:
              type: string
          required:
            - mode
          additionalProperties: false
      required:
        - visitor_identifier
        - available
        - release_id
        - canonical_origin
        - search_enabled
        - authorized
        - access
      additionalProperties: false
    KnowledgeBaseWidgetReader:
      type: object
      properties:
        version:
          type: integer
          const: 1
        kind:
          type: string
          enum:
            - article
            - faq
        id:
          type: string
        title:
          type: string
        canonical_url:
          type: string
          format: uri
        release_id:
          type: string
          pattern: ^[a-f0-9]{64}$
        body_html:
          type: string
          description: Platform-rendered safe body fragment. Never includes custom theme HTML or scripts. SDK sanitizes again before rendering.
        assets:
          type: array
          items:
            type: string
            pattern: ^/_kb/assets/
          description: Release-local images. Fetch through the protected asset route; do not expose permanent public copies.
      required:
        - version
        - kind
        - id
        - title
        - canonical_url
        - release_id
        - body_html
        - assets
      additionalProperties: false
    HelpDeskExternalIdentityConfig:
      type: object
      additionalProperties: false
      properties:
        issuer:
          type: string
          format: uri
          maxLength: 2048
          description: Absolute HTTPS URL without credentials, query or fragment.
        public_key:
          type: string
          maxLength: 8192
          description: RSA public PEM only (2048 to 8192 bits); the company retains its private signing key on its server. RS256 is the only accepted algorithm.
        key_id:
          type: string
          minLength: 1
          maxLength: 128
          pattern: ^[A-Za-z0-9._-]+$
        allowed_origins:
          type: array
          minItems: 1
          maxItems: 20
          uniqueItems: true
          items:
            type: string
            format: uri
          description: Exact canonical HTTPS origins of company pages allowed to complete sign-in. No path, credentials, wildcard or trailing slash.
        session_ttl_seconds:
          type: integer
          minimum: 60
          maximum: 900
          default: 900
        handoff_url:
          type:
            - string
            - "null"
          format: uri
          maxLength: 2048
          description: Company bridge page for silent hosted-portal handoff using its existing company session; null disables hosted handoff.
        sign_in_url:
          type:
            - string
            - "null"
          format: uri
          maxLength: 2048
          description: Optional company-owned login page for visitors without a company session.
      required:
        - issuer
        - public_key
        - key_id
        - allowed_origins
    HelpDeskExternalIdentityPublic:
      type: object
      additionalProperties: false
      properties:
        issuer:
          type: string
          format: uri
          maxLength: 2048
          description: Absolute HTTPS URL without credentials, query or fragment.
        key_id:
          type: string
          minLength: 1
          maxLength: 128
          pattern: ^[A-Za-z0-9._-]+$
        assertion_audience:
          type: string
        session_ttl_seconds:
          type: integer
          minimum: 60
          maximum: 900
          default: 900
        handoff_url:
          type:
            - string
            - "null"
          format: uri
          maxLength: 2048
          description: Absolute HTTPS URL without credentials, query or fragment.
        sign_in_url:
          type:
            - string
            - "null"
          format: uri
          maxLength: 2048
          description: Absolute HTTPS URL without credentials, query or fragment.
        guest_email:
          type: boolean
      required:
        - issuer
        - key_id
        - assertion_audience
        - session_ttl_seconds
        - handoff_url
        - sign_in_url
        - guest_email
    HelpDeskExternalIdentityIntegration:
      type: object
      additionalProperties: false
      properties:
        desk_id:
          type: string
        canonical_host:
          type:
            - string
            - "null"
          description: Current canonical portal hostname, without scheme or path.
        portal_origins:
          type: array
          items:
            type: string
            format: uri
          description: Actual current HTTPS portal origins. A company bridge must allow return URLs only at one of these origins plus /auth/company/callback.
        active:
          type: boolean
        auth_mode:
          type:
            - string
            - "null"
          enum:
            - email_pin
            - external_sso
            - external_unavailable
            - null
        ready:
          type: boolean
          description: A valid public verifier is configured; active && ready && auth_mode===external_sso means company sign-in is serving.
        external_identity:
          oneOf:
            - $ref: "#/components/schemas/HelpDeskExternalIdentityConfig"
            - type: "null"
        external_guest_email:
          type: boolean
        assertion_audience:
          type: string
        version:
          type:
            - integer
            - "null"
      required:
        - desk_id
        - canonical_host
        - portal_origins
        - active
        - auth_mode
        - ready
        - external_identity
        - external_guest_email
        - assertion_audience
        - version
    HelpDeskExternalChallenge:
      type: object
      additionalProperties: false
      properties:
        nonce:
          type: string
          pattern: ^[A-Za-z0-9_-]{43}$
        verifier:
          type: string
          pattern: ^[A-Za-z0-9_-]{43}$
        expires_at:
          type: integer
          description: Unix seconds.
      required:
        - nonce
        - verifier
        - expires_at
    HelpDeskExternalHandoff:
      type: object
      additionalProperties: false
      properties:
        code:
          type: string
          pattern: ^[A-Za-z0-9_-]{43}$
        expires_at:
          type: integer
          description: Unix seconds.
      required:
        - code
        - expires_at
    HelpDeskWidgetIdentityChallenge:
      type: object
      properties:
        challenge_id:
          type: string
          pattern: ^[A-Za-z0-9_-]{43}$
        verifier:
          type: string
          pattern: ^[A-Za-z0-9_-]{43}$
        state:
          type: string
          pattern: ^[A-Za-z0-9_-]{43}$
          description: Private to the initiating browser, like the verifier. The browser hands it to the sign-in window it opened on https://signin.help.sv, by postMessage to that window's origin when the window asks its opener for it, and every sign-in window step requires it, so the challenge completes only in the window that started it.
        sign_in_url:
          type: string
          format: uri
          description: "https://signin.help.sv/{desk_id}/{challenge_id}: the sign-in window to open."
        expires_at:
          type: integer
      required:
        - challenge_id
        - verifier
        - state
        - sign_in_url
        - expires_at
      additionalProperties: false
    HelpDeskWidgetIdentitySession:
      allOf:
        - $ref: "#/components/schemas/HelpDeskSession"
        - type: object
          properties:
            identity_grant:
              type: object
              properties:
                token:
                  type: string
                  pattern: ^hdwip_[A-Za-z0-9_-]{43}$
                expires_at:
                  type: integer
                ttl_seconds:
                  type: integer
                  const: 300
              required:
                - token
                - expires_at
                - ttl_seconds
              additionalProperties: false
          required:
            - identity_grant
    HelpDeskDescriptor:
      type: object
      properties:
        account_id:
          type: string
          description: Real company owner; a named desk never substitutes for the account in billing.
        desk_id:
          type: string
          description: The original acc_ account ID or a named hdd_ desk ID.
        name:
          type: string
          minLength: 1
          maxLength: 80
        audience:
          type: string
          enum:
            - internal
            - external
        slug:
          type: string
        mailbox:
          type:
            - string
            - "null"
        version:
          type: integer
          minimum: 0
          description: The descriptor version returned by the directory. Refresh after a conflict.
        billing_slot:
          type:
            - integer
            - "null"
          minimum: 1
          description: Allocated plan capacity, absent for archived desks. May change during another desk's retirement.
        archived_at:
          type:
            - integer
            - "null"
          minimum: 0
          description: Archive time; absent or null for a current desk.
        created_at:
          type:
            - integer
            - "null"
        updated_at:
          type: integer
          minimum: 0
        address:
          type:
            - string
            - "null"
        email_host:
          type:
            - string
            - "null"
          description: The company help.sv mail host, where the desk's mailbox always receives.
        contact_email:
          type:
            - string
            - "null"
          format: email
          description: "The desk's address as its email uses it now: its mailbox (support for a desk without one) at its selected company subdomain once that sends and receives, else at email_host."
        activation:
          $ref: "#/components/schemas/HelpDeskActivationState"
        role:
          type:
            - string
            - "null"
          enum:
            - manager
            - agent
            - trainee
            - null
          description: The caller's role on the desk; null for none, and on an archived desk.
        can_manage:
          type: boolean
          description: "The caller configures the desk: a company administrator, or the desk's Manager."
      required:
        - account_id
        - desk_id
        - name
        - audience
        - version
        - role
        - can_manage
    HelpDeskDirectory:
      type: object
      properties:
        desks:
          type: array
          items:
            $ref: "#/components/schemas/HelpDeskDescriptor"
          description: "The current desks the caller sees: every one for a company administrator, else those the caller holds a role on with Help Desk access."
        archived_desks:
          type: array
          items:
            $ref: "#/components/schemas/HelpDeskDescriptor"
          description: Retained archived desks, for a current company administrator alone; empty for anyone else.
        count:
          type: integer
          minimum: 0
          description: Company-wide nonarchived count, including temporarily inactive desks. Minimum positive billing quantity.
        archived_count:
          type: integer
          minimum: 0
          description: How many archived desks archived_desks lists.
        capacity:
          type: integer
          minimum: 0
          description: Purchased Desk capacity; zero when the product has lapsed.
        can_create:
          type: boolean
          description: "The caller creates, archives and restores desks: a company administrator."
        vault_id:
          type:
            - string
            - "null"
        email_host:
          type:
            - string
            - "null"
      required:
        - desks
        - count
        - capacity
        - can_create
    HelpDeskSupportFigures:
      type: object
      required:
        - started
        - eligible
        - unavailable
        - article_opened
        - solved
        - contact_requested
        - eligible_contact_requested
        - contact_no_results
        - contact_none_match
        - contact_article_not_answered
        - contact_unavailable
        - contact_unattributed
        - ticket_created
        - unknown
        - resolution_pct
        - answered_outcomes_pct
      properties:
        started:
          type: integer
          minimum: 0
        eligible:
          type: integer
          minimum: 0
        unavailable:
          type: integer
          minimum: 0
        article_opened:
          type: integer
          minimum: 0
        solved:
          type: integer
          minimum: 0
        contact_requested:
          type: integer
          minimum: 0
        eligible_contact_requested:
          type: integer
          minimum: 0
        contact_no_results:
          type: integer
          minimum: 0
        contact_none_match:
          type: integer
          minimum: 0
        contact_article_not_answered:
          type: integer
          minimum: 0
        contact_unavailable:
          type: integer
          minimum: 0
        contact_unattributed:
          type: integer
          minimum: 0
        ticket_created:
          type: integer
          minimum: 0
        unknown:
          type: integer
          minimum: 0
        resolution_pct:
          type:
            - number
            - "null"
          minimum: 0
          maximum: 100
        answered_outcomes_pct:
          type:
            - number
            - "null"
          minimum: 0
          maximum: 100
    HelpDeskSupportAnalytics:
      type: object
      additionalProperties: false
      properties:
        from:
          type: string
          format: date
        to:
          type: string
          format: date
        time_zone:
          type: string
        partial:
          type: boolean
        kpis:
          $ref: "#/components/schemas/HelpDeskSupportFigures"
        previous:
          $ref: "#/components/schemas/HelpDeskSupportFigures"
        series:
          type: array
          items:
            allOf:
              - $ref: "#/components/schemas/HelpDeskSupportFigures"
              - type: object
                required:
                  - day
                properties:
                  day:
                    type: string
                    format: date
      required:
        - from
        - to
        - time_zone
        - partial
        - kpis
        - previous
        - series
    NotifyProjectBilling:
      type: object
      required:
        - status
        - notifications_cap
      properties:
        subscription_item_id:
          type:
            - string
            - "null"
        subscription_id:
          type:
            - string
            - "null"
        status:
          type: string
          enum:
            - draft
            - active
            - past_due
            - read_only
        notifications_cap:
          type: integer
          minimum: 0
          description: Legacy volume allowance; a compatibility SKU marker, not a volume ceiling, for usage-credit plans.
        renewal_notifications_cap:
          type: integer
          minimum: 0
          description: Legacy allowance selected for the next period; a compatibility marker for usage-credit plans.
        billing_model:
          type: string
          const: usage_credits
        enabled:
          type: boolean
        included_monthly_credits:
          type: integer
          minimum: 0
          description: This paid project's contribution to the company's shared monthly allowance.
        renewal_included_monthly_credits:
          type: integer
          minimum: 0
          description: The project's contribution when its plan renews.
        current_period_end:
          type:
            - integer
            - "null"
        cancel_at_period_end:
          type: boolean
        price_id:
          type:
            - string
            - "null"
        stripe_product_id:
          type:
            - string
            - "null"
        tier_price_id:
          type:
            - string
            - "null"
        legacy:
          type: boolean
          description: Default uses the company's existing Notify plan.
    NotifyProject:
      type: object
      required:
        - project_id
        - account_id
        - name
        - description
        - sender_name
        - status
        - created_at
        - updated_at
        - billing
        - usage
      properties:
        project_id:
          type: string
          pattern: ^(?:default|ntp_[A-Za-z0-9_-]+)$
          maxLength: 128
        account_id:
          type: string
        name:
          type: string
          minLength: 1
          maxLength: 80
        description:
          type: string
          maxLength: 240
        sender_name:
          type:
            - string
            - "null"
          maxLength: 64
          description: Project sender display name. Null uses the organization name; reserved platform names are refused.
        status:
          type: string
          enum:
            - draft
            - active
            - read_only
            - archived
        created_at:
          type: integer
          minimum: 0
        updated_at:
          type: integer
          minimum: 0
        archived_at:
          type: integer
          minimum: 0
        billing:
          $ref: "#/components/schemas/NotifyProjectBilling"
        usage:
          type: object
          required:
            - notifications_used
            - cycle_resets_at
          properties:
            notifications_used:
              type: integer
              minimum: 0
            cycle_resets_at:
              type:
                - integer
                - "null"
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: SparkVault API key (create one at https://app.sparkvault.com/api/keys).
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: SparkVault session JWT issued by the auth endpoints.
    VaultAccessToken:
      type: apiKey
      in: header
      name: X-Vault-Access-Token
      description: Vault Access Token minted by POST /vaults/{id}/unseal; required for ingot operations.
    IdentityPortalToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: "Identity Portal access token, issued to the portal client by the Identity token endpoint. It names the person (SVID) and the directory session it was minted for, and stops working the moment that session is revoked. Distinct from the SparkVault session JWT: it grants a person control of their own identity record, never access to a company account."
    IdentityAccessToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Identity access token issued to an end user by the tenant they signed in to, addressed to that tenant, and only usable while the session behind it is live. Sent as a Bearer credential (RFC 6750 section 2.1); the UserInfo endpoint additionally accepts it as an `access_token` form field on POST (RFC 6750 section 2.2), and requires the `openid` scope.
    OidcClientSecretBasic:
      type: http
      scheme: basic
      description: 'OIDC client authentication as client_secret_basic (RFC 6749 section 2.3.1): the registered client_id and client_secret, HTTP Basic. A client registered for client_secret_post sends the same credentials in the form body instead, which is not an HTTP authentication scheme. On the token and revocation endpoints an empty alternative also stands, because a public client (token_endpoint_auth_method "none") presents no secret at all and is bound to its authorization code by PKCE. Introspection carries no such alternative: it refuses a public client outright (RFC 7662 section 2.1), so a secret is always required there, by one method or the other.'
    HelpDeskCustomerToken:
      type: http
      scheme: bearer
      description: "A help desk customer's credential, as the sign-in routes of their desk answered it: the help desk session token (`hdt_…`) an emailed code or a Secure Identity sign-in opened. It is read on every request at the desk the path names and nowhere else; a customer never holds a SparkVault session JWT."
    IdentityHubSessionCookie:
      type: apiKey
      in: cookie
      name: __Host-authsv_sso
      description: First-party, host-locked, HttpOnly SameSite=Lax cookie carrying this browser's roster of signed-in identities. It is the credential for the account-chooser actions, which answer 401 without it; the browser sends it automatically on same-origin requests to the Identity origin, and no other site can read or send it.
    HubSpotRequestSignature:
      type: apiKey
      in: header
      name: X-HubSpot-Signature-v3
      description: HubSpot v3 request signature, sent with X-HubSpot-Request-Timestamp. Proves the call was made by HubSpot on behalf of the installing portal; verified against the app client secret over the method, URI, and body, within a freshness window.
    SalesforcePanelSecret:
      type: http
      scheme: bearer
      description: "The Salesforce org's panel secret, which SparkVault writes into the org's SparkVault External Credential at Connect and Refresh connection and Salesforce adds to every panel callout; checked against the hash the org's installation stores. An org credential, not a SparkVault one: these routes are called by Salesforce, never by an API client."
