Skip to main content
API v1 is deprecated. For new integrations, please use API v2 Documents.

Overview

Documents are the core resource in Documenso API v1. The typical workflow:
  1. Create a document (get a presigned upload URL)
  2. Upload your PDF to the presigned URL
  3. Add recipients and fields
  4. Send the document for signing
  5. Download the completed document

Document Object

{
  "id": 123,
  "externalId": "order-12345",
  "userId": 456,
  "teamId": 789,
  "folderId": "folder_abc123",
  "title": "Service Agreement",
  "status": "PENDING",
  "createdAt": "2024-01-15T10:30:00.000Z",
  "updatedAt": "2024-01-15T10:35:00.000Z",
  "completedAt": null
}

Properties

FieldTypeDescription
idnumberUnique document identifier
externalIdstring | nullYour custom identifier for idempotency
userIdnumberID of the user who created the document
teamIdnumber | nullID of the team (if created in team context)
folderIdstring | nullID of the folder containing the document
titlestringDocument title
statusstringCurrent status (see Document Statuses)
createdAtstringISO 8601 timestamp
updatedAtstringISO 8601 timestamp
completedAtstring | nullTimestamp when all recipients signed

List Documents

Retrieve a paginated list of documents.
GET /api/v1/documents

Query Parameters

ParameterTypeDefaultDescription
pagenumber1Page number (1-indexed)
perPagenumber10Results per page (1-100)
folderIdstring-Filter by folder ID

Code Examples

# List all documents
curl -X GET "https://app.documenso.com/api/v1/documents" \
  -H "Authorization: Bearer api_xxxxxxxxxxxxxxxx"

# Paginate results
curl -X GET "https://app.documenso.com/api/v1/documents?page=2&perPage=20" \
  -H "Authorization: Bearer api_xxxxxxxxxxxxxxxx"

# Filter by folder
curl -X GET "https://app.documenso.com/api/v1/documents?folderId=folder_abc123" \
  -H "Authorization: Bearer api_xxxxxxxxxxxxxxxx"

Response

{
  "documents": [
    {
      "id": 123,
      "title": "Service Agreement",
      "status": "PENDING",
      "createdAt": "2024-01-15T10:30:00.000Z",
      "updatedAt": "2024-01-15T10:35:00.000Z",
      "completedAt": null
    }
  ],
  "totalPages": 5
}

Get Document

Retrieve a single document by ID, including recipients and fields.
GET /api/v1/documents/:id

Path Parameters

ParameterTypeDescription
idnumberThe document ID

Code Examples

curl -X GET "https://app.documenso.com/api/v1/documents/123" \
  -H "Authorization: Bearer api_xxxxxxxxxxxxxxxx"

Response

{
  "id": 123,
  "externalId": "order-12345",
  "userId": 456,
  "teamId": 789,
  "folderId": null,
  "title": "Service Agreement",
  "status": "PENDING",
  "createdAt": "2024-01-15T10:30:00.000Z",
  "updatedAt": "2024-01-15T10:35:00.000Z",
  "completedAt": null,
  "recipients": [
    {
      "id": 1,
      "documentId": 123,
      "email": "john@example.com",
      "name": "John Doe",
      "role": "SIGNER",
      "signingOrder": 1,
      "token": "abc123xyz",
      "signedAt": null,
      "readStatus": "NOT_OPENED",
      "signingStatus": "NOT_SIGNED",
      "sendStatus": "SENT",
      "signingUrl": "https://app.documenso.com/sign/abc123xyz"
    }
  ],
  "fields": [
    {
      "id": 1,
      "documentId": 123,
      "recipientId": 1,
      "type": "SIGNATURE",
      "page": 1,
      "positionX": 10,
      "positionY": 80,
      "width": 30,
      "height": 5,
      "customText": "",
      "fieldMeta": null
    }
  ]
}

Create Document

Create a new document and get a presigned URL for uploading the PDF.
POST /api/v1/documents

