Create a template

POST/template

Use this endpoint to create a template, by uploading a PDF file. The name of the template will be deducted from the filename. If the PDF file contains a fillable form, the fields of that will be detected and added to the template directly.

For authentication provide x-api-key header.


Request

Header parameters

Content-Typerequired
The content type header needs to be set to multipart/form-data

Body

filerequired

Multipart binary file pdf file that is going to be used as a template to fill.

The pdf file must be less than 5MB and cannot contain more than 100 pages.


import requests
pdf = open('my-template.pdf', 'rb')
resp = requests.post("https://api.doqs.dev/v1/templates",
    headers={"x-api-key":"your-api-key","content-type":"multipart/form-data"},
    files={"file": (my-template.pdf, pdf)},
)

Response

Body attributes are nested inside the results to align with the other endpoints.

Attributes

id
Unique identifier for the template
name
Name of the template, this is prefilled from the filename of the uploaded file.
fields
List of fields in the template. It will contain entries if the PDF contained a fillable form.
{
    "results": {
        "id": "tpl_d7d84644c9374cdf83e2c8463279e23c",
        "name": "my-template",
        "fields": []
    }
}