Navigation

API Documentation

Create a PDF

The createPdf endpoint renders a template as a PDF. Send the template id and your modifications as JSON, and get the PDF file back in the response.

POST https://api.bannerify.co/v1/templates/createPdf

Render a template as a PDF and return the PDF file in the response body. The PDF has one page that is the size of the template canvas. Text stays text, so it can be selected and searched, and the fonts are embedded. Each render counts toward your quota. See https://bannerify.co/docs/essentials/generate-pdfs.

Request body

NameTypeDescription
apiKey (required)stringYour API key. Create one on the API Keys page of the dashboard, and keep it on the server.
templateId (required)stringThe id of the template to render. In the dashboard, open the menu on a template card and choose Copy Template ID.
modificationsarray of Modification or object or stringThe values to change in the template, as an array of modifications. Each modification names a layer and sets one or more fields, and a layer without a modification keeps the values from the template. An object keyed by layer name and a JSON string of either shape also work. See https://bannerify.co/docs/essentials/modifications.

Responses

  • 200: The PDF file. The RateLimit-Remaining and RateLimit-Reset headers show the state of your rate limit.
  • 400: The request cannot be processed. BAD_REQUEST means a field is invalid, the API key is unknown, or a signed URL has a wrong signature. FETCH_IMAGE_ERROR means Bannerify could not download an image from a src URL. A rate limit on the PDF and stored endpoints also uses status 400 with the code TOO_MANY_REQUESTS. Read error.code to tell them apart.
  • 404: The template does not exist.
  • 500: The server could not finish the request. INTERNAL_SERVER_ERROR means an unexpected failure, such as a render error or a failed upload to your S3 bucket. USAGE_EXCEEDED means your workspace reached its daily or monthly generation limit, and RATE_LIMITED means the API key sent too many requests. Read error.code to tell them apart.