Combine PDFs

Merges multiple submissions into a single PDF.

HTTP Request



You must send an Authorization header with the value Basic followed by base 64 encoded token_id:token_secret.

For example: Authorization: Basic dG9rZW5faWQ6dG9rZW5fc2VjcmV0Cg==

See the Authentication documentation for more information.


The request body must be a JSON object with the following keys:

  • submission_ids (array): An array of processed submission IDs. (PDFs will be merged in the same order.)
  • metadata (object, optional): Any additional data, such as a user id. metadata will be included in webhook requests.

Note: This feature is free to use, but the source PDFs will count towards your monthly usage.

Example Code

var FormAPI = require("@formapi/formapi");

var config = new FormAPI.Configuration();
config.apiTokenId = "FORMAPI_TOKEN_ID";
config.apiTokenSecret = "FORMAPI_TOKEN_SECRET";
client = new FormAPI.Client(config);

var opts = {
  submission_ids: ["sub_000000000000000001", "sub_000000000000000002"]
client.combineSubmissions(opts, function(error, combinedSubmission) {
  if (error) throw error;
require 'form_api'


FormAPI.configure do |c|
  c.username  = ENV['FORMAPI_TOKEN_ID']
  c.password  = ENV['FORMAPI_TOKEN_SECRET']

formapi =

response = formapi.combine_submissions(
  submission_ids: ["SUBMISSION_1_ID", "SUBMISSION_2_ID", ... ],
  metadata: {
    user_id: 123

puts "Download your combined PDF at: #{response.combined_submission.download_url}"
# This is a live example that you can run in the Python interpreter
import form_api

client = form_api.Client()
client.api_client.configuration.username = "FORMAPI_TOKEN_ID"
client.api_client.configuration.password = "FORMAPI_TOKEN_SECRET"

combined_submission = client.combine_submissions({
  "submission_ids": ["SUBMISSION_1_ID", "SUBMISSION_2_ID", ... ],
  "metadata": {
    "user_id": 123,

print("Download your combined PDF at: %s" % combined_submission.download_url)
// This is a live example that you can run in the PHP interactive shell (php -a)
$formapi = new FormAPI\Client();

$params = new FormAPI\Model\CreateCombinedSubmissionBody([
  "test" => false,
  "submission_ids" => [ "SUBMISSION_1_ID", "SUBMISSION_2_ID", ... ],
  "metadata" => [ "key" => "value" ]

$response = $formapi->combineSubmissions($params);
echo $response;

echo "Download your combined PDF at: " . $response->getCombinedSubmission()->getDownloadUrl();
using System;
using System.Diagnostics;
using FormApi.Client.Api;
using FormApi.Client.Client;
using FormApi.Client.Model;

namespace Example
    public class FormAPIExample
        public void main()
          Configuration.Default.Username = "yRaaR9JmTPtGX7EN";
          Configuration.Default.Password = "IB3TRkSdm4f2BdtU_D3YgxjdMB7l-r2fOgvxD1Yzwec";

          var apiInstance = new PDFApi();
          var combinedSubmissionData = new CombinedSubmissionData(
            new List<string>(new string[] {
          var combinedSubmission = apiInstance.CombineSubmissions(combinedSubmissionData);

          // The job will now be in the "pending" state until it is processed.
          // You may want to call GetCombinedSubmission once per second until
          // the state changes to "processed".
          // Alternatively, you can set up a webhook notification.

The following example waits for the merged PDF to be processed, then prints the download URL.

# This is a live example that you can run in your console.


combine_submissions() {
  curl -s "" \
    -H "Content-Type: application/json" \
    -X POST \
    -d '{"submission_ids":["SUBMISSION_1_ID", "SUBMISSION_2_ID"], "metadata": { "user_id": 123 }}'

get_combined_submission() {
  curl -s "$1" \

get_json_value() {
  echo "$1" | sed -n 's/.*"'"$2"'":"\([^"]\+\)".*/\1/p'

SUBMISSION_ID=$(get_json_value "$RESPONSE" id)
SUBMISSION_STATE=$(get_json_value "$RESPONSE" state)

echo "Waiting for PDF to be processed..."
while [[ "$SUBMISSION_STATE" = "pending" ]]; do
  sleep 1
  RESPONSE=$(get_combined_submission "$SUBMISSION_ID")
  SUBMISSION_STATE=$(get_json_value "$RESPONSE" state)

echo "Download your combined PDF at:"
get_json_value "$RESPONSE" download_url

results matching ""

    No results matching ""