openapi: 3.1.0
info:
  title: HESigns integration API
  version: 0.7.0
  description: Database-backed v2 integration runtime with a separate
    authenticated sender workspace. Locally validated; public deployment and
    independent production review remain pending. Up to 10 PDFs, 25 signers and
    200 fields. Optional email-code authentication, service PDF seals and
    RFC3161 timestamps. No claim of qualified signatures or verified legal
    identity.
servers:
  - url: https://hesigns.homeequal.ai
    description: Intended production origin; deployment pending
security:
  - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
    mcpBearer:
      type: http
      scheme: bearer
      description: An expiring HESigns key limited to review:read and review:write,
        for review services that cannot run OAuth
    scimBearer:
      type: http
      scheme: bearer
      description: Expiring HESigns key with provisioning:manage scope
    oauth2:
      type: oauth2
      description: Each person approves a tool for themselves. Tokens last one hour;
        refresh tokens rotate and last 30 days. A repeated authorization code
        revokes everything it produced.
      flows:
        authorizationCode:
          authorizationUrl: /oauth/authorize
          tokenUrl: /oauth/token
          refreshUrl: /oauth/token
          scopes:
            review:read: Read agreements, versions, text and comparisons
            review:write: Comment and propose revisions
            envelopes:read: "HESigns for Word only: read drafts"
            envelopes:write: "HESigns for Word only: work on drafts"
  parameters:
    requestId:
      in: path
      name: id
      required: true
      schema:
        type: string
        pattern: ^hs_[a-f0-9-]{36}$
    idempotencyKey:
      in: header
      name: Idempotency-Key
      required: true
      schema:
        type: string
        maxLength: 200
    agentName:
      in: header
      name: HE-Signs-Agent
      required: false
      schema:
        type: string
        maxLength: 120
      description: Name of the AI agent or review service acting, such as Harvey. Its
        comments and proposals are credited to it, and it cannot accept, reject
        or revise.
    onBehalfOf:
      in: header
      name: HE-Signs-On-Behalf-Of
      required: false
      schema:
        type: string
        maxLength: 120
      description: The person the agent works for, shown with its comments and proposals.
  schemas:
    AgreementTemplateInput:
      type: object
      required:
        - name
        - roles
        - routing
      description: A fixed-PDF template sends document or documents with fields; a
        questionnaire template sends composition instead, and its fields are
        placed by the document. Recipient names and emails are never stored.
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 120
        description:
          type: string
          maxLength: 300
        base_version:
          type: integer
          minimum: 1
          description: Required for PUT; must equal the latest stored version
        document:
          type: object
          required:
            - name
            - base64
          properties:
            name:
              type: string
              maxLength: 200
            base64:
              type: string
              description: PDF up to 8 MiB decoded and 100 pages
        roles:
          type: array
          minItems: 1
          maxItems: 25
          items:
            type: object
            required:
              - key
              - name
            properties:
              key:
                type: string
                pattern: ^[a-z][a-z0-9_]{0,39}$
                description: Unique stable key used for recipient assignments
              name:
                type: string
                minLength: 1
                maxLength: 60
                description: Unique display name such as Client or Provider
              locale:
                type: string
                enum:
                  - en
                  - es
                  - fr
                  - ar
                default: en
              authentication:
                type: string
                enum:
                  - private_link
                  - email_otp
                default: private_link
                description: Email codes require configured mail and the database runtime.
                  Mailbox access does not independently establish legal
                  identity.
              allow_delegation:
                type: boolean
                default: false
              routing_order:
                type: integer
                minimum: 1
                maximum: 25
                description: Required with groups routing. All people in earlier groups must
                  finish.
              attachment_requests:
                type: array
                maxItems: 3
                items:
                  $ref: "#/components/schemas/AttachmentRequest"
        routing:
          type: string
          enum:
            - parallel
            - sequential
            - groups
        fields:
          type: array
          minItems: 1
          maxItems: 200
          items:
            $ref: "#/components/schemas/EnvelopeField"
        documents:
          type: array
          minItems: 1
          maxItems: 10
          items:
            type: object
            required:
              - name
              - base64
            properties:
              name:
                type: string
                maxLength: 200
              base64:
                type: string
                description: PDF up to 8 MiB decoded and 100 pages
          description: "PDFs in final order. Combined decoded sources: 8 MiB and 100
            pages. Fields use page numbers in the combined packet."
        composition:
          $ref: "#/components/schemas/TemplateComposition"
        category:
          type: string
          maxLength: 40
        jurisdiction:
          type: string
          maxLength: 120
        tags:
          type: array
          maxItems: 12
          items:
            type: string
            maxLength: 30
        usage_notes:
          type: string
          maxLength: 2000
          description: When your team should use this template
        change_note:
          type: string
          maxLength: 300
          description: What changed in this version
        import_source:
          type: object
          description: "From /v2/templates/convert, for a new template: recorded as its
            source."
          properties:
            format:
              enum:
                - docx
                - dotx
                - docm
                - dotm
                - txt
            file_name:
              type: string
              maxLength: 200
            sha256:
              type: string
              pattern: ^[a-f0-9]{64}$
      oneOf:
        - required:
            - document
          not:
            anyOf:
              - required:
                  - documents
              - required:
                  - composition
        - required:
            - documents
          not:
            anyOf:
              - required:
                  - document
              - required:
                  - composition
        - required:
            - composition
          not:
            anyOf:
              - required:
                  - document
              - required:
                  - documents
    AgreementTemplate:
      type: object
      properties:
        id:
          type: string
        version:
          type: integer
        latest_version:
          type: integer
        name:
          type: string
        description:
          type: string
        archived:
          type: boolean
        document_name:
          type: string
        sha256:
          type: string
        page_count:
          type: integer
        roles:
          type: array
          items:
            type: object
            properties:
              key:
                type: string
              name:
                type: string
        routing:
          type: string
        fields:
          type: array
          items:
            $ref: "#/components/schemas/EnvelopeField"
        created_at:
          type: string
          format: date-time
        saved_at:
          type: string
          format: date-time
        versions:
          type: array
          description: Present on single-template reads
          items:
            type: object
            properties:
              version:
                type: integer
              name:
                type: string
              saved_at:
                type: string
                format: date-time
        kind:
          type: string
          enum:
            - assembled
          description: Present on questionnaire templates
        composition_sha256:
          type: string
        assembly:
          type: object
          description: Questions, required questions, interview sections, clause choices,
            compliance notes and execution advice
        category:
          type: string
        jurisdiction:
          type: string
        tags:
          type: array
          items:
            type: string
        usage_notes:
          type: string
        change_note:
          type: string
        saved_by:
          type: string
        updated_at:
          type: string
          format: date-time
        source:
          type: object
          description: "{kind: catalog, key, version}, {kind: duplicate, template_id,
            version} or {kind: import}"
        approval:
          oneOf:
            - $ref: "#/components/schemas/TemplateApproval"
            - type: "null"
        require_approval:
          type: boolean
        pinned:
          type: boolean
        approval_history:
          type: array
          items:
            type: object
            properties:
              action:
                enum:
                  - approved
                  - withdrawn
                  - required
                  - optional
              version:
                type: integer
              at:
                type: string
                format: date-time
              by:
                type: string
              note:
                type: string
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
    Field:
      type: object
      required:
        - page
        - x
        - y
        - width
        - height
      description: Coordinates in PDF points from the bottom left of an unrotated page.
      properties:
        page:
          type: integer
          minimum: 1
        x:
          type: number
          minimum: 0
        y:
          type: number
          minimum: 0
        width:
          type: number
          minimum: 180
        height:
          type: number
          minimum: 48
    CreateRequest:
      type: object
      required:
        - client_reference
        - document
        - participant
        - field
      properties:
        client_reference:
          type: string
          maxLength: 200
        document:
          type: object
          required:
            - name
            - base64
          properties:
            name:
              type: string
              maxLength: 200
            base64:
              type: string
              description: Base64 PDF bytes, maximum 8 MiB decoded
        participant:
          type: object
          required:
            - name
            - email
          properties:
            name:
              type: string
              maxLength: 120
            email:
              type: string
              format: email
        field:
          $ref: "#/components/schemas/Field"
        sender_authorization:
          type: object
          description: Required when a tenant has enrolled a customer Ed25519 public key.
          required:
            - signature
          properties:
            signature:
              type: string
              description: Base64 Ed25519 signature over canonical manifest UTF-8 bytes
    RequestStatus:
      type: object
      required:
        - id
        - client_reference
        - status
        - document_name
        - participant
        - created_at
        - expires_at
      properties:
        id:
          type: string
        client_reference:
          type: string
        status:
          type: string
          enum:
            - ready_for_delivery
            - sent
            - in_progress
            - completed
            - declined
            - voided
            - expired
        document_name:
          type: string
        page_count:
          type: integer
        participant:
          type: object
          properties:
            name:
              type: string
            email:
              type: string
        created_at:
          type: string
          format: date-time
        expires_at:
          type: string
          format: date-time
        completed_at:
          type:
            - string
            - "null"
          format: date-time
        declined_at:
          type:
            - string
            - "null"
          format: date-time
        voided_at:
          type:
            - string
            - "null"
          format: date-time
        expired_at:
          type:
            - string
            - "null"
          format: date-time
        terminal_reason:
          type:
            - string
            - "null"
        signer_path:
          type:
            - string
            - "null"
          description: Private link path; customer delivers it to signer
        invitation_delivery:
          type:
            - object
            - "null"
          description: Provider acceptance, failure, or attempt state
        completion_delivery:
          type:
            - object
            - "null"
          description: Signed-copy email state
        reminder_delivery:
          type:
            - object
            - "null"
          description: Bounded reminder attempts and provider acceptance
    EnvelopeField:
      type: object
      required:
        - signer
        - type
        - page
        - x
        - y
        - width
        - height
      description: Coordinates are PDF points from the bottom left of an unrotated
        page. Fields must not overlap. Full name and email are filled from
        recipient data; signed_date is the signing date in UTC. Date is entered
        by the signer. Minimum widths are signature 180, initials 90, full_name
        180, email 180, signed_date 110, date 110, text 180, checkbox 150,
        dropdown 150 points.
      properties:
        signer:
          type: integer
          minimum: 0
          maximum: 24
        type:
          type: string
          enum:
            - signature
            - initials
            - full_name
            - email
            - signed_date
            - date
            - text
            - checkbox
            - dropdown
            - radio
            - formula
            - stamp
            - prefilled
        label:
          type: string
          maxLength: 80
          description: Prompt for a date, text, checkbox or dropdown field, printed with
            the answer
        options:
          type: array
          minItems: 2
          maxItems: 25
          items:
            type: string
            maxLength: 60
          description: Dropdown only. The choices, all different; the signer picks one.
            Each must fit the field width at the answer size.
        format:
          type: string
          enum:
            - number
            - email
            - phone
            - zip
          description: Text only. The answer must be a number, an email address, a phone
            number, or a US ZIP code. Checked in the signer's browser, at
            signing, and by the verifier.
        max_length:
          type: integer
          minimum: 1
          maximum: 120
          description: Text only. Most characters the answer may have.
        hint:
          type: string
          maxLength: 160
          description: Help shown to the signer while answering. Not printed on the PDF.
        group:
          type: string
          maxLength: 40
          description: Radio only. Buttons of one signer that share a group are one
            question; the signer picks one. A group has 2 to 25 buttons with
            different labels (the label prints beside the button), and the same
            required setting and condition.
        formula:
          type: string
          maxLength: 200
          description: Formula only. Arithmetic (+ - * / and brackets) over number-format
            text fields of the same signer, each written {n} for field n, such
            as "{4} * {5}". Worked out at signing and re-checked by the
            verifier; the signer cannot edit it.
        decimals:
          type: integer
          minimum: 0
          maximum: 4
          default: 2
          description: Formula only. Decimal places shown, rounded half away from zero,
            with thousands separators.
        value:
          type: string
          maxLength: 120
          description: Prefilled only. Text the sender writes, printed as written; it is
            part of what a customer key authorizes, and the signer cannot change
            it.
        page:
          type: integer
          minimum: 1
        x:
          type: number
          minimum: 0
        y:
          type: number
          minimum: 0
        width:
          type: number
          minimum: 24
          description: Minimum depends on type; initials 24, signing dates 64, signatures
            100 points.
        height:
          type: number
          minimum: 14
          description: Minimum depends on type; initials 14, date and text fields 18,
            signatures 20; other types 44 points. Fields below 44 points print
            their value without repeating the document label.
        required:
          type: boolean
          default: true
          description: Only text, date and checkbox fields may be optional.
        condition:
          type: object
          required:
            - field
            - equals
          properties:
            field:
              type: integer
              minimum: 0
              maximum: 199
            equals:
              type:
                - string
                - boolean
          description: Show when an unconditional checkbox/text/date field of the same
            signer has this exact answer. At least one unconditional signature
            per signer remains required.
    CreateEnvelope:
      type: object
      required:
        - client_reference
        - participants
        - routing
        - fields
      properties:
        client_reference:
          type: string
          maxLength: 200
        document:
          type: object
          required:
            - name
            - base64
          properties:
            name:
              type: string
              maxLength: 200
            base64:
              type: string
              description: Base64 PDF bytes, maximum 8 MiB decoded
        routing:
          type: string
          enum:
            - parallel
            - sequential
            - groups
        expires_in_days:
          type: integer
          minimum: 1
          maximum: 120
          default: 7
          description: Days until unsigned signing links close. A completed agreement
            stays downloadable by its signers for 30 days after completion,
            whatever this deadline.
        template:
          type: object
          description: Where this agreement came from, recorded as its origin. Either an
            agreement template (id and version; the version must exist in this
            workspace, and must be the approved version when the template
            requires approval) or an agreed draft (draft_id, version and
            draft_token from /v2/drafts/{id}/finalize).
          properties:
            id:
              type: string
            version:
              type: integer
              minimum: 1
            assembly_token:
              type: string
              description: From a final draft of an assembled template. When the document is
                unchanged, the agreement records origin.assembled.verified =
                true.
            draft_id:
              type: string
              description: An agreed draft. When the document is exactly the agreed PDF, the
                agreement records origin.kind = draft and origin.verified =
                true, and the draft becomes sent.
            draft_token:
              type: string
          oneOf:
            - required:
                - id
                - version
            - required:
                - draft_id
                - version
                - draft_token
        copy_to:
          type: array
          maxItems: 10
          description: People who receive the signed copy and do nothing else. They never
            get a signing link; once everyone has finished, each is emailed a
            private link to the signed PDF and proof kit. An address already on
            the agreement is refused.
          items:
            type: object
            required:
              - name
              - email
            properties:
              name:
                type: string
                maxLength: 120
              email:
                type: string
                format: email
                maxLength: 254
        reminders:
          type: object
          required:
            - every_days
          additionalProperties: false
          description: Automatic reminders to people invited by email, every N days after
            their invitation or last reminder, at most three each, never after
            the signing deadline. Omit for none.
          properties:
            every_days:
              type: integer
              minimum: 1
              maximum: 14
        network_details:
          type: string
          enum:
            - private
            - shared
          default: private
          description: Where each signer opened and signed from (IP address and browser).
            private seals them into the proof as salted fingerprints, so
            co-signers never see them; your proof kit adds
            network-evidence.json, which the offline verifier checks against the
            proof when you choose to disclose it. shared prints the IP address
            on the signing record and includes the details in every signer's
            proof.
        participants:
          type: array
          minItems: 1
          maxItems: 25
          items:
            type: object
            required:
              - name
              - email
            properties:
              name:
                type: string
                maxLength: 120
              email:
                type: string
                format: email
              locale:
                type: string
                enum:
                  - en
                  - es
                  - fr
                  - ar
                default: en
              authentication:
                type: string
                enum:
                  - private_link
                  - email_otp
                default: private_link
                description: Email codes require configured mail and the database runtime.
                  Mailbox access does not independently establish legal
                  identity.
              allow_delegation:
                type: boolean
                default: false
              signature_level:
                type: string
                enum:
                  - qualified
                  - advanced
                description: "Require this signer to sign with their own certificate through the
                  workspace's signing provider (CSC API v2). Signers only.
                  Requires a provider that offers the level (400
                  SIGNATURE_LEVEL_UNAVAILABLE; an unknown level is 400
                  INVALID_SIGNATURE_LEVEL). Part of the sender-authorization
                  manifest when present. Such a signer signs on their own
                  signing page: an embedded session shows them a link to it, and
                  HEMeets opens it in a new tab."
              routing_order:
                type: integer
                minimum: 1
                maximum: 25
                description: Required with groups routing. All people in earlier groups must
                  finish.
              attachment_requests:
                type: array
                maxItems: 3
                items:
                  $ref: "#/components/schemas/AttachmentRequest"
              action:
                type: string
                enum:
                  - sign
                  - approve
                  - interpret
                default: sign
                description: sign places fields and signs. approve approves this exact version
                  without signing it; approvers get no fields. interpret signs
                  an interpreter statement for the signers in interprets_for.
              interprets_for:
                type: array
                minItems: 1
                maxItems: 5
                uniqueItems: true
                items:
                  type: integer
                  minimum: 0
                  maximum: 24
                description: "Required with action interpret: indices of the signers this person
                  interprets for"
              languages:
                type: array
                minItems: 2
                maxItems: 2
                items:
                  type: string
                  pattern: ^[a-z]{2,3}(-[A-Z]{2})?$
                description: 'Required with action interpret: the two languages interpreted
                  between, such as ["en","es"]'
        fields:
          type: array
          minItems: 1
          maxItems: 200
          items:
            $ref: "#/components/schemas/EnvelopeField"
        sender_authorization:
          type: object
          description: Required when this tenant has enrolled a customer Ed25519 public key.
          required:
            - signature
          properties:
            signature:
              type: string
              description: Base64 signature over the canonical v2 manifest
        documents:
          type: array
          minItems: 1
          maxItems: 10
          items:
            type: object
            required:
              - name
              - base64
            properties:
              name:
                type: string
                maxLength: 200
              base64:
                type: string
                description: Base64 PDF bytes, maximum 8 MiB decoded
          description: "PDFs in final order. Combined decoded sources: 8 MiB and 100
            pages. Fields use page numbers in the combined packet."
        machine_translation:
          type: string
          enum:
            - device
            - service
          default: device
          description: How recipients can read the document in another language. device
            uses the translation built into their browser, so the text never
            leaves their device (Chrome and Edge; other browsers show the
            original). service also offers the configured translation provider,
            which receives page text; up to 300,000 characters per agreement.
            Either way the English document is what is signed, and the proof
            records which pages were read with machine translation. Returns
            TRANSLATION_SERVICE_UNAVAILABLE when no provider is configured.
      oneOf:
        - required:
            - document
          not:
            required:
              - documents
        - required:
            - documents
          not:
            required:
              - document
    AgreementReport:
      type: object
      properties:
        period:
          type: object
          properties:
            from:
              type: string
              format: date-time
            to:
              type: string
              format: date-time
            tz:
              type: string
            bucket:
              type: string
              enum:
                - day
                - week
        generated_at:
          type: string
          format: date-time
        truncated:
          type: boolean
          description: True when the period holds more than 5,000 agreements; the newest
            5,000 are counted.
        totals:
          type: object
          properties:
            sent:
              type: integer
            completed:
              type: integer
            open:
              type: integer
            declined:
              type: integer
            voided:
              type: integer
            expired:
              type: integer
            signed_in_person:
              type: integer
            from_forms:
              type: integer
        completion_rate:
          type:
            - number
            - "null"
        closed_completion_rate:
          type:
            - number
            - "null"
        time_to_complete:
          type: object
          properties:
            count:
              type: integer
            median_hours:
              type:
                - number
                - "null"
            p90_hours:
              type:
                - number
                - "null"
            average_hours:
              type:
                - number
                - "null"
            fastest_hours:
              type:
                - number
                - "null"
        signer_response:
          type: object
          properties:
            count:
              type: integer
            median_hours:
              type:
                - number
                - "null"
            p90_hours:
              type:
                - number
                - "null"
            average_hours:
              type:
                - number
                - "null"
            fastest_hours:
              type:
                - number
                - "null"
        funnel:
          type: array
          description: Reached, opened, agreed to sign electronically, signed. Each step
            after the first says why people stopped before it.
          items:
            type: object
            properties:
              stage:
                type: string
              label:
                type: string
              count:
                type: integer
              stopped_before:
                type: object
                properties:
                  declined:
                    type: integer
                  waiting:
                    type: integer
                  closed:
                    type: integer
        declined_signers:
          type: integer
        series:
          type: array
          items:
            type: object
            properties:
              key:
                type: string
              sent:
                type: integer
              completed:
                type: integer
              open:
                type: integer
              closed:
                type: integer
        sources:
          type: array
          items:
            type: object
        documents:
          type: array
          items:
            type: object
        declines:
          type: array
          items:
            type: object
        waiting:
          type: array
          items:
            type: object
        waiting_count:
          type: integer
        delivery_failures:
          type: integer
    Brand:
      type: object
      properties:
        name:
          type: string
        color:
          type: string
          description: Lowercase hex colour.
        logo:
          type: string
          description: Path of the logo, /brand/<sha256>.png or .jpg. Absent without a logo.
        logo_width:
          type: integer
        logo_height:
          type: integer
    SigningForm:
      type: object
      properties:
        id:
          type: string
        title:
          type: string
        description:
          type: string
        template_id:
          type: string
        template_version:
          type: integer
        template_name:
          type: string
        public_role:
          type: string
          description: The template role the person filling in the form takes. They sign
            first.
        public_role_name:
          type: string
        fixed:
          type: object
          description: Name and email for every other role, keyed by role key.
          additionalProperties:
            type: object
            properties:
              name:
                type: string
              email:
                type: string
        limit:
          type:
            - integer
            - "null"
        expires_at:
          type:
            - string
            - "null"
          format: date-time
        active:
          type: boolean
        submissions:
          type: integer
          description: Agreements started from this form.
        path:
          type: string
          description: The public link, /f/{token}. A new link closes the old one.
    EnvelopeStatus:
      type: object
      properties:
        id:
          type: string
        kind:
          type: string
          const: envelope
        status:
          type: string
          enum:
            - ready_for_delivery
            - in_progress
            - completed
            - declined
            - voided
            - expired
        customer_authorized:
          type: boolean
        assurance:
          type: object
          description: What protects completed.pdf once everyone has signed
          properties:
            pdf_seal:
              type: boolean
              description: The HESigns service seal is embedded
            timestamp:
              type: boolean
              description: An RFC 3161 timestamp was obtained
            certificate_signatures:
              type: integer
              description: Signer certificate signatures embedded in completed.pdf
        routing:
          type: string
          enum:
            - parallel
            - sequential
        client_reference:
          type: string
        document_name:
          type: string
        page_count:
          type: integer
        fields:
          type: array
          items:
            $ref: "#/components/schemas/EnvelopeField"
        participants:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
              name:
                type: string
              email:
                type: string
                format: email
              status:
                type: string
                enum:
                  - ready
                  - waiting
                  - sent
                  - opened
                  - signed
                  - declined
                description: "signed means this person finished: signed, approved, or signed the
                  interpreter statement."
              signer_path:
                type:
                  - string
                  - "null"
                description: Private path for this signer
              signature_level:
                type: string
                enum:
                  - qualified
                  - advanced
              certificate_signature:
                type: object
                description: Present once the signer's certificate signature is recorded.
                properties:
                  level:
                    type: string
                    enum:
                      - qualified
                      - advanced
                  pades:
                    type: string
                    enum:
                      - B-B
                      - B-T
                      - B-LT
                  provider:
                    type:
                      - string
                      - "null"
                  name:
                    type: string
                    description: Certificate common name
                  issuer:
                    type: string
                  qualified_certificate:
                    type: boolean
                    description: The certificate carries QcCompliance and QcSSCD (and the
                      e-signature type when typed)
                  trust_list:
                    type:
                      - string
                      - "null"
                    description: Status found on the configured EU trusted list, e.g. granted; null
                      when none is configured
                  timestamp:
                    type:
                      - string
                      - "null"
                    format: date-time
              certificate_signing:
                type: object
                description: Present while the signer is confirming at the provider.
                properties:
                  step:
                    type: string
                    enum:
                      - sign_in
                      - preparing
                      - choose
                      - approve
                  started_at:
                    type: string
                    format: date-time
                  problem:
                    type:
                      - string
                      - "null"
                    enum:
                      - cancelled
                      - expired
                      - session_expired
                      - unavailable
                      - rejected
                      - invalid_response
                      - no_certificate
                      - wrong_certificate
                      - signature_mismatch
                      - document_changed
                      - moved_on
                      - busy
                      - closed
                      - internal
                      - null
              invitation_delivery:
                type:
                  - object
                  - "null"
              reminder_delivery:
                type:
                  - object
                  - "null"
                description: Attempts and accepted reminders for this signer
              next_reminder_at:
                type:
                  - string
                  - "null"
                format: date-time
                description: When the next automatic reminder is due, if one is scheduled
              completion_delivery:
                type:
                  - object
                  - "null"
              action:
                type: string
                enum:
                  - sign
                  - approve
                  - interpret
              interprets_for:
                type: array
                items:
                  type: integer
              languages:
                type: array
                items:
                  type: string
              approved_version:
                type: integer
                description: The version an approver approved
        created_at:
          type: string
          format: date-time
        expires_at:
          type: string
          format: date-time
        completed_at:
          type:
            - string
            - "null"
          format: date-time
        copy_access_until:
          type: string
          format: date-time
          description: Present once completed. Signer and copy links serve the signed PDF
            and proof kit until this time.
        reminders:
          type:
            - object
            - "null"
          properties:
            every_days:
              type: integer
        origin:
          type: object
          description: Present when the agreement was started from a public signing form,
            a template, or a bulk send from a template.
          properties:
            kind:
              type: string
              enum:
                - signing_form
                - template
            form_id:
              type: string
            title:
              type: string
            template_id:
              type: string
            template_version:
              type: integer
            name:
              type: string
        copy_to:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
              name:
                type: string
              email:
                type: string
              delivery:
                type:
                  - object
                  - "null"
                description: The signed-copy email, sent once everyone has finished
              copy_path:
                type:
                  - string
                  - "null"
                description: Private, read-only path to the signed copy once completed
        network_details:
          type: string
          enum:
            - private
            - shared
        machine_translation:
          type: string
          enum:
            - device
            - service
        current_version:
          type: integer
          minimum: 1
          maximum: 20
          description: The version out for signature. Revising resets everyone who had not
            finished.
        versions:
          type: array
          items:
            $ref: "#/components/schemas/DocumentVersion"
        proposals:
          type: array
          items:
            $ref: "#/components/schemas/Proposal"
        open_comments:
          type: integer
    AttachmentRequest:
      type: object
      required:
        - label
      properties:
        label:
          type: string
          minLength: 1
          maxLength: 100
        required:
          type: boolean
          default: true
    ReviewAuthor:
      type: object
      required:
        - kind
      properties:
        kind:
          type: string
          enum:
            - sender
            - agent
        name:
          type: string
          maxLength: 120
        on_behalf_of:
          type: string
          maxLength: 120
    DocumentVersion:
      type: object
      properties:
        number:
          type: integer
          minimum: 1
          maximum: 20
        sha256:
          type: string
        document_name:
          type: string
        page_count:
          type: integer
        created_at:
          type: string
          format: date-time
        source:
          type: string
          enum:
            - created
            - revision
            - proposal
        author:
          $ref: "#/components/schemas/ReviewAuthor"
        summary:
          type: string
          maxLength: 300
        proposal:
          type: string
          description: The accepted proposal this version came from
    ComparisonStats:
      type: object
      properties:
        changes:
          type: integer
        words_added:
          type: integer
        words_removed:
          type: integer
        flagged:
          type: integer
          description: Changes that touch an amount, date, percentage or obligation
    Proposal:
      type: object
      properties:
        id:
          type: string
        number:
          type: integer
          minimum: 1
          maximum: 20
        status:
          type: string
          enum:
            - pending
            - accepted
            - rejected
        base_version:
          type: integer
        sha256:
          type: string
        document_name:
          type: string
        page_count:
          type: integer
        summary:
          type: string
          maxLength: 300
        explanation:
          type: string
          maxLength: 4000
        author:
          $ref: "#/components/schemas/ReviewAuthor"
        created_at:
          type: string
          format: date-time
        stats:
          oneOf:
            - $ref: "#/components/schemas/ComparisonStats"
            - type: "null"
        decided_at:
          type: string
          format: date-time
        decided_by:
          $ref: "#/components/schemas/ReviewAuthor"
        reason:
          type: string
          maxLength: 500
        version:
          type: integer
          description: The version created when the proposal was accepted
    ReviewComment:
      type: object
      properties:
        id:
          type: string
        version:
          type: integer
        page:
          type:
            - integer
            - "null"
        quote:
          type: string
          maxLength: 500
        comment:
          type: string
          maxLength: 2000
        suggested_text:
          type: string
          maxLength: 2000
        author:
          $ref: "#/components/schemas/ReviewAuthor"
        created_at:
          type: string
          format: date-time
        status:
          type: string
          enum:
            - open
            - resolved
        resolved_at:
          type: string
          format: date-time
        resolved_by:
          $ref: "#/components/schemas/ReviewAuthor"
    Change:
      type: object
      properties:
        id:
          type: string
          pattern: ^chg_[0-9]{3,}$
        number:
          type: integer
        kind:
          type: string
          enum:
            - insert
            - delete
            - replace
        before:
          type: string
        after:
          type: string
        context_before:
          type: string
        context_after:
          type: string
        page:
          type:
            - integer
            - "null"
          description: Page in the newer document
        before_page:
          type:
            - integer
            - "null"
          description: Page in the older document
        section:
          type:
            - string
            - "null"
          description: Nearest numbered heading before the change
        flags:
          type: array
          items:
            type: string
            enum:
              - amount
              - date
              - percentage
              - obligation
        words_added:
          type: integer
        words_removed:
          type: integer
    Comparison:
      type: object
      description: Word-by-word comparison of the text in two PDFs. Layout, spacing,
        line breaks and images are not compared.
      properties:
        method:
          type: string
        from:
          type: object
          properties:
            version:
              type: integer
            proposal:
              type: string
            sha256:
              type: string
        to:
          type: object
          properties:
            version:
              type: integer
            proposal:
              type: string
            sha256:
              type: string
        identical:
          type: boolean
        text:
          type: object
          properties:
            from_sha256:
              type: string
            to_sha256:
              type: string
        pages_without_text:
          type: object
          description: Scanned pages with no text layer; their changes cannot be detected
          properties:
            from:
              type: array
              items:
                type: integer
            to:
              type: array
              items:
                type: integer
        stats:
          $ref: "#/components/schemas/ComparisonStats"
        changes:
          type: array
          items:
            $ref: "#/components/schemas/Change"
        changes_sha256:
          type: string
          description: SHA-256 of the canonical change list bound to both file hashes. A
            person who read an earlier version acknowledges this value when they
            finish.
    ReviewAgreement:
      type: object
      description: "What a reviewer or AI agent sees: the document and its review
        state. Never signing links, email addresses or delivery details."
      properties:
        id:
          type: string
        kind:
          const: envelope
        document_name:
          type: string
        status:
          type: string
        created_at:
          type: string
          format: date-time
        expires_at:
          type: string
          format: date-time
        current_version:
          type: integer
        page_count:
          type: integer
        versions:
          type: array
          items:
            $ref: "#/components/schemas/DocumentVersion"
        participants:
          type: array
          items:
            type: object
            properties:
              index:
                type: integer
              name:
                type: string
              action:
                type: string
                enum:
                  - sign
                  - approve
                  - interpret
              status:
                type: string
              approved_version:
                type: integer
        proposals:
          type: array
          items:
            $ref: "#/components/schemas/Proposal"
        comments:
          type: array
          items:
            $ref: "#/components/schemas/ReviewComment"
        open_comments:
          type: integer
          description: Listing only; the listing omits comments
    MeetingParticipantInput:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          maxLength: 120
        email:
          type: string
          format: email
          description: Needed to send an invitation, and for anyone who will sign
        role:
          type: string
          enum:
            - host
            - mediator
            - attorney
            - client
            - party
            - interpreter
            - observer
            - notary
            - principal
            - witness
          default: party
          description: "host and mediator run the meeting: admit people, move them between
            rooms, ask to record, draft the agreement and end it. notary,
            principal and witness are only for notarization meetings, where the
            notary runs the meeting"
        represents:
          type: string
          maxLength: 120
          description: The party this person represents, as stated
        side:
          type: string
          maxLength: 60
        bar_number:
          type: string
          maxLength: 40
          description: As stated; HESigns does not verify it
        locale:
          type: string
          enum:
            - en
            - es
            - pt
            - fr
            - ar
          default: en
        phone:
          type: string
          maxLength: 24
          description: Used only to prepare a WhatsApp message with the link
        signer_index:
          type: integer
          description: "With agreement_id: which recipient of that agreement this person is"
    CreateMeeting:
      type: object
      required:
        - title
        - participants
      properties:
        title:
          type: string
          maxLength: 160
        purpose:
          type: string
          enum:
            - signing
            - mediation
            - closing
            - consultation
            - general
            - notarization
          default: signing
        matter_number:
          type: string
          maxLength: 60
        scheduled_at:
          type: string
          format: date-time
          description: Defaults to now; up to a year ahead
        duration_minutes:
          type: integer
          minimum: 15
          maximum: 600
          default: 60
        time_zone:
          type: string
          default: UTC
          description: IANA zone used in invitations
        agreement_id:
          type: string
          description: An agreement to sign in the meeting
        notarization:
          type: object
          description: "With purpose notarization (agreement_id required): online
            notarization of that agreement. The waiting room, recording with
            consent and no caucus are forced on. 409 NOTARIZATION_UNAVAILABLE
            when the deployment does not offer it. Each notary's commission and
            any state approval to notarize online are legal steps outside the
            software."
          properties:
            notary_member:
              type: string
              description: The workspace member who notarizes; defaults to the person
                scheduling
            act_type:
              type: string
              description: The notarial act, such as acknowledgment or jurat
        options:
          type: object
          properties:
            lobby:
              type: boolean
              default: true
              description: "Waiting room: the host admits each person once"
            recording:
              type: string
              enum:
                - off
                - with_consent
              default: off
              description: "with_consent: recording starts only after everyone present agrees,
                on the host’s device"
            captions:
              type: boolean
              default: true
              description: Captions recognised on each speaker’s device only
            caucus:
              type: boolean
              description: Private rooms with their own keys; defaults to true for mediation
            legal:
              type: boolean
              description: Legal wording (matter number, counsel, bar numbers, attorneys' eyes
                only) and a draft court certification in the closing binder;
                defaults to true for mediation, plain wording otherwise
            reminder_minutes:
              type: integer
              enum:
                - 0
                - 15
                - 30
                - 60
                - 1440
              default: 60
              description: Minutes before the start; 0 disables reminders. Delivered only to
                emailed participants who have not declined.
        brand:
          type: object
          properties:
            name:
              type: string
              maxLength: 80
            accent:
              type: string
              pattern: ^#[0-9a-fA-F]{6}$
              description: Buttons and accents; trust colors stay fixed
        participants:
          type: array
          minItems: 1
          maxItems: 25
          items:
            $ref: "#/components/schemas/MeetingParticipantInput"
    Meeting:
      type: object
      description: Meeting details. Private join_path values require meetings:write;
        read-only credentials and workspace viewers receive null links.
      properties:
        id:
          type: string
          pattern: ^mtg_[a-f0-9-]{36}$
        kind:
          const: meeting
        title:
          type: string
        purpose:
          type: string
        notarization:
          type:
            - object
            - "null"
          description: "Notarization meetings: the owner's summary of the act (status, act
            type, notary)"
        matter_number:
          type:
            - string
            - "null"
        scheduled_at:
          type: string
          format: date-time
        duration_minutes:
          type: integer
        time_zone:
          type: string
        status:
          type: string
          enum:
            - scheduled
            - live
            - ended
            - cancelled
        started_at:
          type:
            - string
            - "null"
        ended_at:
          type:
            - string
            - "null"
        options:
          type: object
        agreement_id:
          type:
            - string
            - "null"
        agreements:
          type: array
          items:
            type: string
        participants:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              name:
                type: string
              role:
                type: string
                enum:
                  - host
                  - mediator
                  - attorney
                  - client
                  - party
                  - interpreter
                  - observer
              email:
                type:
                  - string
                  - "null"
              represents:
                type:
                  - string
                  - "null"
              room:
                type: string
              join_path:
                type:
                  - string
                  - "null"
                description: Private bearer link; null for read-only callers and once cancelled.
                  Replace a leaked one with new-link.
              admitted:
                type: boolean
              invitation_delivery:
                type:
                  - object
                  - "null"
                properties:
                  state:
                    type: string
                    enum:
                      - queued
                      - retrying
                      - sent
                      - failed
                      - cancelled
                      - update_needed
                  kind:
                    type: string
                    enum:
                      - invite
                      - update
                      - cancel
                      - reminder
                  at:
                    type: string
                    format: date-time
                  code:
                    type: string
              reminder_delivery:
                type:
                  - object
                  - "null"
                properties:
                  state:
                    type: string
                    enum:
                      - queued
                      - retrying
                      - sent
                      - failed
                      - cancelled
                      - update_needed
                  kind:
                    type: string
                    enum:
                      - invite
                      - update
                      - cancel
                      - reminder
                  at:
                    type: string
                    format: date-time
                  code:
                    type: string
              rsvp:
                type:
                  - object
                  - "null"
                properties:
                  status:
                    type: string
                    enum:
                      - accepted
                      - tentative
                      - declined
                  at:
                    type: string
                    format: date-time
        rooms:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              name:
                type: string
        recordings:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              started_at:
                type: string
              stopped_at:
                type:
                  - string
                  - "null"
              recorded_by:
                type: string
              sha256:
                type:
                  - string
                  - "null"
              retained_by_he_signs:
                type: boolean
                description: "Notarization: the recording of the act was uploaded encrypted and
                  is retained by HESigns"
        sealed:
          type:
            - object
            - "null"
          properties:
            sha256:
              type: string
            sealed_at:
              type: string
        revision:
          type: integer
          minimum: 1
          description: Send this revision when editing details or adding participants;
            stale edits return 409.
    MeetingRecord:
      type: object
      description: The sealed meeting record, signed with the HESigns Ed25519 key
        over canonical JSON of evidence
      properties:
        evidence:
          type: object
          properties:
            schema:
              const: he-meets-record-v1
            final:
              type: boolean
              description: false for a snapshot of a meeting that has not ended
            sealed_at:
              type: string
            key_id:
              type: string
            meeting:
              type: object
            participants:
              type: array
              items:
                type: object
            attendance:
              type: array
              items:
                type: object
                properties:
                  participant:
                    type: string
                  room:
                    type: string
                  joined_at:
                    type: string
                  left_at:
                    type:
                      - string
                      - "null"
                  source:
                    type: string
                    enum:
                      - media_server
                      - participant_browser
            encryption:
              type: object
              properties:
                server_holds_keys:
                  const: false
            security_codes:
              type: array
              items:
                type: object
            recording_consents:
              type: array
              items:
                type: object
            recordings:
              type: array
              items:
                type: object
                properties:
                  sha256:
                    type:
                      - string
                      - "null"
                  stored_by_he_signs:
                    const: false
            wire_confirmations:
              type: array
              items:
                type: object
                properties:
                  details_sha256:
                    type: string
                  shared_by:
                    type: string
                  confirmed_by:
                    type: string
                  security_code:
                    type: string
                  at:
                    type: string
            agreements:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  status:
                    type: string
                  proof_sha256:
                    type:
                      - string
                      - "null"
            events:
              type: array
              items:
                type: object
            statement:
              type: string
        signature:
          type: string
        key_id:
          type: string
        algorithm:
          const: Ed25519
        sha256:
          type: string
    UpdateMeeting:
      type: object
      required:
        - revision
        - title
        - scheduled_at
        - duration_minutes
        - time_zone
        - options
        - participants
      properties:
        title:
          type: string
          maxLength: 160
        purpose:
          type: string
          enum:
            - signing
            - mediation
            - closing
            - consultation
            - general
            - notarization
          default: signing
        matter_number:
          type: string
          maxLength: 60
        scheduled_at:
          type: string
          format: date-time
          description: Defaults to now; up to a year ahead
        duration_minutes:
          type: integer
          minimum: 15
          maximum: 600
          default: 60
        time_zone:
          type: string
          default: UTC
          description: IANA zone used in invitations
        agreement_id:
          type:
            - string
            - "null"
        options:
          type: object
          properties:
            lobby:
              type: boolean
              default: true
              description: "Waiting room: the host admits each person once"
            recording:
              type: string
              enum:
                - off
                - with_consent
              default: off
              description: "with_consent: recording starts only after everyone present agrees,
                on the host’s device"
            captions:
              type: boolean
              default: true
              description: Captions recognised on each speaker’s device only
            caucus:
              type: boolean
              description: Private rooms with their own keys; defaults to true for mediation
            legal:
              type: boolean
              description: Legal wording (matter number, counsel, bar numbers, attorneys' eyes
                only) and a draft court certification in the closing binder;
                defaults to true for mediation, plain wording otherwise
            reminder_minutes:
              type: integer
              enum:
                - 0
                - 15
                - 30
                - 60
                - 1440
              default: 60
              description: Minutes before the start; 0 disables reminders. Delivered only to
                emailed participants who have not declined.
        brand:
          type: object
          properties:
            name:
              type: string
              maxLength: 80
            accent:
              type: string
              pattern: ^#[0-9a-fA-F]{6}$
              description: Buttons and accents; trust colors stay fixed
        participants:
          type: array
          minItems: 1
          maxItems: 25
          items:
            allOf:
              - $ref: "#/components/schemas/MeetingParticipantInput"
              - type: object
                properties:
                  id:
                    type: string
                    description: Keep the existing ID to preserve that person and their link. An
                      email change replaces their link.
        revision:
          type: integer
          minimum: 1
    TemplateComposition:
      type: object
      required:
        - title
        - blocks
      description: A document written as blocks that HESigns drafts into a PDF. Text
        may use {{question}}, {{question | words}} (amounts in words),
        {{question | upper}}, {{role.name}}, {{role.email}}, **bold**, and
        inline {{#if question}}…{{else}}…{{/if}} or {{#if question ==
        "value"}}…{{/if}}. Signature, name, date, initials, checkbox and fill-in
        fields are placed where the blocks print them. The same composition and
        answers always draft the same bytes.
      properties:
        schema:
          const: he-signs-composition-v1
        title:
          type: string
          maxLength: 120
        short_title:
          type: string
          maxLength: 60
        variables:
          type: array
          maxItems: 60
          items:
            type: object
            required:
              - key
              - label
            properties:
              key:
                type: string
                pattern: ^[a-z][a-z0-9_]{0,39}$
              label:
                type: string
                maxLength: 80
              type:
                type: string
                enum:
                  - text
                  - longtext
                  - date
                  - money
                  - number
                  - percent
                  - choice
                  - boolean
                  - email
                  - phone
                default: text
              required:
                type: boolean
                default: true
              group:
                type: string
                maxLength: 60
              hint:
                type: string
                maxLength: 200
              options:
                type: array
                minItems: 2
                maxItems: 25
                items:
                  type: object
                  properties:
                    key:
                      type: string
                    label:
                      type: string
              default:
                description: An answer used when none is given. A date may default to "today".
              currency:
                type: string
                pattern: ^[A-Z]{3}$
                default: USD
              decimals:
                type: integer
                minimum: 0
                maximum: 4
              show_if:
                type: object
                description: Ask only when an earlier question is answered, equals, or does not
                  equal a value.
                properties:
                  variable:
                    type: string
                  equals: {}
                  not: {}
        blocks:
          type: array
          maxItems: 600
          items:
            type: object
            required:
              - type
            properties:
              type:
                type: string
                enum:
                  - heading
                  - paragraph
                  - section
                  - list
                  - if
                  - slot
                  - notice
                  - table
                  - fill
                  - checkboxes
                  - signatures
                  - page_break
                  - spacer
            description: section {title, body}; if {when, blocks, else}; slot {key, label,
              options:[{key, title, description, blocks}], default}; fill {role,
              kind, label}; checkboxes {role, items}; signatures {roles:[role or
              {role, heading, by}], columns, lines}. Every signing role needs a
              signature block.
        options:
          type: object
          properties:
            font:
              enum:
                - times
                - helvetica
            initials_each_page:
              type: array
              items:
                type: string
              maxItems: 4
        meta:
          type: object
          properties:
            summary:
              type: string
            jurisdiction:
              type: string
            tags:
              type: array
              items:
                type: string
            compliance:
              type: array
              maxItems: 20
              items:
                type: object
                properties:
                  level:
                    enum:
                      - required
                      - recommended
                      - info
                  title:
                    type: string
                  detail:
                    type: string
                  source:
                    type: string
            execution:
              type: object
              properties:
                esign:
                  enum:
                    - sufficient
                    - check
                    - not_sufficient
                notes:
                  type: string
    TemplateApproval:
      type: object
      properties:
        version:
          type: integer
        approved_at:
          type: string
          format: date-time
        approved_by:
          type: string
        note:
          type: string
    AssembledDraft:
      type: object
      description: A document drafted from an assembled template.
      properties:
        document:
          type: object
          properties:
            name:
              type: string
            base64:
              type: string
            sha256:
              type: string
            page_count:
              type: integer
        fields:
          type: array
          items:
            $ref: "#/components/schemas/EnvelopeField"
        choices:
          type: object
          additionalProperties:
            type: string
        asked:
          type: object
          additionalProperties:
            type: boolean
        missing:
          type: array
          items:
            type: string
        errors:
          type: object
          additionalProperties:
            type: string
        warnings:
          type: array
          items:
            type: string
        ready:
          type: boolean
        assembly_token:
          type: string
          description: Final drafts only. Send it as template.assembly_token when creating
            the agreement, unchanged, and the agreement records
            origin.assembled.verified.
        answers_sha256:
          type: string
    DestinationInput:
      type: object
      properties:
        kind:
          enum:
            - sharepoint
            - onedrive
            - webdav
        label:
          type: string
          maxLength: 60
          description: Name on the "Save to" button; defaults to SharePoint, OneDrive or
            your document system
        folder_template:
          type: string
          maxLength: 300
          default: /Clients/{client}/{matter}/{agreement}
          description: The folder for each agreement's files. Placeholders are {client},
            {matter}, {agreement}, {year}, {month} and {date} (UTC). Each value
            is made a safe single folder name.
        save_when_agreed:
          type: boolean
          default: true
        save_when_completed:
          type: boolean
          default: true
        active:
          type: boolean
          default: true
        microsoft:
          type: object
          properties:
            tenant_id:
              type: string
              description: Directory (tenant) ID or a verified domain
            client_id:
              type: string
              format: uuid
            client_secret:
              type: string
              maxLength: 1024
              writeOnly: true
            permission:
              enum:
                - sites_selected
                - files_readwrite_all
            site_url:
              type: string
              description: For SharePoint, such as
                https://yourfirm.sharepoint.com/sites/Clients
            user:
              type: string
              description: For OneDrive, the owner's email address
            drive_id:
              type: string
              description: A document library from the test; empty for the default
            drive_name:
              type: string
        webdav:
          type: object
          properties:
            url:
              type: string
              description: An https:// address at a public host
            username:
              type: string
            password:
              type: string
              maxLength: 1024
              writeOnly: true
    Destination:
      type: object
      properties:
        kind:
          type: string
        label:
          type: string
        name:
          type: string
        folder_template:
          type: string
        example_path:
          type: string
        save_when_agreed:
          type: boolean
        save_when_completed:
          type: boolean
        active:
          type: boolean
        microsoft:
          type: object
          properties:
            tenant_id:
              type: string
            client_id:
              type: string
            permission:
              type: string
            site_url:
              type: string
            user:
              type: string
            drive_id:
              type: string
            drive_name:
              type: string
            client_secret_saved:
              type: boolean
            client_secret_saved_at:
              type: string
              nullable: true
        webdav:
          type: object
          properties:
            url:
              type: string
            username:
              type: string
            password_saved:
              type: boolean
            password_saved_at:
              type: string
              nullable: true
        last_test:
          type: object
          nullable: true
        updated_at:
          type: string
          nullable: true
        updated_by:
          type: string
          nullable: true
    DestinationTest:
      type: object
      properties:
        ok:
          type: boolean
        message:
          type: string
        tested_at:
          type: string
        example_path:
          type: string
        steps:
          type: array
          items:
            type: object
            properties:
              label:
                type: string
              ok:
                type: boolean
              detail:
                type: string
        drives:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              name:
                type: string
              web_url:
                type: string
                nullable: true
        drive_id:
          type: string
    DestinationUpload:
      type: object
      properties:
        id:
          type: string
        source:
          enum:
            - draft
            - envelope
        source_id:
          type: string
        file:
          enum:
            - agreed_pdf
            - agreed_docx
            - draft_pdf
            - draft_docx
            - signed_pdf
            - proof_kit
        file_label:
          type: string
        title:
          type: string
        trigger:
          enum:
            - agreed
            - completed
            - manual
        destination:
          type: object
          properties:
            kind:
              type: string
            label:
              type: string
        folder:
          type: string
        name:
          type: string
        path:
          type: string
          nullable: true
        web_url:
          type: string
          nullable: true
        state:
          enum:
            - queued
            - saving
            - saved
            - retrying
            - failed
            - cancelled
        attempts:
          type: integer
        error:
          type: string
          nullable: true
        requested_by:
          type: string
          nullable: true
        created_at:
          type: string
        updated_at:
          type: string
          nullable: true
        saved_at:
          type: string
          nullable: true
    SaveToRequest:
      type: object
      properties:
        files:
          type: array
          maxItems: 6
          items:
            enum:
              - agreed_pdf
              - agreed_docx
              - draft_pdf
              - draft_docx
              - signed_pdf
              - proof_kit
        client:
          type: string
          maxLength: 200
        matter:
          type: string
          maxLength: 200
        again:
          type: boolean
          description: Save another copy even where this file was already saved
    SaveToPreview:
      type: object
      properties:
        available:
          type: boolean
        reason:
          type: string
        destination:
          type: object
          properties:
            kind:
              type: string
            label:
              type: string
        agreement:
          type: string
        client:
          type: string
        matter:
          type: string
        folder:
          type: string
        files:
          type: array
          items:
            type: object
            properties:
              file:
                type: string
              label:
                type: string
              name:
                type: string
              saved:
                type: boolean
              state:
                type: string
                nullable: true
        saves:
          type: array
          items:
            $ref: "#/components/schemas/DestinationUpload"
    SaveToResult:
      type: object
      properties:
        destination:
          type: object
          properties:
            kind:
              type: string
            label:
              type: string
        folder:
          type: string
        uploads:
          type: array
          items:
            $ref: "#/components/schemas/DestinationUpload"
        already_saved:
          type: array
          items:
            type: string
    BulkRow:
      type: object
      required:
        - client_reference
        - assignments
      properties:
        client_reference:
          type: string
          maxLength: 200
        assignments:
          type: object
          additionalProperties:
            type: object
            required:
              - name
              - email
            properties:
              name:
                type: string
              email:
                type: string
                format: email
        sender_authorization:
          type: object
          description: Required when this tenant has enrolled a customer Ed25519 public key.
          required:
            - signature
          properties:
            signature:
              type: string
              description: Base64 signature over the canonical v2 manifest
