curl --request PUT \
--url https://api.firma.dev/functions/v1/signing-request-api/signing-requests/{id}/documents/order \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"document_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
'import requests
url = "https://api.firma.dev/functions/v1/signing-request-api/signing-requests/{id}/documents/order"
payload = { "document_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({document_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']})
};
fetch('https://api.firma.dev/functions/v1/signing-request-api/signing-requests/{id}/documents/order', 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/{id}/documents/order",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'document_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
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/{id}/documents/order"
payload := strings.NewReader("{\n \"document_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.firma.dev/functions/v1/signing-request-api/signing-requests/{id}/documents/order")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"document_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firma.dev/functions/v1/signing-request-api/signing-requests/{id}/documents/order")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"document_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"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
}
],
"documents_version": 123,
"documents_layout_version": 123
}{
"error": "<string>",
"code": "ALREADY_CANCELLED",
"errors": [
{
"message": "<string>"
}
],
"message": "<string>",
"details": {}
}{
"error": "Unauthorized",
"message": "Invalid API key"
}{
"error": "<string>",
"code": "ALREADY_CANCELLED",
"errors": [
{
"message": "<string>"
}
],
"message": "<string>",
"details": {}
}{
"error": "<string>",
"code": "ALREADY_CANCELLED",
"errors": [
{
"message": "<string>"
}
],
"message": "<string>",
"details": {}
}{
"error": "Rate Limit Exceeded",
"message": "Too many requests. Please wait before retrying.",
"details": {
"retry_after": 45
}
}{
"error": "<string>",
"code": "<string>",
"errors": [
{
"message": "<string>"
}
],
"message": "<string>",
"details": {}
}Reorder a signing request's documents
Sets the order of the signing request’s documents. document_ids must name every document of the signing request exactly once: a missing or repeated id answers 400 INVALID_DOCUMENT_ORDER, an id that is not a document of this signing request 404 DOCUMENT_NOT_FOUND. A sent, finished, cancelled or declined signing request answers 409 DOCUMENT_SET_LOCKED.
Enablement required. This operation is part of the multi-document contract (API 01.39.00). It is served only for companies enabled for multi-document documents; for any other company, and for a signing request or template the API key cannot see, it answers 404 with code NOT_FOUND (“Endpoint not found”), exactly as an unknown endpoint does.
curl --request PUT \
--url https://api.firma.dev/functions/v1/signing-request-api/signing-requests/{id}/documents/order \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"document_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
'import requests
url = "https://api.firma.dev/functions/v1/signing-request-api/signing-requests/{id}/documents/order"
payload = { "document_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({document_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']})
};
fetch('https://api.firma.dev/functions/v1/signing-request-api/signing-requests/{id}/documents/order', 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/{id}/documents/order",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'document_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
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/{id}/documents/order"
payload := strings.NewReader("{\n \"document_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.firma.dev/functions/v1/signing-request-api/signing-requests/{id}/documents/order")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"document_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.firma.dev/functions/v1/signing-request-api/signing-requests/{id}/documents/order")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"document_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"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
}
],
"documents_version": 123,
"documents_layout_version": 123
}{
"error": "<string>",
"code": "ALREADY_CANCELLED",
"errors": [
{
"message": "<string>"
}
],
"message": "<string>",
"details": {}
}{
"error": "Unauthorized",
"message": "Invalid API key"
}{
"error": "<string>",
"code": "ALREADY_CANCELLED",
"errors": [
{
"message": "<string>"
}
],
"message": "<string>",
"details": {}
}{
"error": "<string>",
"code": "ALREADY_CANCELLED",
"errors": [
{
"message": "<string>"
}
],
"message": "<string>",
"details": {}
}{
"error": "Rate Limit Exceeded",
"message": "Too many requests. Please wait before retrying.",
"details": {
"retry_after": 45
}
}{
"error": "<string>",
"code": "<string>",
"errors": [
{
"message": "<string>"
}
],
"message": "<string>",
"details": {}
}Authorizations
API key for authentication. Use your API key directly without any prefix (e.g., 'your-api-key'). Bearer prefix is optional but not required.
Path Parameters
Signing request ID
Body
Every document id of the set (documents[].document_id), in the new order.
1Was this page helpful?