DocuDetectDocs
Reference

Documents

Documents 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 documents

GET /documents

Permission: documents:read

Newest first. With updatedSince, oldest change first, so a poller can keep the last updatedAt it saw and ask again.

Parameters

NameInTypeRequiredDescription
statusqueryone of draft, sent, completed, cancelednoOnly documents in this state.
updatedSincequerystring (date-time)noOnly documents changed at or after this time, oldest change first: poll with the last updatedAt you saw.
limitqueryintegernoItems per page, 1 to 100. Default 50.
cursorquerystringnoThe nextCursor of the previous page.

Response 200

data: DocumentPage

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/documents" \
  -H "Authorization: Bearer $DOCUDETECT_API_KEY"

Make a draft from a PDF

POST /documents

Permission: documents:write · accepts an Idempotency-Key

multipart/form-data with the PDF as file (up to 20 MB). Optionally name the signer and place fields; otherwise finish the draft in the app. Nothing is emailed. Counts against the account's new documents an hour, like the app.

Request body (multipart/form-data)

FieldTypeRequiredDescription
filefileyesThe PDF, up to 20 MB.
titlestringnoDefaults to the file name.
signerNamestringnoThe signer's name (with signerEmail).
signerEmailstringnoThe signer's email (with signerName).
fieldsstringnoA JSON array of fields, as the editor saves them: { id, type: signature|initials|text|date|checkbox, page, x, y, width, height, required?, label?, value? }, positions as fractions of the page (0 to 1, from the top left). Leave it out to place fields in the app.

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/documents" \
  -H "Authorization: Bearer $DOCUDETECT_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F "file=@lease.pdf" \
  -F "signerName=Alex Example" \
  -F "signerEmail=alex@example.com"

Get a document

GET /documents/{id}

Permission: documents:read

Parameters

NameInTypeRequiredDescription
idpathstringyesA document or template id.

Response 200

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).
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/documents/$DOCUMENT_ID" \
  -H "Authorization: Bearer $DOCUDETECT_API_KEY"

A document's history

GET /documents/{id}/events

Permission: documents:read

Parameters

NameInTypeRequiredDescription
idpathstringyesA document or template id.

Response 200

data: DocumentEvents

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/documents/$DOCUMENT_ID/events" \
  -H "Authorization: Bearer $DOCUDETECT_API_KEY"

Download the signed or the original PDF

GET /documents/{id}/pdf

Permission: documents:read

Parameters

NameInTypeRequiredDescription
idpathstringyesA document or template id.
versionqueryone of signed, originalnosigned: the completed PDF (409 until the document is completed). original: the PDF as uploaded. Default "signed".

Response 200

The file, as application/pdf.

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).
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/documents/$DOCUMENT_ID/pdf" \
  -H "Authorization: Bearer $DOCUDETECT_API_KEY" \
  -o document.pdf

Download the certificate of completion

GET /documents/{id}/certificate

Permission: documents:read

Parameters

NameInTypeRequiredDescription
idpathstringyesA document or template id.

Response 200

The file, as application/pdf.

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).
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/documents/$DOCUMENT_ID/certificate" \
  -H "Authorization: Bearer $DOCUDETECT_API_KEY" \
  -o document.pdf

Send a draft to its signers

POST /documents/{id}/send

Permission: documents:send · accepts an Idempotency-Key

Emails each signer of the first step their signing request. Goes through the same checks as the app: account standing, a verified email, young-account limits, the daily email limit and scam-title review; a refused send answers with its code (held_for_review, email_unverified, new_account_limit, ...). Sending a document that is already out returns it as it is.

Parameters

NameInTypeRequiredDescription
idpathstringyesA document or template id.

Request body (application/json)

Optional. Send an empty object or no body.

FieldTypeRequiredDescription
revisionintegernoSend only if the document is still at this revision (409 otherwise).
deliveryone of email, embeddednoemail (the default) emails the signer their signing request. embedded (one signer, embedded signing on) emails nobody and sends no automatic reminders: the signer signs inside your app through an embedded session.

Response 200

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.
503Temporarily unavailable (unavailable); retry shortly with the same Idempotency-Key.

Example

curl -X POST "https://docudetect.com/api/public/v1/documents/$DOCUMENT_ID/send" \
  -H "Authorization: Bearer $DOCUDETECT_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'

Remind the signers whose turn it is

POST /documents/{id}/remind

Permission: documents:send · accepts an Idempotency-Key

At most once every 10 minutes per document (429 recently_reminded otherwise).

Parameters

NameInTypeRequiredDescription
idpathstringyesA document or template id.

Request body (application/json)

No fields. Send an empty object or no body.

FieldTypeRequiredDescription

Response 200

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.
503Temporarily unavailable (unavailable); retry shortly with the same Idempotency-Key.

Example

curl -X POST "https://docudetect.com/api/public/v1/documents/$DOCUMENT_ID/remind" \
  -H "Authorization: Bearer $DOCUDETECT_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

Cancel a document that is waiting for signatures

POST /documents/{id}/cancel

Permission: documents:send · accepts an Idempotency-Key

Every signing link stops working. Signers who were already emailed a link are told it was canceled.

Parameters

NameInTypeRequiredDescription
idpathstringyesA document or template id.

Request body (application/json)

No fields. Send an empty object or no body.

FieldTypeRequiredDescription

Response 200

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.
503Temporarily unavailable (unavailable); retry shortly with the same Idempotency-Key.

Example

curl -X POST "https://docudetect.com/api/public/v1/documents/$DOCUMENT_ID/cancel" \
  -H "Authorization: Bearer $DOCUDETECT_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

Make a one-time embedded signing link for a signer whose turn it is

POST /documents/{id}/signers/{signerId}/embedded-session

Permission: embedding:sessions

For signing inside your own app: show url in an iframe on origin, which must be a verified domain under Settings → Developers → Embedded signing. Whoever opens the link signs as that signer, so put it only in front of them. The link opens once, within 5 minutes, and then works for 60 minutes in that frame. Nothing is emailed. Each call makes a new link; opening one ends the earlier ones.

Parameters

NameInTypeRequiredDescription
idpathstringyesA document id.
signerIdpathstringyesThe signer: s1 on a one-signer document, otherwise the signer's id.

Request body (application/json)

Where the session will be framed.

FieldTypeRequiredDescription
originstringyesThe domain of the page that frames the signing page, such as app.example.com (or https://app.example.com). It must be a verified domain.

Response 201

data: EmbeddedSession

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).
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/documents/$DOCUMENT_ID/signers/$SIGNER_ID/embedded-session" \
  -H "Authorization: Bearer $DOCUDETECT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"origin":"app.example.com"}'