Skip to main content

API Reference

The Swagger UI for the API is available at /api/v1/openapi. This page provides detailed information about the API endpoints, request and response formats, and authentication requirements.

Upload a Document

Uploading a document to your Documenso account requires a two-step process.

Generate Document From Template

Documenso allows you to generate documents from templates. This is useful when you have a standard document format you want to reuse. The API endpoint for generating a document from a template is /api/v1/templates/{templateId}/generate-document, and it takes a JSON payload with the following fields:
The JSON payload is identical to the payload for uploading a document, so you can read more about the fields in the Create Document step. For this API endpoint, the recipients property is required.

Add Fields to Document

The API allows you to add fields to a document via the /api/v1/documents/{documentId}/fields endpoint. This is useful when you want to add fields to a document before sending it to recipients. To add fields to a document, you need to make a POST request with a JSON payload containing the field(s) information.
This endpoint accepts either one field or an array of fields.
Before adding fields to a document, you need each recipient’s ID. If the document already has recipients, you can query the document to retrieve the recipient’s details. If the document has no recipients, you need to add a recipient via the UI or API before adding a field.

A Note on Advanced Fields

The advanced fields are: text, checkbox, radio, number, and select. Whenever you append any of these advanced fields to a document, you need to pass the type in the fieldMeta property:
Replace the text value with the corresponding field type:
  • For the TEXT field it should be text.
  • For the CHECKBOX field it should be checkbox.
  • For the RADIO field it should be radio.
  • For the NUMBER field it should be number.
  • For the SELECT field it should be select. (check this before merge)
You must pass this property at all times, even if you don’t need to set any other properties. If you don’t, the endpoint will throw an error.