Duplicate an existing contract into a new contract whose status
derives from its service lines.
The request body is the final, client-edited state of the copy (name,
optional product change, the final service lines, and the carry-over
selection). Responses:
same-name copy not finished yet → 409 (DuplicateInProgressResponse)
created → 201 (ContractCreatedResponse)
Repeating a request with the same name within ten minutes of the
first returns the copy it created (201, same id) instead of making
another, so retrying after a timeout is safe. While that copy is
still being built, or when the first request failed part-way, the
repeat gets a 409 with the unfinished copy's id instead.
The duplicate is entirely synchronous Spanner work, so it runs on a
worker thread: inline it would hold the event loop and stall every
other request on the pod for as long as it takes. The activity
re-link for carried-over people runs after the response — it scales
with the company's activity history and is what pushed a duplicate
past the load balancer timeout (a 504 on a contract that was in fact
created). The background task is best-effort: a pod stopped
mid-rollout drops it and nothing retries it.
Path Parameters
contract_id
Type: string
required
Body·
required
application/json
Body for POST /contracts/{contract_id}/duplicate.
The modal is a client-side editing surface: the user edits the copy before
anything is persisted, and this payload is the final result. The server
creates the new contract from the source plus these values — it never reads
a draft state. The duplicate's status derives from its own service lines,
regardless of the source's status.
name
Type: string
max length:
1024
required
Name for the new contract (FE pre-fills '
Copy')
acknowledgeOverlap
Type: boolean
Set true to proceed after the caller has acknowledged a dates-overlap conflict (see 409 response)