DocuDetectDocs
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

NameInTypeRequiredDescription
qquerystringnoMatches the template name.
limitqueryintegernoItems per page, 1 to 100. Default 50.
cursorquerystringnoThe nextCursor of the previous page.

Response 200

data: TemplatePage

Errors

StatusWhen
400Invalid input (invalid_request), or a document that isn't ready for this (the message says what to fix).
401Missing, unknown, expired or revoked key (invalid_api_key).
403The 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).
404Not found in this account (not_found).
429Too 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

NameInTypeRequiredDescription
idpathstringyesA document or template id.

Response 200

data: Template

Errors

StatusWhen
400Invalid input (invalid_request), or a document that isn't ready for this (the message says what to fix).
401Missing, unknown, expired or revoked key (invalid_api_key).
403The 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).
404Not found in this account (not_found).
429Too 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

NameInTypeRequiredDescription
idpathstringyesA document or template id.

Request body (application/json)

FieldTypeRequiredDescription
signersarray of objectyesOne person for each of the template's signers.
signers[].namestringyesTheir full name, as it appears in the email and the certificate.
signers[].emailstringyesWhere the signing request goes.
signers[].rolestringyesThe template signer's id (from GET /templates/{id}).
copiesarray of objectnoSeveral-signer templates: people who get a copy when everyone has signed.
copies[].namestringyesTheir full name, as it appears in the email and the certificate.
copies[].emailstringyesWhere the signing request goes.
titlestringnoAdded to the template's name: "<template>: <title>".
valuesarray of objectnoValues for the fields you fill before sending (senderFields of the template).
values[].fieldIdstringyes
values[].valuestringyes

Response 201

data: Document

Errors

StatusWhen
400Invalid input (invalid_request), or a document that isn't ready for this (the message says what to fix).
401Missing, unknown, expired or revoked key (invalid_api_key).
403The 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).
404Not found in this account (not_found).
409Not 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).
413The body is too large (too_large).
422This Idempotency-Key was used for a different call (idempotency_mismatch).
429Too 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"}'