Skip to main content
POST
/
documents
Create document (Legacy)
curl --request POST \
  --url https://api.firma.dev/functions/v1/signing-request-api/documents \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Sales Agreement 2024",
  "recipients": [
    {
      "name": "John Doe",
      "email": "john@example.com"
    }
  ]
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "description": "<string>",
  "document_url": "<string>",
  "document_url_expires_at": "2023-11-07T05:31:56Z",
  "document_page_count": 2,
  "expiration_hours": 168,
  "credit_cost": 1,
  "settings": {
    "allow_download": true,
    "attach_pdf_on_finish": true,
    "allow_editing_before_sending": false,
    "send_signing_email": true,
    "send_finish_email": true,
    "send_expiration_email": true,
    "send_cancellation_email": true,
    "hand_drawn_only": false
  },
  "template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "date_created": "2023-11-07T05:31:56Z",
  "date_sent": "2023-11-07T05:31:56Z",
  "date_finished": "2023-11-07T05:31:56Z",
  "date_cancelled": "2023-11-07T05:31:56Z",
  "date_declined": "2023-11-07T05:31:56Z",
  "expires_at": "2023-11-07T05:31:56Z",
  "certificate": {
    "generated": true,
    "generated_on": "2023-11-07T05:31:56Z",
    "has_error": true
  },
  "final_document_download_url": "<string>",
  "document_only_download_url": "<string>",
  "certificate_only_download_url": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.firma.dev/llms.txt

Use this file to discover all available pages before exploring further.

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

Document name

Maximum string length: 255
recipients
object[]

Response

Document created successfully

id
string<uuid>

Unique identifier for the signing request

name
string

Signing request name

Maximum string length: 255
description
string | null

Signing request 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 signing request 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 signing request again to receive a fresh signed URL.

document_page_count
integer

Number of pages in the document

Required range: x >= 1
status
enum<string>

Current status of the signing request

Available options:
not_sent,
in_progress,
finished,
cancelled,
declined,
deleted,
expired
expiration_hours
integer
default:168

Hours until signing request expires (default: 168 = 7 days)

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

Number of credits consumed when this signing request was sent. Minimum value is 1.

Required range: x >= 1
settings
object
use_signing_order
enum<integer>
deprecated

Deprecated: Use settings.use_signing_order (boolean) instead. Whether signing order is enforced (0=false, 1=true).

Available options:
0,
1
allow_download
enum<integer>
deprecated

Deprecated: Use settings.allow_download (boolean) instead. Whether recipients can download the document (0=false, 1=true).

Available options:
0,
1
allow_editing_before_sending
enum<integer>
deprecated

Deprecated: Use settings.allow_editing_before_sending (boolean) instead. Whether editing is allowed before sending (0=false, 1=true).

Available options:
0,
1
hand_drawn_only
enum<integer>
deprecated

Deprecated: Use settings.hand_drawn_only (boolean) instead. Whether only hand-drawn signatures are allowed (0=false, 1=true).

Available options:
0,
1
attach_pdf_on_finish
enum<integer>
deprecated

Deprecated: Use settings.attach_pdf_on_finish (boolean) instead. Whether to attach PDF on completion (0=false, 1=true).

Available options:
0,
1
template_id
string<uuid> | null

ID of template used to create this signing request

date_created
string<date-time>

Signing request creation timestamp

date_sent
string<date-time> | null

Timestamp when the signing request was sent

date_finished
string<date-time> | null

Timestamp when all signatures were completed

date_cancelled
string<date-time> | null

Timestamp when signing request was cancelled

date_declined
string<date-time> | null

Timestamp when a signer declined the signing request

expires_at
string<date-time> | null

Expiration timestamp

certificate
object

Certificate generation status information

final_document_download_url
string<uri> | null

Signed URL to download the final signed document (PDF with certificate). Only available when signing request is finished and certificate has been generated. URL expires after 1 hour.

final_document_download_error
enum<string> | null

Error indicator if the final document exists but could not be accessed. Value is 'file_not_accessible' when the file path exists but the file is missing or inaccessible, otherwise null.

Available options:
file_not_accessible,
null
document_only_download_url
string<uri> | null

Signed URL to download the document-only PDF (signed document without certificate/audit trail pages). Only available when the split PDF feature has been applied. URL expires after 1 hour.

document_only_download_error
enum<string> | null

Error indicator if the document-only file exists but could not be accessed.

Available options:
file_not_accessible,
null
certificate_only_download_url
string<uri> | null

Signed URL to download the certificate-only PDF (audit trail/certificate pages only). Only available when the split PDF feature has been applied. URL expires after 1 hour.

certificate_only_download_error
enum<string> | null

Error indicator if the certificate-only file exists but could not be accessed.

Available options:
file_not_accessible,
null