Create Template
Changed onCreate a new template with a base64-encoded PDF document. The API automatically extracts the page count from the document.
seal_participants, recipients and fields are not accepted keys on this operation: they are ignored and nothing is created from them. When the request body contains any of them (the key being present is enough, whatever its value, including null or []), the 201 response carries warnings, one string per ignored key. Add participants and fields with PATCH /templates/{id} or PUT /templates/{id}.
Request
- Base URLhttps://api.firma.dev/functions/v1/signing-request-api
- AuthAPI key in header Authorization
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Request body
Example request
{
"name": "Employment Contract Template",
"description": "Standard employment contract for new hires",
"document": "JVBERi0xLjQKJeLjz9MKMyAwIG9iago8PC9UeXBlIC9QYWdlCi9QYXJlbnQgMSAwIFIKL1Jlc291c...",
"expiration_hours": 168,
"document_id": "123e4567-e89b-12d3-a456-426614174000"
}Response
Template created successfully
Example response
{
"fields": [
{
"format_rules": {
"dateFormat": "MMMM dd, yyyy"
}
}
],
"documents": [
{
"document_id": null,
"position": 1,
"label": null,
"original_filename": null,
"page_count": 3,
"document_url": "https://api.firma.dev/storage/v1/object/sign/signing-request-documents/example.pdf?token=example",
"document_url_kind": "stored",
"document_only_hash": null
}
],
"warnings": [
"seal_participants is not accepted on POST /templates and was ignored; add it with PATCH or PUT /templates/{id}"
]
}Changes
- breaking
the response's body type changed from
objectto no type for status - breaking
removed the required property
from the response with the status - warning
removed the optional property
from the response with the status - warning
removed the optional property
from the response with the status - warning
removed the optional property
from the response with the status - warning
removed the optional property
from the response with the status - info
added to the response body
anyOflist for the response status
- breaking
- info
added the new optional request property
/ - info
added the new optional request property
/ - info
added the optional property
/////to the response with the status - info
added the optional property
/////to the response with the status
- info