Save a deal as a template
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 Bearer token using a Clai API key secret (clai_live_*).
In: header
Path Parameters
| Name | Type | Description |
|---|---|---|
orgIdrequired | string | Organization ID the key is operating in |
dealIdrequired | string | Format uuid |
Header Parameters
| Name | Type | Description |
|---|---|---|
Idempotency-Keyrequired | string | Required client-supplied idempotency key for safe retries Length 1 <= length |
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
| Name | Type | Description |
|---|---|---|
namerequired | string | Name for the new template. Confirm it with the user before calling. Length 1 <= 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": {}
}
}POSTAdd templates to a package
Merges the document flows of one or more deal templates (from listDeals with isTemplate=true) into an existing package. Requires the `api_deals_create` scope and the bound user's edit access to the deal. Idempotency-Key is required and enforced server-side for safe retries.
GETList tasks
Returns a cursor-paginated list of tasks visible to the API key in the organization. Poll with `updatedSince` and `cursor` for CRM sync. Canceled tasks are not deleted; only `deletedAt` marks a tombstone when `includeDeleted=true`. ## Checklists Checklists are left out of results by default; their items are included. - `type=checklist` returns only checklists. - `parentId=<checklist taskId>` returns the items of one checklist. Tasks on template deals are returned only when `dealId` names that template. Requires the `api_tasks_list` scope.