Request Body

FieldTypeRequiredDescription
titlestringYesDocument title
externalIdstringNoYour custom identifier
folderIdstringNoFolder ID to organize the document
recipientsarrayYesList of recipients (see below)
metaobjectNoEmail and signing settings
authOptionsobjectNoAuthentication options
formValuesobjectNoPrefill form field values
attachmentsarrayNoDocument attachments

Recipients Schema

Each recipient object:
FieldTypeRequiredDescription
namestringYesRecipient’s full name
emailstringYesRecipient’s email address
rolestringNoDefault: SIGNER (see Recipient Roles)
signingOrdernumberNoOrder for sequential signing

Meta Schema

FieldTypeDescription
subjectstringEmail subject line
messagestringEmail message body
timezonestringTimezone for date fields (default: Etc/UTC)
dateFormatstringDate format string
redirectUrlstringURL to redirect after signing
signingOrderstringPARALLEL or SEQUENTIAL
languagestringLanguage code (e.g., en, de)
typedSignatureEnabledbooleanAllow typed signatures
uploadSignatureEnabledbooleanAllow uploaded signatures
drawSignatureEnabledbooleanAllow drawn signatures
distributionMethodstringEMAIL or NONE

Code Examples

curl -X POST "https://app.documenso.com/api/v1/documents" \
  -H "Authorization: Bearer api_xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Service Agreement",
    "externalId": "order-12345",
    "recipients": [
      {
        "name": "John Doe",
        "email": "john@example.com",
        "role": "SIGNER"
      },
      {
        "name": "Jane Smith",
        "email": "jane@example.com",
        "role": "APPROVER",
        "signingOrder": 1
      }
    ],
    "meta": {
      "subject": "Please sign: Service Agreement",
      "message": "Hi {signer.name}, please review and sign this agreement.",
      "redirectUrl": "https://example.com/thank-you",
      "signingOrder": "SEQUENTIAL"
    }
  }'

Response

{
  "uploadUrl": "https://s3.amazonaws.com/bucket/presigned-url...",
  "documentId": 123,
  "externalId": "order-12345",
  "recipients": [
    {
      "recipientId": 1,
      "name": "John Doe",
      "email": "john@example.com",
      "token": "abc123xyz",
      "role": "SIGNER",
      "signingOrder": null,
      "signingUrl": "https://app.documenso.com/sign/abc123xyz"
    }
  ]
}
After receiving the response, you must upload your PDF to the uploadUrl using a PUT request with Content-Type: application/octet-stream.

Send Document

Send a document to recipients for signing.
POST /api/v1/documents/:id/send

Path Parameters

ParameterTypeDescription
idnumberThe document ID

Request Body

FieldTypeDefaultDescription
sendEmailbooleantrueSend email to recipients
sendCompletionEmailsboolean-Override completion email settings
If sendEmail is false, recipients won’t receive email notifications. You must manually distribute the signing URLs from the response.

Code Examples

# Send with email
curl -X POST "https://app.documenso.com/api/v1/documents/123/send" \
  -H "Authorization: Bearer api_xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{ "sendEmail": true }'

# Send without email (get signing URLs)
curl -X POST "https://app.documenso.com/api/v1/documents/123/send" \
  -H "Authorization: Bearer api_xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{ "sendEmail": false }'

Response

{
  "message": "Document sent successfully",
  "id": 123,
  "externalId": "order-12345",
  "userId": 456,
  "teamId": 789,
  "folderId": null,
  "title": "Service Agreement",
  "status": "PENDING",
  "createdAt": "2024-01-15T10:30:00.000Z",
  "updatedAt": "2024-01-15T10:35:00.000Z",
  "completedAt": null,
  "recipients": [
    {
      "id": 1,
      "email": "john@example.com",
      "name": "John Doe",
      "role": "SIGNER",
      "token": "abc123xyz",
      "signingUrl": "https://app.documenso.com/sign/abc123xyz",
      "signingStatus": "NOT_SIGNED",
      "sendStatus": "SENT"
    }
  ]
}

