Team and administration
API endpoints
Let programs, scripts and automations send documents to a secret URL and print them.
An API endpoint is a secret URL that programs send documents to, for example invoices from an ERP system, labels from an online shop or reports from a script. Every document becomes a job on behalf of the person who created the endpoint and goes to the endpoint's destination. The URL itself is the access key, so no API token is needed. The API reference describes every option.
Prerequisites
- The inbound channel REST API must be on under Settings → Inbound channels. It is on in new organizations; in older ones an admin may have to switch it on.
- Every member can create API endpoints. Users see their own, admins all endpoints of the organization.
- Included in every plan.
One-time setup
- Go to Sources → API endpoints and select New API endpoint.
- Enter a Name that says what the endpoint is used for, for example "ERP invoices".
- Choose the Target for documents whose request names none: a destination, group or workflow, Default target, or No target – keep in Sealed Print.
- Select Create and copy the Endpoint URL into your program.
Send the document as the request body with a matching Content-Type:
curl -X POST "https://www.sealedprint.com/api/print/sp_ep_…?name=Invoice" \
-H "Content-Type: application/pdf" \
--data-binary @invoice.pdf
Or as a form with the field file; options go along as form fields:
curl -X POST "https://www.sealedprint.com/api/print/sp_ep_…" \
-F "file=@invoice.pdf" \
-F "name=Invoice" \
-F "copies=2"
targets sends one request elsewhere by identifier: the identifiers of destinations, groups or a workflow,
comma-separated, for example targets=office,warehouse (a workflow comes first). destinationId,
destinationIds, groupId or workflowId do the same by ID, and noTarget=true (or targets=hold) keeps the
document in Sealed Print. They override the endpoint's target for one request; print options
such as copies or sides go along as query parameters or form fields. The response is the job (HTTP 201).
Every time
- Last used on the endpoint shows whether a program still sends documents.
- Edit changes the name and the target; the URL stays the same.
- Generate new URL replaces the URL; the old one stops working at once. Delete ends the endpoint for good.
- To follow a job's status from your program, use an API token.
Troubleshooting
- HTTP 403: the inbound channel REST API is switched off, or the person who created the endpoint left the organization. Create a new endpoint with another member.
- HTTP 404: the URL is wrong or was replaced by a new one. With the code
unknown_target, an identifier intargetsdoes not exist or belongs to a destination the endpoint's owner cannot print to. - HTTP 413 or 415: the file is larger than the plan allows, or not a PDF, JPEG or PNG.
- The URL was copied somewhere it should not be: select Generate new URL right away.
What's next
- API reference: every endpoint, with the OpenAPI description.
- API tokens
- Inbound and outbound channels
- Print Stripe documents: invoices, credit notes and quotes from Stripe through an API endpoint.