paths:
  /v2/templates:
    get:
      summary: List the latest version of each owned agreement template, including
        archived templates
      responses:
        "200":
          description: Template library
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/AgreementTemplate"
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: templates:read
    post:
      summary: Save an agreement template with reusable recipient roles
      description: Stores version 1 without creating an agreement or sending email.
        Supports 100 templates per local workspace.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AgreementTemplateInput"
      responses:
        "201":
          description: Template saved
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AgreementTemplate"
        "400":
          description: Invalid roles, PDF or fields
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: templates:write
  "/v2/templates/{id}":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    get:
      summary: Read an owned template version and version history
      parameters:
        - in: query
          name: version
          schema:
            type: integer
            minimum: 1
          description: Defaults to latest
      responses:
        "200":
          description: Template metadata
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AgreementTemplate"
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Template or version not found for this customer
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: templates:read
    put:
      summary: Save a new immutable version of an owned template
      description: Requires base_version equal to the latest version. Earlier versions
        and created agreements remain unchanged. Up to 50 versions per template.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AgreementTemplateInput"
      responses:
        "200":
          description: New version saved
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AgreementTemplate"
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Version conflict or archived template
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: templates:write
  "/v2/templates/{id}/pdf":
    get:
      summary: Download the exact PDF for an owned template version
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - in: query
          name: version
          schema:
            type: integer
            minimum: 1
      responses:
        "200":
          description: PDF bytes after hash verification
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Template or version not found for this customer
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: templates:read
  "/v2/templates/{id}/archive":
    post:
      summary: Archive or restore an owned template without deleting its versions
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - archived
              properties:
                archived:
                  type: boolean
      responses:
        "200":
          description: Archive state updated
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Template not found for this customer
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: templates:write
  "/v2/templates/{id}/prepare":
    post:
      summary: Resolve an exact template version and role assignments into an
        agreement creation body
      description: Assign every role. For a questionnaire template also send values
        (answers) and choices (clause alternatives); the document is drafted
        with the assigned names. The version must be the approved one when the
        template requires approval.
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - version
                - client_reference
                - assignments
              properties:
                version:
                  type: integer
                  minimum: 1
                client_reference:
                  type: string
                  maxLength: 200
                assignments:
                  type: object
                  description: Exactly one entry per role key
                  additionalProperties:
                    type: object
                    required:
                      - name
                      - email
                    properties:
                      name:
                        type: string
                        maxLength: 120
                      email:
                        type: string
                        format: email
      responses:
        "200":
          description: Reviewed input for the existing envelope creation API
          content:
            application/json:
              schema:
                type: object
                properties:
                  template:
                    type: object
                    properties:
                      id:
                        type: string
                      version:
                        type: integer
                      name:
                        type: string
                  envelope:
                    $ref: "#/components/schemas/CreateEnvelope"
        "400":
          description: Missing version or invalid role assignments
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Template is archived
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: templates:write
  /v2/envelopes/placement-preview:
    post:
      summary: Preview automatic field placements without creating or sending an
        agreement
      description: Reads PDF text, literal anchors, or repeated page footers. Up to 8
        MiB, 100 pages, and 200 suggestions. Review each returned field and
        issue before submitting explicit fields to the creation endpoint.
        Scanned-image OCR is not supported.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - document
              properties:
                document:
                  type: object
                  required:
                    - base64
                  properties:
                    base64:
                      type: string
                mode:
                  type: string
                  enum:
                    - labels
                    - anchor
                    - initials
                  default: labels
                anchor:
                  type: string
                  maxLength: 120
                  description: Required for anchor mode; literal case-insensitive text
                field_type:
                  type: string
                  enum:
                    - signature
                    - initials
                    - full_name
                    - email
                    - signed_date
                    - date
                    - text
                    - checkbox
                  default: signature
                signer:
                  type: integer
                  minimum: 0
                  maximum: 24
                  default: 0
                recipient_count:
                  type: integer
                  minimum: 1
                  maximum: 25
                  default: 2
                recipients:
                  type: array
                  minItems: 1
                  maxItems: 25
                  description: Optional names and roles, in recipient index order. Length must
                    equal recipient_count. Unmatched or ambiguous parties return
                    signer -1 and require assignment.
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                        maxLength: 120
                      role:
                        type: string
                        maxLength: 120
                      action:
                        type: string
                        enum:
                          - sign
                          - approve
                          - interpret
                ocr:
                  type: boolean
                  default: false
                  description: Use the bundled English OCR model for up to 10 scanned pages. Runs
                    locally; suggestions always require sender review.
                pages:
                  type: array
                  maxItems: 10
                  items:
                    type: integer
                    minimum: 1
                    maximum: 100
      responses:
        "200":
          description: Placement candidates with source text, reason, warning, and
            blocking issue; review_required is true
          content:
            application/json:
              schema:
                type: object
                properties:
                  review_required:
                    type: boolean
                    const: true
                  page_count:
                    type: integer
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        field:
                          $ref: "#/components/schemas/EnvelopeField"
                        source:
                          type: string
                        reason:
                          type: string
                        warning:
                          type: string
                        issue:
                          type:
                            - string
                            - "null"
        "400":
          description: Invalid PDF, mode, field type, recipient, anchor, or page count
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  /v2/envelopes:
    get:
      summary: List up to 100 recent customer-owned agreements
      responses:
        "200":
          description: Newest-first cursor page. Follow next_cursor as cursor; includes
            data, has_more and next_cursor.
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      parameters:
        - in: query
          name: limit
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 100
        - in: query
          name: cursor
          required: false
          schema:
            type: string
      x-required-scope: envelopes:read
    post:
      summary: Create an agreement for 1 to 5 signers
      description: Requires at least one signature field for each signer. No
        invitations are sent by creation.
      parameters:
        - $ref: "#/components/parameters/idempotencyKey"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateEnvelope"
      responses:
        "201":
          description: Created or idempotently replayed
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EnvelopeStatus"
        "400":
          description: Invalid signer, PDF, routing, or fields
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "402":
          description: "SUBSCRIPTION_REQUIRED or SUBSCRIPTION_INACTIVE: workspace owner
            must activate or restore the subscription. Existing signing and
            downloads remain available."
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Idempotency key conflict
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  /v2/envelopes/manifest:
    post:
      summary: Prepare the exact agreement manifest for a customer Ed25519 signature
      parameters:
        - $ref: "#/components/parameters/idempotencyKey"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateEnvelope"
      responses:
        "200":
          description: Canonical manifest to sign
          content:
            application/json:
              schema:
                type: object
                properties:
                  manifest:
                    type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/envelopes/{id}":
    get:
      summary: Read a customer-owned agreement
      parameters:
        - $ref: "#/components/parameters/requestId"
      responses:
        "200":
          description: Agreement status
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EnvelopeStatus"
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Agreement not found for this customer
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:read
  "/v2/envelopes/{id}/send/{signer}":
    post:
      summary: Email an active signer; ordered successors are invited automatically
        after the previous signature
      parameters:
        - $ref: "#/components/parameters/requestId"
        - in: path
          name: signer
          required: true
          schema:
            type: integer
            minimum: 0
            maximum: 4
      responses:
        "202":
          description: Delivery durably queued; inspect recipient and delivery status.
            SMTP acceptance is not inbox receipt.
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Delivery unavailable or reminder not due
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
        "503":
          description: Email not configured
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:send
  "/v2/envelopes/{id}/remind/{signer}":
    post:
      summary: Remind an invited, unsigned signer after at least 24 hours; at most
        three accepted reminders
      parameters:
        - $ref: "#/components/parameters/requestId"
        - in: path
          name: signer
          required: true
          schema:
            type: integer
            minimum: 0
            maximum: 4
      responses:
        "202":
          description: Delivery durably queued; inspect recipient and delivery status.
            SMTP acceptance is not inbox receipt.
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Delivery unavailable or reminder not due
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
        "503":
          description: Email not configured
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:send
  "/v2/envelopes/{id}/deliver-completed/{signer}":
    post:
      summary: Retry a failed completed-copy email without asking the signer to sign
        again
      parameters:
        - $ref: "#/components/parameters/requestId"
        - in: path
          name: signer
          required: true
          schema:
            type: integer
            minimum: 0
            maximum: 4
      responses:
        "202":
          description: Delivery durably queued; inspect recipient and delivery status.
            SMTP acceptance is not inbox receipt.
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Delivery unavailable or reminder not due
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
        "503":
          description: Email not configured
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:send
  "/v2/envelopes/{id}/in-person/{signer}":
    post:
      summary: Start in-person signing on the sender's device. The signer reads and
        signs on the returned hosted page; the proof names the host and the ID
        they say they checked, which HESigns does not verify.
      parameters:
        - $ref: "#/components/parameters/requestId"
        - in: path
          name: signer
          required: true
          schema:
            type: integer
            minimum: 0
            maximum: 24
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - host_name
              properties:
                host_name:
                  type: string
                  maxLength: 120
                id_checked:
                  type: string
                  enum:
                    - none
                    - drivers_license
                    - passport
                    - national_id
                    - other
                  default: none
                id_note:
                  type: string
                  maxLength: 160
      responses:
        "200":
          description: The agreement, with in_person_path, the hosted signing page
        "400":
          description: INVALID_HOST
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: This person cannot sign right now
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  /v2/forms:
    get:
      summary: List public signing forms
      responses:
        "200":
          description: The workspace's signing forms
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/SigningForm"
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: templates:read
    post:
      summary: Make a public signing form from a template version. The public role
        must sign first, alone; every other role needs a fixed name and email.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - title
                - template_id
                - template_version
                - public_role
              properties:
                title:
                  type: string
                  maxLength: 120
                description:
                  type: string
                  maxLength: 500
                template_id:
                  type: string
                template_version:
                  type: integer
                public_role:
                  type: string
                fixed:
                  type: object
                  additionalProperties:
                    type: object
                    properties:
                      name:
                        type: string
                      email:
                        type: string
                limit:
                  type: integer
                  minimum: 1
                  maximum: 10000
                expires_at:
                  type: string
                  format: date-time
      responses:
        "201":
          description: The form, with its public path
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SigningForm"
        "400":
          description: INVALID_FORM, FORM_ORDER or FORM_LIMIT
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: templates:write
  "/v2/forms/{id}/active":
    post:
      summary: Pause or reopen a signing form
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - active
              properties:
                active:
                  type: boolean
      responses:
        "200":
          description: The form
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: templates:write
  "/v2/forms/{id}/rotate":
    post:
      summary: Replace a signing form's link; the old link stops working
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: The form, with its new path
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: templates:write
  "/v2/forms/{id}":
    delete:
      summary: Delete a signing form. Agreements already started are kept.
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Deleted
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: templates:write
  "/f/{token}":
    get:
      summary: The public page of a signing form
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      responses:
        "200":
          description: HTML page, or a closed notice when paused, past its date or full
        "404":
          description: Unknown form link
    post:
      summary: Start the visitor's own agreement from the form. Returns their signing
        page. Rate limited per address and per form; a request from another site
        is refused.
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - email
              properties:
                name:
                  type: string
                  maxLength: 120
                email:
                  type: string
                  format: email
      responses:
        "201":
          description: The new agreement's id and the visitor's signer_path
        "403":
          description: ORIGIN_REJECTED
        "410":
          description: FORM_CLOSED
        "429":
          description: TOO_MANY_SUBMISSIONS
  /v2/reports/agreements:
    get:
      summary: Agreement report for a period. Counts agreements by the moment they
        were prepared; time to complete runs from the first invitation,
        in-person hand-over or open to the last signature.
      parameters:
        - in: query
          name: from
          schema:
            type: string
            format: date-time
          description: Start of the period (inclusive). Defaults to 30 days before `to`.
        - in: query
          name: to
          schema:
            type: string
            format: date-time
          description: End of the period (exclusive). Defaults to now. A period is at most
            366 days.
        - in: query
          name: tz
          schema:
            type: string
          description: IANA time zone for counting days, such as America/New_York.
            Defaults to UTC.
      responses:
        "200":
          description: The report
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AgreementReport"
        "400":
          description: INVALID_PERIOD or INVALID_TIME_ZONE
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:read
  /v2/reports/agreements.csv:
    get:
      summary: The same period as a spreadsheet, one row per agreement. Cells a
        spreadsheet would run as formulas are prefixed with an apostrophe.
      parameters:
        - in: query
          name: from
          schema:
            type: string
            format: date-time
          description: Start of the period (inclusive). Defaults to 30 days before `to`.
        - in: query
          name: to
          schema:
            type: string
            format: date-time
          description: End of the period (exclusive). Defaults to now. A period is at most
            366 days.
        - in: query
          name: tz
          schema:
            type: string
          description: IANA time zone for counting days, such as America/New_York.
            Defaults to UTC.
      responses:
        "200":
          description: UTF-8 CSV with a byte-order mark
          content:
            text/csv:
              schema:
                type: string
        "400":
          description: INVALID_PERIOD or INVALID_TIME_ZONE
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:read
  /v2/brand:
    get:
      summary: The workspace's look on signing pages, public forms, copy pages and
        emails
      responses:
        "200":
          description: The brand, or null for the HESigns look
          content:
            application/json:
              schema:
                type: object
                properties:
                  brand:
                    oneOf:
                      - $ref: "#/components/schemas/Brand"
                      - type: "null"
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: templates:read
    put:
      summary: Set the name, accent colour and logo signers see. HESigns stays named
        as the service, and the signature frame and proof keep their own
        colours.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - color
              properties:
                name:
                  type: string
                  maxLength: 60
                color:
                  type: string
                  pattern: ^#[0-9a-fA-F]{6}$
                  description: White text on it must reach a contrast ratio of at least 4.5 to 1.
                logo:
                  type: object
                  description: Leave out to keep the current logo.
                  required:
                    - base64
                  properties:
                    base64:
                      type: string
                      description: A PNG or JPEG up to 200 KB, 16 to 2400 pixels on each side.
                remove_logo:
                  type: boolean
      responses:
        "200":
          description: The saved brand
          content:
            application/json:
              schema:
                type: object
                properties:
                  brand:
                    $ref: "#/components/schemas/Brand"
        "400":
          description: INVALID_BRAND, BRAND_CONTRAST or INVALID_LOGO
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: brand:manage
    delete:
      summary: Go back to the HESigns look
      responses:
        "200":
          description: The brand is cleared
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: brand:manage
  "/v2/envelopes/{id}/deliver-copy/{recipient}":
    post:
      summary: Send, or retry, the signed-copy email to a copy recipient
      parameters:
        - $ref: "#/components/parameters/requestId"
        - in: path
          name: recipient
          required: true
          schema:
            type: integer
            minimum: 0
            maximum: 9
      responses:
        "202":
          description: Delivery durably queued; inspect recipient and delivery status.
            SMTP acceptance is not inbox receipt.
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Delivery unavailable or reminder not due
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
        "503":
          description: Email not configured
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:send
  "/v2/envelopes/{id}/void":
    post:
      summary: Void an open agreement with a reason
      parameters:
        - $ref: "#/components/parameters/requestId"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - reason
              properties:
                reason:
                  type: string
                  maxLength: 500
      responses:
        "200":
          description: Agreement voided
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Agreement already closed
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/envelopes/{id}/events":
    get:
      summary: Read recorded agreement and signer events
      parameters:
        - $ref: "#/components/parameters/requestId"
      responses:
        "200":
          description: Event history
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: events:read
  "/v2/envelopes/{id}/original.pdf":
    get:
      summary: Download the original agreement PDF
      parameters:
        - $ref: "#/components/parameters/requestId"
      responses:
        "200":
          description: Original PDF
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:read
  "/v2/envelopes/{id}/completed.pdf":
    get:
      summary: Download the visibly marked PDF after all signers finish
      parameters:
        - $ref: "#/components/parameters/requestId"
      responses:
        "200":
          description: Completed PDF
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Agreement not completed
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:read
  "/v2/envelopes/{id}/proof.json":
    get:
      summary: Download the detached signed evidence for all signers
      parameters:
        - $ref: "#/components/parameters/requestId"
      responses:
        "200":
          description: Evidence JSON
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Agreement not completed
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:read
  "/v2/envelopes/{id}/proof-kit.zip":
    get:
      summary: Download both PDFs, evidence, public key, and offline verifier
      parameters:
        - $ref: "#/components/parameters/requestId"
      responses:
        "200":
          description: Portable proof kit ZIP
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Agreement not completed
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:read
  "/esign/{token}":
    get:
      security: []
      summary: Private signer page; waiting signers see their place in the order
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Signer HTML page
  "/esign/{token}/document.pdf":
    get:
      security: []
      summary: Open the original PDF and record that this signer opened it
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Original PDF
        "409":
          description: Signer is waiting or already signed
  "/esign/{token}/complete":
    post:
      security: []
      summary: Record this signer's assigned field values, review, consent, typed
        name, and intent
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - reviewed_document
                - consent_to_electronic_signing
              properties:
                name:
                  type: string
                reviewed_document:
                  type: boolean
                  const: true
                consent_to_electronic_signing:
                  type: boolean
                  const: true
                intent_to_sign:
                  type: boolean
                  const: true
                  description: Required when the participant action is sign
                in_person:
                  type: boolean
                  description: Sent by the hosted page of an in-person signing. Recorded as in
                    person only within 4 hours of the host starting it;
                    otherwise refused with IN_PERSON_EXPIRED.
                signature_image:
                  type: object
                  required:
                    - base64
                  properties:
                    base64:
                      type: string
                  description: Optional uploaded image of the signer's handwritten signature, a
                    PNG or JPEG up to 1 MiB. Used in place of a typed or drawn
                    appearance; its SHA-256 is in the signed evidence.
                stamps:
                  type: array
                  maxItems: 25
                  description: One PNG or JPEG (up to 1 MiB) for each stamp field assigned to the
                    signer, keyed by field index. Optional stamps may be
                    omitted.
                  items:
                    type: object
                    required:
                      - field
                      - base64
                    properties:
                      field:
                        type: integer
                        minimum: 0
                      base64:
                        type: string
                signature_strokes:
                  type: array
                  minItems: 1
                  maxItems: 16
                  description: Optional hand-drawn signature appearance from a 600x160 canvas.
                    Each stroke contains 2-120 normalized [x,y] points between 0
                    and 1; at most 720 points total. The typed name and consent
                    remain required. The appearance is included in the signed
                    evidence. Omit to use a typed appearance.
                  items:
                    type: array
                    minItems: 2
                    maxItems: 120
                    items:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: number
                        minimum: 0
                        maximum: 1
                field_values:
                  type: object
                  description: Required values keyed by zero-based index in the agreement's fields
                    array. Date uses YYYY-MM-DD, text is a short printable
                    answer that meets the field's format and max_length, a
                    dropdown answer is one of its options, and each required
                    checkbox must be true. Signature, initials, and full_name
                    are derived from the signer's name; email comes from
                    recipient data, and signed_date from the UTC signing time.
                    These automatic fields cannot be overridden.
                  additionalProperties:
                    oneOf:
                      - type: string
                      - type: boolean
                        const: true
                locale:
                  type: string
                  enum:
                    - en
                    - es
                    - fr
                    - ar
                  default: en
                attachments:
                  type: array
                  maxItems: 3
                  items:
                    type: object
                    required:
                      - request
                      - name
                      - base64
                    properties:
                      request:
                        type: integer
                        minimum: 0
                        maximum: 2
                      name:
                        type: string
                      base64:
                        type: string
                  description: PDF/PNG/JPEG; 4 MiB each, 8 MiB total across the agreement. Matched
                    to attachment request indices and included in the proof kit
                    for all recipients.
                approve:
                  type: boolean
                  const: true
                  description: "Required when the participant action is approve: approves the
                    current version without signing it"
                attest:
                  type: boolean
                  const: true
                  description: "Required when the participant action is interpret: signs the
                    interpreter statement shown on the page"
                acknowledged_changes:
                  type: object
                  required:
                    - from_version
                    - to_version
                    - changes_sha256
                  properties:
                    from_version:
                      type: integer
                    to_version:
                      type: integer
                    changes_sha256:
                      type: string
                  description: "Required when this person opened or approved an earlier version:
                    the exact comparison they reviewed, from GET /esign/{token}
                    review data. Otherwise the request fails with
                    CHANGES_NOT_ACKNOWLEDGED. Recorded in the proof as
                    reviewed_changes."
                reading_aids:
                  type: array
                  maxItems: 3
                  items:
                    type: object
                    required:
                      - engine
                      - to
                      - pages
                    properties:
                      engine:
                        const: device
                      from:
                        type: string
                        enum:
                          - en
                          - es
                          - pt
                          - fr
                          - ht
                          - ar
                          - zh
                          - zh-Hant
                          - vi
                          - ko
                          - ru
                          - uk
                          - pl
                          - de
                          - it
                          - tl
                          - hi
                          - ja
                          - he
                          - tr
                      to:
                        type: string
                        enum:
                          - en
                          - es
                          - pt
                          - fr
                          - ht
                          - ar
                          - zh
                          - zh-Hant
                          - vi
                          - ko
                          - ru
                          - uk
                          - pl
                          - de
                          - it
                          - tl
                          - hi
                          - ja
                          - he
                          - tr
                      pages:
                        type: array
                        minItems: 1
                        maxItems: 100
                        items:
                          type: integer
                          minimum: 1
                  description: Pages this person read with their browser translator, reported by
                    the browser. Translation through the service is recorded by
                    the service and needs no report.
              description: Send intent_to_sign for a signer, approve for an approver, or
                attest for an interpreter; the one that matches the participant
                action is required.
      responses:
        "200":
          description: Signature recorded; final artifact created after the last signer
        "409":
          description: Signer is waiting, already signed, or agreement is closed;
            CERTIFICATE_SIGNATURE_REQUIRED for a signer asked to sign with their
            certificate (the signing page continues to their signing provider)
  "/esign/{token}/decline":
    post:
      security: []
      summary: Decline and close the whole agreement
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Decline recorded
  "/esign/{token}/completed.pdf":
    get:
      security: []
      summary: Download signed PDF after all signers finish
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Completed PDF
        "409":
          description: Agreement not completed
  "/esign/{token}/proof.json":
    get:
      security: []
      summary: Download detached evidence after completion
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Evidence JSON
  "/esign/{token}/proof-kit.zip":
    get:
      security: []
      summary: Download portable proof kit after completion
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Proof kit ZIP
  /v2/envelopes/assemble:
    post:
      summary: Preview an ordered PDF packet without creating or sending
      x-required-scope: envelopes:write
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                documents:
                  type: array
                  minItems: 1
                  maxItems: 10
                  items:
                    type: object
                    required:
                      - name
                      - base64
                    properties:
                      name:
                        type: string
                        maxLength: 200
                      base64:
                        type: string
                        description: Base64 PDF bytes, maximum 8 MiB decoded
                  description: "PDFs in final order. Combined decoded sources: 8 MiB and 100
                    pages. Fields use page numbers in the combined packet."
              required:
                - documents
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Action unavailable in the current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/templates/{id}/documents":
    get:
      summary: Read immutable source PDF bytes for an exact template version
      x-required-scope: templates:read
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Action unavailable in the current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - in: query
          name: version
          required: false
          schema:
            type: integer
  "/v2/envelopes/{id}/source-{index}.pdf":
    get:
      summary: Download one original packet PDF
      x-required-scope: envelopes:read
      responses:
        "200":
          description: PDF
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Unavailable
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - in: path
          name: index
          required: true
          schema:
            type: integer
            minimum: 0
            maximum: 9
  "/v2/envelopes/{id}/signed-{index}.pdf":
    get:
      summary: Download one completed packet PDF
      x-required-scope: envelopes:read
      responses:
        "200":
          description: PDF
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Unavailable
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - in: path
          name: index
          required: true
          schema:
            type: integer
            minimum: 0
            maximum: 9
  "/esign/{token}/source-{index}.pdf":
    get:
      summary: Download one original packet PDF
      responses:
        "200":
          description: PDF
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        "404":
          description: Unavailable
          content:
            application/json:
              schema:
                type: object
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
        - in: path
          name: index
          required: true
          schema:
            type: integer
            minimum: 0
            maximum: 9
      security: []
  "/esign/{token}/signed-{index}.pdf":
    get:
      summary: Download one completed packet PDF
      responses:
        "200":
          description: PDF
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        "404":
          description: Unavailable
          content:
            application/json:
              schema:
                type: object
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
        - in: path
          name: index
          required: true
          schema:
            type: integer
            minimum: 0
            maximum: 9
      security: []
  "/esign/{token}/delegate":
    post:
      summary: Transfer signing when explicitly permitted; revokes old access and
        queues a new invitation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 120
                email:
                  type: string
                  format: email
                confirm:
                  const: true
              required:
                - name
                - email
                - confirm
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Action unavailable in the current state
          content:
            application/json:
              schema:
                type: object
      security: []
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
  /v2/review/envelopes:
    get:
      summary: List agreements for review, newest first, with open comment counts
      x-required-scope: review:read
      parameters:
        - in: query
          name: limit
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 100
        - in: query
          name: cursor
          required: false
          schema:
            type: string
      responses:
        "200":
          description: data, has_more and next_cursor
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/ReviewAgreement"
                  has_more:
                    type: boolean
                  next_cursor:
                    type:
                      - string
                      - "null"
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/review/envelopes/{id}":
    get:
      summary: Read one agreement for review
      x-required-scope: review:read
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Review state
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ReviewAgreement"
        "400":
          description: Invalid request
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Agreement, version, proposal or comment not found
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/envelopes/{id}/versions":
    get:
      summary: List document versions
      x-required-scope: review:read
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Versions, oldest first
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/DocumentVersion"
        "400":
          description: Invalid request
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Agreement, version, proposal or comment not found
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/envelopes/{id}/versions/{version}/document.pdf":
    get:
      summary: Download one version of the document
      x-required-scope: review:read
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - in: path
          name: version
          required: true
          schema:
            type: integer
            minimum: 1
            maximum: 20
      responses:
        "200":
          description: PDF
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        "400":
          description: Invalid request
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Agreement, version, proposal or comment not found
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/envelopes/{id}/versions/{version}/text":
    get:
      summary: Read the text of one version, page by page
      x-required-scope: review:read
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - in: path
          name: version
          required: true
          schema:
            type: integer
            minimum: 1
            maximum: 20
      responses:
        "200":
          description: Page text
          content:
            application/json:
              schema:
                type: object
                properties:
                  version:
                    type: integer
                  sha256:
                    type: string
                  document_name:
                    type: string
                  text_sha256:
                    type: string
                  pages:
                    type: array
                    items:
                      type: object
                      properties:
                        page:
                          type: integer
                        text:
                          type: string
                        has_text:
                          type: boolean
        "400":
          description: Invalid request
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Agreement, version, proposal or comment not found
        "422":
          description: "TEXT_UNAVAILABLE: no readable text"
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/envelopes/{id}/compare":
    get:
      summary: Compare two versions word by word, or the current version with a proposal
      x-required-scope: review:read
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - in: query
          name: from
          required: false
          schema:
            type: integer
          description: Defaults to the version before to
        - in: query
          name: to
          required: false
          schema:
            type: integer
          description: Defaults to the current version
        - in: query
          name: proposal
          required: false
          schema:
            type: string
          description: Compare this proposal with the version it was made against; from
            and to are ignored
      responses:
        "200":
          description: Comparison
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Comparison"
        "400":
          description: Invalid request
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Agreement, version, proposal or comment not found
        "422":
          description: COMPARISON_UNAVAILABLE
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/envelopes/{id}/compare.pdf":
    get:
      summary: "Download the redline: a change summary followed by the newer document
        with deletions struck through and insertions underlined"
      x-required-scope: review:read
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - in: query
          name: from
          required: false
          schema:
            type: integer
        - in: query
          name: to
          required: false
          schema:
            type: integer
        - in: query
          name: proposal
          required: false
          schema:
            type: string
      responses:
        "200":
          description: Redline PDF
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        "400":
          description: Invalid request
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Agreement, version, proposal or comment not found
        "422":
          description: COMPARISON_UNAVAILABLE
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/envelopes/{id}/revisions":
    post:
      summary: Replace the document with a new version. Everyone who has not finished
        starts again; people who opened or approved an earlier version must
        initial each change.
      x-required-scope: envelopes:write
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - $ref: "#/components/parameters/idempotencyKey"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - summary
              properties:
                summary:
                  type: string
                  minLength: 1
                  maxLength: 300
                document:
                  $ref: "#/components/schemas/CreateEnvelope/properties/document"
                documents:
                  $ref: "#/components/schemas/CreateEnvelope/properties/documents"
                fields:
                  type: array
                  maxItems: 200
                  items:
                    $ref: "#/components/schemas/EnvelopeField"
                  description: Defaults to the current fields
                sender_authorization:
                  $ref: "#/components/schemas/CreateEnvelope/properties/sender_authorization"
      responses:
        "201":
          description: The agreement with its new current version
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EnvelopeStatus"
        "400":
          description: Invalid request
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: "PERSON_REQUIRED: an AI agent can comment and propose; a person
            accepts, rejects and revises"
        "404":
          description: Agreement, version, proposal or comment not found
        "409":
          description: ENVELOPE_CLOSED, NO_CHANGE, VERSION_LIMIT or IDEMPOTENCY_CONFLICT
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/envelopes/{id}/comments":
    get:
      summary: List comments
      x-required-scope: review:read
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Comments
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/ReviewComment"
        "400":
          description: Invalid request
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Agreement, version, proposal or comment not found
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
    post:
      summary: Comment on a quoted passage, optionally with suggested wording
      x-required-scope: review:write
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - $ref: "#/components/parameters/agentName"
        - $ref: "#/components/parameters/onBehalfOf"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - quote
                - comment
              properties:
                quote:
                  type: string
                  minLength: 1
                  maxLength: 500
                  description: Exact words from the version; whitespace and case are ignored when
                    matching
                comment:
                  type: string
                  minLength: 1
                  maxLength: 2000
                suggested_text:
                  type: string
                  maxLength: 2000
                version:
                  type: integer
                  description: Defaults to the current version
      responses:
        "201":
          description: Comment anchored to its page
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ReviewComment"
        "400":
          description: Invalid request
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Agreement, version, proposal or comment not found
        "409":
          description: COMMENT_LIMIT (200 per agreement)
        "422":
          description: QUOTE_NOT_FOUND
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/envelopes/{id}/comments/{comment}/resolve":
    post:
      summary: Resolve a comment
      x-required-scope: review:write
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - in: path
          name: comment
          required: true
          schema:
            type: string
        - $ref: "#/components/parameters/agentName"
        - $ref: "#/components/parameters/onBehalfOf"
      responses:
        "200":
          description: Resolved comment
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ReviewComment"
        "400":
          description: Invalid request
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Agreement, version, proposal or comment not found
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/envelopes/{id}/proposals":
    get:
      summary: List proposed revisions
      x-required-scope: review:read
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Proposals
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/Proposal"
        "400":
          description: Invalid request
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Agreement, version, proposal or comment not found
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
    post:
      summary: Propose a revised document. Nothing changes for signers until a person
        accepts it.
      x-required-scope: review:write
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - $ref: "#/components/parameters/agentName"
        - $ref: "#/components/parameters/onBehalfOf"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - summary
              properties:
                summary:
                  type: string
                  minLength: 1
                  maxLength: 300
                document:
                  $ref: "#/components/schemas/CreateEnvelope/properties/document"
                documents:
                  $ref: "#/components/schemas/CreateEnvelope/properties/documents"
                explanation:
                  type: string
                  maxLength: 4000
      responses:
        "201":
          description: Pending proposal with its change counts
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Proposal"
        "400":
          description: Invalid request
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Agreement, version, proposal or comment not found
        "409":
          description: ENVELOPE_CLOSED, NO_CHANGE or PROPOSAL_LIMIT (20 per agreement)
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/envelopes/{id}/proposals/{proposal}/document.pdf":
    get:
      summary: Download a proposed document
      x-required-scope: review:read
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - in: path
          name: proposal
          required: true
          schema:
            type: string
      responses:
        "200":
          description: PDF
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        "400":
          description: Invalid request
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Agreement, version, proposal or comment not found
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/envelopes/{id}/proposals/{proposal}/accept":
    post:
      summary: Accept a proposal as the next version; this is a revision
      x-required-scope: envelopes:write
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - in: path
          name: proposal
          required: true
          schema:
            type: string
        - $ref: "#/components/parameters/idempotencyKey"
          required: false
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                summary:
                  type: string
                  maxLength: 300
                fields:
                  type: array
                  maxItems: 200
                  items:
                    $ref: "#/components/schemas/EnvelopeField"
                sender_authorization:
                  $ref: "#/components/schemas/CreateEnvelope/properties/sender_authorization"
      responses:
        "200":
          description: The agreement with its new current version
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EnvelopeStatus"
        "400":
          description: Invalid request
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: "PERSON_REQUIRED: an AI agent can comment and propose; a person
            accepts, rejects and revises"
        "404":
          description: Agreement, version, proposal or comment not found
        "409":
          description: PROPOSAL_DECIDED or PROPOSAL_OUTDATED (the agreement changed after
            the proposal was made)
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/envelopes/{id}/proposals/{proposal}/reject":
    post:
      summary: Reject a proposal
      x-required-scope: envelopes:write
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - in: path
          name: proposal
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                reason:
                  type: string
                  maxLength: 500
      responses:
        "200":
          description: Rejected proposal
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Proposal"
        "400":
          description: Invalid request
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: "PERSON_REQUIRED: an AI agent can comment and propose; a person
            accepts, rejects and revises"
        "404":
          description: Agreement, version, proposal or comment not found
        "409":
          description: PROPOSAL_DECIDED
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/esign/{token}/changes.pdf":
    get:
      security: []
      summary: Redline of what changed since this person last read or approved the
        document
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Redline PDF
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        "404":
          description: No earlier version to compare
  "/esign/{token}/translate":
    post:
      security: []
      summary: Translate one page through the translation service, when the sender
        turned it on. The service records which pages this person read this way.
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - to
                - page
              properties:
                to:
                  type: string
                  enum:
                    - en
                    - es
                    - pt
                    - fr
                    - ht
                    - ar
                    - zh
                    - zh-Hant
                    - vi
                    - ko
                    - ru
                    - uk
                    - pl
                    - de
                    - it
                    - tl
                    - hi
                    - ja
                    - he
                    - tr
                from:
                  type: string
                  enum:
                    - en
                    - es
                    - pt
                    - fr
                    - ht
                    - ar
                    - zh
                    - zh-Hant
                    - vi
                    - ko
                    - ru
                    - uk
                    - pl
                    - de
                    - it
                    - tl
                    - hi
                    - ja
                    - he
                    - tr
                  description: Detected when omitted
                page:
                  type: integer
                  minimum: 1
      responses:
        "200":
          description: Translated page text
          content:
            application/json:
              schema:
                type: object
                properties:
                  page:
                    type: integer
                  to:
                    type: string
                  from:
                    type: string
                  text:
                    type: string
                  engine:
                    const: service
                  provider:
                    type: string
        "400":
          description: INVALID_LANGUAGE or INVALID_PAGE
        "409":
          description: TRANSLATION_SERVICE_OFF
        "410":
          description: SESSION_CLOSED
        "429":
          description: "TRANSLATION_LIMIT: 300,000 characters per agreement"
        "503":
          description: TRANSLATION_UNAVAILABLE
  /mcp:
    post:
      summary: "Model Context Protocol endpoint for AI review tools (Streamable HTTP,
        JSON responses). Supports protocol 2026-07-28 and 2025-03-26 through
        2025-11-25. Tools: list_agreements, get_agreement, read_document,
        compare_versions, get_redline_pdf, add_comment, suggest_edits,
        propose_revision."
      security:
        - oauth2:
            - review:read
            - review:write
        - mcpBearer: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - method
              properties:
                jsonrpc:
                  const: "2.0"
                id:
                  type:
                    - string
                    - integer
                method:
                  type: string
                params:
                  type: object
      responses:
        "200":
          description: JSON-RPC result or error
          content:
            application/json:
              schema:
                type: object
        "202":
          description: Notification accepted
        "401":
          description: Missing or invalid token; WWW-Authenticate names the protected
            resource metadata
        "403":
          description: Origin rejected
        "405":
          description: GET and DELETE are not supported; this server does not stream
  /v2/meetings:
    get:
      summary: List live meetings first, then upcoming soonest, then recent past
        meetings
      x-required-scope: meetings:read
      parameters:
        - in: query
          name: status
          required: false
          schema:
            type: string
            enum:
              - all
              - scheduled
              - live
              - overdue
              - ended
              - cancelled
        - in: query
          name: q
          required: false
          schema:
            type: string
            description: Search title, matter reference and participants, across the full
              library.
        - in: query
          name: offset
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
        - in: query
          name: limit
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 200
            default: 50
        - in: query
          name: time_zone
          required: false
          schema:
            type: string
            description: IANA time zone for the today summary; defaults to UTC.
        - name: cursor
          in: query
          schema:
            type: string
            maxLength: 800
          description: Use next_cursor from the previous page with the same search, status
            and time zone. Expires after 24 hours; refresh on INVALID_CURSOR.
            Preferred to offset.
      responses:
        "200":
          description: Matching page, total matching records, next_offset (null at end),
            and summaries across the full library.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/Meeting"
                  total:
                    type: integer
                  next_offset:
                    type:
                      - integer
                      - "null"
                  counts:
                    type: object
                  featured:
                    oneOf:
                      - $ref: "#/components/schemas/Meeting"
                      - type: "null"
                  today:
                    type: array
                    items:
                      $ref: "#/components/schemas/Meeting"
                  last_sealed:
                    oneOf:
                      - $ref: "#/components/schemas/Meeting"
                      - type: "null"
                  next_cursor:
                    type:
                      - string
                      - "null"
                  today_total:
                    type: integer
                    description: Full count for today; today contains at most 200 records.
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      description: "Database-filtered, tenant-scoped library. Search uses
        accent-folded word prefixes across title, reference, purpose, names,
        emails and represented organizations. Counts, featured, today and
        last_sealed cover the entire workspace, independently of the current
        page and filter. Search limits: 300 characters, 20 words. Changes
        between pages may move an edited record; this is a live library, not a
        frozen snapshot."
    post:
      summary: Schedule an end-to-end encrypted meeting; each person gets a private link
      x-required-scope: meetings:write
      parameters:
        - in: header
          name: Idempotency-Key
          required: false
          schema:
            type: string
            maxLength: 200
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateMeeting"
      responses:
        "201":
          description: Scheduled
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Meeting"
        "400":
          description: Invalid meeting
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: IDEMPOTENCY_CONFLICT
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/meetings/{id}":
    get:
      summary: Read a meeting
      x-required-scope: meetings:read
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Meeting
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Meeting"
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Meeting not found
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/meetings/{id}/cancel":
    post:
      summary: Cancel a meeting; every link stops working and its rooms close
      x-required-scope: meetings:write
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Cancelled
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Meeting"
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Meeting not found
        "409":
          description: MEETING_ENDED
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      description: Revokes personal links and queues CANCEL calendar notices for
        previously emailed participants. Repeated cancellation does not create
        duplicate notices. Failed notices may be retried through invitations.
  "/v2/meetings/{id}/end":
    post:
      summary: End the meeting for everyone and seal its record
      x-required-scope: meetings:write
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Ended; sealed sha256 and time
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Meeting not found
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/meetings/{id}/invitations":
    post:
      summary: Queue selected personal invitations, or retry failed cancellation notices
      x-required-scope: meetings:write
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                participants:
                  type: array
                  items:
                    type: string
                  description: Defaults to everyone with an email
      responses:
        "200":
          description: Meeting with per-participant queue status; no SMTP work occurs in
            the request transaction.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Meeting"
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Meeting not found
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
        "503":
          description: EMAIL_NOT_CONFIGURED
      description: Production durably queues encrypted mail snapshots in the same
        transaction as meeting state. Repeating the request coalesces the same
        participant/link/calendar version. Failed mail retries with backoff, up
        to eight attempts. SMTP acceptance is not inbox delivery; transport is
        at least once, with a stable Message-ID. Inspect invitation_delivery for
        progress. Cancelled meetings allow retry only of already-created
        cancellation notices.
  "/v2/meetings/{id}/agreement":
    post:
      summary: Attach an agreement to sign in the meeting and match its recipients to
        participants
      x-required-scope: meetings:write
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - agreement_id
              properties:
                agreement_id:
                  type: string
                signers:
                  type: object
                  additionalProperties:
                    type: integer
                  description: participant ID → recipient index
      responses:
        "200":
          description: Attached
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Meeting"
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Meeting not found
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/meetings/{id}/participants/{participant}/new-link":
    post:
      summary: Replace a person’s link; the old one stops working and they are removed
        from the call
      x-required-scope: meetings:write
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - in: path
          name: participant
          required: true
          schema:
            type: string
      responses:
        "200":
          description: New link
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Meeting"
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Meeting not found
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/meetings/{id}/participants/{participant}/calendar.ics":
    get:
      summary: Calendar invitation for one person
      x-required-scope: meetings:write
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - in: path
          name: participant
          required: true
          schema:
            type: string
      responses:
        "200":
          description: iCalendar
          content:
            text/calendar:
              schema:
                type: string
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Meeting not found
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/meetings/{id}/record.json":
    get:
      summary: The sealed meeting record (a signed snapshot until the meeting ends)
      x-required-scope: meetings:read
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Signed record
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MeetingRecord"
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Meeting not found
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/meetings/{id}/binder.zip":
    get:
      summary: "Closing binder: sealed record, each signed agreement with its proof
        kit, appearances, time entries, a draft certification and README"
      x-required-scope: meetings:read
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: ZIP
          content:
            application/zip:
              schema:
                type: string
                format: binary
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Meeting not found
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/meetings/{id}/time.csv":
    get:
      summary: Time in the meeting per person and room, in minutes and tenths of an hour
      x-required-scope: meetings:read
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: CSV
          content:
            text/csv:
              schema:
                type: string
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Meeting not found
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/meet/{token}":
    get:
      security: []
      summary: The meeting page for one participant
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      responses:
        "200":
          description: HTML
        "404":
          description: Unknown or replaced link
        "410":
          description: Cancelled
  "/meet/{token}/state":
    get:
      security: []
      summary: "What this participant may see: people, rooms, waiting room (hosts),
        recording consent, confirmations and the agreement, with their own
        signing link"
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      responses:
        "200":
          description: State
  "/meet/{token}/agreement.pdf":
    get:
      security: []
      summary: The agreement's original PDF, for hosts, mediators and counsel to
        follow along; parties open it through their own signing link
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      responses:
        "200":
          description: PDF
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        "403":
          description: Not available to this participant
        "404":
          description: No agreement in this meeting
  "/meet/{token}/media-token":
    post:
      security: []
      summary: A 10-minute media grant for the assigned room (hosts may visit any room)
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                room:
                  type: string
      responses:
        "200":
          description: url, room, identity and token
        "403":
          description: WAITING_FOR_HOST or ROOM_NOT_ASSIGNED
        "409":
          description: MEETING_ENDED
        "503":
          description: Media server not configured
  /meet/livekit/webhook:
    post:
      security: []
      summary: Media-server events (who joined and left which room); authorized by its
        signed JWT and body hash
      requestBody:
        required: true
        content:
          application/webhook+json:
            schema:
              type: object
      responses:
        "200":
          description: Recorded
        "401":
          description: Signature rejected
  "/meet/{token}/knock":
    post:
      security: []
      summary: Ask to join; hosts and meetings without a waiting room are admitted at
        once
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                cancel:
                  type: boolean
                  description: Leave the waiting room and remove the pending request.
      responses:
        "200":
          description: Done
        "400":
          description: Invalid
        "403":
          description: HOST_REQUIRED or ORIGIN_REJECTED
        "409":
          description: Not possible in the current state
  "/meet/{token}/admit":
    post:
      security: []
      summary: "Host: admit or turn away someone waiting"
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
      responses:
        "200":
          description: Done
        "400":
          description: Invalid
        "403":
          description: HOST_REQUIRED or ORIGIN_REJECTED
        "409":
          description: Not possible in the current state
  "/meet/{token}/presence":
    post:
      security: []
      summary: Report joining or leaving a room (a fallback to the media server)
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
      responses:
        "200":
          description: Done
        "400":
          description: Invalid
        "403":
          description: HOST_REQUIRED or ORIGIN_REJECTED
        "409":
          description: Not possible in the current state
  "/meet/{token}/rooms":
    post:
      security: []
      summary: "Host: create, assign, close caucus rooms, or bring everyone back"
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
      responses:
        "200":
          description: Done
        "400":
          description: Invalid
        "403":
          description: HOST_REQUIRED or ORIGIN_REJECTED
        "409":
          description: Not possible in the current state
  "/meet/{token}/consent":
    post:
      security: []
      summary: "Recording consent: host requests; each person agrees, declines or
        withdraws"
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
      responses:
        "200":
          description: Done
        "400":
          description: Invalid
        "403":
          description: HOST_REQUIRED or ORIGIN_REJECTED
        "409":
          description: Not possible in the current state
  "/meet/{token}/recording":
    post:
      security: []
      summary: "Host: report a recording started (only when everyone present agreed)
        or stopped, with its SHA-256"
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
      responses:
        "200":
          description: Done
        "400":
          description: Invalid
        "403":
          description: HOST_REQUIRED or ORIGIN_REJECTED
        "409":
          description: Not possible in the current state
  "/meet/{token}/verify-code":
    post:
      security: []
      summary: Record that this person compared the security code, and whether it
        matched
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
      responses:
        "200":
          description: Done
        "400":
          description: Invalid
        "403":
          description: HOST_REQUIRED or ORIGIN_REJECTED
        "409":
          description: Not possible in the current state
  "/meet/{token}/wire":
    post:
      security: []
      summary: Record a voice confirmation of wire instructions by their SHA-256 (the
        instructions stay encrypted in the meeting)
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
      responses:
        "200":
          description: Done
        "400":
          description: Invalid
        "403":
          description: HOST_REQUIRED or ORIGIN_REJECTED
        "409":
          description: Not possible in the current state
  "/meet/{token}/appearance":
    post:
      security: []
      summary: State the party represented, bar number or language
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
      responses:
        "200":
          description: Done
        "400":
          description: Invalid
        "403":
          description: HOST_REQUIRED or ORIGIN_REJECTED
        "409":
          description: Not possible in the current state
  "/meet/{token}/agreement":
    post:
      security: []
      summary: "Host: print the terms agreed in the meeting as a PDF with signature
        blocks and create the agreement"
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
      responses:
        "200":
          description: Done
        "400":
          description: Invalid
        "403":
          description: HOST_REQUIRED or ORIGIN_REJECTED
        "409":
          description: Not possible in the current state
  "/meet/{token}/moderate":
    post:
      security: []
      summary: "Host controls, enforced at the media server: mute one person or
        everyone else, remove someone (they cannot rejoin until let back in),
        let them back in, or lock and unlock the meeting so no one new can join.
        Host or mediator only; each action is recorded in the sealed meeting
        record"
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - action
              properties:
                action:
                  type: string
                  enum:
                    - mute
                    - mute_all
                    - remove
                    - readmit
                    - lock
                    - unlock
                participant:
                  type: string
                  description: Required for mute, remove and readmit
      responses:
        "200":
          description: Done
        "403":
          description: Only the host or mediator can do this
        "409":
          description: The host or mediator cannot be muted or removed
  "/meet/{token}/end":
    post:
      security: []
      summary: "Host: end the meeting for everyone and seal the record"
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
      responses:
        "200":
          description: Done
        "400":
          description: Invalid
        "403":
          description: HOST_REQUIRED or ORIGIN_REJECTED
        "409":
          description: Not possible in the current state
  "/copy/{token}":
    get:
      summary: A copy recipient's page. Shows the signed copy once everyone has
        finished; a copy link can never sign
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      responses:
        "200":
          description: HTML page
        "404":
          description: Unknown copy link
        "410":
          description: Copy access ended 30 days after completion
  "/copy/{token}/proof-kit.zip":
    get:
      summary: The proof kit through a copy link
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      responses:
        "200":
          description: ZIP of the original, the signed PDF, proof.json and the offline
            verifier
        "409":
          description: Not everyone has signed yet
        "410":
          description: Copy access ended 30 days after completion
  "/copy/{token}/{artifact}":
    get:
      summary: The signed PDF (completed.pdf or signed-N.pdf) or proof.json through a
        copy link
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
        - in: path
          name: artifact
          required: true
          schema:
            type: string
      responses:
        "200":
          description: The file
        "404":
          description: Unknown copy link or file
        "409":
          description: Not everyone has signed yet
        "410":
          description: Copy access ended 30 days after completion
  "/v2/meetings/{id}/update":
    post:
      summary: Edit a scheduled meeting with revision protection
      x-required-scope: meetings:write
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateMeeting"
      responses:
        "200":
          description: Updated meeting. No invitations are sent automatically.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Meeting"
        "400":
          description: Invalid meeting or participant
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Meeting not found
        "409":
          description: Stale revision, meeting closed, or meeting already started for a
            details edit
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      description: Revision-checked update. Previously emailed participants receive
        REQUEST calendar updates; removed participants and replaced email
        addresses receive CANCEL. UID stays stable and SEQUENCE increases.
        Rescheduling clears prior RSVP responses. Notifications and the update
        commit atomically.
  "/v2/meetings/{id}/participants":
    post:
      summary: Add people to a scheduled or live meeting while preserving existing links
      x-required-scope: meetings:write
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - revision
                - participants
              properties:
                revision:
                  type: integer
                  minimum: 1
                participants:
                  type: array
                  minItems: 1
                  maxItems: 24
                  items:
                    $ref: "#/components/schemas/MeetingParticipantInput"
      responses:
        "200":
          description: Updated meeting. No invitations are sent automatically.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Meeting"
        "400":
          description: Invalid meeting or participant
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Meeting not found
        "409":
          description: Stale revision, meeting closed, or meeting already started for a
            details edit
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/meet/{token}/rsvp":
    post:
      summary: Respond to a personal meeting invitation
      security: []
      parameters:
        - name: token
          in: path
          required: true
          schema:
            type: string
      description: Requires the meeting origin and a valid current personal link. Only
        updates that participant. A decline suppresses reminders; it does not
        revoke the link.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - status
              properties:
                status:
                  type: string
                  enum:
                    - accepted
                    - tentative
                    - declined
      responses:
        "200":
          description: Saved participant RSVP
        "400":
          description: Invalid response
        "403":
          description: Wrong origin
        "404":
          description: Invalid or revoked personal link
        "409":
          description: Meeting closed
  /v2/templates/catalog:
    get:
      summary: "List the HESigns attorney library: drafted agreements with questions,
        clause choices and cited compliance notes"
      description: Starting drafts for licensed lawyers to review; not legal advice.
        Each entry says whether this workspace has added it.
      responses:
        "200":
          description: version, notice, practice_areas and data
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: templates:read
  "/v2/templates/catalog/{key}":
    parameters:
      - in: path
        name: key
        required: true
        schema:
          type: string
        description: Library template key, such as engagement_letter
    get:
      summary: "Read a library template: outline, questions, clause alternatives,
        compliance notes and execution advice"
      responses:
        "200":
          description: Library template
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Unknown key
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: templates:read
  "/v2/templates/catalog/{key}/preview.pdf":
    parameters:
      - in: path
        name: key
        required: true
        schema:
          type: string
        description: Library template key, such as engagement_letter
    get:
      summary: A sample drafted from a library template, with each question shown in
        [brackets]
      responses:
        "200":
          description: PDF
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: templates:read
  "/v2/templates/catalog/{key}/install":
    parameters:
      - in: path
        name: key
        required: true
        schema:
          type: string
        description: Library template key, such as engagement_letter
    post:
      summary: Add a library template to this workspace as version 1 of a
        questionnaire template
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 120
      responses:
        "201":
          description: Template
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AgreementTemplate"
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: templates:write
  /v2/templates/usage:
    get:
      summary: "How each template was used: agreements, completed, open, verified
        drafts, versions used and median hours to complete"
      parameters:
        - in: query
          name: days
          schema:
            type: integer
            minimum: 1
            maximum: 366
            default: 365
      responses:
        "200":
          description: from, to, days, truncated and data keyed by template ID
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: templates:read
  /v2/templates/preview:
    post:
      summary: Draft a sample from an unsaved composition, for template editors
      description: Answers 200 with valid false and the reason when the composition
        cannot be saved yet.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - roles
                - routing
                - composition
              properties:
                roles:
                  type: array
                routing:
                  enum:
                    - parallel
                    - sequential
                    - groups
                composition:
                  $ref: "#/components/schemas/TemplateComposition"
      responses:
        "200":
          description: valid, document, fields, warnings and plan; or valid false with error
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: templates:write
  /v2/templates/import:
    post:
      summary: Import a template file exported from another HESigns workspace
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - format
                - format_version
              properties:
                format:
                  const: he-signs-template
                format_version:
                  const: 1
      responses:
        "201":
          description: Template
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AgreementTemplate"
        "400":
          description: Not a template file
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: templates:write
  "/v2/templates/{id}/composition":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    get:
      summary: "Read a questionnaire template: questions, clause choices, compliance
        notes and the composition"
      parameters:
        - in: query
          name: version
          schema:
            type: integer
            minimum: 1
          description: Defaults to latest
      responses:
        "200":
          description: template, variables, slots, title, meta and composition
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Fixed-PDF template
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: templates:read
  "/v2/templates/{id}/assemble":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    post:
      summary: Draft a document from answers
      description: A preview shows unanswered questions as [placeholders] and reports
        missing and invalid answers. A final draft needs every required answer
        and a name and email for every role, uses the approved version where
        approval is required, and returns an assembly_token.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - version
              properties:
                version:
                  type: integer
                  minimum: 1
                mode:
                  enum:
                    - preview
                    - final
                  default: preview
                values:
                  type: object
                choices:
                  type: object
                  additionalProperties:
                    type: string
                assignments:
                  type: object
      responses:
        "200":
          description: Draft
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AssembledDraft"
        "400":
          description: Invalid or missing answers
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Version not approved, or template archived
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: templates:write
  "/v2/templates/{id}/compare":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    get:
      summary: "Compare two versions: word-by-word changes in the document and
        structural changes to roles, fields, questions, clauses and compliance
        notes"
      parameters:
        - in: query
          name: from
          schema:
            type: integer
        - in: query
          name: to
          schema:
            type: integer
      responses:
        "200":
          description: Changes, statistics and structure
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: templates:read
  "/v2/templates/{id}/compare.pdf":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    get:
      summary: Redline PDF between two template versions
      parameters:
        - in: query
          name: from
          schema:
            type: integer
        - in: query
          name: to
          schema:
            type: integer
      responses:
        "200":
          description: PDF
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: templates:read
  "/v2/templates/{id}/duplicate":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    post:
      summary: Copy a template version into a new template
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                version:
                  type: integer
                name:
                  type: string
                  maxLength: 120
      responses:
        "201":
          description: Template
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AgreementTemplate"
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: templates:write
  "/v2/templates/{id}/export.json":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    get:
      summary: A portable template file another workspace can import
      parameters:
        - in: query
          name: version
          schema:
            type: integer
            minimum: 1
          description: Defaults to latest
      responses:
        "200":
          description: format he-signs-template, format_version 1, and the template
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: templates:read
  "/v2/templates/{id}/approval":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    put:
      summary: Approve a version, withdraw approval, or require approval before use
      description: Every change is kept in approval_history.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                approved:
                  type: boolean
                version:
                  type: integer
                  minimum: 1
                require:
                  type: boolean
                note:
                  type: string
                  maxLength: 300
      responses:
        "200":
          description: Template
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AgreementTemplate"
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: templates:approve
  "/v2/templates/{id}/pin":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    put:
      summary: Pin a template to the top of the library for everyone in the workspace
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - pinned
              properties:
                pinned:
                  type: boolean
      responses:
        "200":
          description: Template
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AgreementTemplate"
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: templates:write
  /v2/templates/convert:
    post:
      summary: Read a Word (.docx, .dotx) or text file from the firm’s own software
        into a questionnaire template, without saving it
      description: Merge fields, content controls, [bracketed] and ______ blanks,
        «field», <<field>> and {{field}} markers become questions; whole
        bracketed sentences become optional clauses; paragraphs separated by
        [OR] become clause choices; «IF x»…«ELSE»…«END IF» become conditions;
        drafting notes move to usage_notes; signature blocks become recipients.
        Placeholders that are a signer’s own name or email use what the sender
        types for that person. Tracked changes are accepted as shown. Nothing is
        executed. Save the result with POST /v2/templates, passing
        import_source.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: object
                  required:
                    - name
                    - base64
                  properties:
                    name:
                      type: string
                      maxLength: 200
                    base64:
                      type: string
                      description: Up to 8 MB
      responses:
        "200":
          description: name, roles, routing, composition, usage_notes, import_source and a
            report of what was found
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Unsupported, damaged, password-protected or empty file, with what
            to do instead
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: templates:write
  /v2/drafts:
    get:
      summary: List this workspace’s drafts, newest first (up to 500)
      responses:
        "200":
          description: "data: title, matter, status, people, open suggestions and
            comments, review links and when each was opened"
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:read
    post:
      summary: Start a draft from a questionnaire template’s answers, a Word or text
        file, or blank
      description: Template drafts resolve every answer and clause choice into
        concrete, editable text; signers’ names stay live as {{role.name}}.
        Unanswered questions stay as [bracketed] placeholders, which the draft
        checks list.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  maxLength: 120
                matter:
                  type: string
                  maxLength: 200
                template:
                  type: object
                  required:
                    - id
                    - version
                  properties:
                    id:
                      type: string
                    version:
                      type: integer
                      minimum: 1
                values:
                  type: object
                choices:
                  type: object
                people:
                  type: object
                  description: By role key
                  additionalProperties:
                    type: object
                    properties:
                      name:
                        type: string
                        maxLength: 120
                      email:
                        type: string
                        format: email
                import:
                  type: object
                  required:
                    - name
                    - base64
                  properties:
                    name:
                      type: string
                    base64:
                      type: string
                      description: A .docx, .dotx, .docm or .txt file up to 8 MB
                from_terms:
                  type: string
                  description: "With template: a pasted term sheet (20 to 20,000 characters). The
                    assistant answers the template’s own questions from it;
                    values sent with it win. The response adds filled_from_terms
                    { answered, choices, unanswered, notes }. Needs the
                    assistant on with whole_document allowed."
      responses:
        "201":
          description: "The draft as the firm sees it: blocks with ids, people,
            suggestions (with outdated), comments with visibility, versions,
            review links, checks and activity"
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid answers, file or title
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/drafts/{id}":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    get:
      summary: Read a draft
      parameters:
        - in: query
          name: since
          required: false
          schema:
            type: integer
          description: "The revision you have; returns {unchanged: true} when nothing
            changed"
      responses:
        "200":
          description: "The draft as the firm sees it: blocks with ids, people,
            suggestions (with outdated), comments with visibility, versions,
            review links, checks and activity"
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Draft not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:read
  "/v2/drafts/{id}/details":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    put:
      summary: Change the title, matter or status
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  maxLength: 120
                matter:
                  type: string
                  maxLength: 200
                status:
                  enum:
                    - drafting
                    - internal_review
                    - with_client
                    - with_counterparty
                    - archived
      responses:
        "200":
          description: "The draft as the firm sees it: blocks with ids, people,
            suggestions (with outdated), comments with visibility, versions,
            review links, checks and activity"
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Draft not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: The text changed, the draft is locked, or it is not ready
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/drafts/{id}/people":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    put:
      summary: Name who signs each role; a role sent with neither name nor email is
        cleared. Fixed once agreed.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - people
              properties:
                people:
                  type: object
                  description: By role key
                  additionalProperties:
                    type: object
                    properties:
                      name:
                        type: string
                        maxLength: 120
                      email:
                        type: string
                        format: email
      responses:
        "200":
          description: "The draft as the firm sees it: blocks with ids, people,
            suggestions (with outdated), comments with visibility, versions,
            review links, checks and activity"
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Draft not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: The text changed, the draft is locked, or it is not ready
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/drafts/{id}/edits":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    post:
      summary: "Edit the text directly: change a passage, insert, delete or move a
        block, or add and remove list items"
      description: 'Send from with each text change: if the passage changed since you
        read it, nothing is saved and 409 TEXT_CHANGED is returned. Up to 200
        changes apply together or not at all. Signature blocks for every signer
        must remain. restore puts back a block that was deleted (with after,
        before, or into and index), keeping its block ids where they are free,
        which is how undo works. Text may contain {{ref:<section block id>}}, a
        live cross-reference that prints as “Section N” and follows the section
        when it moves; draft checks flag references to sections that are gone
        and section numbers typed as text. When a text change’s from no longer
        matches because someone else saved a change meanwhile, the two are
        combined if they touch different words (the result is "merged"); if they
        change the same words, nothing is saved and 409 TEXT_CHANGED is
        returned. nest moves a block into the section or exhibit before it
        (direction in) or out of its section (direction out), keeping reading
        order. replace puts back a whole block (with) as undo does. list_item
        takes action level (with level 0 to 3) as well as insert and delete.
        Inserted blocks may be exhibit ({ title, kind: exhibit | schedule |
        annex | appendix, text }) or image ({ image, width, align, alt }). Text
        marks: **bold**, <i>italic</i>, <u>underline</u>, <fn>footnote</fn>;
        {{ref:b12}} and {{ref:b12.k3}} are live cross-references to a section or
        exhibit and to a list item. move also takes after, before, or into
        with index, to put a block anywhere (exhibits stay at the top level).
        Inserted blocks may also be a table ({ cols, rows } or { columns,
        rows }) and a table of contents ({ type: contents, title, depth: 1 |
        2 }). Paragraphs and headings take align: center, right or justify.
        Text marks also include <s>strikethrough</s> and <hl>highlight</hl>.
        Highlights are drafting marks: previews show them, the agreed
        document prints without them, and draft checks list each one as
        HIGHLIGHTED. A table may carry widths (whole percentages, 5 to 95,
        adding up to 100) and merges ([{ row, col, rows, cols }], row -1
        being the header row, which merges only across). Merged cells never
        overlap; a cell hidden inside a merged cell keeps empty text and
        cannot be edited. The PDF, the Word file and Word import all keep
        merged cells; a Word file''s table of contents carries the PDF''s page
        numbers.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - changes
              properties:
                changes:
                  type: array
                  minItems: 1
                  maxItems: 200
                  items:
                    type: object
                    required:
                      - op
                    properties:
                      op:
                        enum:
                          - text
                          - insert
                          - delete
                          - move
                          - list_item
                          - restore
                          - nest
                          - replace
                      block:
                        oneOf:
                          - type: string
                          - type: object
                            description: "For insert and restore: the block"
                      field:
                        type: string
                        description: text, title, items.N, items.N.label, columns.N or rows.R.C
                      from:
                        type: string
                      text:
                        type: string
                      after:
                        type: string
                      before:
                        type: string
                      into:
                        type: string
                      direction:
                        type: string
                        enum:
                          - up
                          - down
                          - in
                          - out
                        description: move (up, down) or nest (in, out)
                      action:
                        type: string
                        enum:
                          - insert
                          - delete
                          - level
                      index:
                        type: integer
                        description: For list_item, the item; for restore or move with into, the position
                      clause_option:
                        type: string
                        description: For a text change taken from /alternatives
                      level:
                        type: integer
                        minimum: 0
                        maximum: 3
                        description: For list_item level
                      with:
                        type: object
                        description: "For replace: the block as it should be"
      responses:
        "200":
          description: "The draft as the firm sees it: blocks with ids, people,
            suggestions (with outdated), comments with visibility, versions,
            review links, checks and activity, and results naming inserted block
            ids"
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid change
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Draft not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: The text changed, the draft is locked, or it is not ready
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/drafts/{id}/suggestions":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    post:
      summary: Suggest a change without making it (tracked change)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - kind
              properties:
                kind:
                  enum:
                    - replace
                    - insert
                    - delete
                    - structure
                changes:
                  type: array
                  minItems: 1
                  maxItems: 200
                  items:
                    type: object
                  description: For structure, the edit operations (as for edits), applied together when the suggestion is accepted
                summary:
                  type: string
                  maxLength: 200
                  description: For structure, a plain summary; the firm's own editor may name it, and a reviewer's is always worked out by the server
                block:
                  type: string
                field:
                  type: string
                from:
                  type: string
                to:
                  type: string
                after:
                  type: string
                block_data:
                  type: object
                  description: paragraph, heading, section, list, notice, page_break, checkboxes
                    or fill
                  required:
                    - type
                  properties:
                    type:
                      enum:
                        - paragraph
                        - heading
                        - section
                        - list
                        - notice
                        - page_break
                        - checkboxes
                        - fill
                    text:
                      type: string
                    title:
                      type: string
                    items:
                      type: array
                      items:
                        type: string
                    role:
                      type: string
                    label:
                      type: string
                note:
                  type: string
                  maxLength: 1000
                before:
                  type: string
                  description: "For an insertion: the block it goes before (instead of after)"
                source:
                  type: string
                  maxLength: 300
                  description: Where the wording comes from, such as a playbook clause
                clause_option:
                  type: string
                  description: "For a replacement taken from /alternatives: the alternative it
                    uses"
      responses:
        "201":
          description: "The draft as the firm sees it: blocks with ids, people,
            suggestions (with outdated), comments with visibility, versions,
            review links, checks and activity, and the suggestion"
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Draft not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: The text changed, the draft is locked, or it is not ready
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/drafts/{id}/decisions":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    post:
      summary: Accept or reject suggestions by id, or every open one from a party
      description: "A suggestion whose passage changed after it was made is outdated:
        accepting it by id needs force: true; accepting by party skips it."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - accept
              properties:
                accept:
                  type: boolean
                ids:
                  type: array
                  items:
                    type: string
                party:
                  enum:
                    - firm
                    - client
                    - counterparty
                    - agent
                force:
                  type: boolean
      responses:
        "200":
          description: "The draft as the firm sees it: blocks with ids, people,
            suggestions (with outdated), comments with visibility, versions,
            review links, checks and activity, and decided"
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Draft not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: The text changed, the draft is locked, or it is not ready
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/drafts/{id}/comments":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    post:
      summary: Comment on the draft, a passage or a quoted phrase, choosing who can
        see it
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - body
              properties:
                body:
                  type: string
                  maxLength: 4000
                visibility:
                  enum:
                    - internal
                    - client
                    - counterparty
                    - everyone
                  default: internal
                  description: Internal comments never reach a reviewer and never print.
                block:
                  type: string
                field:
                  type: string
                quote:
                  type: string
                  maxLength: 500
                occurrence:
                  type: integer
                  minimum: 0
      responses:
        "201":
          description: "The draft as the firm sees it: blocks with ids, people,
            suggestions (with outdated), comments with visibility, versions,
            review links, checks and activity, and the comment"
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Draft not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: The text changed, the draft is locked, or it is not ready
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/drafts/{id}/comments/{comment}":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
      - in: path
        name: comment
        required: true
        schema:
          type: string
    delete:
      summary: Delete a comment and its replies
      responses:
        "200":
          description: "The draft as the firm sees it: blocks with ids, people,
            suggestions (with outdated), comments with visibility, versions,
            review links, checks and activity"
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Draft not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: The text changed, the draft is locked, or it is not ready
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/drafts/{id}/comments/{comment}/replies":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
      - in: path
        name: comment
        required: true
        schema:
          type: string
    post:
      summary: Reply to a comment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - body
              properties:
                body:
                  type: string
                  maxLength: 4000
      responses:
        "201":
          description: "The draft as the firm sees it: blocks with ids, people,
            suggestions (with outdated), comments with visibility, versions,
            review links, checks and activity"
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Draft not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: The text changed, the draft is locked, or it is not ready
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/drafts/{id}/comments/{comment}/status":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
      - in: path
        name: comment
        required: true
        schema:
          type: string
    put:
      summary: Resolve or reopen a comment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - status
              properties:
                status:
                  enum:
                    - open
                    - resolved
      responses:
        "200":
          description: "The draft as the firm sees it: blocks with ids, people,
            suggestions (with outdated), comments with visibility, versions,
            review links, checks and activity"
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Draft not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: The text changed, the draft is locked, or it is not ready
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/drafts/{id}/versions":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    post:
      summary: Save the current text as a named version
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                label:
                  type: string
                  maxLength: 120
      responses:
        "201":
          description: "The draft as the firm sees it: blocks with ids, people,
            suggestions (with outdated), comments with visibility, versions,
            review links, checks and activity"
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Draft not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: The text changed, the draft is locked, or it is not ready
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/drafts/{id}/compare":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
      - in: query
        name: from
        required: false
        schema:
          type: string
        description: A version number
      - in: query
        name: to
        required: false
        schema:
          type: string
        description: A version number, or current (default)
    get:
      summary: Compare two versions passage by passage, word by word
      responses:
        "200":
          description: "units (changed, inserted, deleted), changes, stats, and insights:
            what changed in practice (amounts, rates, periods, dates, duties,
            negations, definitions, removed protections, moved passages), each
            with its section"
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Draft not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: The text changed, the draft is locked, or it is not ready
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:read
  "/v2/drafts/{id}/compare.pdf":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
      - in: query
        name: from
        required: false
        schema:
          type: string
        description: A version number
      - in: query
        name: to
        required: false
        schema:
          type: string
        description: A version number, or current (default)
    get:
      summary: A redline PDF of the comparison
      responses:
        "200":
          description: Redline PDF
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Draft not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: The text changed, the draft is locked, or it is not ready
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:read
  "/v2/drafts/{id}/document.pdf":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
      - in: query
        name: version
        required: false
        schema:
          type: integer
        description: Omit for the current text
    get:
      summary: The draft as its PDF, as it would be signed
      responses:
        "200":
          description: PDF
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Draft not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: The text changed, the draft is locked, or it is not ready
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:read
  "/v2/drafts/{id}/shares":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    post:
      summary: Create a private review link for the client or the other side
      description: Reviewers see the draft, comments visible to their side, their own
        suggestions and what changed since the link was created or resent. The
        client and the other side never see each other’s comments or
        suggestions, or anyone’s email address.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - email
                - party
              properties:
                name:
                  type: string
                  maxLength: 120
                email:
                  type: string
                  format: email
                party:
                  enum:
                    - client
                    - counterparty
                permission:
                  enum:
                    - suggest
                    - comment
                  default: suggest
                send:
                  type: boolean
                  description: Email the link now (409 EMAIL_UNAVAILABLE where email is not set
                    up)
                message:
                  type: string
                  description: A note for the reviewer, up to 2,000 characters
                respond_by:
                  type: string
                  description: A date to respond by (YYYY-MM-DD, today or later)
                  format: date
      responses:
        "201":
          description: "The draft as the firm sees it: blocks with ids, people,
            suggestions (with outdated), comments with visibility, versions,
            review links, checks and activity, and the share with its path,
            /d/{token}"
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Draft not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: The text changed, the draft is locked, or it is not ready
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/drafts/{id}/shares/{share}/{action}":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
      - in: path
        name: share
        required: true
        schema:
          type: string
      - in: path
        name: action
        required: true
        schema:
          enum:
            - revoke
            - rotate
            - reshare
        description: revoke turns the link off; rotate replaces it; reshare saves a
          version so the reviewer sees changes since now
    post:
      summary: Turn off, renew or resend a review link
      responses:
        "200":
          description: "The draft as the firm sees it: blocks with ids, people,
            suggestions (with outdated), comments with visibility, versions,
            review links, checks and activity"
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Draft not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: The text changed, the draft is locked, or it is not ready
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                send:
                  type: boolean
                  description: "With reshare or rotate: email the link again"
                message:
                  type: string
                  description: A new note
                respond_by:
                  type: string
                  description: A new date to respond by
                  format: date
      x-required-scope: envelopes:write
  "/v2/drafts/{id}/finalize":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    post:
      summary: "Mark the draft agreed: locks the text, saves a version and returns the
        signing package"
      description: Refused with NOT_READY while suggestions are open or a signer lacks
        a name or email, and with PLACEHOLDERS while [bracketed] placeholders
        remain unless allow_placeholders is true.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                allow_placeholders:
                  type: boolean
      responses:
        "200":
          description: "The signing package: title, version, roles, routing, people,
            fields, document {name, base64, sha256, page_count} and draft_token.
            Create the agreement with this document unchanged and template
            {draft_id, version, draft_token}."
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Draft not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: The text changed, the draft is locked, or it is not ready
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/drafts/{id}/agreed":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    get:
      summary: Read the signing package of an agreed draft again
      responses:
        "200":
          description: "The signing package: title, version, roles, routing, people,
            fields, document {name, base64, sha256, page_count} and draft_token.
            Create the agreement with this document unchanged and template
            {draft_id, version, draft_token}."
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Draft not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: The text changed, the draft is locked, or it is not ready
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:read
  "/v2/drafts/{id}/reopen":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    post:
      summary: Reopen an agreed draft for changes
      responses:
        "200":
          description: "The draft as the firm sees it: blocks with ids, people,
            suggestions (with outdated), comments with visibility, versions,
            review links, checks and activity"
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Draft not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: The text changed, the draft is locked, or it is not ready
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/drafts/{id}/duplicate":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    post:
      summary: Copy the text and people into a new draft, without comments,
        suggestions or links
      responses:
        "201":
          description: "The draft as the firm sees it: blocks with ids, people,
            suggestions (with outdated), comments with visibility, versions,
            review links, checks and activity"
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Draft not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: The text changed, the draft is locked, or it is not ready
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/d/{token}/data":
    parameters:
      - in: path
        name: token
        required: true
        schema:
          type: string
        description: From the review link
    get:
      summary: The reviewer’s view of the draft
      security: []
      responses:
        "200":
          description: title, roles, people names, blocks, reviewer, comments visible to
            their side, their suggestions, changes_since and locked
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Link not valid or turned off
          content:
            application/json:
              schema:
                type: object
  "/d/{token}/document.pdf":
    parameters:
      - in: path
        name: token
        required: true
        schema:
          type: string
        description: From the review link
    get:
      summary: The draft PDF for the reviewer
      security: []
      responses:
        "200":
          description: PDF
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        "404":
          description: Link not valid or turned off
          content:
            application/json:
              schema:
                type: object
  "/d/{token}/comments":
    parameters:
      - in: path
        name: token
        required: true
        schema:
          type: string
        description: From the review link
    post:
      summary: Comment as the reviewer; visible to the firm and the reviewer’s side
      security: []
      description: Browser requests from another origin are refused.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                body:
                  type: string
                  maxLength: 4000
                block:
                  type: string
                field:
                  type: string
                quote:
                  type: string
                occurrence:
                  type: integer
      responses:
        "201":
          description: Saved
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Not allowed by this link, or from another origin
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Link not valid or turned off
          content:
            application/json:
              schema:
                type: object
  "/d/{token}/suggestions":
    parameters:
      - in: path
        name: token
        required: true
        schema:
          type: string
        description: From the review link
    post:
      summary: Suggest a change as the reviewer (links with permission suggest)
      security: []
      description: Browser requests from another origin are refused.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                kind:
                  enum:
                    - replace
                    - insert
                    - delete
                    - structure
                changes:
                  type: array
                  minItems: 1
                  maxItems: 200
                  items:
                    type: object
                  description: For structure, the edit operations (as for edits), applied together when the suggestion is accepted
                summary:
                  type: string
                  maxLength: 200
                  description: For structure, a plain summary; the firm's own editor may name it, and a reviewer's is always worked out by the server
                block:
                  type: string
                field:
                  type: string
                from:
                  type: string
                to:
                  type: string
                after:
                  type: string
                block_data:
                  type: object
                  description: paragraph, heading, section, list, notice, page_break, checkboxes
                    or fill
                  required:
                    - type
                  properties:
                    type:
                      enum:
                        - paragraph
                        - heading
                        - section
                        - list
                        - notice
                        - page_break
                        - checkboxes
                        - fill
                    text:
                      type: string
                    title:
                      type: string
                    items:
                      type: array
                      items:
                        type: string
                    role:
                      type: string
                    label:
                      type: string
                note:
                  type: string
      responses:
        "201":
          description: Saved
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Not allowed by this link, or from another origin
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Link not valid or turned off
          content:
            application/json:
              schema:
                type: object
  "/d/{token}/replies":
    parameters:
      - in: path
        name: token
        required: true
        schema:
          type: string
        description: From the review link
    post:
      summary: Reply to a comment the reviewer can see
      security: []
      description: Browser requests from another origin are refused.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                comment:
                  type: string
                body:
                  type: string
                  maxLength: 4000
      responses:
        "201":
          description: Saved
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Not allowed by this link, or from another origin
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Link not valid or turned off
          content:
            application/json:
              schema:
                type: object
  "/v2/drafts/{id}/reviews/{block}":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
      - in: path
        name: block
        required: true
        schema:
          type: string
        description: A section or passage block id
    put:
      summary: Mark a section reviewed, or clear the mark. The mark covers the exact
        text; any later change to the section shows it as no longer current.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                reviewed:
                  type: boolean
                  default: true
      responses:
        "200":
          description: The draft as the firm sees it; reviews shows each mark with current
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Draft not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: The draft is locked or the text changed
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/drafts/{id}/approval":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    put:
      summary: Require approval before the draft can be agreed, or stop requiring it
      x-required-scope: templates:approve
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - required
              properties:
                required:
                  type: boolean
      responses:
        "200":
          description: The draft as the firm sees it
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Needs templates:approve
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Draft not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: The draft is locked or the text changed
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/drafts/{id}/approval/request":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    post:
      summary: Ask for approval of the current text
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                approver:
                  type: string
                  maxLength: 120
                note:
                  type: string
                  maxLength: 1000
      responses:
        "200":
          description: The draft as the firm sees it
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Draft not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: The draft is locked or the text changed
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/drafts/{id}/approval/decide":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    post:
      summary: Approve the current text, or return it with a note
      description: An approval records a hash of the exact text and saves a version.
        Any later change to the wording makes it out of date, and agreement is
        blocked until it is approved again.
      x-required-scope: templates:approve
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - approved
              properties:
                approved:
                  type: boolean
                note:
                  type: string
                  maxLength: 1000
                  description: Required when returning the draft
      responses:
        "200":
          description: The draft as the firm sees it; approval shows current or stale
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Needs templates:approve
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Draft not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: The draft is locked or the text changed
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/drafts/{id}/comments/{comment}/assign":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
      - in: path
        name: comment
        required: true
        schema:
          type: string
    put:
      summary: Give a comment an owner and a due date, or remove them. Reviewers never
        see owners.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - assignee
              properties:
                assignee:
                  oneOf:
                    - type: object
                      required:
                        - name
                      properties:
                        name:
                          type: string
                          maxLength: 120
                        email:
                          type: string
                          format: email
                    - type: "null"
                due:
                  type: string
                  format: date
      responses:
        "200":
          description: The draft as the firm sees it
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Draft not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: The draft is locked or the text changed
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/drafts/{id}/standard":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
      - in: query
        name: block
        required: false
        schema:
          type: string
        description: Passage block id
      - in: query
        name: field
        required: false
        schema:
          type: string
        description: text (default), title or items.N
    get:
      summary: "Compare a passage with the firm’s standard: the template wording it
        was drafted from, or the first draft"
      responses:
        "200":
          description: label, standard, current, same, and insights (what the difference
            does in practice)
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Draft not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: The draft is locked or the text changed
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:read
  "/v2/drafts/{id}/alternatives":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
      - in: query
        name: block
        required: false
        schema:
          type: string
        description: A passage that came from a template clause choice
    get:
      summary: The template’s alternatives for a clause, drafted with this matter’s
        answers
      description: Apply one with an edit or a replace suggestion carrying
        clause_option, so the draft remembers which alternative it uses.
      responses:
        "200":
          description: slot, current, modified and options [{key, title, description,
            text, applicable, current}]
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: This passage has no alternative clauses
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:read
  "/v2/drafts/{id}/document.docx":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    post:
      summary: Export the draft as a Word document for a reader
      description: Every passage is bookmarked so a returned copy can be read back;
        the comments the reader may see go out as Word comments, and open
        suggestions optionally as tracked changes. The text that went out is
        kept as a version.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                audience:
                  enum:
                    - firm
                    - client
                    - counterparty
                  default: firm
                suggestions:
                  type: boolean
                  default: false
      responses:
        "200":
          description: The Word document
          content:
            application/vnd.openxmlformats-officedocument.wordprocessingml.document:
              schema:
                type: string
                format: binary
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Draft not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: The draft is locked or the text changed
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/drafts/{id}/word-return":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    post:
      summary: Read a Word copy that came back as suggestions and comments
      description: Each changed passage becomes a replace suggestion from that party
        (noted when the passage also changed here after export), new paragraphs
        become suggested insertions, removed passages become suggested removals,
        and Word comments become comments visible to that party (with firm, your
        own team's edits made in Word become your team's suggestions and
        internal comments). Their tracked changes are read as accepted. Nothing
        changes the text until it is accepted.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - base64
                - party
              properties:
                name:
                  type: string
                  maxLength: 200
                base64:
                  type: string
                  description: A .docx up to 8 MB
                party:
                  type: string
                  enum:
                    - client
                    - counterparty
                    - firm
                  description: "Whose edits these are: firm for your own team’s edits made in Word
                    (they become your suggestions and internal comments)"
                reviewer:
                  type: string
                  maxLength: 120
      responses:
        "200":
          description: The draft as the firm sees it, and report {changed, inserted,
            deleted, comments, conflicts, unchanged, base_version}
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Not a Word document
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Exported from a different draft, or the draft is locked
          content:
            application/json:
              schema:
                type: object
        "422":
          description: None of the draft’s passages are in the file
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  /v2/playbooks:
    get:
      summary: List the workspace’s playbooks
      x-required-scope: templates:read
      responses:
        "200":
          description: "data: playbooks with their positions"
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
    post:
      summary: "Create a playbook: positions on recurring clauses with preferred
        wording, fallbacks, red lines and who approves exceptions"
      x-required-scope: templates:approve
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - positions
              properties:
                name:
                  type: string
                  maxLength: 120
                scope:
                  enum:
                    - firm
                    - client
                client:
                  type: string
                  maxLength: 160
                description:
                  type: string
                  maxLength: 600
                positions:
                  type: array
                  maxItems: 60
                  items:
                    type: object
                    required:
                      - topic
                      - match
                    properties:
                      id:
                        type: string
                      topic:
                        type: string
                        maxLength: 120
                      match:
                        type: array
                        maxItems: 20
                        items:
                          type: string
                          maxLength: 80
                        description: Words or phrases that find the clause in a draft
                      required:
                        type: boolean
                      preferred:
                        type: string
                        maxLength: 20000
                      fallbacks:
                        type: array
                        maxItems: 5
                        items:
                          type: object
                          properties:
                            text:
                              type: string
                            note:
                              type: string
                              maxLength: 400
                      prohibited:
                        type: array
                        maxItems: 20
                        items:
                          type: string
                          maxLength: 200
                        description: Red lines that must not appear
                      guidance:
                        type: string
                        maxLength: 1000
                      escalate_to:
                        type: string
                        maxLength: 120
                        description: Who approves an exception
      responses:
        "201":
          description: The playbook
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid playbook
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  /v2/playbooks/example:
    post:
      summary: Add an example firm playbook to edit into the firm’s own
      x-required-scope: templates:approve
      responses:
        "201":
          description: The playbook
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/playbooks/{playbook}":
    parameters:
      - in: path
        name: playbook
        required: true
        schema:
          type: string
    put:
      summary: Replace a playbook
      x-required-scope: templates:approve
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - positions
              properties:
                name:
                  type: string
                  maxLength: 120
                scope:
                  enum:
                    - firm
                    - client
                client:
                  type: string
                  maxLength: 160
                description:
                  type: string
                  maxLength: 600
                positions:
                  type: array
                  maxItems: 60
                  items:
                    type: object
                    required:
                      - topic
                      - match
                    properties:
                      id:
                        type: string
                      topic:
                        type: string
                        maxLength: 120
                      match:
                        type: array
                        maxItems: 20
                        items:
                          type: string
                          maxLength: 80
                        description: Words or phrases that find the clause in a draft
                      required:
                        type: boolean
                      preferred:
                        type: string
                        maxLength: 20000
                      fallbacks:
                        type: array
                        maxItems: 5
                        items:
                          type: object
                          properties:
                            text:
                              type: string
                            note:
                              type: string
                              maxLength: 400
                      prohibited:
                        type: array
                        maxItems: 20
                        items:
                          type: string
                          maxLength: 200
                        description: Red lines that must not appear
                      guidance:
                        type: string
                        maxLength: 1000
                      escalate_to:
                        type: string
                        maxLength: 120
                        description: Who approves an exception
      responses:
        "200":
          description: The playbook
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Not possible in the draft’s current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
    delete:
      summary: Delete a playbook
      x-required-scope: templates:approve
      responses:
        "200":
          description: Deleted
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Not possible in the draft’s current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/drafts/{id}/playbook":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    get:
      summary: Check the draft against every firm playbook and the client playbooks
        chosen for it
      description: Each finding names the position, its status (preferred, fallback,
        deviates, missing or red_line), the passage, a plain message, the
        options to use instead, and any accepted exception. Worked out from the
        text; no model is involved.
      responses:
        "200":
          description: applicable playbooks, client_playbooks with selected, and findings
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Not possible in the draft’s current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:read
  "/v2/drafts/{id}/playbooks":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    put:
      summary: Choose the client playbooks that apply to this draft
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - client_playbooks
              properties:
                client_playbooks:
                  type: array
                  maxItems: 10
                  items:
                    type: string
      responses:
        "200":
          description: The draft as the firm sees it
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Not possible in the draft’s current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/drafts/{id}/playbook/{position}/waive":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
      - in: path
        name: position
        required: true
        schema:
          type: string
    post:
      summary: Accept an exception to a playbook position, with a reason; it lapses if
        the passage changes
      x-required-scope: templates:approve
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                block:
                  type: string
                field:
                  type: string
                note:
                  type: string
                  maxLength: 1000
                waived:
                  type: boolean
                  description: false withdraws the exception
      responses:
        "200":
          description: The draft as the firm sees it
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Not possible in the draft’s current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/drafts/{id}/obligations/candidates":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    get:
      summary: Find the duties, deadlines, renewals and notice periods in the agreed
        text
      description: 'Due dates are worked out from the effective date: one set on the
        draft, a date stated in the text ("made as of"), or the day signing
        completed. Found by rule from the text; nothing is saved.'
      responses:
        "200":
          description: effective_date, effective_source and candidates not yet tracked
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Not possible in the draft’s current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:read
  "/v2/drafts/{id}/obligations":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    post:
      summary: Track obligations, found or added by hand
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - items
              properties:
                items:
                  type: array
                  minItems: 1
                  maxItems: 50
                  items:
                    type: object
                    required:
                      - title
                    properties:
                      title:
                        type: string
                        maxLength: 200
                      text:
                        type: string
                        maxLength: 1000
                      kind:
                        enum:
                          - payment
                          - notice
                          - renewal
                          - termination
                          - reporting
                          - confidentiality
                          - delivery
                          - other
                      block:
                        type: string
                      field:
                        type: string
                      section:
                        type: string
                      parties:
                        type: array
                        items:
                          type: string
                      due:
                        type: object
                        description: "How the date is worked out: relative to the effective date or the
                          end of the term, a fixed date, a renewal, or a
                          schedule (every)"
                      due_date:
                        oneOf:
                          - type: string
                            format: date
                          - type: "null"
                      owner:
                        oneOf:
                          - type: object
                            required:
                              - name
                            properties:
                              name:
                                type: string
                              email:
                                type: string
                                format: email
                          - type: "null"
                      reminder_days:
                        type: integer
                        minimum: 0
                        maximum: 365
                        default: 7
                      note:
                        type: string
                      source:
                        enum:
                          - found
                          - added
      responses:
        "201":
          description: The draft as the firm sees it, and the ids added
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Not possible in the draft’s current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/drafts/{id}/obligations/{obligation}":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
      - in: path
        name: obligation
        required: true
        schema:
          type: string
    put:
      summary: Change an obligation’s date, owner, reminder or status. A date set here
        no longer follows the effective date.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  maxLength: 200
                text:
                  type: string
                  maxLength: 1000
                kind:
                  enum:
                    - payment
                    - notice
                    - renewal
                    - termination
                    - reporting
                    - confidentiality
                    - delivery
                    - other
                block:
                  type: string
                field:
                  type: string
                section:
                  type: string
                parties:
                  type: array
                  items:
                    type: string
                due:
                  type: object
                  description: "How the date is worked out: relative to the effective date or the
                    end of the term, a fixed date, a renewal, or a schedule
                    (every)"
                due_date:
                  oneOf:
                    - type: string
                      format: date
                    - type: "null"
                owner:
                  oneOf:
                    - type: object
                      required:
                        - name
                      properties:
                        name:
                          type: string
                        email:
                          type: string
                          format: email
                    - type: "null"
                reminder_days:
                  type: integer
                  minimum: 0
                  maximum: 365
                  default: 7
                note:
                  type: string
                status:
                  enum:
                    - open
                    - done
      responses:
        "200":
          description: The draft as the firm sees it
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Not possible in the draft’s current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
    delete:
      summary: Stop tracking an obligation
      responses:
        "200":
          description: The draft as the firm sees it
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Not possible in the draft’s current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/drafts/{id}/effective-date":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    put:
      summary: Set the effective date; due dates worked out from it follow, dates set
        by hand stay
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - date
              properties:
                date:
                  oneOf:
                    - type: string
                      format: date
                    - type: "null"
      responses:
        "200":
          description: The draft as the firm sees it
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Not possible in the draft’s current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/drafts/{id}/obligations.ics":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    get:
      summary: This agreement’s open obligations as a calendar, with reminders
      responses:
        "200":
          description: An iCalendar file
          content:
            text/calendar:
              schema:
                type: string
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Not possible in the draft’s current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:read
  /v2/obligations:
    get:
      summary: Obligations across every agreement in the workspace, soonest first
      parameters:
        - in: query
          name: status
          required: false
          schema:
            enum:
              - open
              - done
              - all
            default: open
        - in: query
          name: draft
          required: false
          schema:
            type: string
          description: Only this draft
      responses:
        "200":
          description: data (each with its agreement), and counts of overdue, this_week
            and undated
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:read
  /v2/obligations.ics:
    get:
      summary: Every open obligation with a date, as a calendar with reminders;
        schedules repeat
      responses:
        "200":
          description: An iCalendar file
          content:
            text/calendar:
              schema:
                type: string
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:read
  "/v2/drafts/{id}/amend":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    post:
      summary: Start an amendment from the signed text of an agreed or sent draft
      description: The new draft’s first version is the signed text, so every change
        can be compared and signed again. Both drafts link to each other.
      responses:
        "201":
          description: The amendment draft
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Not possible in the draft’s current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/drafts/{id}/presence":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    put:
      summary: Say this editor has the draft open, and which passage it is editing;
        renew every few seconds
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - session
              properties:
                session:
                  type: string
                  pattern: ^[A-Za-z0-9-]{8,64}$
                block:
                  type: string
                field:
                  type: string
      responses:
        "200":
          description: "people: everyone else with the draft open"
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Not possible in the draft’s current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/drafts/{id}/presence/{session}":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
      - in: path
        name: session
        required: true
        schema:
          type: string
    delete:
      summary: Say this editor has closed the draft
      responses:
        "200":
          description: Left
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Not possible in the draft’s current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/drafts/{id}/live":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    get:
      summary: A server-sent event stream of the draft’s revision and who has it open
      description: Sends event "state" with {revision, people} at once and whenever
        either changes; a comment line keeps the connection open. The stream
        ends after ten minutes; reconnect.
      responses:
        "200":
          description: Event stream
          content:
            text/event-stream:
              schema:
                type: string
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Not possible in the draft’s current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:read
  /v2/assistant:
    get:
      summary: Whether a drafting assistant is configured on this server and turned on
        for the workspace, and what it is sent
      x-required-scope: templates:read
      responses:
        "200":
          description: available, provider, model, enabled, actions and sends
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
    put:
      summary: Turn the drafting assistant on or off for the workspace
      x-required-scope: templates:approve
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - enabled
              properties:
                enabled:
                  type: boolean
                acknowledged:
                  type: boolean
                  description: "Required to turn it on: passages asked about are sent to the
                    provider"
                whole_document:
                  type: boolean
                  description: Allow issue lists (the whole agreement) and filling templates from
                    a pasted term sheet
                whole_document_acknowledged:
                  type: boolean
                  description: "Required with whole_document: true when turning it on"
                precedents:
                  type: boolean
                  description: Allow similar clauses from the firm’s agreed and signed agreements
                    as examples
                precedents_acknowledged:
                  type: boolean
                  description: "Required with precedents: true when turning it on"
      responses:
        "200":
          description: The setting
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Acknowledgement required
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: No provider is configured on this server
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/drafts/{id}/assist":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    post:
      summary: Ask the drafting assistant about one passage
      description: "explain and explain_client return an explanation (and risks);
        mutual, plain, position (a playbook position id) and custom (an
        instruction) return proposed wording with a rationale and any missing
        facts as bracketed placeholders. Nothing changes the draft: apply the
        wording with an edit or a suggestion. People’s names are replaced by
        their roles before anything is sent. Limited per workspace per hour.
        action issues reads the whole agreement (allowed separately:
        whole_document) and returns issues [{ passage, severity, issue, block,
        field, from, replacement? }], high first. With precedents allowed,
        mutual, plain, position and custom may include up to three similar
        clauses from the firm’s agreed or signed drafts as examples (listed in
        precedents); a restricted matter’s agreements are used only within that
        matter."
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - action
                - block
              properties:
                action:
                  enum:
                    - explain
                    - explain_client
                    - mutual
                    - plain
                    - position
                    - custom
                block:
                  type: string
                field:
                  type: string
                instruction:
                  type: string
                  maxLength: 1000
                position:
                  type: string
                for_role:
                  type: string
                  description: "With issues: the role the firm acts for (default: the client
                    role)"
      responses:
        "200":
          description: kind, from, and explanation/risks or replacement/rationale,
            missing_facts, provider and model
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Not found in this workspace
          content:
            application/json:
              schema:
                type: object
        "409":
          description: The assistant is not configured or is off
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
        "502":
          description: The provider did not answer usefully
          content:
            application/json:
              schema:
                type: object
        "504":
          description: The provider took too long
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/drafts/{id}/suggestions/{suggestion}/withdraw":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
      - in: path
        name: suggestion
        required: true
        schema:
          type: string
    post:
      summary: Withdraw one of your team’s open suggestions
      responses:
        "200":
          description: The draft as the firm sees it
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Only your team’s suggestions can be withdrawn
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Not found
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Already decided
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  /v2/signing-provider:
    get:
      summary: The workspace's remote signing provider (CSC API v2)
      description: client_secret is never returned; return_url is the address to
        register with the provider.
      x-required-scope: envelopes:read
      responses:
        "200":
          description: "{ provider: {name, base_url, client_id, client_secret_set, levels,
            oauth_base, tested_at, test, updated_at} | null, return_url, levels,
            trust_list, signature_timestamps }"
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
    put:
      summary: Set the signing provider (owners and admins; brand:manage)
      x-required-scope: brand:manage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - base_url
                - client_id
                - levels
              properties:
                name:
                  type: string
                  maxLength: 80
                base_url:
                  type: string
                  format: uri
                  description: CSC API v2 base, e.g. https://provider.example/csc/v2
                client_id:
                  type: string
                  maxLength: 200
                client_secret:
                  type: string
                  maxLength: 500
                  description: Required the first time; omit to keep the stored secret. Stored
                    encrypted.
                levels:
                  type: array
                  items:
                    type: string
                    enum:
                      - qualified
                      - advanced
                  minItems: 1
      responses:
        "200":
          description: Same shape as GET
          content:
            application/json:
              schema:
                type: object
        "400":
          description: INVALID_PROVIDER_URL, INVALID_PROVIDER_CLIENT,
            INVALID_PROVIDER_SECRET, INVALID_PROVIDER_LEVELS,
            INVALID_PROVIDER_NAME
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: ROLE_REQUIRED
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
    delete:
      summary: Remove the signing provider (owners and admins)
      x-required-scope: brand:manage
      responses:
        "200":
          description: Same shape as GET, with provider null
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  /v2/signing-provider/test:
    post:
      summary: Test the connection with CSC info
      x-required-scope: brand:manage
      responses:
        "200":
          description: "{ ok, checks: [{check, passed, detail}], info: {name, specs,
            region, description, methods, auth_types}, provider, return_url }"
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: NO_SIGNING_PROVIDER
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
        "502":
          description: PROVIDER_UNREACHABLE
          content:
            application/json:
              schema:
                type: object
  /v2/destinations:
    get:
      summary: Where this workspace saves agreements, without any secret
      responses:
        "200":
          description: The settings, or null when none are set up
          content:
            application/json:
              schema:
                type: object
                properties:
                  destination:
                    oneOf:
                      - $ref: "#/components/schemas/Destination"
                      - type: "null"
                  placeholders:
                    type: array
                    items:
                      type: string
                  default_template:
                    type: string
                  example_path:
                    type: string
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: destinations:manage
    put:
      summary: Choose where agreements are saved
      description: Microsoft SharePoint or OneDrive through Microsoft Graph (client
        credentials), or a WebDAV server. The client secret or password is
        encrypted at rest and never returned; leave it out to keep the saved
        one, which is reused only for the same app in the same directory, or the
        same WebDAV address and username.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DestinationInput"
      responses:
        "200":
          description: The saved settings
          content:
            application/json:
              schema:
                type: object
                properties:
                  destination:
                    $ref: "#/components/schemas/Destination"
        "400":
          description: INVALID_DESTINATION or SECRET_REQUIRED, with the reason
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: destinations:manage
    delete:
      summary: Stop saving; the stored secret is deleted and waiting saves are cancelled
      responses:
        "200":
          description: The settings, now off
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: destinations:manage
  /v2/destinations/test:
    post:
      summary: Test the saved settings, or settings sent in the body, without saving
        them
      description: Signs in, finds the site and its libraries (or the OneDrive, or the
        WebDAV folder), then saves and removes a small test file in the fixed
        start of the folder path.
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DestinationInput"
      responses:
        "200":
          description: The result of each step; ok is false with a plain reason when a
            step failed
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DestinationTest"
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: destinations:manage
  /v2/destinations/uploads:
    get:
      summary: Recent saves, newest first
      parameters:
        - in: query
          name: state
          schema:
            enum:
              - failed
        - in: query
          name: source
          schema:
            enum:
              - draft
              - envelope
        - in: query
          name: source_id
          schema:
            type: string
        - in: query
          name: limit
          schema:
            type: integer
            minimum: 1
            maximum: 200
            default: 50
      responses:
        "200":
          description: The saves
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/DestinationUpload"
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: destinations:manage
  "/v2/destinations/uploads/{id}/retry":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
          pattern: ^dst_[a-f0-9]{40}$
    post:
      summary: Save a failed or waiting file again now
      responses:
        "202":
          description: Queued again
          content:
            application/json:
              schema:
                type: object
                properties:
                  upload:
                    $ref: "#/components/schemas/DestinationUpload"
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: UPLOAD_NOT_FOUND
          content:
            application/json:
              schema:
                type: object
        "409":
          description: ALREADY_SAVED, or SAVING while a worker holds it
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: destinations:manage
  "/v2/drafts/{id}/save-to":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    get:
      summary: Where "Save to …" would put this draft's files, and what was saved before
      parameters:
        - in: query
          name: client
          schema:
            type: string
            maxLength: 200
        - in: query
          name: matter
          schema:
            type: string
            maxLength: 200
      responses:
        "200":
          description: The preview
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SaveToPreview"
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:read
    post:
      summary: Save this draft's files now (the agreed PDF and Word copy once agreed,
        otherwise the current draft)
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SaveToRequest"
      responses:
        "202":
          description: Queued; files already saved at this place are reported, not saved
            again
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SaveToResult"
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: NOT_CONFIGURED or NOTHING_TO_SAVE
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/envelopes/{id}/save-to":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    get:
      summary: Where "Save to …" would put this agreement's signed PDF and proof kit
      parameters:
        - in: query
          name: client
          schema:
            type: string
            maxLength: 200
        - in: query
          name: matter
          schema:
            type: string
            maxLength: 200
      responses:
        "200":
          description: The preview
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SaveToPreview"
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:read
    post:
      summary: Save this completed agreement's signed PDF and proof kit now
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SaveToRequest"
      responses:
        "202":
          description: Queued; files already saved at this place are reported, not saved
            again
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SaveToResult"
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: NOT_CONFIGURED, or NOTHING_TO_SAVE before everyone has signed
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/templates/{id}/versions/{version}/counsel-review":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
      - in: path
        name: version
        required: true
        schema:
          type: integer
          minimum: 1
    get:
      summary: Counsel review status of one template version
      description: Status reviewed, stale (an earlier version was reviewed and the
        template changed since) or not_reviewed; label ("Reviewed by counsel for
        Florida on October 5, 2026" or "Not yet reviewed by counsel");
        content_sha256, the fingerprint a review binds to (the questionnaire for
        drafted templates, the PDF for fixed ones); standing reviews; the
        template's review history; and the jurisdictions that can be chosen.
      responses:
        "200":
          description: Counsel review status
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Template or version not found
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: templates:read
    post:
      summary: Record that licensed counsel reviewed this exact version
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - reviewer_name
                - bar_admissions
                - jurisdictions
                - reviewed_on
                - content_sha256
              properties:
                reviewer_name:
                  type: string
                  maxLength: 120
                bar_admissions:
                  type: array
                  minItems: 1
                  maxItems: 10
                  items:
                    type: object
                    required:
                      - state
                      - number
                    properties:
                      state:
                        type: string
                        description: Two-letter state or territory
                      number:
                        type: string
                        maxLength: 40
                jurisdictions:
                  type: array
                  minItems: 1
                  items:
                    type: string
                    description: Two-letter state or territory, or US for federal law
                reviewed_on:
                  type: string
                  format: date
                scope_notes:
                  type: string
                  maxLength: 2000
                content_sha256:
                  type: string
                  pattern: ^[a-f0-9]{64}$
                  description: Must equal the version's fingerprint (409 CONTENT_CHANGED
                    otherwise)
      responses:
        "201":
          description: Counsel review status
          content:
            application/json:
              schema:
                type: object
        "400":
          description: INVALID_COUNSEL_REVIEW
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Needs templates:approve
        "409":
          description: CONTENT_CHANGED or COUNSEL_REVIEW_LIMIT
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: templates:approve
  "/v2/templates/{id}/versions/{version}/counsel-review/withdraw":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
      - in: path
        name: version
        required: true
        schema:
          type: integer
          minimum: 1
    post:
      summary: Withdraw a counsel review, with the reason
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - reason
              properties:
                review_id:
                  type: string
                reason:
                  type: string
                  maxLength: 300
      responses:
        "200":
          description: Counsel review status
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Needs templates:approve
        "404":
          description: No standing review
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: templates:approve
  "/v2/templates/{id}/versions/{version}/counsel-review/packet.docx":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
      - in: path
        name: version
        required: true
        schema:
          type: integer
          minimum: 1
    get:
      summary: A Word review packet for counsel (questionnaire templates), with Track
        Changes on
      responses:
        "200":
          description: .docx
          content:
            application/vnd.openxmlformats-officedocument.wordprocessingml.document:
              schema:
                type: string
                format: binary
        "400":
          description: NOT_ASSEMBLED
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: templates:read
  /v2/meetings/notary/profile:
    get:
      summary: "Your notary profile: commission, seal and certificate details (never
        the key, its password or the seal's bytes)"
      description: "403 NOTARY_MEMBER_REQUIRED for an API key: profiles and journals
        belong to a signed-in workspace member."
      x-required-scope: meetings:read
      responses:
        "200":
          description: The profile, or null before one is saved
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: NOTARY_MEMBER_REQUIRED
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
    put:
      summary: Save your notary profile
      description: "403 NOTARY_MEMBER_REQUIRED for an API key: profiles and journals
        belong to a signed-in workspace member."
      x-required-scope: meetings:write
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - commission
              properties:
                commission:
                  type: object
                  required:
                    - name
                    - state
                    - number
                    - expires_on
                  properties:
                    name:
                      type: string
                    state:
                      type: string
                    number:
                      type: string
                    expires_on:
                      type: string
                      format: date
                    county:
                      type: string
                    registration:
                      type: string
                seal_png:
                  type: string
                  description: The seal image, base64 PNG
                certificate:
                  type: object
                  description: "The notary's signing certificate: PKCS#12 (RSA, 2048 bits or
                    more), base64, with its password"
                  properties:
                    p12:
                      type: string
                    password:
                      type: string
                remove_certificate:
                  type: boolean
                revision:
                  type: integer
      responses:
        "200":
          description: The saved profile
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid commission, seal or certificate
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: NOTARY_MEMBER_REQUIRED or SCOPE_REQUIRED
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  /v2/meetings/notary/profile/seal.png:
    get:
      summary: Your saved seal image
      x-required-scope: meetings:read
      responses:
        "200":
          description: Your saved seal image
          content:
            image/png:
              schema:
                type: string
                format: binary
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: NOTARY_MEMBER_REQUIRED
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  /v2/meetings/notary/journal:
    get:
      summary: Your notary journal, with the verification of its hash chain
      description: "403 NOTARY_MEMBER_REQUIRED for an API key: profiles and journals
        belong to a signed-in workspace member."
      x-required-scope: meetings:read
      responses:
        "200":
          description: "{ data, verification }"
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: NOTARY_MEMBER_REQUIRED
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  /v2/meetings/notary/journal.csv:
    get:
      summary: Your notary journal as CSV
      x-required-scope: meetings:read
      responses:
        "200":
          description: Your notary journal as CSV
          content:
            text/csv:
              schema:
                type: string
                format: binary
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: NOTARY_MEMBER_REQUIRED
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  /v2/meetings/notary/journal.pdf:
    get:
      summary: Your notary journal as PDF
      x-required-scope: meetings:read
      responses:
        "200":
          description: Your notary journal as PDF
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: NOTARY_MEMBER_REQUIRED
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  /v2/meetings/notary/journal.json:
    get:
      summary: Your notary journal as JSON, signed by HESigns (Ed25519)
      x-required-scope: meetings:read
      responses:
        "200":
          description: Your notary journal as JSON, signed by HESigns (Ed25519)
          content:
            application/json:
              schema:
                type: string
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: NOTARY_MEMBER_REQUIRED
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  /v2/meetings/notary/journal/corrections:
    post:
      summary: "Correct a journal entry: a new entry that names the one it corrects
        (entries are never changed)"
      description: "403 NOTARY_MEMBER_REQUIRED for an API key: profiles and journals
        belong to a signed-in workspace member."
      x-required-scope: meetings:write
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - corrects_seq
                - changes
                - reason
              properties:
                corrects_seq:
                  type: integer
                  minimum: 1
                changes:
                  type: object
                  description: "field: corrected value"
                reason:
                  type: string
      responses:
        "201":
          description: The correction entry
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid correction
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: NOTARY_MEMBER_REQUIRED or SCOPE_REQUIRED
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/meetings/{id}/notarization/notarized.pdf":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    get:
      summary: "The notarized agreement: the signed PDF with the notarial certificate,
        seal and the notary's signature added as a later revision"
      x-required-scope: meetings:read
      responses:
        "200":
          description: "The notarized agreement: the signed PDF with the notarial
            certificate, seal and the notary's signature added as a later
            revision"
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: NOTARY_MEMBER_REQUIRED
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/meetings/{id}/notarization/recordings/{recording}":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
      - in: path
        name: recording
        required: true
        schema:
          type: string
    get:
      summary: The retained recording of the act (the notary only)
      x-required-scope: meetings:read
      responses:
        "200":
          description: The retained recording of the act (the notary only)
          content:
            video/webm:
              schema:
                type: string
                format: binary
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: NOTARY_MEMBER_REQUIRED
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/meet/{token}/notarization/details":
    post:
      security: []
      summary: "Principal: the details the journal records, such as their address"
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
      responses:
        "200":
          description: Done
        "400":
          description: Invalid
        "403":
          description: Not this person's step, or ORIGIN_REJECTED
        "409":
          description: Not possible in the current state of the act
  "/meet/{token}/notarization/identity":
    post:
      security: []
      summary: "Principal: upload ID images for credential analysis (OCR on this
        server; at most 5 attempts)"
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
      responses:
        "200":
          description: Done
        "400":
          description: Invalid
        "403":
          description: Not this person's step, or ORIGIN_REJECTED
        "409":
          description: Not possible in the current state of the act
  "/meet/{token}/notarization/kba/start":
    post:
      security: []
      summary: "Principal: start knowledge-based authentication, when the deployment
        has a KBA provider"
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
      responses:
        "200":
          description: Done
        "400":
          description: Invalid
        "403":
          description: Not this person's step, or ORIGIN_REJECTED
        "409":
          description: Not possible in the current state of the act
  "/meet/{token}/notarization/kba/answer":
    post:
      security: []
      summary: "Principal: answer the knowledge-based authentication questions"
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
      responses:
        "200":
          description: Done
        "400":
          description: Invalid
        "403":
          description: Not this person's step, or ORIGIN_REJECTED
        "409":
          description: Not possible in the current state of the act
  "/meet/{token}/notarization/identify":
    post:
      security: []
      summary: "Notary: record how each principal was identified"
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
      responses:
        "200":
          description: Done
        "400":
          description: Invalid
        "403":
          description: Not this person's step, or ORIGIN_REJECTED
        "409":
          description: Not possible in the current state of the act
  "/meet/{token}/notarization/certificate":
    post:
      security: []
      summary: "Notary: complete the notarial certificate (act type, venue, wording)"
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
      responses:
        "200":
          description: Done
        "400":
          description: Invalid
        "403":
          description: Not this person's step, or ORIGIN_REJECTED
        "409":
          description: Not possible in the current state of the act
  "/meet/{token}/notarization/act":
    post:
      security: []
      summary: "Notary: start or finish the notarial act"
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
      responses:
        "200":
          description: Done
        "400":
          description: Invalid
        "403":
          description: Not this person's step, or ORIGIN_REJECTED
        "409":
          description: Not possible in the current state of the act
  "/meet/{token}/notarization/journal-signature":
    post:
      security: []
      summary: "Principal or witness: sign the notary journal entry"
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
      responses:
        "200":
          description: Done
        "400":
          description: Invalid
        "403":
          description: Not this person's step, or ORIGIN_REJECTED
        "409":
          description: Not possible in the current state of the act
  "/meet/{token}/notarization/seal":
    post:
      security: []
      summary: "Notary: seal and sign the notarized PDF (PAdES, as an incremental
        update)"
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
      responses:
        "200":
          description: Done
        "400":
          description: Invalid
        "403":
          description: Not this person's step, or ORIGIN_REJECTED
        "409":
          description: Not possible in the current state of the act
  "/meet/{token}/notarization/recording/start":
    post:
      security: []
      summary: "Notary: start the encrypted upload of the recording of the act"
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
      responses:
        "200":
          description: Done
        "400":
          description: Invalid
        "403":
          description: Not this person's step, or ORIGIN_REJECTED
        "409":
          description: Not possible in the current state of the act
  "/meet/{token}/notarization/recording/finish":
    post:
      security: []
      summary: "Notary: finish the recording upload; HESigns confirms its SHA-256"
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
      responses:
        "200":
          description: Done
        "400":
          description: Invalid
        "403":
          description: Not this person's step, or ORIGIN_REJECTED
        "409":
          description: Not possible in the current state of the act
  "/meet/{token}/notarization/recording/chunk":
    post:
      security: []
      summary: 'Notary: one encrypted recording chunk (IV, AES-GCM ciphertext and tag;
        AAD "<recording>:<seq>"), up to 9 MB'
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
        - in: query
          name: recording
          required: true
          schema:
            type: string
        - in: query
          name: seq
          required: true
          schema:
            type: integer
            minimum: 0
      requestBody:
        required: true
        content:
          application/octet-stream:
            schema:
              type: string
              format: binary
      responses:
        "200":
          description: Done
        "400":
          description: Invalid
        "403":
          description: Not this person's step, or ORIGIN_REJECTED
        "409":
          description: Not possible in the current state of the act
  "/meet/{token}/notarization/id/{participant}/{side}":
    get:
      security: []
      summary: "Notary: a principal's ID image, while it is retained"
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
        - in: path
          name: participant
          required: true
          schema:
            type: string
        - in: path
          name: side
          required: true
          schema:
            type: string
            enum:
              - front
              - back
      responses:
        "200":
          description: Image
          content:
            image/jpeg:
              schema:
                type: string
                format: binary
            image/png:
              schema:
                type: string
                format: binary
        "403":
          description: Notary only
        "410":
          description: Deleted at the end of its retention period
  "/meet/{token}/notarization/notarized.pdf":
    get:
      security: []
      summary: The notarized agreement, for the people in the act
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
      responses:
        "200":
          description: PDF
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        "404":
          description: Not notarized yet
  "/v2/drafts/{id}/images":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    post:
      summary: Add a picture (PNG or JPEG up to 2 MB) to use in the draft or as the
        header logo
      description: Pictures are held once per draft under an id made from their bytes
        (img_…); place one with an insert edit of type image. Up to 30 pictures,
        8 MB in all.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: File name
                base64:
                  type: string
                  description: The PNG or JPEG file
              required:
                - base64
      responses:
        "201":
          description: "The draft, with image: {id, type, width, height}"
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Not a PNG or JPEG
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: The draft is locked or holds too many pictures
          content:
            application/json:
              schema:
                type: object
        "413":
          description: Larger than 2 MB
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/drafts/{id}/images/{image}":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
      - in: path
        name: image
        required: true
        schema:
          type: string
    get:
      summary: A picture’s bytes
      responses:
        "200":
          description: The image
          content:
            image/png:
              schema:
                type: string
                format: binary
            image/jpeg:
              schema:
                type: string
                format: binary
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Picture not found
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:read
  "/v2/drafts/{id}/layout":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    put:
      summary: The running header and footer, header logo, font, numbering, paper and
        line spacing, as every page prints them
      description: An approval also covers the header, footer and logo, and a numbering,
        paper or line spacing other than the default; changing them after approval
        needs approval again. Numbering changes what every cross-reference says
        ("Section 4.2" or "Article IV", "Section 4.02(a)"). A default value removes
        the setting.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                header_text:
                  type: string
                  description: One line, up to 120 characters; empty to remove
                  nullable: true
                footer_text:
                  type: string
                  description: One line, up to 120 characters; replaces the title in the footer;
                    empty to remove
                  nullable: true
                header_image:
                  type: string
                  description: A picture id from POST images, or null
                  nullable: true
                font:
                  type: string
                  description: times or helvetica
                  enum:
                    - times
                    - helvetica
                numbering:
                  type: string
                  description: decimal (1., 1.1, 1.1.1, the default) or article (ARTICLE I,
                    Section 1.01, (a), (i), (A))
                  nullable: true
                  enum:
                    - decimal
                    - article
                paper:
                  type: string
                  description: letter (the default) or a4
                  nullable: true
                  enum:
                    - letter
                    - a4
                spacing:
                  type: number
                  description: Line spacing for the body text; 1 (single, the default),
                    1.15, 1.5 or 2. Tables, footnotes and signature blocks stay single.
                  nullable: true
                  enum:
                    - 1
                    - 1.15
                    - 1.5
                    - 2
      responses:
        "200":
          description: The draft
          content:
            application/json:
              schema:
                type: object
        "400":
          description: INVALID_LAYOUT
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: The draft is locked
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/drafts/{id}/watchers":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    put:
      summary: Who is emailed when the client or the other side responds
      description: Responses are sent as one digest per ten minutes of activity, not
        one email per comment. The person who shares a draft is added
        automatically. A restricted matter’s digests reach only its team.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                watchers:
                  type: array
                  maxItems: 10
                  items:
                    type: object
                    properties:
                      email:
                        type: string
                        description: Email
                      name:
                        type: string
                        description: Name
                    required:
                      - email
              required:
                - watchers
      responses:
        "200":
          description: The draft
          content:
            application/json:
              schema:
                type: object
        "400":
          description: INVALID_WATCHERS
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/drafts/{id}/seen":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    post:
      summary: Mark the reviewers’ responses as seen by the firm (clears responded in
        the list)
      responses:
        "200":
          description: "{ ok: true }"
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/drafts/{id}/matter":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    put:
      summary: File the draft under a matter, or none
      description: The matter’s name (and reference) becomes the draft’s matter line.
        Only a restricted matter’s team can file drafts under it.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                matter_id:
                  type: string
                  description: A matter id, or null for none
                  nullable: true
      responses:
        "200":
          description: The draft
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: NOT_ON_TEAM
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Matter not found
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:write
  "/v2/drafts/{id}/spelling":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    get:
      summary: Words to check for spelling in a draft
      description: "Each passage's words as a reader sees them are checked against the
        English dictionary, a legal word list, the terms the draft defines, its
        people and organization, the firm's dictionary and the words ignored in
        this draft. A capitalized word used more than once counts as a name unless
        it is one letter from a real word. Wording in capitals, numbers, Roman
        numerals, addresses and links are not checked."
      responses:
        "200":
          description: "{ revision, items: [{ block, field, word, offset, length, note,
            context }] }. offset and length count characters of the passage's words
            as a reader sees them (a line break is one character); note is the
            footnote's index when the word is in a footnote."
          content:
            application/json:
              schema:
                type: object
  "/v2/drafts/{id}/spelling/suggestions":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    get:
      summary: Spelling suggestions for up to 40 words, best first
      parameters:
        - in: query
          name: words
          required: true
          schema:
            type: string
          description: Words separated by commas
      responses:
        "200":
          description: "{ suggestions: { word: [up to five suggestions] } }"
          content:
            application/json:
              schema:
                type: object
  "/v2/drafts/{id}/spelling/ignore":
    parameters:
      - in: path
        name: id
        required: true
        schema:
          type: string
    post:
      summary: Ignore a word's spelling in this draft only
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - word
              properties:
                word:
                  type: string
                  maxLength: 60
      responses:
        "200":
          description: The draft
          content:
            application/json:
              schema:
                type: object
        "400":
          description: INVALID_WORD
          content:
            application/json:
              schema:
                type: object
  /v2/dictionary:
    get:
      summary: The firm's dictionary, which every spelling check accepts
      responses:
        "200":
          description: "{ words }"
          content:
            application/json:
              schema:
                type: object
    post:
      summary: Add a word to the firm's dictionary
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - word
              properties:
                word:
                  type: string
                  maxLength: 60
                  description: One word; letters, with apostrophes or hyphens inside it
      responses:
        "201":
          description: "{ words }"
          content:
            application/json:
              schema:
                type: object
        "400":
          description: INVALID_WORD
          content:
            application/json:
              schema:
                type: object
        "409":
          description: LIMIT (5,000 words)
          content:
            application/json:
              schema:
                type: object
  "/v2/dictionary/{word}":
    parameters:
      - in: path
        name: word
        required: true
        schema:
          type: string
    delete:
      summary: Remove a word from the firm's dictionary
      responses:
        "200":
          description: "{ words }"
          content:
            application/json:
              schema:
                type: object
  /v2/matters:
    get:
      summary: Matters, including the restricted ones you may see or manage
      description: "A restricted matter is an ethical wall: its drafts, obligations
        and signed agreements answer 404 to signed-in people outside its team,
        owners and admins included (they manage teams; adding themselves is
        recorded). API keys act for the whole workspace and are not walled."
      responses:
        "200":
          description: "{ data: [{ id, name, client, reference, restricted, team, member,
            history }] }"
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: envelopes:read
    post:
      summary: Create a matter (owners and admins)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Up to 120 characters
                client:
                  type: string
                  description: Up to 120 characters
                reference:
                  type: string
                  description: Up to 120 characters
                restricted:
                  type: boolean
                  description: Only the team sees the matter’s drafts, obligations and agreements
                team:
                  type: array
                  maxItems: 200
                  items:
                    type: object
                    properties:
                      email:
                        type: string
                        description: Sign-in email
                      name:
                        type: string
                        description: Name
                    required:
                      - email
      responses:
        "201":
          description: The matter
          content:
            application/json:
              schema:
                type: object
        "400":
          description: INVALID_MATTER
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: matters:manage
  "/v2/matters/{matter}":
    parameters:
      - in: path
        name: matter
        required: true
        schema:
          type: string
    put:
      summary: Change a matter or its team (owners and admins); every change is
        recorded in its history
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Up to 120 characters
                client:
                  type: string
                  description: Up to 120 characters
                reference:
                  type: string
                  description: Up to 120 characters
                restricted:
                  type: boolean
                  description: Only the team sees the matter’s drafts, obligations and agreements
                team:
                  type: array
                  maxItems: 200
                  items:
                    type: object
                    properties:
                      email:
                        type: string
                        description: Sign-in email
                      name:
                        type: string
                        description: Name
                    required:
                      - email
      responses:
        "200":
          description: The matter
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Matter not found
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: matters:manage
    delete:
      summary: Delete a matter with no drafts filed under it
      responses:
        "200":
          description: "{ deleted: true }"
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: MATTER_IN_USE
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: matters:manage
  "/v2/envelopes/{id}/embedded-sessions":
    post:
      summary: Create a 15-minute signing session for an enrolled application origin
      x-required-scope: sessions:write
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - signer
                - parent_origin
              properties:
                signer:
                  type: integer
                  minimum: 0
                  maximum: 24
                parent_origin:
                  type: string
                  format: uri
      responses:
        "201":
          description: Short-lived session
          content:
            application/json:
              schema:
                type: object
                required:
                  - session_id
                  - session_url
                  - expires_at
                properties:
                  session_id:
                    type: string
                  session_url:
                    type: string
                    format: uri
                  expires_at:
                    type: string
                    format: date-time
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Origin not enrolled
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Agreement or signer already finished
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/embedded-sessions/{sessionId}":
    delete:
      summary: Revoke an embedded session
      x-required-scope: sessions:write
      parameters:
        - in: path
          name: sessionId
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Revoked
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Session not found
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  /v2/credentials:
    get:
      summary: List your credential metadata; never returns secrets
      x-required-scope: credentials:manage
      responses:
        "200":
          description: Credential metadata
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
    post:
      summary: Issue a scoped expiring key; cannot exceed the caller’s scopes
      x-required-scope: credentials:manage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - label
                - scopes
              properties:
                label:
                  type: string
                  maxLength: 100
                scopes:
                  type: array
                  items:
                    type: string
                expires_in_days:
                  type: integer
                  minimum: 1
                  maximum: 365
                  default: 90
      responses:
        "201":
          description: Store api_key securely; it is returned only once
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid or excessive scope
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: 20 active credentials limit reached
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/credentials/{id}":
    delete:
      summary: Immediately revoke a credential
      x-required-scope: credentials:manage
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Revoked
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Credential not found
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  /v2/events:
    get:
      summary: Read the durable event stream, including events created before webhook
        enrollment
      x-required-scope: events:read
      parameters:
        - in: query
          name: after
          required: false
          schema:
            type: string
      responses:
        "200":
          description: Up to 100 events, has_more and next_cursor. Persist next_cursor
            only after durable processing.
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  /v2/usage:
    get:
      summary: Read UTC calendar-month agreement usage, allowance and delivery backlog
      x-required-scope: usage:read
      responses:
        "200":
          description: Usage; idempotent replays are not counted again
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  /v2/webhooks:
    get:
      summary: Read your webhook endpoint metadata
      x-required-scope: webhooks:manage
      responses:
        "200":
          description: Endpoint metadata; no secret
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
    put:
      summary: Enroll or rotate an HTTPS webhook endpoint and secret
      x-required-scope: webhooks:manage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - url
              properties:
                url:
                  type: string
                  format: uri
                  maxLength: 2048
      responses:
        "200":
          description: Secret returned once. Existing queued events retain their old
            destination and secret.
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Private or invalid endpoint
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
    delete:
      summary: Disable new callbacks and cancel queued deliveries; an in-flight
        attempt may finish
      x-required-scope: webhooks:manage
      responses:
        "200":
          description: Disabled
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  /v2/webhooks/deliveries:
    get:
      summary: Inspect the most recent 100 webhook and email jobs
      x-required-scope: webhooks:manage
      responses:
        "200":
          description: Delivery state, attempts, next attempt, and sanitized failure code
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/webhooks/deliveries/{id}/replay":
    post:
      summary: Replay a dead, retrying or delivered job using its original event ID
        and destination snapshot
      x-required-scope: webhooks:manage
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "202":
          description: Queued
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Unavailable or currently processing
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  /v2/retention:
    get:
      summary: List retention state for the most recent 100 agreements
      x-required-scope: retention:manage
      responses:
        "200":
          description: Agreement metadata, legal holds, deletion dates and a seven-day
            grace period
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/retention/{id}/hold":
    put:
      summary: Place or release a legal hold; placing a hold cancels scheduled deletion
      x-required-scope: retention:manage
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - enabled
              properties:
                enabled:
                  type: boolean
      responses:
        "200":
          description: Updated hold
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Agreement unavailable
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/retention/{id}/deletion":
    post:
      summary: Schedule deletion of a closed agreement after seven days
      x-required-scope: retention:manage
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - confirm_document_name
              properties:
                confirm_document_name:
                  type: string
                  description: Must exactly match the document name
      responses:
        "202":
          description: Scheduled; cancellable before processing
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Agreement unavailable
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Agreement active or held
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
    delete:
      summary: Cancel scheduled deletion
      x-required-scope: retention:manage
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Cancelled
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Agreement unavailable
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  /verification-keys:
    get:
      summary: List active and historical public proof keys; establish trust through a
        separate channel
      security: []
      responses:
        "200":
          description: Public key metadata
          content:
            application/json:
              schema:
                type: object
  /v2/exports/completed:
    get:
      summary: List completed agreements eligible for bulk export, with cursor
        pagination
      x-required-scope: exports:read
      parameters:
        - in: query
          name: after
          required: false
          schema:
            type: string
      responses:
        "200":
          description: Up to 50 records, has_more and next_cursor. This is a live listing,
            not a frozen export snapshot.
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  /v2/exports/proof-kits.zip:
    post:
      summary: Export 1–10 completed proof kits in one archive, up to 32 MiB of
        artifact data
      x-required-scope: exports:read
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - ids
              properties:
                ids:
                  type: array
                  minItems: 1
                  maxItems: 10
                  uniqueItems: true
                  items:
                    type: string
      responses:
        "200":
          description: ZIP containing individual proof kits, a filename mapping and
            checksums
          content:
            application/zip:
              schema:
                type: string
                format: binary
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: One or more completed agreements unavailable
          content:
            application/json:
              schema:
                type: object
        "413":
          description: Choose a smaller batch
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
        "503":
          description: Export busy, or artifact/historical key unavailable
          content:
            application/json:
              schema:
                type: object
  /verification-key.pem:
    get:
      summary: Download a public proof key by key_id; defaults to the active key
      security: []
      parameters:
        - in: query
          name: key_id
          required: false
          schema:
            type: string
      responses:
        "200":
          description: Ed25519 public PEM
          content:
            application/x-pem-file:
              schema:
                type: string
        "404":
          description: Unknown key
          content:
            application/json:
              schema:
                type: object
  /v2/audit-log:
    get:
      summary: "Admin audit log, newest first: who did what (a member, an API key or
        the system), from which address, when. Entries are hash-chained and
        append-only."
      parameters:
        - in: query
          name: before
          required: false
          schema:
            type: string
        - in: query
          name: limit
          required: false
          schema:
            type: string
      responses:
        "200":
          description: data (seq, at, action, subject, actor {kind,id,name,email}, ip,
            user_agent), has_more, next_before
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: audit:read
  /v2/audit-log/verify:
    get:
      summary: Recompute the hash chain over every entry. A privacy redaction is
        reported, not treated as tampering.
      responses:
        "200":
          description: verified, entries, redacted, head {seq, entry_hash}; or broken_at
            and reason
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: audit:read
  /v2/audit-log/export.json:
    get:
      summary: The whole chain with what is needed to recompute it, signed with the
        service proof key (Ed25519, key_id as in /verification-key.pem). Refused
        while the chain fails verification.
      responses:
        "200":
          description: statement {purpose, tenant_id, generated_at, entry_hash algorithm,
            entries, redacted, head, key_id}, signature (base64), entries
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: AUDIT_CHAIN_BROKEN
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      x-required-scope: audit:read
  "/esign/{token}/challenge":
    post:
      summary: Queue a short-lived email verification code
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties: {}
              required: []
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Action unavailable in the current state
          content:
            application/json:
              schema:
                type: object
      security: []
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
  "/esign/{token}/verify-code":
    post:
      summary: Exchange an email code for a 30-minute private signing session
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                code:
                  type: string
                  pattern: ^[0-9]{6}$
              required:
                - code
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Action unavailable in the current state
          content:
            application/json:
              schema:
                type: object
      security: []
      parameters:
        - in: path
          name: token
          required: true
          schema:
            type: string
  /v2/deployment:
    get:
      summary: Read the configured region; physical infrastructure requires operator
        verification
      x-required-scope: usage:read
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Action unavailable in the current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  /v2/bulk/prepare-row:
    post:
      summary: Prepare one stable row manifest before submitting a customer-authorized
        bulk batch
      x-required-scope: envelopes:write
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                template_id:
                  type: string
                version:
                  type: integer
                row_index:
                  type: integer
                  minimum: 0
                  maximum: 999
                row:
                  $ref: "#/components/schemas/BulkRow"
              required:
                - template_id
                - version
                - row_index
                - row
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Action unavailable in the current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      parameters:
        - $ref: "#/components/parameters/idempotencyKey"
  /v2/bulk:
    get:
      summary: List durable batches
      x-required-scope: envelopes:write
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Action unavailable in the current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      parameters:
        - in: query
          name: after
          required: false
          schema:
            type: string
    post:
      summary: Queue reviewed independent agreements; send_invitations additionally
        requires envelopes:send
      x-required-scope: envelopes:write
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                template_id:
                  type: string
                version:
                  type: integer
                  minimum: 1
                rows:
                  type: array
                  minItems: 1
                  maxItems: 1000
                  items:
                    $ref: "#/components/schemas/BulkRow"
                confirm:
                  const: true
                send_invitations:
                  type: boolean
              required:
                - template_id
                - version
                - rows
                - confirm
                - send_invitations
      responses:
        "202":
          description: Durably queued. Up to three active jobs per workspace; payloads and
            downloads expire after 24 hours.
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid rows or selection
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Idempotency conflict, active-job limit or unavailable template
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      parameters:
        - $ref: "#/components/parameters/idempotencyKey"
  "/v2/bulk/{id}":
    get:
      summary: Read progress and up to 100 row results; continue using next_cursor as
        after
      x-required-scope: envelopes:write
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Action unavailable in the current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - in: query
          name: after
          required: false
          schema:
            type: integer
    delete:
      summary: Cancel pending rows; completed agreements remain
      x-required-scope: envelopes:write
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Action unavailable in the current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
  /v2/exports/jobs:
    get:
      summary: List durable batches
      x-required-scope: exports:read
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Action unavailable in the current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      parameters:
        - in: query
          name: after
          required: false
          schema:
            type: string
    post:
      summary: Freeze up to 10,000 completed agreements for background export
      x-required-scope: exports:read
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                all:
                  type: boolean
                ids:
                  type: array
                  minItems: 1
                  maxItems: 10000
                  uniqueItems: true
                  items:
                    type: string
              required: []
      responses:
        "202":
          description: Durably queued. Up to three active jobs per workspace; payloads and
            downloads expire after 24 hours.
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid rows or selection
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Idempotency conflict, active-job limit or unavailable template
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      parameters:
        - $ref: "#/components/parameters/idempotencyKey"
  "/v2/exports/jobs/{id}":
    get:
      summary: Read progress and up to 100 row results; continue using next_cursor as
        after
      x-required-scope: exports:read
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Action unavailable in the current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - in: query
          name: after
          required: false
          schema:
            type: integer
    delete:
      summary: Cancel pending rows; completed agreements remain
      x-required-scope: exports:read
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Action unavailable in the current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
  "/v2/exports/jobs/{id}/parts/{item}":
    get:
      summary: Download one completed proof ZIP; validate against the manifest SHA-256
      x-required-scope: exports:read
      responses:
        "200":
          description: One agreement ZIP, at most 64 MiB
          content:
            application/zip:
              schema:
                type: string
                format: binary
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "404":
          description: Unavailable or deleted agreement
          content:
            application/json:
              schema:
                type: object
        "410":
          description: Expired export
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - in: path
          name: item
          required: true
          schema:
            type: integer
  /v2/privacy:
    get:
      summary: List workspace privacy requests
      x-required-scope: privacy:manage
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Action unavailable in the current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      parameters:
        - in: query
          name: after
          required: false
          schema:
            type: string
    post:
      summary: Register a privacy request with an operator-selected due date
      x-required-scope: privacy:manage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                email:
                  type: string
                  format: email
                kind:
                  enum:
                    - access
                    - erasure
                    - correction
                due_at:
                  type: string
                  format: date
              required:
                - email
                - kind
                - due_at
      responses:
        "201":
          description: Registered
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
  "/v2/privacy/{id}":
    get:
      summary: Read request and action history
      x-required-scope: privacy:manage
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Action unavailable in the current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - in: query
          name: after
          required: false
          schema:
            type: string
  "/v2/privacy/{id}/inventory":
    get:
      summary: Read related workspace records after authority review
      x-required-scope: privacy:manage
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Action unavailable in the current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - in: query
          name: after
          required: false
          schema:
            type: string
  "/v2/privacy/{id}/export.json":
    get:
      summary: Export requester data without other recipients or private PDF contents
      x-required-scope: privacy:manage
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Action unavailable in the current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
        - in: query
          name: after
          required: false
          schema:
            type: string
  "/v2/privacy/{id}/verify":
    post:
      summary: "Review and perform privacy action: verify"
      x-required-scope: privacy:manage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                note:
                  type: string
                  minLength: 10
                  maxLength: 2000
              required:
                - note
      responses:
        "200":
          description: Action recorded; held agreements and retention periods remain
            enforced
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Review required, protected data remains or request already closed
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
  "/v2/privacy/{id}/restriction":
    post:
      summary: "Review and perform privacy action: restriction"
      x-required-scope: privacy:manage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                enabled:
                  type: boolean
              required:
                - enabled
      responses:
        "200":
          description: Action recorded; held agreements and retention periods remain
            enforced
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Review required, protected data remains or request already closed
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
  "/v2/privacy/{id}/erase-profile":
    post:
      summary: "Review and perform privacy action: erase-profile"
      x-required-scope: privacy:manage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                confirm_email:
                  type: string
                  format: email
              required:
                - confirm_email
      responses:
        "200":
          description: Action recorded; held agreements and retention periods remain
            enforced
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Review required, protected data remains or request already closed
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
  "/v2/privacy/{id}/deletions":
    post:
      summary: "Review and perform privacy action: deletions"
      x-required-scope: privacy:manage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                ids:
                  type: array
                  items:
                    type: string
              required:
                - ids
      responses:
        "202":
          description: Action recorded; held agreements and retention periods remain
            enforced
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Review required, protected data remains or request already closed
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
  "/v2/privacy/{id}/resolve":
    post:
      summary: "Review and perform privacy action: resolve"
      x-required-scope: privacy:manage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                outcome:
                  enum:
                    - fulfilled
                    - partially_fulfilled
                    - denied
                resolution:
                  type: string
                  minLength: 10
                  maxLength: 2000
                confirm_reviewed:
                  const: true
              required:
                - outcome
                - resolution
                - confirm_reviewed
      responses:
        "200":
          description: Action recorded; held agreements and retention periods remain
            enforced
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Review required, protected data remains or request already closed
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
  /v2/scim/ServiceProviderConfig:
    get:
      summary: Discover supported SCIM user provisioning capabilities
      x-required-scope: provisioning:manage
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Action unavailable in the current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      security:
        - scimBearer: []
  /v2/scim/Schemas:
    get:
      summary: Discover supported SCIM user provisioning capabilities
      x-required-scope: provisioning:manage
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Action unavailable in the current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      security:
        - scimBearer: []
  "/v2/scim/Schemas/{id}":
    get:
      summary: Discover supported SCIM user provisioning capabilities
      x-required-scope: provisioning:manage
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Action unavailable in the current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      security:
        - scimBearer: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
  /v2/scim/ResourceTypes:
    get:
      summary: Discover supported SCIM user provisioning capabilities
      x-required-scope: provisioning:manage
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Action unavailable in the current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      security:
        - scimBearer: []
  /v2/scim/ResourceTypes/User:
    get:
      summary: Discover supported SCIM user provisioning capabilities
      x-required-scope: provisioning:manage
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Action unavailable in the current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      security:
        - scimBearer: []
  /v2/scim/Users:
    get:
      summary: List users; supports only userName eq "email" filter
      x-required-scope: provisioning:manage
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Action unavailable in the current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      security:
        - scimBearer: []
      parameters:
        - in: query
          name: startIndex
          required: false
          schema:
            type: integer
            minimum: 1
        - in: query
          name: count
          required: false
          schema:
            type: integer
            minimum: 0
            maximum: 100
        - in: query
          name: filter
          required: false
          schema:
            type: string
    post:
      summary: Provision a sender or viewer under enrolled Google company policy
      x-required-scope: provisioning:manage
      responses:
        "201":
          description: Provisioned SCIM user
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Existing employee
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      security:
        - scimBearer: []
      requestBody:
        required: true
        content:
          application/scim+json:
            schema:
              type: object
              properties:
                schemas:
                  type: array
                  items:
                    type: string
                userName:
                  type: string
                  format: email
                displayName:
                  type: string
                active:
                  type: boolean
                externalId:
                  type: string
                name:
                  type: object
                  properties:
                    formatted:
                      type: string
              required:
                - userName
          application/json:
            schema:
              type: object
              properties:
                schemas:
                  type: array
                  items:
                    type: string
                userName:
                  type: string
                  format: email
                displayName:
                  type: string
                active:
                  type: boolean
                externalId:
                  type: string
                name:
                  type: object
                  properties:
                    formatted:
                      type: string
              required:
                - userName
  "/v2/scim/Users/{id}":
    get:
      summary: Read provisioned user
      x-required-scope: provisioning:manage
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Action unavailable in the current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      security:
        - scimBearer: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
    put:
      summary: Update user; email changes and elevated role changes are refused
      x-required-scope: provisioning:manage
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Action unavailable in the current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      security:
        - scimBearer: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/scim+json:
            schema:
              type: object
              properties:
                schemas:
                  type: array
                  items:
                    type: string
                userName:
                  type: string
                  format: email
                displayName:
                  type: string
                active:
                  type: boolean
                externalId:
                  type: string
                name:
                  type: object
                  properties:
                    formatted:
                      type: string
              required:
                - userName
          application/json:
            schema:
              type: object
              properties:
                schemas:
                  type: array
                  items:
                    type: string
                userName:
                  type: string
                  format: email
                displayName:
                  type: string
                active:
                  type: boolean
                externalId:
                  type: string
                name:
                  type: object
                  properties:
                    formatted:
                      type: string
              required:
                - userName
    patch:
      summary: Apply add/replace to supported user attributes
      x-required-scope: provisioning:manage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                Operations:
                  type: array
                  minItems: 1
                  maxItems: 20
                  items:
                    type: object
                    properties:
                      op:
                        enum:
                          - add
                          - replace
                      path:
                        type: string
                      value: {}
                    required:
                      - op
                      - value
              required:
                - Operations
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
        "400":
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: Action unavailable in the current state
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      security:
        - scimBearer: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
    delete:
      summary: Deactivate employee and revoke workspace sessions
      x-required-scope: provisioning:manage
      responses:
        "204":
          description: Removed
        "401":
          description: Missing, expired or revoked API key
          content:
            application/json:
              schema:
                type: object
        "403":
          description: Insufficient credential scope
          content:
            application/json:
              schema:
                type: object
        "409":
          description: An owner must first remove elevated responsibilities
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Rate or monthly agreement limit; inspect Retry-After for request
            limits
          content:
            application/json:
              schema:
                type: object
      security:
        - scimBearer: []
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
  /.well-known/oauth-protected-resource:
    get:
      summary: Protected resource metadata (RFC 9728) for the MCP endpoint
      security: []
      responses:
        "200":
          description: resource, authorization_servers, scopes_supported
          content:
            application/json:
              schema:
                type: object
  /.well-known/oauth-protected-resource/mcp:
    get:
      summary: Protected resource metadata (RFC 9728) for the MCP endpoint
      security: []
      responses:
        "200":
          description: resource, authorization_servers, scopes_supported
          content:
            application/json:
              schema:
                type: object
  /.well-known/oauth-authorization-server:
    get:
      summary: Authorization server metadata (RFC 8414)
      security: []
      responses:
        "200":
          description: Endpoints, S256 only, authorization_code and refresh_token grants,
            iss in the authorization response
          content:
            application/json:
              schema:
                type: object
  /oauth/register:
    post:
      summary: Register an AI tool (RFC 7591). HTTPS redirect URIs, or loopback
        addresses for native tools; public clients use none.
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                client_name:
                  type: string
                  maxLength: 100
                client_uri:
                  type: string
                  format: uri
                redirect_uris:
                  type: array
                  minItems: 1
                  maxItems: 10
                  items:
                    type: string
                    format: uri
                    maxLength: 500
                token_endpoint_auth_method:
                  enum:
                    - none
                    - client_secret_basic
                    - client_secret_post
                  default: none
                grant_types:
                  type: array
                  items:
                    enum:
                      - authorization_code
                      - refresh_token
                response_types:
                  type: array
                  items:
                    const: code
              required:
                - redirect_uris
      responses:
        "201":
          description: client_id, and client_secret for confidential clients
          content:
            application/json:
              schema:
                type: object
        "400":
          description: "OAuth error: error and error_description"
          content:
            application/json:
              schema:
                type: object
        "429":
          description: Registration limit for this address
          content:
            application/json:
              schema:
                type: object
  /oauth/authorize:
    get:
      summary: Consent page. Signs the person in first; a workspace that requires an
        authenticator needs it set up before any tool can connect.
      security: []
      parameters:
        - in: query
          name: response_type
          required: true
          schema:
            const: code
        - in: query
          name: client_id
          required: true
          schema:
            type: string
        - in: query
          name: redirect_uri
          required: true
          schema:
            type: string
            format: uri
        - in: query
          name: code_challenge
          required: true
          schema:
            type: string
            pattern: ^[A-Za-z0-9_-]{43,128}$
        - in: query
          name: code_challenge_method
          required: true
          schema:
            const: S256
        - in: query
          name: scope
          required: false
          schema:
            type: string
            description: Space-separated; defaults to review:read review:write
        - in: query
          name: state
          required: false
          schema:
            type: string
        - in: query
          name: resource
          required: false
          schema:
            type: string
            format: uri
            description: When present, must be this server's /mcp URL
      responses:
        "200":
          description: Consent page
          content:
            text/html:
              schema:
                type: string
        "303":
          description: Sign-in, or back to the tool with an error
        "400":
          description: Unregistered tool or redirect URI; nothing is sent to the tool
    post:
      summary: Allow or deny from the consent page (CSRF-protected form)
      security: []
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                response_type:
                  const: code
                client_id:
                  type: string
                redirect_uri:
                  type: string
                  format: uri
                code_challenge:
                  type: string
                  pattern: ^[A-Za-z0-9_-]{43,128}$
                code_challenge_method:
                  const: S256
                scope:
                  type: string
                  description: Space-separated; defaults to review:read review:write
                state:
                  type: string
                resource:
                  type: string
                  format: uri
                  description: When present, must be this server's /mcp URL
                decision:
                  enum:
                    - allow
                    - deny
                csrf:
                  type: string
              required:
                - decision
                - csrf
      responses:
        "303":
          description: Redirect to the tool with code, state and iss, or error=access_denied
  /oauth/token:
    post:
      summary: Exchange a code (with the PKCE verifier) or rotate a refresh token
      security: []
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                grant_type:
                  enum:
                    - authorization_code
                    - refresh_token
                code:
                  type: string
                code_verifier:
                  type: string
                redirect_uri:
                  type: string
                refresh_token:
                  type: string
                client_id:
                  type: string
                client_secret:
                  type: string
                resource:
                  type: string
              required:
                - grant_type
      responses:
        "200":
          description: access_token, token_type Bearer, expires_in 3600, refresh_token,
            scope
          content:
            application/json:
              schema:
                type: object
        "400":
          description: "OAuth error: error and error_description"
          content:
            application/json:
              schema:
                type: object
        "401":
          description: "OAuth error: error and error_description"
          content:
            application/json:
              schema:
                type: object
  /oauth/revoke:
    post:
      summary: Revoke an access or refresh token (RFC 7009); always answers 200
      security: []
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                token:
                  type: string
                token_type_hint:
                  type: string
                client_id:
                  type: string
                client_secret:
                  type: string
              required:
                - token
      responses:
        "200":
          description: Revoked or unknown
          content:
            application/json:
              schema:
                type: object