Resend Document

Resend the document to specific recipients.
POST /api/v1/documents/:id/resend

Request Body

FieldTypeRequiredDescription
recipientsarrayYesArray of recipient IDs to resend to

Code Examples

curl -X POST "https://app.documenso.com/api/v1/documents/123/resend" \
  -H "Authorization: Bearer api_xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{ "recipients": [1, 2] }'

Download Document

Get a download URL for the signed document (S3 storage only).
GET /api/v1/documents/:id/download

Query Parameters

ParameterTypeDefaultDescription
downloadOriginalDocumentbooleanfalseDownload original instead of signed version

Code Examples

# Download signed document
curl -X GET "https://app.documenso.com/api/v1/documents/123/download" \
  -H "Authorization: Bearer api_xxxxxxxxxxxxxxxx"

# Download original document
curl -X GET "https://app.documenso.com/api/v1/documents/123/download?downloadOriginalDocument=true" \
  -H "Authorization: Bearer api_xxxxxxxxxxxxxxxx"

Response

{
  "downloadUrl": "https://s3.amazonaws.com/bucket/signed-document.pdf?presigned..."
}

Delete Document

Delete a document. Completed documents cannot be deleted.
DELETE /api/v1/documents/:id

Code Examples

curl -X DELETE "https://app.documenso.com/api/v1/documents/123" \
  -H "Authorization: Bearer api_xxxxxxxxxxxxxxxx"

Response

{
  "id": 123,
  "title": "Service Agreement",
  "status": "DRAFT"
}

Document Statuses

StatusDescription
DRAFTDocument created but not sent
PENDINGDocument sent, waiting for signatures
COMPLETEDAll recipients have signed
REJECTEDA recipient rejected the document

Recipient Roles

RoleDescription
SIGNERMust sign the document
APPROVERMust approve before signers can sign
CCReceives a copy, no action required
VIEWERCan view but takes no action
ASSISTANTCan fill fields on behalf of others

Complete Example

import { initClient } from '@ts-rest/core';
import { ApiContractV1 } from '@documenso/api/v1/contract';
import fs from 'fs';

const client = initClient(ApiContractV1, {
  baseUrl: 'https://app.documenso.com/api/v1',
  baseHeaders: {
    authorization: 'Bearer api_xxxxxxxxxxxxxxxx',
  },
});

async function createAndSendDocument() {
  // 1. Create document
  const { status, body } = await client.createDocument({
    body: {
      title: 'Service Agreement',
      recipients: [
        {
          name: 'John Doe',
          email: 'john@example.com',
          role: 'SIGNER',
        },
      ],
      meta: {
        subject: 'Please sign this document',
        message: 'Hi {signer.name}, please sign the attached document.',
      },
    },
  });

  if (status !== 200) throw new Error('Failed to create document');

  const { uploadUrl, documentId, recipients } = body;

  // 2. Upload PDF
  const pdfBuffer = fs.readFileSync('./contract.pdf');
  await fetch(uploadUrl, {
    method: 'PUT',
    headers: { 'Content-Type': 'application/octet-stream' },
    body: pdfBuffer,
  });

  // 3. Add signature field
  await client.createField({
    params: { id: documentId.toString() },
    body: {
      type: 'SIGNATURE',
      recipientId: recipients[0].recipientId,
      pageNumber: 1,
      pageX: 10,
      pageY: 80,
      pageWidth: 30,
      pageHeight: 5,
      fieldMeta: {},
    },
  });

  // 4. Send document
  const sendResult = await client.sendDocument({
    params: { id: documentId.toString() },
    body: { sendEmail: true },
  });

  console.log('Document sent!');
  console.log('Signing URL:', sendResult.body.recipients[0].signingUrl);
}

createAndSendDocument().catch(console.error);

See Also