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

# Cancel a signature request

> Cancel an in-flight signature request. Terminal requests cannot be cancelled.



## OpenAPI

````yaml /openapi.yaml post /v1/signatures/{id}/cancel
openapi: 3.1.0
info:
  title: Craftkit API
  version: 1.0.0
  description: >
    The Craftkit public REST API. Design templates with typed variables, render

    PDFs asynchronously, share and track them, and send them out for digital

    signature.


    ## Authentication


    Most endpoints authenticate with a **project API key** as a bearer token:


    ```

    Authorization: Bearer ck_live_xxxxxxxxxxxxxxxx

    ```


    Keys come in `ck_live_` (production) and `ck_test_` (test) flavours. Embed

    iframe surfaces use a short-lived **embed session JWT** instead, and the

    admin provisioning endpoint uses the deployment-wide `CRAFTKIT_ADMIN_KEY`.

    Inbound webhooks (`/v1/hooks/*`) are not bearer-authed — they are verified
    by

    an HMAC signature header.


    ## Idempotency


    `POST /v1/templates/{slug}/render` and `POST /v1/signatures` accept an

    `Idempotency-Key` request header. Retrying with the same key returns the

    original resource instead of creating (and, for signatures, billing) a

    duplicate.


    ## Errors


    Application errors use a shared envelope:


    ```json

    { "error": { "code": "invalid_request", "message": "...", "issues": { } } }

    ```


    A small number of admin/embed endpoints return a flatter shape

    (`{ "error": "invalid_credentials" }`); those are documented inline.
servers:
  - url: https://api.craftkit.dev
    description: Production
security:
  - bearerApiKey: []
tags:
  - name: Templates
    description: Create, list, fetch, republish, delete templates and enqueue renders.
  - name: Renders
    description: Poll render status, download PDFs, manage shares, email, and engagement.
  - name: Signatures
    description: >-
      Send rendered PDFs out for digital signatures via the signature service
      and track status.
  - name: Webhooks
    description: Inbound webhook receivers (HMAC-authenticated, not bearer-authed).
  - name: Embed
    description: Embed session minting, catalogs, builder templates, form submission.
  - name: Admin
    description: Org provisioning (deployment admin key only).
  - name: System
    description: Health and status.
paths:
  /v1/signatures/{id}/cancel:
    parameters:
      - $ref: '#/components/parameters/SignatureId'
    post:
      tags:
        - Signatures
      summary: Cancel a signature request
      description: >-
        Cancel an in-flight signature request. Terminal requests cannot be
        cancelled.
      operationId: cancelSignature
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                reason:
                  type: string
                  maxLength: 500
            example:
              reason: Superseded by a corrected document.
      responses:
        '200':
          description: Signature request cancelled.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SignatureRequest'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/SignatureNotFound'
        '409':
          description: Request is already terminal or can no longer be cancelled upstream.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: conflict
                  message: >-
                    Signature request is already completed and cannot be
                    cancelled.
        '502':
          description: Signature service failed to cancel.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: signature_provider_error
                  message: >-
                    Failed to cancel the signing request with the signature
                    service.
      security:
        - bearerApiKey: []
components:
  parameters:
    SignatureId:
      name: id
      in: path
      required: true
      description: The signature request id.
      schema:
        type: string
        format: uuid
  schemas:
    SignatureRequest:
      type: object
      required:
        - id
        - renderId
        - name
        - status
        - recipients
        - expirationHours
        - signedDownloadUrl
        - certificateUrl
        - errorMessage
        - createdAt
        - completedAt
      properties:
        id:
          type: string
          format: uuid
        renderId:
          type: string
          format: uuid
        name:
          type: string
        status:
          type: string
          enum:
            - sent
            - viewed
            - completed
            - declined
            - expired
            - cancelled
            - failed
        recipients:
          type: array
          items:
            $ref: '#/components/schemas/SignatureRecipient'
        expirationHours:
          type:
            - integer
            - 'null'
        signedDownloadUrl:
          type:
            - string
            - 'null'
          format: uri
          description: Authenticated download URL; null until the signed PDF is archived.
        certificateUrl:
          type:
            - string
            - 'null'
          format: uri
          description: |
            Craftkit-owned authenticated URL (`/v1/signatures/{id}/certificate`)
            for the completion certificate; null until it is available. Not a
            provider URL.
        errorMessage:
          type:
            - string
            - 'null'
        createdAt:
          type: string
          format: date-time
        completedAt:
          type:
            - string
            - 'null'
          format: date-time
    Error:
      type: object
      description: Shared application error envelope.
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
            issues:
              description: Optional Zod flatten() / issues detail.
      example:
        error:
          code: invalid_request
          message: Request body did not match expected shape.
    SignatureRecipient:
      type: object
      required:
        - id
        - firstName
        - email
        - designation
      properties:
        id:
          type: string
        firstName:
          type: string
        lastName:
          type:
            - string
            - 'null'
        email:
          type: string
          format: email
        designation:
          type: string
          enum:
            - Signer
            - Approver
            - CC
        order:
          type:
            - integer
            - 'null'
        signedAt:
          type:
            - string
            - 'null'
          format: date-time
        declinedAt:
          type:
            - string
            - 'null'
          format: date-time
  responses:
    BadRequest:
      description: Invalid JSON or request shape.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: invalid_request
              message: Request body did not match expected shape.
    Unauthorized:
      description: Missing or invalid bearer token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: unauthorized
              message: Missing Bearer token.
    SignatureNotFound:
      description: Signature request not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: not_found
              message: Signature request not found.
  securitySchemes:
    bearerApiKey:
      type: http
      scheme: bearer
      description: >
        Project API key (`ck_live_…` or `ck_test_…`) presented as a bearer
        token.

        For embed partner endpoints this is the partner secret key, which is the

        same credential type.

````