---
title: "Update a draft contract"
method: PUT
path: "/contract/update"
tags: ["Contracts"]
---

# Update a draft contract

`PUT /contract/update`

## Request

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

Update a contract whose status is `draft`. Only the properties sent are changed. `signers`, when sent, replaces the whole signer list. The merged result must pass the same signature-field checks as create. The expiration date cannot be changed.

## Request body

- UpdateContractRequest
  - `contract_id` string, required: Contract ID (cuid)
  - `name` string
  - `template_id` string: Changes the linked template; content is not re-rendered
  - `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[]
  - `metadata` object
  - `test_mode` boolean: Must equal the current value
  - `signers` object[]: Replaces the signer list. Entries with an existing `id` are updated, others are added, and existing signers left out are deleted.
    - `id` string: Existing signer ID
    - `email` string, email, required
    - `name` string, required
    - `mobile` string, required
    - `company` string
    - `signing_order` integer, required

## Response `200`

Contract updated

- 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
  - `signers` Signer[]: The updated signer list; empty unless `signers` was sent
    - `id` string
    - `created_at` string, date-time
    - `updated_at` string, date-time
    - `org_id` string
    - `contract_id` string
    - `email` string, email
    - `name` string
    - `mobile` string, nullable
    - `company` string
    - `signing_order` integer: Display order. Unique per contract. Does not enforce a signing sequence: all signers are emailed at once and may sign in any order.
    - `status` 'pending' | 'signed' | 'declined'
    - `test_mode` boolean
    - `signature_data` string, nullable: Base64 signature image
    - `signed_at` string, date-time, nullable
    - `field_values` object, nullable: Values this signer submitted
  - `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)
