Create a template

POST
/v1/sign/templates

Documents with fields for roles (client, company) instead of named signers, made into requests by naming a signer per role. Fields by position or text anchor (resolved now). Can start empty and be built in the embedded builder (create a builder session).

Authorization

bearerAuth
headerAuthorizationBearer <token>

A secret API key from the dashboard: coss_live_… for production environments, coss_test_… for sandbox environments.

Header Parameters

Coss-Version?"2026-10-10"

The API version (a date) to use for this request. Defaults to your organization's version, pinned to the latest one when it first used the API and upgraded from the dashboard. The SDK always sends the version it was built for.

Value in"2026-10-10"

Request Body

application/json
  1. body
name*string

Your name for the template.

Length1 <= length <= 200
title?|

Requests' title (a request may set its own). Default: name.

Length1 <= length <= 200
message?|

Requests' message to signers (a request may set its own).

Lengthlength <= 5000
signing_order?string

parallel: everyone at once. sequential: in each signer's order. Default for its requests.

Value in"parallel""sequential"
documents?array<|>

Uploaded documents by id, or PDFs inline (base64).

Itemsitems <= 10
roles?array<>

Who signs: each request names one signer per role.

Itemsitems <= 20
fields?array<|>

Each role's fields, by position or text anchor (resolved when saved). A template can be used once every role has a signature field.

Itemsitems <= 500

Response Body

The template.

application/json
  1. response
object*"sign_template"
Value in"sign_template"
id*string
name*string

Your name for the template.

title*|

Requests' title. null: the template's name.

message*|

Requests' message to signers. null: none.

signing_order*string

Its requests' order, unless one sets its own.

Value in"parallel""sequential"
documents*array<>

The documents its requests use, in order.

roles*array<>

Who signs: each request names one signer per role.

fields*array<>

Each role's fields.

ready*boolean

It has documents and every role has a signature field, so requests can be made from it.

sandbox*boolean

Whether it belongs to a sandbox environment.

created_at*string
Formatdate-time
updated_at*string
Formatdate-time
import { Coss } from "coss";const coss = new Coss({  apiKey: process.env.COSS_API_KEY,  baseUrl: "https://api.coss.com",});const { data, error } = await coss.sign.templates.create({  name: "Mutual NDA",  documents: [    {      document_id: "sdoc_01k7c8m4q2f3e9v6t5r1n0p8yz",    },  ],  roles: [    {      key: "client",      name: "Client",    },    {      key: "company",      name: "Company",    },  ],  fields: [    {      role: "client",      type: "signature",      anchor: "{{signature:client}}",    },    {      role: "client",      type: "text",      page: 1,      x: 72,      y: 140,      width: 200,      height: 18,      merge_key: "client_company",    },    {      role: "company",      type: "signature",      anchor: "{{signature:company}}",    },  ],});
{  "object": "sign_template",  "id": "stpl_01k7c8m4q2f3e9v6t5r1n0p8yz",  "name": "Mutual NDA",  "title": null,  "message": null,  "signing_order": "parallel",  "documents": [    {      "id": "sdoc_01k7c8m4q2f3e9v6t5r1n0p8yz",      "filename": "nda.pdf",      "sha256": "9f2c6c0f0e1d4b7a8c5e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8c7d6e5f4a3b2c",      "page_count": 1,      "pages": [        {          "width": 612,          "height": 792        }      ]    }  ],  "roles": [    {      "key": "client",      "name": "Client"    }  ],  "fields": [    {      "id": "stfld_01k7c8m4q2f3e9v6t5r1n0p8yz",      "role": "client",      "document_id": "sdoc_01k7c8m4q2f3e9v6t5r1n0p8yz",      "type": "signature",      "page": 1,      "x": 72,      "y": 640,      "width": 160,      "height": 30,      "required": true,      "label": null,      "merge_key": null    }  ],  "ready": true,  "sandbox": false,  "created_at": "2026-10-26T15:04:05.000Z",  "updated_at": "2026-10-26T15:04:05.000Z"}