---
title: "Move every document of a contract under another key"
method: POST
path: "/v1/contracts/{id}/merge"
tags: ["Contracts"]
---

# Move every document of a contract under another key

`POST /v1/contracts/{id}/merge`

## Request

- Base URL: `https://api.talonic.com`
- URL: `https://api.talonic.com/v1/contracts/{id}/merge`
- Auth: HTTP bearer

Re-keys every document of the contract to `into_key` (created when no contract has it yet) and deletes the emptied contract. The keys are hand-set, so re-reading keeps them. The merge is recorded as a key rule, so later documents filed under the old key go to the target key, and an open decision on the old contract carries over to the target when the target has none.

## Path parameters

- `id` string, uuid, required

## Request body

- object
  - `into_key` string, required
  - `note` string

## Response `201`

How many documents moved and the resulting contract.

- object
  - `moved` integer
  - `contract` ContractsContract, nullable: One contract, folded from its documents.
    - `id` string, uuid
    - `customer_id` string, uuid
    - `contract_key` string
    - `key_source` 'filename' | 'contract' | 'manual' | 'document' | 'rule': How the contract got its key: the document store filename, the printed contract number, a person, its first document (no number anywhere) or a key rule.
    - `title` string, nullable
    - `counterparty` string, nullable
    - `status` 'draft' | 'active' | 'expired' | 'terminated' | 'unknown': As of `computed_on`.
    - `effective_date` string, date, nullable
    - `expiry_date` string, date, nullable: The end in force: the printed end rolled forward by auto-renewal, or the termination date when earlier.
    - `printed_expiry` string, date, nullable: The printed end when auto-renewal moved `expiry_date` past it.
    - `notice_deadline` string, date, nullable
    - `terminated_on` string, date, nullable
    - `auto_renewal` boolean, nullable
    - `terms` object: Terms in force by canonical field name (see `ContractsTermField`).
    - `obligations` ContractsObligation[]
      - `label` string
      - `party` 'us' | 'counterparty', nullable
      - `due_date` string, date, nullable
      - `recurrence` 'once' | 'monthly' | 'quarterly' | 'annual', nullable
      - `quote` string, nullable
      - `verified` boolean
      - `document_id` string, uuid: Set on the obligations of a folded contract.
    - `fingerprint` string, nullable
    - `published_fingerprint` string, nullable
    - `computed_on` string, date, nullable
    - `created_at` string, date-time
    - `updated_at` string, date-time

## Other responses

- `400`: The request is invalid.
- `404`: The requested resource was not found.
- `422`: The request is well-formed but violates the declared task contract.

## Changes

- **2026-10-28** `0a485a46163e`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/talonic/apis/talonic-api/changes/v1/contracts/:id/merge/post.md)

---

[API](https://skmtc.dev/talonic/apis/talonic-api.md) - [All operations](https://skmtc.dev/talonic/apis/talonic-api/llms.txt) - [OpenAPI document](https://skmtc.dev/talonic/apis/talonic-api/revisions/9f6d53e2ab5e?raw)
