Reference
Templates
Templates operations of the REST API, generated from the OpenAPI document.
Source: apps/api/openapi/public-v1.json. Base address https://docudetect.com/api/public/v1.
List templates
GET /templates
Permission: templates:read
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
q | query | string | no | Matches the template name. |
limit | query | integer | no | Items per page, 1 to 100. Default 50. |
cursor | query | string | no | The nextCursor of the previous page. |
Response 200
data: TemplatePage
Errors
| Status | When |
|---|---|
400 | Invalid input (invalid_request), or a document that isn't ready for this (the message says what to fix). |
401 | Missing, unknown, expired or revoked key (invalid_api_key). |
403 | The key lacks a permission (insufficient_scope), the account is suspended (account_suspended), a plan limit is reached (limit_*), or the abuse guard refused a send (held_for_review, email_unverified). |
404 | Not found in this account (not_found). |
429 | Too many calls (rate_limited), a reminder sent less than 10 minutes ago, the new-account or daily email limit (new_account_limit, email_limit). Every 429 carries Retry-After: wait that many seconds. |
Example
curl "https://docudetect.com/api/public/v1/templates" \
-H "Authorization: Bearer $DOCUDETECT_API_KEY"Get a template, with its signers and the fields you fill before sending
GET /templates/{id}
Permission: templates:read
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | A document or template id. |
Response 200
data: Template
Errors
| Status | When |
|---|---|
400 | Invalid input (invalid_request), or a document that isn't ready for this (the message says what to fix). |
401 | Missing, unknown, expired or revoked key (invalid_api_key). |
403 | The key lacks a permission (insufficient_scope), the account is suspended (account_suspended), a plan limit is reached (limit_*), or the abuse guard refused a send (held_for_review, email_unverified). |
404 | Not found in this account (not_found). |
429 | Too many calls (rate_limited), a reminder sent less than 10 minutes ago, the new-account or daily email limit (new_account_limit, email_limit). Every 429 carries Retry-After: wait that many seconds. |
Example
curl "https://docudetect.com/api/public/v1/templates/$TEMPLATE_ID" \
-H "Authorization: Bearer $DOCUDETECT_API_KEY"Make a draft from a template
POST /templates/{id}/use
Permission: templates:read, documents:write · accepts an Idempotency-Key
A new draft with the template's PDF, fields and questions, and the people you name. Nothing is emailed: send it with POST /documents/{id}/send.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | A document or template id. |
Request body (application/json)
| Field | Type | Required | Description |
|---|---|---|---|
signers | array of object | yes | One person for each of the template's signers. |
signers[].name | string | yes | Their full name, as it appears in the email and the certificate. |
signers[].email | string | yes | Where the signing request goes. |
signers[].role | string | yes | The template signer's id (from GET /templates/{id}). |
copies | array of object | no | Several-signer templates: people who get a copy when everyone has signed. |
copies[].name | string | yes | Their full name, as it appears in the email and the certificate. |
copies[].email | string | yes | Where the signing request goes. |
title | string | no | Added to the template's name: "<template>: <title>". |
values | array of object | no | Values for the fields you fill before sending (senderFields of the template). |
values[].fieldId | string | yes | |
values[].value | string | yes |
Response 201
data: Document
Errors
| Status | When |
|---|---|
400 | Invalid input (invalid_request), or a document that isn't ready for this (the message says what to fix). |
401 | Missing, unknown, expired or revoked key (invalid_api_key). |
403 | The key lacks a permission (insufficient_scope), the account is suspended (account_suspended), a plan limit is reached (limit_*), or the abuse guard refused a send (held_for_review, email_unverified). |
404 | Not found in this account (not_found). |
409 | Not possible in the document's current state, or it changed meanwhile (conflict, several_signers, template_not_ready, idempotency_in_progress with Retry-After, idempotency_replay_unavailable). |
413 | The body is too large (too_large). |
422 | This Idempotency-Key was used for a different call (idempotency_mismatch). |
429 | Too many calls (rate_limited), a reminder sent less than 10 minutes ago, the new-account or daily email limit (new_account_limit, email_limit). Every 429 carries Retry-After: wait that many seconds. |
Example
curl -X POST "https://docudetect.com/api/public/v1/templates/$TEMPLATE_ID/use" \
-H "Authorization: Bearer $DOCUDETECT_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"signers":[{"role":"s1","name":"Alex Example","email":"alex@example.com"}],"title":"Lease for 12 Main St"}'