Templates
A template is an envelope without the people: its PDFs, the roles that act on them (Employee, HR), the fields each role fills and the settings. Make an envelope from one by saying who takes each role. Sender API key required.
The template object
Attributes
id string
Not empty
name string
description string
title string
Title of the envelopes made from the template.
message string
Shown to recipients in the invitation and on the signing page.
routing string
sequential goes by order, lowest first (equal orders sign together); parallel invites everyone at once.
One of sequential parallel
reminders object
Attributes of reminders
firstAfterDays integer
Days after the invitation for the first reminder; 0 turns reminders off.
0 to 365
everyDays integer
1 to 365
max integer
Most reminders per recipient.
0 to 50
expiresInDays integer
Envelopes expire this many days after they are created.
roles array of objects
Attributes of roles
id string
Not empty
name string
Unique within the template, ignoring case.
type string
Signers fill fields, approvers approve without fields, viewers get a copy.
One of signer approver viewer
auth string
How the recipient proves who they are. email_otp, the default, asks for the link and a code sent by email; email_link needs only the link.
One of email_link email_otp sms_otp aadhaar
documents array of objects
Attributes of documents
id string
Not empty
name string
size integer
Size of the PDF in bytes.
sha256 string
Matches ^[0-9a-f]{64}$
pageCount integer
At least 1
pages array of objects
Page sizes in PDF points, in page order.
Attributes of pages
width number
height number
fields array of objects
Attributes of fields
id string
Not empty
documentId string
Not empty
roleId string
The role whose person fills the field in.
Not empty
type string
A recipient with auth: aadhaar fills in nothing: the eSign provider signs the document as the sender approved it, with the values of the signers before them. They may have one aadhaar field, the Aadhaar seal position: it only says where the provider draws its signature, takes no value, and nothing is drawn for it. Without it the provider places the signature where its own setting says. A second aadhaar field is refused with VALIDATION. signature and initials fields given to such a signer are dropped when the envelope is sent, so older requests still work; any other field for them is refused with VALIDATION. Only an Aadhaar eSign signer may have an aadhaar field.
One of signature initials date_signed name text checkbox aadhaar
page integer
Zero-based page index.
At least 0
rect object
A box in PDF points, measured from the top-left corner of the page.
Attributes of rect
x number
At least 0
y number
At least 0
width number
At least 1
height number
At least 1
required boolean
label string
Text fields are prefilled by label.
createdAt string (date-time)
updatedAt string (date-time)
{
"id": "3d6f0a1c-8b2e-4f7a-9c5d-1e2f3a4b5c6d",
"name": "Offer letter",
"description": "Standard offer for full-time staff",
"title": "Offer letter",
"message": "Welcome aboard. Please sign your offer.",
"routing": "sequential",
"reminders": {
"firstAfterDays": 3,
"everyDays": 3,
"max": 3
},
"expiresInDays": 30,
"roles": [
{
"id": "5a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"name": "Employee",
"type": "signer",
"auth": "email_otp"
},
{
"id": "6b2c3d4e-5f6a-4b7c-9d8e-0f1a2b3c4d5e",
"name": "HR",
"type": "viewer",
"auth": "email_otp"
}
],
"documents": [
{
"id": "1b8e4f60-2c3a-4d7e-8f91-a5c2e6b3d048",
"name": "offer.pdf",
"size": 1042,
"sha256": "4f2a9c1e7b3d5a6f8091a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f7",
"pageCount": 1,
"pages": [
{
"width": 612,
"height": 792
}
]
}
],
"fields": [
{
"id": "7c3d4e5f-6a7b-4c8d-8e9f-1a2b3c4d5e6f",
"documentId": "1b8e4f60-2c3a-4d7e-8f91-a5c2e6b3d048",
"roleId": "5a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"type": "signature",
"page": 0,
"rect": {
"x": 72,
"y": 640,
"width": 180,
"height": 48
},
"required": true
},
{
"id": "8d4e5f6a-7b8c-4d9e-9f0a-2b3c4d5e6f7a",
"documentId": "1b8e4f60-2c3a-4d7e-8f91-a5c2e6b3d048",
"roleId": "5a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"type": "text",
"page": 0,
"rect": {
"x": 72,
"y": 600,
"width": 180,
"height": 20
},
"required": false,
"label": "Employee code"
}
],
"createdAt": "2026-03-02T09:00:00.000Z",
"updatedAt": "2026-03-02T09:00:00.000Z"
}List templates
GET/v1/templates
The caller's workspace's templates, newest first, one page at a time. Pass the nextCursor of a page as cursor to get the next one. Each row is a summary; get the template for its documents, roles and fields.
Auth Sender API key, as Authorization: Bearer <key>
Results come one page at a time. See pagination.
Query parameters
q string
Case-insensitive text anywhere in the name.
At most 200 characters
limit integer
Page size.
Default 25 · 1 to 100
cursor string
The nextCursor of the previous page.
Returns
200 OK. One page of templates. A TemplateList object.
Errors
| Status | When |
|---|---|
| 400 | VALIDATION: the request is malformed. details.issues lists each problem. |
| 401 | UNAUTHORIZED: the API key is missing or not valid. |
| 409 | INVALID_STATE: this server keeps no templates, or a PDF of the template is missing from storage. CONFLICT: another request changed the template, or one with the same Idempotency-Key is still running; try again. |
curl https://sign.codevibe.in/api/v1/templates \
-H "Authorization: Bearer $SIGN_API_KEY"import { createSignClient } from '@codevibe_technology/sign-client';
const sign = createSignClient({
baseUrl: 'https://sign.codevibe.in/api',
apiKey: process.env.SIGN_API_KEY!,
});
const { templates, nextCursor } = await sign.templates.list({ limit: 25 });import os
import requests
response = requests.get(
"https://sign.codevibe.in/api/v1/templates",
headers={
"Authorization": f"Bearer {os.environ['SIGN_API_KEY']}",
},
timeout=30,
)
response.raise_for_status()
print(response.json())package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://sign.codevibe.in/api/v1/templates", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("SIGN_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(res.Status, string(out))
}{
"templates": [
{
"id": "3d6f0a1c-8b2e-4f7a-9c5d-1e2f3a4b5c6d",
"name": "Offer letter",
"description": "Standard offer for full-time staff",
"roles": [
{
"name": "Employee",
"type": "signer"
},
{
"name": "HR",
"type": "viewer"
}
],
"documentCount": 1,
"pageCount": 1,
"createdAt": "2026-03-02T09:00:00.000Z",
"updatedAt": "2026-03-02T09:00:00.000Z"
}
],
"nextCursor": null
}Create a template
POST/v1/templates
Stores the PDFs with the roles, fields and settings to reuse. Send the PDFs either as base64 in JSON, or as a multipart upload with the template JSON in a form field named template and the files as documents.
Fields name their role by its key in the same request. Each PDF is checked like an envelope's, and field boxes must fit on their page.
Auth Sender API key, as Authorization: Bearer <key>
Send an Idempotency-Key to retry safely: the same key and body within 24 hours return the first response. See retries.
Headers
Idempotency-Key string
Any unique string, up to 255 characters. A retry with the same key and body within 24 hours returns the first response. The same key with a different body is a VALIDATION error; while the first request is still running, CONFLICT.
1 to 255 characters
Request body
Send it as application/json or multipart/form-data.
name string Required
What the template is called in lists.
1 to 120 characters
title string
Title of the envelopes made from it. Default the name.
1 to 200 characters
routing string
sequential goes by order, lowest first (equal orders sign together); parallel invites everyone at once.
One of sequential parallel · Default sequential
reminders object
Attributes of reminders
firstAfterDays integer Required
Days after the invitation for the first reminder; 0 turns reminders off.
0 to 365
everyDays integer Required
1 to 365
max integer Required
Most reminders per recipient.
0 to 50
expiresInDays integer
Default 30 · 1 to 365
description string
1 to 500 characters
message string
1 to 5000 characters
documents array of objects Required
1 to 20 items
Attributes of documents
key string
How fields refer to this document in the same request. Default its position, "0".
At most 100 characters
name string Required
1 to 200 characters
content string (base64) Required
The PDF file as base64.
roles array of objects Required
At least one must be a signer or an approver.
1 to 50 items
Attributes of roles
key string
How fields refer to this role in the same request. Default its position, "0".
At most 100 characters
id string
On PATCH, the id of an existing role to keep.
name string Required
For example Employee. Unique within the template, ignoring case.
1 to 60 characters
type string
Signers fill fields, approvers approve without fields, viewers get a copy.
One of signer approver viewer · Default signer
auth string
How the recipient proves who they are. email_otp, the default, asks for the link and a code sent by email; email_link needs only the link.
One of email_link email_otp sms_otp aadhaar · Default email_otp
fields array of objects
At most 500 items
Attributes of fields
role string Required
The role's key (or id on PATCH). Viewers have no fields.
document string
The document's key or id. Optional when the template has one document.
type string
A recipient with auth: aadhaar fills in nothing: the eSign provider signs the document as the sender approved it, with the values of the signers before them. They may have one aadhaar field, the Aadhaar seal position: it only says where the provider draws its signature, takes no value, and nothing is drawn for it. Without it the provider places the signature where its own setting says. A second aadhaar field is refused with VALIDATION. signature and initials fields given to such a signer are dropped when the envelope is sent, so older requests still work; any other field for them is refused with VALIDATION. Only an Aadhaar eSign signer may have an aadhaar field.
One of signature initials date_signed name text checkbox aadhaar · Default signature
page integer Required
Zero-based page index.
0 to 10000
x number
At least 0
y number
At least 0
width number
At least 1
height number
At least 1
rect object
A box in PDF points, measured from the top-left corner of the page.
Attributes of rect
x number Required
At least 0
y number Required
At least 0
width number Required
At least 1
height number Required
At least 1
required boolean
Default true
label string
Give text fields a label to prefill them by.
At most 200 characters
Returns
201 Created. The template. A template object.
Idempotent-Replayed:truewhen this is the stored response to an earlier request with the sameIdempotency-Key.
Errors
| Status | When |
|---|---|
| 400 | VALIDATION: the request is malformed. details.issues lists each problem. |
| 401 | UNAUTHORIZED: the API key is missing or not valid. |
| 403 | FORBIDDEN: the credential may only read. |
| 409 | INVALID_STATE: this server keeps no templates, or a PDF of the template is missing from storage. CONFLICT: another request changed the template, or one with the same Idempotency-Key is still running; try again. |
| 413 | DOCUMENT_TOO_LARGE: a PDF or the whole request is over the limit (details.maxBytes). |
| 422 | DOCUMENT_INVALID: a file is not a readable PDF. PDF_ALREADY_SIGNED: a file already carries digital signatures; upload the unsigned original. REQUIRED_FIELDS_MISSING: required fields were left empty. INVALID_FIELD_VALUE: a value does not suit its field (PNG, date, length). |
| 429 | RATE_LIMITED: too many requests. Wait Retry-After seconds. |
| 500 | INTERNAL or SEAL_FAILED. Safe to retry with the same Idempotency-Key. |
curl -X POST https://sign.codevibe.in/api/v1/templates \
-H "Authorization: Bearer $SIGN_API_KEY" \
-H "Idempotency-Key: 9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d" \
-H "Content-Type: application/json" \
-d '{
"name": "Offer letter",
"description": "Standard offer for full-time staff",
"message": "Welcome aboard. Please sign your offer.",
"documents": [
{
"key": "offer",
"name": "offer.pdf",
"content": "'"$(base64 < offer.pdf | tr -d '\n')"'"
}
],
"roles": [
{
"key": "employee",
"name": "Employee"
},
{
"key": "hr",
"name": "HR",
"type": "viewer"
}
],
"fields": [
{
"role": "employee",
"document": "offer",
"type": "signature",
"page": 0,
"x": 72,
"y": 640,
"width": 180,
"height": 48
},
{
"role": "employee",
"type": "text",
"label": "Employee code",
"page": 0,
"x": 72,
"y": 600,
"width": 180,
"height": 20,
"required": false
}
]
}'import { readFile } from 'node:fs/promises';
import { createSignClient } from '@codevibe_technology/sign-client';
const sign = createSignClient({
baseUrl: 'https://sign.codevibe.in/api',
apiKey: process.env.SIGN_API_KEY!,
});
const template = await sign.templates.create({
name: 'Offer letter',
description: 'Standard offer for full-time staff',
message: 'Welcome aboard. Please sign your offer.',
documents: [
{
key: 'offer',
name: 'offer.pdf',
content: await readFile('offer.pdf'),
},
],
roles: [
{
key: 'employee',
name: 'Employee',
},
{
key: 'hr',
name: 'HR',
type: 'viewer',
},
],
fields: [
{
role: 'employee',
document: 'offer',
type: 'signature',
page: 0,
x: 72,
y: 640,
width: 180,
height: 48,
},
{
role: 'employee',
type: 'text',
label: 'Employee code',
page: 0,
x: 72,
y: 600,
width: 180,
height: 20,
required: false,
},
],
});
console.log(template.id, template.roles);import os
import base64
import requests
def b64(path):
with open(path, "rb") as file:
return base64.b64encode(file.read()).decode()
response = requests.post(
"https://sign.codevibe.in/api/v1/templates",
headers={
"Authorization": f"Bearer {os.environ['SIGN_API_KEY']}",
"Idempotency-Key": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
},
json={
"name": "Offer letter",
"description": "Standard offer for full-time staff",
"message": "Welcome aboard. Please sign your offer.",
"documents": [
{
"key": "offer",
"name": "offer.pdf",
"content": b64("offer.pdf"),
},
],
"roles": [
{
"key": "employee",
"name": "Employee",
},
{
"key": "hr",
"name": "HR",
"type": "viewer",
},
],
"fields": [
{
"role": "employee",
"document": "offer",
"type": "signature",
"page": 0,
"x": 72,
"y": 640,
"width": 180,
"height": 48,
},
{
"role": "employee",
"type": "text",
"label": "Employee code",
"page": 0,
"x": 72,
"y": 600,
"width": 180,
"height": 20,
"required": False,
},
],
},
timeout=30,
)
response.raise_for_status()
print(response.json())package main
import (
"bytes"
"encoding/base64"
"encoding/json"
"fmt"
"io"
"net/http"
"os"
)
func b64(path string) string {
data, err := os.ReadFile(path)
if err != nil {
panic(err)
}
return base64.StdEncoding.EncodeToString(data)
}
func main() {
payload, err := json.Marshal(map[string]any{
"name": "Offer letter",
"description": "Standard offer for full-time staff",
"message": "Welcome aboard. Please sign your offer.",
"documents": []any{
map[string]any{
"key": "offer",
"name": "offer.pdf",
"content": b64("offer.pdf"),
},
},
"roles": []any{
map[string]any{
"key": "employee",
"name": "Employee",
},
map[string]any{
"key": "hr",
"name": "HR",
"type": "viewer",
},
},
"fields": []any{
map[string]any{
"role": "employee",
"document": "offer",
"type": "signature",
"page": 0,
"x": 72,
"y": 640,
"width": 180,
"height": 48,
},
map[string]any{
"role": "employee",
"type": "text",
"label": "Employee code",
"page": 0,
"x": 72,
"y": 600,
"width": 180,
"height": 20,
"required": false,
},
},
})
if err != nil {
panic(err)
}
req, err := http.NewRequest("POST", "https://sign.codevibe.in/api/v1/templates", bytes.NewReader(payload))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("SIGN_API_KEY"))
req.Header.Set("Idempotency-Key", "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(res.Status, string(out))
}{
"id": "3d6f0a1c-8b2e-4f7a-9c5d-1e2f3a4b5c6d",
"name": "Offer letter",
"description": "Standard offer for full-time staff",
"title": "Offer letter",
"message": "Welcome aboard. Please sign your offer.",
"routing": "sequential",
"reminders": {
"firstAfterDays": 3,
"everyDays": 3,
"max": 3
},
"expiresInDays": 30,
"roles": [
{
"id": "5a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"name": "Employee",
"type": "signer",
"auth": "email_otp"
},
{
"id": "6b2c3d4e-5f6a-4b7c-9d8e-0f1a2b3c4d5e",
"name": "HR",
"type": "viewer",
"auth": "email_otp"
}
],
"documents": [
{
"id": "1b8e4f60-2c3a-4d7e-8f91-a5c2e6b3d048",
"name": "offer.pdf",
"size": 1042,
"sha256": "4f2a9c1e7b3d5a6f8091a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f7",
"pageCount": 1,
"pages": [
{
"width": 612,
"height": 792
}
]
}
],
"fields": [
{
"id": "7c3d4e5f-6a7b-4c8d-8e9f-1a2b3c4d5e6f",
"documentId": "1b8e4f60-2c3a-4d7e-8f91-a5c2e6b3d048",
"roleId": "5a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"type": "signature",
"page": 0,
"rect": {
"x": 72,
"y": 640,
"width": 180,
"height": 48
},
"required": true
},
{
"id": "8d4e5f6a-7b8c-4d9e-9f0a-2b3c4d5e6f7a",
"documentId": "1b8e4f60-2c3a-4d7e-8f91-a5c2e6b3d048",
"roleId": "5a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"type": "text",
"page": 0,
"rect": {
"x": 72,
"y": 600,
"width": 180,
"height": 20
},
"required": false,
"label": "Employee code"
}
],
"createdAt": "2026-03-02T09:00:00.000Z",
"updatedAt": "2026-03-02T09:00:00.000Z"
}Get a template
GET/v1/templates/{templateId}
The template with its documents, roles, fields and settings.
Auth Sender API key, as Authorization: Bearer <key>
Path parameters
templateId string Required
The template id.
Returns
200 OK. The template. A template object.
Errors
| Status | When |
|---|---|
| 401 | UNAUTHORIZED: the API key is missing or not valid. |
| 404 | NOT_FOUND: no such template in the workspace of the API key. |
| 409 | INVALID_STATE: this server keeps no templates, or a PDF of the template is missing from storage. CONFLICT: another request changed the template, or one with the same Idempotency-Key is still running; try again. |
curl https://sign.codevibe.in/api/v1/templates/3d6f0a1c-8b2e-4f7a-9c5d-1e2f3a4b5c6d \
-H "Authorization: Bearer $SIGN_API_KEY"import { createSignClient } from '@codevibe_technology/sign-client';
const sign = createSignClient({
baseUrl: 'https://sign.codevibe.in/api',
apiKey: process.env.SIGN_API_KEY!,
});
const template = await sign.templates.get('3d6f0a1c-8b2e-4f7a-9c5d-1e2f3a4b5c6d');import os
import requests
response = requests.get(
"https://sign.codevibe.in/api/v1/templates/3d6f0a1c-8b2e-4f7a-9c5d-1e2f3a4b5c6d",
headers={
"Authorization": f"Bearer {os.environ['SIGN_API_KEY']}",
},
timeout=30,
)
response.raise_for_status()
print(response.json())package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://sign.codevibe.in/api/v1/templates/3d6f0a1c-8b2e-4f7a-9c5d-1e2f3a4b5c6d", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("SIGN_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(res.Status, string(out))
}{
"id": "3d6f0a1c-8b2e-4f7a-9c5d-1e2f3a4b5c6d",
"name": "Offer letter",
"description": "Standard offer for full-time staff",
"title": "Offer letter",
"message": "Welcome aboard. Please sign your offer.",
"routing": "sequential",
"reminders": {
"firstAfterDays": 3,
"everyDays": 3,
"max": 3
},
"expiresInDays": 30,
"roles": [
{
"id": "5a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"name": "Employee",
"type": "signer",
"auth": "email_otp"
},
{
"id": "6b2c3d4e-5f6a-4b7c-9d8e-0f1a2b3c4d5e",
"name": "HR",
"type": "viewer",
"auth": "email_otp"
}
],
"documents": [
{
"id": "1b8e4f60-2c3a-4d7e-8f91-a5c2e6b3d048",
"name": "offer.pdf",
"size": 1042,
"sha256": "4f2a9c1e7b3d5a6f8091a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f7",
"pageCount": 1,
"pages": [
{
"width": 612,
"height": 792
}
]
}
],
"fields": [
{
"id": "7c3d4e5f-6a7b-4c8d-8e9f-1a2b3c4d5e6f",
"documentId": "1b8e4f60-2c3a-4d7e-8f91-a5c2e6b3d048",
"roleId": "5a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"type": "signature",
"page": 0,
"rect": {
"x": 72,
"y": 640,
"width": 180,
"height": 48
},
"required": true
},
{
"id": "8d4e5f6a-7b8c-4d9e-9f0a-2b3c4d5e6f7a",
"documentId": "1b8e4f60-2c3a-4d7e-8f91-a5c2e6b3d048",
"roleId": "5a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"type": "text",
"page": 0,
"rect": {
"x": 72,
"y": 600,
"width": 180,
"height": 20
},
"required": false,
"label": "Employee code"
}
],
"createdAt": "2026-03-02T09:00:00.000Z",
"updatedAt": "2026-03-02T09:00:00.000Z"
}Change a template
PATCH/v1/templates/{templateId}
Only the properties you send change. roles and fields, when sent, replace the existing ones; give a role its id to keep it. Fields you do not resend must still have their role. The documents of a template cannot be changed: create a new template instead. Envelopes already made from the template are not affected.
Auth Sender API key, as Authorization: Bearer <key>
Path parameters
templateId string Required
The template id.
Request body
name string
What the template is called in lists.
1 to 120 characters
title string
Title of the envelopes made from it. Default the name.
1 to 200 characters
routing string
sequential goes by order, lowest first (equal orders sign together); parallel invites everyone at once.
One of sequential parallel · Default sequential
reminders object
Attributes of reminders
firstAfterDays integer Required
Days after the invitation for the first reminder; 0 turns reminders off.
0 to 365
everyDays integer Required
1 to 365
max integer Required
Most reminders per recipient.
0 to 50
expiresInDays integer
Default 30 · 1 to 365
description string or null
Send null to clear it.
At most 500 characters
message string or null
Send null to clear it.
At most 5000 characters
roles array of objects
Replaces the roles. Include id to keep an existing one.
1 to 50 items
Attributes of roles
key string
How fields refer to this role in the same request. Default its position, "0".
At most 100 characters
id string
On PATCH, the id of an existing role to keep.
name string Required
For example Employee. Unique within the template, ignoring case.
1 to 60 characters
type string
Signers fill fields, approvers approve without fields, viewers get a copy.
One of signer approver viewer · Default signer
auth string
How the recipient proves who they are. email_otp, the default, asks for the link and a code sent by email; email_link needs only the link.
One of email_link email_otp sms_otp aadhaar · Default email_otp
fields array of objects
Replaces all fields.
At most 500 items
Attributes of fields
role string Required
The role's key (or id on PATCH). Viewers have no fields.
document string
The document's key or id. Optional when the template has one document.
type string
A recipient with auth: aadhaar fills in nothing: the eSign provider signs the document as the sender approved it, with the values of the signers before them. They may have one aadhaar field, the Aadhaar seal position: it only says where the provider draws its signature, takes no value, and nothing is drawn for it. Without it the provider places the signature where its own setting says. A second aadhaar field is refused with VALIDATION. signature and initials fields given to such a signer are dropped when the envelope is sent, so older requests still work; any other field for them is refused with VALIDATION. Only an Aadhaar eSign signer may have an aadhaar field.
One of signature initials date_signed name text checkbox aadhaar · Default signature
page integer Required
Zero-based page index.
0 to 10000
x number
At least 0
y number
At least 0
width number
At least 1
height number
At least 1
rect object
A box in PDF points, measured from the top-left corner of the page.
Attributes of rect
x number Required
At least 0
y number Required
At least 0
width number Required
At least 1
height number Required
At least 1
required boolean
Default true
label string
Give text fields a label to prefill them by.
At most 200 characters
Returns
200 OK. The changed template. A template object.
Errors
| Status | When |
|---|---|
| 400 | VALIDATION: the request is malformed. details.issues lists each problem. |
| 401 | UNAUTHORIZED: the API key is missing or not valid. |
| 403 | FORBIDDEN: the credential may only read. |
| 404 | NOT_FOUND: no such template in the workspace of the API key. |
| 409 | INVALID_STATE: this server keeps no templates, or a PDF of the template is missing from storage. CONFLICT: another request changed the template, or one with the same Idempotency-Key is still running; try again. |
curl -X PATCH https://sign.codevibe.in/api/v1/templates/3d6f0a1c-8b2e-4f7a-9c5d-1e2f3a4b5c6d \
-H "Authorization: Bearer $SIGN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Offer letter 2026",
"message": "Welcome aboard. Please sign by Friday.",
"expiresInDays": 14
}'import { createSignClient } from '@codevibe_technology/sign-client';
const sign = createSignClient({
baseUrl: 'https://sign.codevibe.in/api',
apiKey: process.env.SIGN_API_KEY!,
});
const template = await sign.templates.update('3d6f0a1c-8b2e-4f7a-9c5d-1e2f3a4b5c6d', {
name: 'Offer letter 2026',
message: 'Welcome aboard. Please sign by Friday.',
expiresInDays: 14,
});import os
import requests
response = requests.patch(
"https://sign.codevibe.in/api/v1/templates/3d6f0a1c-8b2e-4f7a-9c5d-1e2f3a4b5c6d",
headers={
"Authorization": f"Bearer {os.environ['SIGN_API_KEY']}",
},
json={
"name": "Offer letter 2026",
"message": "Welcome aboard. Please sign by Friday.",
"expiresInDays": 14,
},
timeout=30,
)
response.raise_for_status()
print(response.json())package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
"os"
)
func main() {
payload, err := json.Marshal(map[string]any{
"name": "Offer letter 2026",
"message": "Welcome aboard. Please sign by Friday.",
"expiresInDays": 14,
})
if err != nil {
panic(err)
}
req, err := http.NewRequest("PATCH", "https://sign.codevibe.in/api/v1/templates/3d6f0a1c-8b2e-4f7a-9c5d-1e2f3a4b5c6d", bytes.NewReader(payload))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("SIGN_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(res.Status, string(out))
}{
"id": "3d6f0a1c-8b2e-4f7a-9c5d-1e2f3a4b5c6d",
"name": "Offer letter",
"description": "Standard offer for full-time staff",
"title": "Offer letter",
"message": "Welcome aboard. Please sign your offer.",
"routing": "sequential",
"reminders": {
"firstAfterDays": 3,
"everyDays": 3,
"max": 3
},
"expiresInDays": 30,
"roles": [
{
"id": "5a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"name": "Employee",
"type": "signer",
"auth": "email_otp"
},
{
"id": "6b2c3d4e-5f6a-4b7c-9d8e-0f1a2b3c4d5e",
"name": "HR",
"type": "viewer",
"auth": "email_otp"
}
],
"documents": [
{
"id": "1b8e4f60-2c3a-4d7e-8f91-a5c2e6b3d048",
"name": "offer.pdf",
"size": 1042,
"sha256": "4f2a9c1e7b3d5a6f8091a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d5e6f7",
"pageCount": 1,
"pages": [
{
"width": 612,
"height": 792
}
]
}
],
"fields": [
{
"id": "7c3d4e5f-6a7b-4c8d-8e9f-1a2b3c4d5e6f",
"documentId": "1b8e4f60-2c3a-4d7e-8f91-a5c2e6b3d048",
"roleId": "5a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"type": "signature",
"page": 0,
"rect": {
"x": 72,
"y": 640,
"width": 180,
"height": 48
},
"required": true
},
{
"id": "8d4e5f6a-7b8c-4d9e-9f0a-2b3c4d5e6f7a",
"documentId": "1b8e4f60-2c3a-4d7e-8f91-a5c2e6b3d048",
"roleId": "5a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"type": "text",
"page": 0,
"rect": {
"x": 72,
"y": 600,
"width": 180,
"height": 20
},
"required": false,
"label": "Employee code"
}
],
"createdAt": "2026-03-02T09:00:00.000Z",
"updatedAt": "2026-03-02T09:00:00.000Z"
}Delete a template
DELETE/v1/templates/{templateId}
Removes the template and its stored PDFs for good. Envelopes already made from it keep their own copies and are not affected.
Auth Sender API key, as Authorization: Bearer <key>
Path parameters
templateId string Required
The template id.
Returns
200 OK. The template is gone. An object.
Errors
| Status | When |
|---|---|
| 401 | UNAUTHORIZED: the API key is missing or not valid. |
| 403 | FORBIDDEN: the credential may only read. |
| 404 | NOT_FOUND: no such template in the workspace of the API key. |
| 409 | INVALID_STATE: this server keeps no templates, or a PDF of the template is missing from storage. CONFLICT: another request changed the template, or one with the same Idempotency-Key is still running; try again. |
curl -X DELETE https://sign.codevibe.in/api/v1/templates/3d6f0a1c-8b2e-4f7a-9c5d-1e2f3a4b5c6d \
-H "Authorization: Bearer $SIGN_API_KEY"import { createSignClient } from '@codevibe_technology/sign-client';
const sign = createSignClient({
baseUrl: 'https://sign.codevibe.in/api',
apiKey: process.env.SIGN_API_KEY!,
});
await sign.templates.delete('3d6f0a1c-8b2e-4f7a-9c5d-1e2f3a4b5c6d');import os
import requests
response = requests.delete(
"https://sign.codevibe.in/api/v1/templates/3d6f0a1c-8b2e-4f7a-9c5d-1e2f3a4b5c6d",
headers={
"Authorization": f"Bearer {os.environ['SIGN_API_KEY']}",
},
timeout=30,
)
response.raise_for_status()
print(response.json())package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("DELETE", "https://sign.codevibe.in/api/v1/templates/3d6f0a1c-8b2e-4f7a-9c5d-1e2f3a4b5c6d", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("SIGN_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(res.Status, string(out))
}{
"id": "3d6f0a1c-8b2e-4f7a-9c5d-1e2f3a4b5c6d",
"deleted": true
}Create an envelope from a template
POST/v1/templates/{templateId}/envelopes
Makes an envelope with the template's documents, fields and settings, and the people you name for its roles. roles is keyed by role name (case does not matter) or role id, and every role needs a person. prefill sets text fields by their label or id before anyone signs. The envelope is a draft unless send is true, and from then on it is an ordinary envelope: metadata.templateId says where it came from.
Counts towards the same per-minute limit as creating envelopes.
Auth Sender API key, as Authorization: Bearer <key>
Send an Idempotency-Key to retry safely: the same key and body within 24 hours return the first response. See retries.
Path parameters
templateId string Required
The template id.
Headers
Idempotency-Key string
Any unique string, up to 255 characters. A retry with the same key and body within 24 hours returns the first response. The same key with a different body is a VALIDATION error; while the first request is still running, CONFLICT.
1 to 255 characters
Request body
roles map Required
One person for every role of the template, keyed by role name or role id.
prefill map
Values for text fields, keyed by field label (case does not matter) or field id. A label shared by several fields fills them all. Recipients may change the values.
title string
Replaces the template's title for this envelope.
1 to 200 characters
message string or null
Replaces the template's message for this envelope; null sends none.
1 to 5000 characters
reminders object
Attributes of reminders
firstAfterDays integer Required
Days after the invitation for the first reminder; 0 turns reminders off.
0 to 365
everyDays integer Required
1 to 365
max integer Required
Most reminders per recipient.
0 to 50
expiresAt string (date-time)
When the envelope expires; must be in the future.
expiresInDays integer
Used when expiresAt is not set. Default the template's.
1 to 365
metadata map
Your own data, for example an employee id. Echoed in webhooks.
send boolean
Send at once instead of keeping a draft.
Default false
Returns
201 Created. The envelope, as a draft or already sent. An envelope object.
Idempotent-Replayed:truewhen this is the stored response to an earlier request with the sameIdempotency-Key.
Errors
| Status | When |
|---|---|
| 400 | VALIDATION: the request is malformed. details.issues lists each problem. |
| 401 | UNAUTHORIZED: the API key is missing or not valid. |
| 403 | FORBIDDEN: the credential may only read. |
| 404 | NOT_FOUND: no such template in the workspace of the API key. |
| 409 | INVALID_STATE: this server keeps no templates, or a PDF of the template is missing from storage. CONFLICT: another request changed the template, or one with the same Idempotency-Key is still running; try again. |
| 429 | RATE_LIMITED: too many requests. Wait Retry-After seconds. |
| 500 | INTERNAL or SEAL_FAILED. Safe to retry with the same Idempotency-Key. |
curl -X POST https://sign.codevibe.in/api/v1/templates/3d6f0a1c-8b2e-4f7a-9c5d-1e2f3a4b5c6d/envelopes \
-H "Authorization: Bearer $SIGN_API_KEY" \
-H "Idempotency-Key: 9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d" \
-H "Content-Type: application/json" \
-d '{
"roles": {
"Employee": {
"name": "Asha Rao",
"email": "asha@example.com"
},
"HR": {
"name": "HR Team",
"email": "hr@example.com"
}
},
"prefill": {
"Employee code": "E-1042"
},
"metadata": {
"employeeId": "E-1042"
},
"send": true
}'import { createSignClient } from '@codevibe_technology/sign-client';
const sign = createSignClient({
baseUrl: 'https://sign.codevibe.in/api',
apiKey: process.env.SIGN_API_KEY!,
});
const envelope = await sign.templates.createEnvelope('3d6f0a1c-8b2e-4f7a-9c5d-1e2f3a4b5c6d', {
roles: {
Employee: {
name: 'Asha Rao',
email: 'asha@example.com',
},
HR: {
name: 'HR Team',
email: 'hr@example.com',
},
},
prefill: {
'Employee code': 'E-1042',
},
metadata: {
employeeId: 'E-1042',
},
send: true,
});
console.log(envelope.id, envelope.status);import os
import requests
response = requests.post(
"https://sign.codevibe.in/api/v1/templates/3d6f0a1c-8b2e-4f7a-9c5d-1e2f3a4b5c6d/envelopes",
headers={
"Authorization": f"Bearer {os.environ['SIGN_API_KEY']}",
"Idempotency-Key": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
},
json={
"roles": {
"Employee": {
"name": "Asha Rao",
"email": "asha@example.com",
},
"HR": {
"name": "HR Team",
"email": "hr@example.com",
},
},
"prefill": {
"Employee code": "E-1042",
},
"metadata": {
"employeeId": "E-1042",
},
"send": True,
},
timeout=30,
)
response.raise_for_status()
print(response.json())package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
"os"
)
func main() {
payload, err := json.Marshal(map[string]any{
"roles": map[string]any{
"Employee": map[string]any{
"name": "Asha Rao",
"email": "asha@example.com",
},
"HR": map[string]any{
"name": "HR Team",
"email": "hr@example.com",
},
},
"prefill": map[string]any{
"Employee code": "E-1042",
},
"metadata": map[string]any{
"employeeId": "E-1042",
},
"send": true,
})
if err != nil {
panic(err)
}
req, err := http.NewRequest("POST", "https://sign.codevibe.in/api/v1/templates/3d6f0a1c-8b2e-4f7a-9c5d-1e2f3a4b5c6d/envelopes", bytes.NewReader(payload))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("SIGN_API_KEY"))
req.Header.Set("Idempotency-Key", "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(res.Status, string(out))
}{
"id": "7f3c9a2e-5b1d-4e8a-9c6f-2d4b8e1a0c37",
"title": "Offer letter",
"message": "Please sign by Friday.",
"status": "sent",
"routing": "sequential",
"documents": [
{
"id": "1b8e4f60-2c3a-4d7e-8f91-a5c2e6b3d048",
"name": "offer.pdf",
"sha256": "1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d",
"pageCount": 1,
"pageSizes": [
{
"width": 595.28,
"height": 841.89
}
]
}
],
"recipients": [
{
"id": "c4a1d9e2-7f3b-4c8d-a6e5-0b9f2d1c7e83",
"name": "Asha Rao",
"email": "asha@example.com",
"role": "signer",
"order": 1,
"auth": "email_otp",
"status": "notified",
"notifiedAt": "2026-03-02T09:00:00.000Z"
}
],
"fields": [
{
"id": "e9d2b7c1-4a6f-4e3b-8d5c-3f1a0b2c6d94",
"documentId": "1b8e4f60-2c3a-4d7e-8f91-a5c2e6b3d048",
"recipientId": "c4a1d9e2-7f3b-4c8d-a6e5-0b9f2d1c7e83",
"type": "signature",
"page": 0,
"rect": {
"x": 72,
"y": 640,
"width": 180,
"height": 48
},
"required": true
}
],
"values": [],
"reminders": {
"firstAfterDays": 2,
"everyDays": 2,
"max": 3
},
"expiresAt": "2026-04-01T09:00:00.000Z",
"createdAt": "2026-03-02T09:00:00.000Z",
"sentAt": "2026-03-02T09:00:00.000Z",
"metadata": {
"employeeId": "E-1042"
},
"auditHead": "3b5f0c4d6e1a2b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c"
}