Skip to main content
POST
/
signing-requests
@firma-dev/sdk
import { FirmaClient } from "@firma-dev/sdk";

const firma = new FirmaClient({ apiKey: "YOUR_API_KEY" });

const response = await firma.signingRequests.createSigningRequest({
    template_id: "template_id",
    name: "Updated Contract Name",
    expiration_hours: 72
});
console.log(response);
curl --request POST \
--url https://api.firma.dev/functions/v1/signing-request-api/signing-requests \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Updated Contract Name",
"expiration_hours": 72
}
'
import requests

url = "https://api.firma.dev/functions/v1/signing-request-api/signing-requests"

payload = {
"name": "Updated Contract Name",
"expiration_hours": 72
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'Updated Contract Name', expiration_hours: 72})
};

fetch('https://api.firma.dev/functions/v1/signing-request-api/signing-requests', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.firma.dev/functions/v1/signing-request-api/signing-requests",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Updated Contract Name',
'expiration_hours' => 72
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.firma.dev/functions/v1/signing-request-api/signing-requests"

payload := strings.NewReader("{\n \"name\": \"Updated Contract Name\",\n \"expiration_hours\": 72\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.firma.dev/functions/v1/signing-request-api/signing-requests")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Updated Contract Name\",\n \"expiration_hours\": 72\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.firma.dev/functions/v1/signing-request-api/signing-requests")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Updated Contract Name\",\n \"expiration_hours\": 72\n}"

response = http.request(request)
puts response.read_body
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "status": "draft",
  "description": "<string>",
  "document_url": "<string>",
  "page_count": 2,
  "expiration_hours": 168,
  "template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "settings": {
    "allow_download": true,
    "attach_pdf_on_finish": true,
    "allow_editing_before_sending": false,
    "use_signing_order": true,
    "hand_drawn_only": false,
    "send_signing_email": true,
    "send_finish_email": true,
    "send_expiration_email": true,
    "send_cancellation_email": true,
    "require_otp_verification": null,
    "disable_guided_navigation": true,
    "allow_presigning_download": true,
    "show_qr_code": true,
    "identity_editable_fields": [
      "<string>"
    ],
    "notify_identity_change_email": false
  },
  "created_date": "2023-11-07T05:31:56Z",
  "updated_date": "2023-11-07T05:31:56Z",
  "sent_date": "2023-11-07T05:31:56Z",
  "finished_date": "2023-11-07T05:31:56Z",
  "cancelled_date": "2023-11-07T05:31:56Z",
  "recipients": [
    {
      "first_name": "<string>",
      "email": "jsmith@example.com",
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "last_name": "<string>",
      "name": "<string>",
      "order": 2,
      "phone_number": "<string>",
      "street_address": "<string>",
      "city": "<string>",
      "state_province": "<string>",
      "postal_code": "<string>",
      "country": "<string>",
      "title": "<string>",
      "company": "<string>",
      "custom_fields": {},
      "finished_date": "2023-11-07T05:31:56Z"
    }
  ],
  "fields": [
    {
      "recipient_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "page_number": 2,
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "x_position": 123,
      "y_position": 123,
      "width": 123,
      "height": 123,
      "required": true,
      "read_only": true,
      "read_only_value": "<string>",
      "variable_name": "<string>",
      "variable_defined_name": "<string>",
      "dropdown_options": [
        "<string>"
      ],
      "format_rules": {},
      "validation_rules": {},
      "date_signing_default": true,
      "final_value": "<string>"
    }
  ],
  "warnings": [
    "<string>"
  ]
}
{
"error": "Validation Error",
"message": "Invalid input data",
"details": {
"name": "Name is required",
"email": "Invalid email format"
}
}
{
"error": "Unauthorized",
"message": "Invalid API key"
}
{
"error": "<string>",
"message": "<string>",
"details": {}
}
{
"error": "Rate Limit Exceeded",
"message": "Too many requests. Please wait before retrying.",
"details": {
"retry_after": 45
}
}

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

Create signing request from a PDF document

document
string<byte>
required

Base64-encoded PDF or DOCX document. DOCX files are automatically converted to PDF. Page count will be auto-extracted.

name
string

Name for the signing request

Maximum string length: 255
description
string

Description for the signing request

expiration_hours
integer
default:168

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

Required range: x >= 1
recipients
object[]

Recipients for the signing request. Use temporary IDs (e.g., 'temp_1') in the id field to reference recipients in fields/reminders.

fields
object[]

Fields to place on the document. Use recipient_id to assign fields to recipients.

anchor_tags
object[]

Anchor tags for automatic field placement. Text markers in the PDF are located and converted to positioned fields. The anchor text is removed from the PDF after processing. Fields created from anchor tags are added alongside any manually specified fields. Only available for document-based creation (not template-based).

Maximum array length: 100
reminders
object[]

Reminders to send to recipients

settings
object

Signing request settings

Response

Signing request created successfully. Response may include a 'warnings' array for email format validation warnings (non-blocking).

Signing request as returned by CREATE endpoints (POST /signing-requests)

id
string<uuid>
required

Unique identifier for the signing request

name
string
required

Signing request name

Maximum string length: 255
status
enum<string>
required

Status is always 'draft' for newly created signing requests

Available options:
draft
description
string | null

Signing request description

document_url
string<uri>

Pre-signed URL to the PDF document

page_count
integer

Number of pages in the document

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

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

Required range: x >= 1
template_id
string<uuid> | null

Template ID if created from a template

settings
object

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

created_date
string<date-time>

Creation timestamp

updated_date
string<date-time>

Last update timestamp

sent_date
string<date-time> | null

When the signing request was sent

finished_date
string<date-time> | null

When all signatures were completed

cancelled_date
string<date-time> | null

When the signing request was cancelled

recipients
object[]

Signing request recipients

fields
object[]

Signing request fields with flat position values

warnings
string[]

Optional email format validation warnings. Only present when recipient emails have unusual formats.