Skip to main content
POST
@firma-dev/sdk

Authorizations

Authorization
string
header
required

API key for authentication. Use your API key directly without any prefix (e.g., 'your-api-key'). Bearer prefix is optional but not required.

Body

application/json
name
string
required

Template name

Maximum string length: 255
Example:

"Employment Contract Template"

document
string<byte>
required

Base64-encoded PDF or DOCX document. DOCX files are automatically converted to PDF. Maximum size: 20MB. The API will automatically extract the page count from the document. (mutually exclusive with document_id)

Example:

"JVBERi0xLjQKJeLjz9MKMyAwIG9iago8PC9UeXBlIC9QYWdlCi9QYXJlbnQgMSAwIFIKL1Jlc291c..."

description
string

Template description

Example:

"Standard employment contract for new hires"

expiration_hours
integer
default:168

Hours until signing request expires

Example:

168

settings
object
document_id
string<uuid>

ID of a previously uploaded document (mutually exclusive with document). Obtain by calling POST /documents first.

Example:

"123e4567-e89b-12d3-a456-426614174000"

Response

Template created successfully

id
string<uuid>
required

Unique identifier for the template

name
string
required

Template name

Maximum string length: 255
created_date
string<date-time>
required

Template creation timestamp

description
string | null

Template description

document_url
string<uri>

Pre-signed URL to the PDF document. This is a time-limited signed URL for secure access - see document_url_expires_at for expiration time. Initial URLs are valid for 7 days; refreshed URLs are valid for 1 hour. Request a new template retrieval to get a fresh URL if expired.

document_url_expires_at
string<date-time> | null

ISO 8601 timestamp when the document_url will expire. After this time, the URL will return an access denied error. Fetch the template again to receive a fresh signed URL.

page_count
integer

Number of pages in the document

Required range: x >= 1
expiration_hours
integer
default:168

Hours until signing requests created from this template expire

Required range: x >= 1
credit_cost
integer
default:1

Number of credits consumed when a signing request is sent from this template. Minimum value is 1.

Required range: x >= 1
settings
object

Settings returned by the signing request list and detail endpoints. Templates use the TemplateSettings schema (no identity fields).

recipients
object[]

Template recipients (included in GET single template)

fields
object[]

Template fields (included in GET single template)

updated_date
string<date-time>

Template last update timestamp