---
title: "Cancel a contract"
method: POST
path: "/contract/cancel"
tags: ["Contracts"]
---

# Cancel a contract

`POST /contract/cancel`

## Request

- Base URL: `https://apisign.io/api`
- URL: `https://apisign.io/api/contract/cancel`
- Auth: API key in header `x-api-key`

Cancel a `draft` or `sent` contract. Pending signers are set to `declined`. The send charge is not refunded.

## Request body

- object
  - `contract_id` string, required: Contract ID to cancel (cuid)

## Response `200`

Contract cancelled

- object
  - `success` boolean
  - `contract` Contract
    - `id` string
    - `created_at` string, date-time
    - `updated_at` string, date-time
    - `status` 'draft' | 'queued' | 'sent' | 'signed' | 'cancelled' | 'expired': `queued` is not set by any endpoint. `expired` is not currently set automatically: a contract past `expires_at` stays `sent`.
    - `org_id` string
    - `sent_at` string, date-time, nullable
    - `expires_at` string, date-time, nullable: Creation time plus expires_in_days. Signing links stop working after this.
    - `cancelled_at` string, date-time, nullable
    - `name` string
    - `content` object
      - `markdown` string
    - `fields` StoredFields, nullable: Field data as stored on a contract or template
      - `fields` FieldDefinition[]
        - `name` string, required: Variable name without braces
        - `type` string, required: signature, initials, signer_name, timestamp, text, email, phone or date
        - `completedBy` 'signer' | 'creator', required
        - `label` string: Prompt shown for a text field
      - `signers` object[]: Per-signer field assignments, matched to signers by signing_order
        - `signing_order` integer
        - `signerFields` string[]
    - `template_id` string, nullable
    - `final_pdf` string: URL of the signed PDF; empty string until every signer has signed
    - `metadata` object
    - `test_mode` boolean
    - `seal_document_hash` string, nullable
    - `seal_created_at` string, date-time, nullable
    - `seal_certificate_serial` string, nullable
  - `message` string

## Other responses

- `400`: Invalid request, or the action is not allowed in the resource's current state
- `401`: Missing, invalid, expired or deleted API key. Body: `{ "error": "Unauthorized" }`
- `404`: Resource not found in this organization
- `500`: Internal server error (also returned for a request body that is not valid JSON)

---

[API](https://skmtc.dev/apisign/apis/api-sign-api.md) · [All operations](https://skmtc.dev/apisign/apis/api-sign-api/llms.txt) · [OpenAPI document](https://skmtc.dev/apisign/apis/api-sign-api/revisions/fa21d8adbc69?raw)
