Skip to content

Documents

The documents API provides functionality for generating PDF documents from prebuilt document templates.

Generates a single PDF document.

https://api.astradoc.io/documents/v1.0/generatedocument
POST
PropertyTypeRequiredDescription
templateIdStringYesThe Id of the document template used to generate the PDF file.
templateVersionStringNoThe version of the template used to generate the PDF file. Defaults to the latest published version. Can be draft or number for specific version.
templateDataStringYesA serialized JSON object containing the payload used for template data.
PropertyTypeDescription
SuccessBoolA Boolean indicating whether or not the request was successful.
MessageStringA message containing error information if the request was unsuccessful.
DataStringA base64 string containing a PDF file.

Generates a collection of PDF documents.

While this API is capable of generating many PDF documents in a single request, if the number of documents to generate is large and the request takes an extended time to complete, it may be better to rather use the Jobs API to generate documents.

https://api.astradoc.io/documents/v1.0/generatedocuments
POST
PropertyTypeRequiredDescription
documentsDocumentData[]YesAn array of DocumentData objects containing data for each of the documents being generated.
PropertyTypeRequiredDescription
templateIdStringYesThe Id of the document template used to generate the PDF file.
templateVersionStringNoThe version of the template used to generate the PDF file. Defaults to the latest published version. Can be draft or number for specific version.
templateDataStringYesA serialized JSON object containing the payload used for template data.
uniqueIdentifierStringYesA string uniquely identifying this template data set. Used to track the individual PDF documents amongst the results.
PropertyTypeDescription
SuccessBoolA Boolean indicating whether or not the request was successful.
MessageStringA message containing error information if the request was unsuccessful.
DataDocumentCollectionResult[]An array of DocumentCollectionResult objects.
PropertyTypeDescription
Base64BoolA base64 string containing a PDF file.
UniqueIdentifierStringA string uniquely identifying this result. Will match the uniqueIdentifier string provided in the original request.