> ## Documentation Index
> Fetch the complete documentation index at: https://docs.quiva.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Record a signatory event

> Accepts only `document_viewed`, `user_seen` and `checkbox_checked`, from the signatory, while the approval is in progress. Decisions are written by approve and reject.



## OpenAPI

````yaml /api-reference/endpoint/documents/openapi.json post /workspaces/approvals/{id}/events
openapi: 3.1.0
info:
  title: Documents API
  description: >-
    Document templates, generated documents, e-signature requests, and checkbox
    approvals. Template and document routes are served under `/file-generator`,
    approval routes under `/workspaces/approvals`.
  version: 1.2.0
servers:
  - url: https://api.quiva.ai
    description: Production API server
security:
  - bearerAuth: []
  - apiKeyAuth: []
tags:
  - name: Templates
    description: >-
      Template lifecycle — create, read, publish, validate, trigger, and delete
      document templates. Templates follow a **draft → published** model: writes
      (`POST`, `PATCH`) always target the draft version, and `POST
      /templates/{key}/publish` promotes the draft. Document generation only
      ever uses the published version, so drafts can be edited safely without
      affecting production output. A template's `source` is a DOCX file
      containing angular-expression tags rendered at trigger time.
  - name: Documents
    description: >-
      Document lifecycle — read, update, and delete generated documents. A
      document record is created immediately when a template is triggered and is
      updated asynchronously: first with the generated `output.key` (an `obj://`
      or `kv://` storage URI) or `errors`, then with `signatures` progress as
      signatories sign.
  - name: Signatures
    description: >-
      E-signature workflows powered by HelloSign (Dropbox Sign). Signature
      requests are created automatically when a triggered template defines
      `signatories`. Each signatory tracks a status lifecycle of `DRAFT → SENT →
      SIGNED`, with `EXPIRED` (validity window elapsed) and `FAILED`
      (delivery/signing error) as terminal failure states. Embedded signing URLs
      can be generated for signatures created in embedded mode.
  - name: Approvals
    description: Checkbox approval of a workspace file, recorded as e-signature evidence.
  - name: Generation
  - name: Template Source
paths:
  /workspaces/approvals/{id}/events:
    post:
      tags:
        - Approvals
      summary: Record a signatory event
      description: >-
        Accepts only `document_viewed`, `user_seen` and `checkbox_checked`, from
        the signatory, while the approval is in progress. Decisions are written
        by approve and reject.
      operationId: createApprovalEvent
      parameters:
        - name: id
          in: path
          required: true
          description: >-
            Approval id, or for an external signatory the signing token from the
            link.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - event_type
              properties:
                event_type:
                  type: string
                  enum:
                    - document_viewed
                    - user_seen
                    - checkbox_checked
                metadata:
                  $ref: '#/components/schemas/ApprovalEventMetadata'
      responses:
        '200':
          description: The event
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApprovalEvent'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: The approval is already decided.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '410':
          description: The approval link has expired (30 days).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ApprovalEventMetadata:
      type: object
      description: >-
        The browser sends only `user_agent`, `fingerprint`, `signature`,
        `initials` and `timezone_offset`. The server stamps the rest at the
        moment of the decision.
      properties:
        ip:
          type: string
          readOnly: true
          description: The forwarding chain. Only the trailing hops are gateway-observed.
        user_agent:
          type: string
        fingerprint:
          type: string
        document_hash:
          type: string
          readOnly: true
          description: SHA-256 (hex) of the document at the decision.
        jurisdiction:
          $ref: '#/components/schemas/Jurisdiction'
          readOnly: true
        consent:
          type: string
          readOnly: true
          description: The consent text shown, recorded verbatim.
        signature:
          type: string
          description: SVG drawn by the signatory.
        initials:
          type: string
          description: SVG drawn by the signatory.
        timezone_offset:
          type: integer
    ApprovalEvent:
      type: object
      properties:
        event_type:
          type: string
        feedback:
          type: string
        created_at:
          type: string
          format: date-time
        metadata:
          $ref: '#/components/schemas/ApprovalEventMetadata'
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          example: '"key" is required'
    Jurisdiction:
      type: string
      enum:
        - AU
        - NZ
        - UK
        - US
      default: AU
      description: >-
        Sets the consent text the signatory sees. `US` adds the ESIGN consumer
        disclosures.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.