Save a deal as a template

POST
/api/v1/orgs/{orgId}/deals/{dealId}/templates

Saves an existing deal as a new template. The template is a separate copy: documents, fields, packages and tasks are copied, signers become role-only slots, and submissions and signer contact details are not copied. The source deal is kept unchanged and later edits to it do not update the template; calling again creates another template. Requires the api_deals_create scope, the bound user's edit access to the deal, and a plan that includes templates. Idempotency-Key is required and enforced server-side for safe retries.

Authorization

bearerAuth
AuthorizationBearer <token>

Bearer token using a Clai API key secret (clai_live_*).

In: header

Path Parameters

NameTypeDescription
orgId
required
string

Organization ID the key is operating in

dealId
required
string
Formatuuid

Header Parameters

NameTypeDescription
Idempotency-Key
required
string

Required client-supplied idempotency key for safe retries

Length1 <= length

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

NameTypeDescription
name
required
string

Name for the new template. Confirm it with the user before calling.

Length1 <= length

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://app.goclai.com/api/v1/orgs/org_2abc123/deals/497f6eca-6276-4993-bfeb-53cbbbba6f08/templates" \  -H "Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{
  "templateDealId": "1c3e367c-7d79-4e8a-8c08-996f02ac6389",
  "name": "string",
  "packageId": "471cc1d4-ec27-4504-b7c2-949af95662bc",
  "sourceDealId": "818a6c35-6448-4abe-acbf-aa4ead302fb2",
  "prepareUrl": "string",
  "sourceDealUrl": "string"
}
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": {}
  }
}
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": {}
  }
}
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": {}
  }
}
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": {}
  }
}
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": {}
  }
}
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": {}
  }
}
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": {}
  }
}
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": {}
  }
}