API overview

Nutrient DWS Processor API exposes a single HTTP endpoint for usage:

POST https://api.nutrient.io/build

This endpoint enables you to declaratively assemble a PDF document from multiple independent parts, applying actions on the whole output file and single parts.

The API expects data to be sent either as as multipart/form-data or application/json content types.

Multipart request

The basic use case for the /build API is to upload all inputs together with the processing instructions with the multipart/form-data request:

Terminal window
curl -X POST https://api.nutrient.io/build \
-H "Authorization: Bearer your_api_key_here" \
-o result.pdf \
--fail \
-F document=@input-file.pdf \
-F instructions='{
"parts": [
{
"file": "document"
}
],
"actions": [
{
"type": "flatten"
}
]
}'

Simple request

The /build API supports inputs provided from remote URLs. If all inputs are provided as remote URLs, the multipart request isn't necessary and can be simplified to a non-multipart request with the application/json content type:

Terminal window
curl -X POST https://api.nutrient.io/build \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your_api_key_here" \
-o result.pdf \
--fail \
-d 'null'

For more details on the structure of an API request, refer to the API reference.