Skip to content
ERPDocs
API reference

ERPDocs Public REST API v1

Authentication, scopes, rate limits, the bulk send workflow, every endpoint and webhook verification — written from the running code.

v1 live https://www.erpdocs.com/api/v1 Bearer token

Reference for integrators. Covers authentication, scopes, rate limits, the bulk e-signature send workflow, every v1 endpoint, and webhook verification.

Every response shape, error code and limit below is taken from the running code. If you find a difference between this page and what the API actually returns, that is a bug — tell us at support@erpdocs.com and we will fix the page or the code.

A ready-to-run Postman collection covering every endpoint is available on the Developers page.


Base URL

The API is served from your own ERPDocs host under /api/v1:

https://www.erpdocs.com/api/v1

Staging uses the staging host. There is no separate API domain and no versioned subdomain.


Authentication

Every request needs a bearer token:

Authorization: Bearer <key>
  • Keys are created in Admin › API & Webhooks (/admin/api/keys). The raw key is shown once at creation and never again.
  • A key belongs to exactly one organization. All reads and writes are scoped to that organization; anything belonging to another org returns 404, not 403.
  • Revoked keys are rejected with 401 invalid_credentials.

Missing or malformed header → 401 missing_credentials. Unknown or revoked key → 401 invalid_credentials.

Plan. API access is part of the Business and Enterprise plans. It is checked on every request, not only when the key is created, so if the organization's plan stops including it, every call returns 402 plan_feature_unavailable (with entitlement: "api_access"). The public demo key is not affected.

Sandbox vs live

Each key has an environment of sandbox or live (reported by GET /ping).

Sandbox keys can read. They are rejected on send endpoints:

{
  "error": {
    "code": "sandbox_write_blocked",
    "message": "Sandbox keys cannot send real envelopes. Use a live key."
  }
}

HTTP status is 403. This applies to POST /templates/{id}/send, POST /bulk-send, POST /signpacks, POST /signpacks/{id}/remind, POST /signpacks/{id}/void, POST /signpacks/{id}/recipients/{rid}/embed-token, POST /brands, PATCH /brands/{id}, DELETE /brands/{id}, and POST /brands/{id}/set-default.

The sandbox check runs in the auth decorator after the scope check but before the function body, so no payload validation runs. A sandbox key with the required scope gets sandbox_write_blocked immediately, even if the body is also invalid. A sandbox key missing the required scope gets 403 insufficient_scope instead — the scope check fires first.

Sandbox does not simulate signing. It is only useful for exercising auth, scopes and read endpoints.

This section is about the SignPack endpoints. The Verify and Onboard API works differently: sandbox keys can start checks and runs there, and no government system is called.

Public demo key

A shared, read-only sandbox key is published on the developer portal so you can try the API without signing up. It points at a dedicated demo organization with sample templates and envelopes, and is rate-limited to 30 requests/minute.

Use it to call GET /ping, GET /templates, GET /signpacks, GET /workspaces and GET /users immediately. Sends are blocked (sandbox). Do not use it in production code — it is shared and may be rotated.


Scopes

A key carries an explicit scope list. Endpoints declare the scope they need; a key missing it gets 403 insufficient_scope with required and missing arrays.

Scope What it allows
signpack.read Read envelopes and their recipients
signpack.write Create, send and remind on single envelopes
signpack.bulk Queue bulk sends (up to 1000 envelopes per request)
signpack.embed Mint short-lived embedded-signing tokens for iframe hosting
template.read List templates and read their role/field contract
workspace.read List workspaces
user.read List organization members
brand.read List and read brand profiles
brand.write Create, update, delete brand profiles and set the default

signpack.bulk is deliberately separate from signpack.write, so an integration can send single envelopes without the ability to fan out thousands of emails. signpack.embed is separate from signpack.write so a host application can embed the signing experience without gaining raw send authority.

Every scope in this table gates at least one endpoint. There is no document.read scope — it was removed because no v1 endpoint consumed it.

Example scope failure:

{
  "error": {
    "code": "insufficient_scope",
    "message": "API key is missing required scope(s)",
    "required": ["signpack.bulk"],
    "missing": ["signpack.bulk"]
  }
}

Rate limits

Fixed one-minute windows, counted per API key.

Bucket Limit
Default (all endpoints without their own limit, shared) 300 requests / minute
POST /bulk-send 10 requests / minute
POST /signpacks/{id}/recipients/{rid}/embed-token 60 requests / minute
Public demo key (all endpoints) 30 requests / minute

Successful responses carry:

Header Meaning
X-RateLimit-Limit Limit for the bucket that was consumed
X-RateLimit-Remaining Requests left in the current window
X-RateLimit-Reset Seconds until the window resets

Over the limit returns 429. A 429 carries the same three X-RateLimit-* headers as a success (with X-RateLimit-Remaining: 0), plus Retry-After in seconds, so one back-off code path works for both cases:

X-RateLimit-Limit: 10
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 24
Retry-After: 24
{
  "error": {
    "code": "rate_limited",
    "message": "Rate limit exceeded",
    "limit": 10,
    "window_seconds": 60
  }
}

Authentication, scope and plan failures are returned before the limiter runs, so 401 missing_credentials, 401 invalid_credentials, 401 org_not_found, 403 insufficient_scope and 402 plan_feature_unavailable carry no rate-limit headers at all. Do not read X-RateLimit-Remaining on those responses. (403 sandbox_write_blocked is raised in the auth decorator and does carry them.)

The limiter fails open: if its Redis backend is unreachable, requests are allowed and the headers report the full limit.


Error format

Every error response has the same envelope:

{"error": {"code": "machine_readable_code", "message": "Human readable text"}}

Some codes add extra keys inside error: row, field, required, missing, allowed, max_rows, max_ttl_seconds, signpack_id, batch_id, limit, used, window_seconds, entitlement, dsc_rule_errors, signers_without_fields. The embedded placement endpoints add slots (the signer keys at fault), valid_slots, max_pages, page_count, max_slots, registered_origins, origin, source, reason, max_length and index.

A 500 never puts internal details in message; it is always a fixed text. When you contact support, quote the envelope or batch id and the time of the call.

code and message are reserved. They are always present and always win over any extra key, so the two fields you branch on can never be shadowed by detail carried up from the send pipeline.

Branch on code, never on message.

Common codes

Code HTTP Meaning
missing_credentials 401 No Authorization: Bearer header
invalid_credentials 401 Key unknown or revoked
org_not_found 401 Key's organization no longer exists
insufficient_scope 403 Key lacks a required scope (required, missing)
sandbox_write_blocked 403 Sandbox key used on an endpoint that sends or changes something (every POST, PATCH and DELETE)
plan_feature_unavailable 402 The organization's plan doesn't include API access (entitlement)
rate_limited 429 Over the per-key limit (limit, window_seconds)
not_found 404 Unknown API route under /api/v1/
method_not_allowed 405 Wrong HTTP method on a known endpoint
invalid_status 400 Unknown ?status= filter on GET /signpacks or GET /bulk-send/{id}/rows (allowed)
internal_error 500 Unhandled server error
template_not_found 404 No such template in this organization
template_id_required 400 template_id missing from a bulk-send body
template_not_sendable 400 Template has no roles or no placed fields (bulk-send only pre-check)
sender_email_required 400 sender_email missing
sender_not_found 400 sender_email is not an active member of the org
rows_required 400 rows missing or empty
too_many_rows 400 More than max_rows rows in one request
invalid_row 400 A rows entry is not an object (row)
invalid_recipients 400 Bad or missing recipients (row on bulk)
invalid_prefill 400 prefill is not an object (row)
invalid_expiry 400 expires_in_days is not an integer, or outside 1–365 (both send endpoints)
workspace_not_found 404 workspace_id not in this organization
batch_not_found 404 No such bulk-send batch in this organization
signpack_not_found 404 No such envelope in this organization
not_completed 409 Download requested before the envelope is Completed
not_remindable 409 Reminder requested for an envelope that is not awaiting signature
signed_pdf_unavailable 404 Completed envelope has no sealed PDF (sealing failed)
download_url_failed 500 Storage adapter could not mint a download URL
queue_failed 503 Accepted but could not be queued (batch_id on bulk-send)
batch_create_failed 500 Batch could not be persisted
create_failed 500 Unexpected failure creating an envelope

Send-validation codes

Raised when an envelope is sent, whichever way it was created (template send, raw-PDF send, each bulk row). On single send they come back as the HTTP error plus signpack_id for the surviving Draft. On bulk send they appear as error_code on the failed row.

Code HTTP Meaning
invalid_status 400 Envelope cannot be sent from its current status
incomplete 400 Envelope has no documents or no recipients
no_signers 400 No signer recipient assigned
missing_recipient_email 400 A signer has no email address
signer_without_fields 400 A signer has no fields (signers_without_fields)
dsc_rule_violation 400 DSC signing-order rules violated (dsc_rule_errors)
sender_required 400 Sender could not be resolved
no_documents 400 Template produced no attachable document
not_found 404 Envelope disappeared between create and send
document_copy_failed 500 Template document could not be copied into the vault
template_missing 500 Template deleted mid-send
template_field_copy_failed 500 Template fields could not be copied
email_queue_failed 500 The envelope was sent, but its invitation emails could not be queued. Do not send again; deliver the links with POST /signpacks/{id}/remind
plan_upgrade_required 402 The envelope uses something the plan doesn't include: a private message to a signer, or DSC signing
plan_limit_reached 402 The plan's monthly envelope limit is used up (entitlement, limit, used)

Bulk rows can additionally carry error_code values sender_missing (sender account deleted) and unexpected_error.


Core workflow

Signature and data fields must sit at specific places on specific pages. There are three ways to tell ERPDocs where they go:

Path Use it when Endpoint
Embedded placement Your users upload ordinary documents (vendor PDFs, scans) and put the signature where it belongs. No tags, no template POST /signpacks with placement=true, then your iframe, then POST /signpacks/{id}/send. See Embedded placement
Generated document with anchor tags Your system creates the document (invoice, offer letter, agreement) and can print tags like {{sig:Signer 1}} into it POST /signpacks — one envelope per call
Template The same layout is sent many times; fields are placed once in the UI POST /templates/{id}/send (one) or POST /bulk-send (many)

All paths then work the same way: email or embedded signing, webhooks, and GET /signpacks/{id}/download for the sealed PDF. The steps below are the template path; for the anchor-tag path see POST /signpacks.

1. Build the template once, in the UI

Templates → Create a template:

  1. Upload the agreement / terms-and-conditions PDF.
  2. Define recipient roles (for example Client, Acme Signatory). Role names are your API contract — keep them stable.
  3. Drag fields onto the pages and assign each to a role: signature, name, company, job title, phone, date, date signed (stamped by ERPDocs when the person signs), text, number, email, checkbox, dropdown, radio, attachment, tag.

A template with no roles or no placed fields cannot produce a sendable envelope. POST /bulk-send checks this up front and rejects the whole batch with 400 template_not_sendable. POST /templates/{id}/send has no such pre-check — it fails later in the send pipeline with signer_without_fields or incomplete, and keeps the Draft.

2. Read the send contract

GET /api/v1/templates/{id}

Returns the role names to address and the field labels you may prefill. Build your mapping from this, not from screenshots.

3. Queue the batch

POST /api/v1/bulk-send

One rows entry per counterparty. Returns 202 with a batch_id immediately; envelopes are created and mailed by background workers.

4. Poll the batch

GET /api/v1/bulk-send/{batch_id}
GET /api/v1/bulk-send/{batch_id}/rows?status=failed

Poll the batch for counters, then pull rows to reconcile against your own records via reference. Check prefill_unmatched on every row, not just failed ones — a row can be sent and still report unmatched labels.

5. Receive webhooks

Subscribe to signpack.sent, signpack.completed, recipient.signed, recipient.viewed, signpack.declined, signpack.recalled, signpack.correction_requested, signpack.cancelled, email.bounced and bulk_send.completed in Admin › API & Webhooks. Do not poll every envelope.

6. Fetch the signed PDF

GET /api/v1/signpacks/{id}/download

Returns time-limited URLs for the completed documents.


Embedded placement (upload, place, send)

For documents that have no anchor tags and no template. Your user uploads a file in your app, puts the signature fields on it inside your page (an ERPDocs iframe), and presses your Send button. Your users never log in to ERPDocs.

Your server                    Your page (browser)                ERPDocs
───────────                    ───────────────────                ───────
1. POST /signpacks
   placement=true  ──────────────────────────────────────────────▶ Draft + one-time link
   ◀─ placement_url
2.                              ERPDocs.open(placement_url) ─────▶ placement screen (iframe)
                                ◀─ events: ready, status, saved     user adds signers,
                                                                    places fields, autosave
3.                              your form: name + email per slot
                                p.send({signers}) ───────────────▶ validates, sends
                                ◀─ event: sent                      signers get the email
   ◀─ webhook signpack.sent / signpack.completed

The same send can come from your server instead of the browser: POST /signpacks/{id}/send takes the same mapping.

The routes (relative to the base URL): /signpacks (upload, with placement=true), /signpacks/{id}/placement-url (a new link), /signpacks/{id}/send (send), /signpacks/{id} (read, and DELETE to remove a draft).

How it works

  1. Upload. POST /signpacks with placement=true and the file. ERPDocs checks the file, creates a Draft (nothing is sent, nobody is emailed) and returns a one-time placement_url.
  2. Place. Your page opens placement_url in an iframe. The user clicks Add signer to add slots (Signer 1, Signer 2, with an optional label such as "Buyer"), and places up to four field types for each slot: signature, name, date signed, text. Every change autosaves. The frame tells your page when each slot has a signature (status).
  3. Send. Your page shows one name and email form per slot (it gets the slot list from status) and a Send button of your own. On click, your page sends the mapping slot → {name, email, signature_method} with the helper (p.send(...)) or your server calls POST /signpacks/{id}/send. Signers get the normal ERPDocs email (in your client's brand if brand_id was set).
  4. Sign and finish. The signers sign. Webhooks and GET /signpacks/{id}/download work as for any envelope.

Nothing is sent before step 3, and a half-filled envelope never goes out: every slot needs a signature field and a person, or the send is refused with a named error that lists the slot keys.

What you need first

  • An API key with scope signpack.write (and signpack.read to list drafts). Sandbox keys are blocked (403 sandbox_write_blocked).
  • The origin of the page that will frame ERPDocs, registered on the key under Admin › API & Webhooks: click + under Frame origins on the key's row (any active key with signpack.write or signpack.embed; the same list embedded signing uses). Exact https origin, no wildcards, no paths; http only for localhost. If the key has one origin, origin can be left out of the calls. With two or more, send origin every time (400 origin_required otherwise). With none: 400 origin_required.
  • For sign_after (the placing user signs right after the send): the send call needs only signpack.write. From your server, the key's verification floor and your signer_authenticated assertion apply exactly as for embed-token. From the browser (p.send), the signer always confirms their email with an ERPDocs code first, whatever the floor (see Sending from the browser or from your server).

Slots

A slot is a placeholder signer. Keys are signer_1, signer_2, and so on, and they are never reused: if the user removes signer_2, the next slot is signer_3. A mapping you built from status can never point at the wrong person. A slot has an optional label (defaults to "Signer N"). Maximum 20 slots.

If you pass recipients when you upload, they only pre-fill slots: one slot per role, label taken from the role's name. Nothing else is stored at upload: if an entry also has email, signature_method or any other key with a value, the 201 carries a warning {"code": "placement_recipient_fields_ignored", "message": "...", "fields": ["email", "signature_method"]}. Give the people when you send. Anchor tags in the file, if any, also create their fields and slots, and the user can edit or delete them.

Fields: signature, name, date_signed (stamped by ERPDocs when the person signs) and text. All are required fields for the signer. allowed_fields can narrow the palette, but it must include signature. Positions are saved in PDF points per page, so rotated and mixed-size pages sign correctly. The frame keeps a field inside its page.

Limits and timings

What Value
Pages per document 50 (too_many_pages)
Slots per document 20 (too_many_slots, max_slots)
Fields per document 500 (too_many_fields)
Placement link 30 minutes to open, opens once
Placement session 2 hours idle (session_expired); activity in the frame refreshes it
redeem of links 30 a minute per client address
Writes from one frame 120 a minute per draft; 10 sends a minute per draft
Drafts Kept until sent or deleted. Nothing deletes them automatically
Expiry of the envelope Starts at send: expires_in_days (default 30, set at upload) counts from the moment you send. A draft has expires_at: null and is never reported as expired

Browsers

The embedded pages work in desktop Chrome, Edge, Brave and Firefox. Safari and iOS are not supported for embedded pages. DSC signing needs Windows or Mac (see DSC signers).

The helper script

One small plain script, no build step, no dependencies:

<script src="https://www.erpdocs.com/static/js/erpdocs-embed.js"></script>
<div id="erpdocs-place"></div>
<script>
  var p = ERPDocs.open(PLACEMENT_URL, { mode: "inline", container: "#erpdocs-place" });

  p.on("status", function (s) {
    // s.ready, s.slots [{key, label, field_count, has_signature}], s.missing [text]
    renderSignerForms(s.slots);              // one name + email form per slot
    sendButton.disabled = !s.ready;
    showProblems(s.missing);
  });
  p.on("sent", function (d) { showDone(d.signpack_id); });
  p.on("error", function (e) { handle(e.code, e.message); });

  sendButton.onclick = function () {
    p.send({ signers: {
      signer_1: { name: "Ravi Menon",  email: "ravi@northwind.example", signature_method: "dsc" },
      signer_2: { name: "Priya Raman", email: "priya@northwind.example" }
    }});
  };
</script>

ERPDocs.open(url, options) returns a handle. url is the placement_url (or a sign_url).

Option Meaning
mode inline (default): an iframe inside container. modal: a full-window dialog with a close button. tab: a new browser tab (no events, no send())
container An element or a selector. Required for inline
height Inline height in pixels. Default 720, minimum 240
title Accessible title of the frame or dialog
Handle method Meaning
p.on(type, fn) / p.off(type, fn) Listen to an event (below). "*" receives all
p.send({signers, sign_after?, signer_authenticated?, suppress_completion_email?}) Send from the browser. Not available in tab mode. The frame calls the same send as the API
p.close() Remove the frame or dialog. Emits closed

Events reach your handlers only from the frame this helper created, and only from its own origin. send() posts only to that origin.

Size. The ERPDocs pages do not resize themselves: they fill the frame and scroll inside. An inline frame is 720 px tall by default (option height); if the signing page reports a larger minimum (min_height, 540) the helper grows the frame to it. Give the frame as much room as your layout allows. Phones work down to about 390 px wide.

Keyboard. In modal mode, Esc closes the dialog when focus is in your page. Keys pressed inside the frame never reach your page, so Esc there does nothing: your user closes with the dialog's close button. Tab moves between the close button and the frame.

Without the helper. You can talk to the frame yourself: listen to message events whose origin is https://www.erpdocs.com and whose source is your iframe's contentWindow, and post {type: "send", ...} to https://www.erpdocs.com. If you do, you must also handle open_top_level yourself (below).

Frame events (ERPDocs to your page)

Every message is an object with a type. Use them for your own screen; the authoritative signals are the API responses and webhooks.

type When Other keys
ready The placement screen loaded none
status On every change (and once at load) ready (true only when there is at least one slot, every slot has a signature, and everything is saved), saving, save_failed, slots (key, label, field_count, has_signature), missing (plain-language problems, e.g. "Signer 3 has no signature — add one or remove Signer 3")
saved A change reached the server save_seq
sent The send succeeded signpack_id, dsc_notices, recipients ([{slot, id, signature_method, embedded}]: the recipient id to use with embed-token later), sign_after_status (null, "not_your_turn" or "session_failed", as in the API response), sign_after_error (null or a code, see sign_after_error codes)
error A refusal or failure (table below) code, message, plus any extra keys of the error, e.g. slots or reason
open_top_level The frame wants a full browser tab (DSC signing) url
closed p.close() was called (helper only) none
resize A frame asked for a height (helper only; our pages do not send it today). In inline mode the helper applies it, between 240 and 20000 px height (pixels)

After a send with sign_after, the frame turns into the signing page. From then on you receive the embedded signing events (ready with min_height, complete, decline, redirect, error).

If you set redirect_url at upload, the frame navigates to it inside the iframe after a send that does not open signing, with ?event=sent added. Omit redirect_url if you would rather react to the sent event yourself. Without redirect_url the frame shows a calm screen:

After the send The frame shows
No sign_after "Sent for signing" — "Each signer gets an email with their link."
sign_after, not their turn yet "Sent for signing" — "You'll be asked to sign here when it's your turn." (plus "The other signers get an email with their link." when there are others). Open signing later with embed-token for the recipient id from sent.recipients
sign_after, session could not be opened "Sent" — "We couldn't open signing here — the app can open it again." The pack is sent; use embed-token

Error events.

code Meaning What to do
link_expired The link was not opened within 30 minutes, was unknown, or (reason: "replaced") was replaced by a newer link Mint a new link with placement-url and reopen
link_used The link was already opened once (for example in a second tab) Mint a new link
session_replaced A newer link was minted while this frame was open. Nothing is lost: saved work stays Close this frame; show the new one
session_expired The frame was idle for 2 hours Mint a new link; saved fields reappear
draft_closed The draft was sent (reason: "sent", the frame shows "This document was already sent") or deleted (reason: "deleted", "This document was deleted") while the frame was open Stop. Read the envelope with GET /signpacks/{id} (a deleted one is 404)
save_failed Three saves in a row failed. The frame keeps retrying and shows "Not saved — retrying" Tell the user; send stays blocked until saved
save_pending You asked to send while changes were still saving. Nothing was sent Wait for status.ready, then send again
invalid_message Your send message was malformed (not an object, signers missing, a signer without text name and email, a non-text sign_after, and so on). Nothing was sent Fix the call
popup_blocked Helper only: the browser blocked the new tab for open_top_level. Extra key url Show the link to the user
invalid_url Helper only: the frame asked to open an address outside ERPDocs. The helper refused None
send_failed The browser could not reach ERPDocs while sending Try again

When the session or the draft is gone (session_replaced, session_expired, draft_closed, csrf_invalid), the frame posts the error first and then reloads into a page that explains it; that page posts the same error again (with reason where there is one). Handle the code once.

Every send error of the API (the send codes below) also arrives as an error event with the same code and extra keys. A send from the frame also checks the key that opened the link exactly as the API checks a key, with the same codes: invalid_credentials (revoked), insufficient_scope (no signpack.write), plan_feature_unavailable (the plan lost API access), sandbox_write_blocked. Other codes you may see in the frame, from a change the frame had to refuse (the frame then reloads the saved state and says "Your last change wasn't saved — the document was refreshed."): invalid_fields, unknown_field, field_type_not_allowed, invalid_page, invalid_field_geometry, invalid_field_label, too_many_fields, too_many_slots, invalid_slot_label, unknown_slot, invalid_body, csrf_invalid, rate_limited.

Sending from the browser or from your server

Both send the same way and are refused for the same reasons. They differ in who supplies the mapping:

  • From the browser (p.send(...), or your own {type: "send"} message): the mapping (signers) and signer_authenticated come from the page, which the person using it controls. ERPDocs records them as given. So with sign_after from the browser, the signer always confirms their mailbox with a one-time ERPDocs email code inside the frame before the document opens, whatever the key's verification floor (even none). The audit trail and the Certificate of Completion say the envelope was sent from your app's browser page.
  • From your server (POST /signpacks/{id}/send): the mapping comes from your backend. The key's floor and your require_verification apply as for embed-token; the certificate says the envelope was sent from your server.

If you need strict control over who signs and how they are verified (for example a none floor because your app already authenticated the signer), send from your server.

Sending a DSC signer, and sign_after

signature_method: "dsc" in the mapping turns that slot's signature fields into DSC fields. Rules are those of POST /signpacks: DSC must be on for your organization (400 dsc_not_enabled), the plan must include it (402 plan_upgrade_required), and a pack with both methods is sent in sequence with DSC signers last. dsc_notices (in the response and in the sent event) says what was rearranged.

sign_after lets the person who placed the fields sign straight away, in the same frame, with no invitation email. Give the slot key and signer_authenticated:

  • If it is that signer's turn, the response has a single-use sign_url. When you send from the browser, the frame itself continues into the signing page (an e-sign signer signs right there, after the ERPDocs email code: see Sending from the browser or from your server).
  • If other signers must go first, the pack is sent and the response says "sign_after_status": "not_your_turn". Mint a link later with embed-token.
  • If the signing session could not be started after a successful send, the response says "sign_after_status": "session_failed" with sign_after_error. The pack is sent; use embed-token.

sign_after_error codes

sign_after_error is always a code, never a sentence:

Code Meaning
embed_token_failed The signing session could not be saved on our side
session_failed Anything else went wrong while opening the session (logged on our side)

A DSC signer cannot sign inside the placement frame. The frame posts open_top_level with the signing url and shows "Sent. Continue signing in a new tab" with the link. The helper opens the tab (popup_blocked if the browser refuses: show the link yourself, at once). The link from the embedded signing page's "Continue in a new tab" is single-use and lives 120 seconds; the placement path's sign_url is single-use and lives 300 seconds by default (sign_url_expires_in). The same hand-off appears on an embedded signing page when the signer's browser extension is missing or older than 1.5.0: the signer gets a Continue in a new tab button, and the new tab has its own session. Send DSC signers to https://www.erpdocs.com/dsc/setup beforehand. Windows or Mac only.

Drafts

A placement draft stays until it is sent or deleted. List yours with GET /signpacks?status=Draft. Each placement draft carries slots and fields_placed (GET /signpacks). To reopen one, mint a new link with POST /signpacks/{id}/placement-url: the old link and any open frame stop working, the saved slots and fields come back. To drop one, DELETE /signpacks/{id}; it removes the stored files too.

A partner draft cannot be edited or sent from inside the ERPDocs app. It is listed there as "Partner draft", read-only, with only a Delete button. After the send it is an ordinary envelope everywhere.

Webhooks, audit and billing

signpack.sent fires at send with the real recipients. There is no event for creating a draft or placing fields. A draft never counts against the plan's envelope limit; it is counted at send (402 plan_limit_reached if used up, draft untouched). The audit trail records the API upload, the placement being opened and saved, and the send (with the API key's name).

End to end: what happens in each case

Case Outcome
Not a PDF, DOCX or image, or conversion fails 400 file_conversion_failed, no draft
Password-protected or unreadable PDF 400 file_unreadable, no draft
More than 50 pages 400 too_many_pages (max_pages), no draft
Key has no registered origin, or two or more and none given 400 origin_required, no draft
origin not registered on the key 403 origin_not_allowed, no draft
Sandbox key 403 sandbox_write_blocked
placement=true with send=true 400 invalid_send: a placement draft is never sent on upload
origin, allowed_fields or redirect_url without placement=true Ignored; the 201 carries a placement_params_ignored warning
Link opened after 30 minutes, or a second time The frame shows "This link has expired — ask the app to reopen it." (link_expired) or "This link was already opened — ask the app to reopen it." (link_used) and posts the same code
New link while the old frame is open The old frame's next save fails with session_replaced; saved work is kept
2 hours idle Next save fails with session_expired; mint a new link, saved fields reappear
Draft sent or deleted while the frame is open draft_closed (reason sent or deleted), posted to your page; the frame shows "This document was already sent" or "This document was deleted"
sign_after sent from the browser The signer confirms their email with an ERPDocs code before the document opens, whatever the key's floor
recipients at upload with email or signature_method Not stored; 201 with a placement_recipient_fields_ignored warning
Network trouble while saving Retries with backoff; after three failures save_failed; send blocked until saved
A slot with no signature Not ready; send refused with signer_without_signature (slot keys)
A slot with no name or email in the mapping 400 unmapped_slots (slot keys)
A key that is not a slot 400 unknown_slot (slots, valid_slots)
The same email on two slots 400 duplicate_signer_email (slot keys)
Double click, or the API and the helper at once One send wins; the other gets 409 already_sent
DSC off for the org or not in the plan 400 dsc_not_enabled / 402 plan_upgrade_required, draft untouched
Monthly envelope limit reached 402 plan_limit_reached, draft untouched
The user the draft was created for was deactivated 400 sender_not_found, draft untouched
brand_id deleted since upload The default brand is used
sign_after and it is not their turn Sent; sign_after_status: "not_your_turn"
Signer email equals the sender's Allowed; no self-notification
Placement link or session used after the send draft_closed
DELETE on a sent envelope 409 not_deletable (use void)
email_queue_failed (500) on a send The pack was sent (the sent audit row and the signpack.sent webhook exist); the invitation emails may not have gone out. Do not send again (409 already_sent). Deliver the links with POST /signpacks/{id}/remind

Endpoints

All paths are relative to https://www.erpdocs.com/api/v1.

Method Path Scope
GET /ping none (valid key only)
GET /templates template.read
GET /templates/{id} template.read
POST /templates/{id}/send signpack.write
POST /bulk-send signpack.bulk
GET /bulk-send/{batch_id} signpack.read
GET /bulk-send/{batch_id}/rows signpack.read
GET /signpacks signpack.read
POST /signpacks signpack.write
GET /signpacks/{id} signpack.read
GET /signpacks/{id}/download signpack.read
POST /signpacks/{id}/remind signpack.write
POST /signpacks/{id}/void signpack.write
POST /signpacks/{id}/recipients/{rid}/embed-token signpack.embed
GET /workspaces workspace.read
GET /users user.read
GET /brands brand.read
POST /brands brand.write
GET /brands/{id} brand.read
PATCH /brands/{id} brand.write
DELETE /brands/{id} brand.write
POST /brands/{id}/set-default brand.write

GET /teams is a legacy alias of /workspaces and returns an identical response. Build against /workspaces.


GET /ping

Credential smoke test. Confirms the key, its organization and its granted scopes. Requires no scope.

curl https://www.erpdocs.com/api/v1/ping \
  -H "Authorization: Bearer $ERPDOCS_API_KEY"
{
  "ok": true,
  "org_id": 12,
  "org_name": "Acme Holdings",
  "environment": "live",
  "scopes": ["signpack.bulk", "signpack.read", "signpack.write", "template.read"],
  "server_time": "2026-03-04T09:12:44.512003Z"
}

GET /templates

Lists templates this organization can send from: its own user templates, plus active document templates owned by the org or global.

curl https://www.erpdocs.com/api/v1/templates \
  -H "Authorization: Bearer $ERPDOCS_API_KEY"
{
  "data": [
    {
      "id": 41,
      "type": "user_template",
      "name": "Acme Supplier T&C 2026",
      "description": "Standard supplier terms",
      "roles_count": 2,
      "fields_count": 6
    },
    {
      "id": 7,
      "type": "document_template",
      "name": "Mutual NDA",
      "description": null,
      "roles_count": 2,
      "fields_count": 4
    }
  ]
}

type is user_template or document_template. Ids are only unique within a type — pass template_type on bulk-send if both types could share an id.


GET /templates/{id}

The send contract for one template.

curl https://www.erpdocs.com/api/v1/templates/41 \
  -H "Authorization: Bearer $ERPDOCS_API_KEY"
{
  "id": 41,
  "type": "user_template",
  "name": "Acme Supplier T&C 2026",
  "description": "Standard supplier terms",
  "roles_count": 2,
  "fields_count": 6,
  "roles": [
    {
      "name": "Supplier",
      "order": 1,
      "type": "Signer",
      "default_name": null,
      "default_email": null
    },
    {
      "name": "Acme Signatory",
      "order": 2,
      "type": "Signer",
      "default_name": "Priya Raman",
      "default_email": "priya.raman@acme.example"
    }
  ],
  "prefillable_fields": ["Effective Date", "Supplier Legal Name", "Supplier PAN"]
}
  • roles[].name — address this in recipients (case-insensitive). roles[].order (as a string) also works as a key.
  • roles[].type — Signer, Reviewer or CC.
  • roles[].default_name / default_email — used when you omit that role from a row.
  • prefillable_fields — field labels you may set, sorted alphabetically and de-duplicated.

prefillable_fields lists the labels of fields of these types:

text, date, email, number, name, company, job_title, phone, location, tag

Sending applies the same rule, so this list never promises a label that sending will refuse. These can never be prefilled: signature, DSC signature, attachment and checkbox (a mark, a token signature, an upload or a consent tick must come from the recipient), dropdown and radio (the recipient picks one of the options), and date signed (ERPDocs stamps it at signing). A prefill key aimed at one of those is skipped and reported in prefill_unmatched.

Errors: 404 template_not_found.


POST /templates/{id}/send

Create and immediately send one envelope from a template. Use this for low volume or one-offs; use /bulk-send for batches.

Body:

Field Type Required Notes
sender_email string yes Must be an active member of the calling org. Envelopes must be attributed to a real user or completion notifications break.
recipients object or array no Role map, or list of {role, name, email}. Omitted roles fall back to template defaults. Each assignment may include "embedded": true to suppress invitation/reminder emails and mark the recipient for iframe hosting (see Embedded signing). You can also set "suppress_completion_email": true per assignment.
prefill object no Field label → value, matched case-insensitively.
title string no Defaults to the template name.
expires_in_days integer no Must be an integer between 1 and 365. Anything else → 400 invalid_expiry. Omit to use the template's expiry setting.
send boolean no Single-send only. Default true. Pass false to create a Draft without sending.
brand_id integer no Brand profile id (from GET /brands). Must belong to the calling org. Wins over the template, workspace and org default brand for this envelope. Omit to use the template's brand, then the workspace's, then the org default. The brand is fixed when the envelope is sent. A non-integer value returns 400 invalid_brand_id; an integer that is not one of your brands returns 404 brand_not_found.

signature_method is not read here; the template decides each signer's method.

workspace_id and idempotency_key are not accepted here — they are bulk-send only. The envelope lands in the template's workspace, or the sender's personal workspace if the template has none.

curl -X POST https://www.erpdocs.com/api/v1/templates/41/send \
  -H "Authorization: Bearer $ERPDOCS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
        "sender_email": "priya.raman@acme.example",
        "title": "Acme Supplier T&C — Northwind Ltd",
        "recipients": {
          "supplier": {"name": "Ravi Menon", "email": "ravi@northwind.example"}
        },
        "prefill": {
          "Supplier Legal Name": "Northwind Ltd",
          "Effective Date": "2026-04-01"
        },
        "expires_in_days": 21
      }'

201 Created:

{
  "id": 9012,
  "title": "Acme Supplier T&C — Northwind Ltd",
  "status": "Sent",
  "signing_order": "parallel",
  "created_at": "2026-03-04T09:14:02.104881",
  "sent_at": "2026-03-04T09:14:03.551200",
  "completed_at": null,
  "expires_at": "2026-03-25T09:14:02.104881",
  "workspace_id": 5,
  "brand_id": null,
  "recipient_count": 2,
  "dsc_notices": [],
  "prefill_unmatched": []
}

With "send": false the response is the same shape minus recipient_count and dsc_notices, and status is "Draft".

prefill_unmatched lists the prefill keys that matched no prefillable field, exactly as you sent them (surrounding whitespace trimmed) — {"Compnay Name": "…"} comes back as ["Compnay Name"], so you can reconcile directly against your own payload keys. A non-empty array means the envelope went out with those blanks unfilled. Treat it as a failure in your integration even though the HTTP status is 201.

If creation succeeds but sending fails, the Draft is kept so the organization can fix it in the UI, and the error carries its id:

{
  "error": {
    "code": "signer_without_fields",
    "message": "The following signer(s) have no fields assigned: Supplier. Each signer must have at least 1 field.",
    "signpack_id": 9012,
    "signers_without_fields": ["Supplier"]
  }
}

POST /bulk-send

Queue many envelopes from one template. Returns 202 as soon as the batch is persisted and handed to the workers.

Body:

Field Type Required Notes
template_id integer yes Template to clone.
template_type string no user_template or document_template. Disambiguates ids.
sender_email string yes Active member of the calling org.
rows array yes 1 – 1000 entries. One envelope per entry.
rows[].recipients object or array yes Role map, or list of {role, name, email}. Every entry needs a non-empty email.
rows[].prefill object no Field label → value.
rows[].reference string no Your own identifier, echoed back on the row.
rows[].title string no Envelope title. Defaults to the template name.
expires_in_days integer no 1–365. Applies to every envelope in the batch. Out of range or non-integer → 400 invalid_expiry. Omit to use the template's expiry setting.
workspace_id integer no Bulk-send only. Must belong to the calling org.
idempotency_key string no Bulk-send only. Also accepted as the Idempotency-Key header.

Single-send vs bulk-send parameters

Parameter POST /templates/{id}/send POST /bulk-send
workspace_id not accepted accepted
idempotency_key (or Idempotency-Key header) not accepted accepted
send accepted (false → stop at Draft) not accepted — rows are always sent
expires_in_days accepted; rejected with invalid_expiry outside 1–365 accepted; rejected with invalid_expiry outside 1–365

signature_method is not read on either endpoint; the template decides each signer's method.

expires_in_days is validated by one shared helper, so it behaves identically on both endpoints. (It used to clamp silently on single send and reject on bulk — the same parameter, two behaviours. Do not design around the old clamping.)

curl -X POST https://www.erpdocs.com/api/v1/bulk-send \
  -H "Authorization: Bearer $ERPDOCS_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: supplier-tc-2026-04-batch-1" \
  -d '{
        "template_id": 41,
        "template_type": "user_template",
        "sender_email": "priya.raman@acme.example",
        "workspace_id": 5,
        "rows": [
          {
            "reference": "SUP-1001",
            "title": "Acme Supplier T&C — Northwind Ltd",
            "recipients": {
              "supplier": {"name": "Ravi Menon", "email": "ravi@northwind.example"}
            },
            "prefill": {
              "Supplier Legal Name": "Northwind Ltd",
              "Effective Date": "2026-04-01"
            }
          },
          {
            "reference": "SUP-1002",
            "recipients": [
              {"role": "Supplier", "name": "Dana Okafor", "email": "dana@globex.example"}
            ],
            "prefill": {"Supplier Legal Name": "Globex Pvt Ltd"}
          }
        ]
      }'

202 Accepted:

{
  "batch_id": 318,
  "status": "queued",
  "template_id": 41,
  "template_type": "user_template",
  "total_rows": 2,
  "sent_count": 0,
  "error_count": 0,
  "created_at": "2026-03-04T09:20:11.442310",
  "completed_at": null
}

Recipients

Two accepted shapes, per row:

"recipients": {"supplier": {"name": "Ravi Menon", "email": "ravi@northwind.example"}}
"recipients": [{"role": "Supplier", "name": "Ravi Menon", "email": "ravi@northwind.example"}]
  • Role keys are lowercased before matching, so Supplier, supplier and SUPPLIER are the same role. The role's order as a string ("1") also matches.
  • Each assignment may also carry message — a private message for that recipient.
  • Roles you do not address fall back to the template's default_name / default_email. A role with neither an assignment nor defaults will fail at send time (missing_recipient_email or incomplete).
  • recipients is required on every bulk row and every assignment must have an email.

Prefill

  • Keys are field labels, matched case-insensitively and trimmed, against the labels shown by GET /templates/{id}.
  • Values are written as the field's default value; null becomes an empty string.
  • Prefillable field types: text, date, email, number, name, location, tag.
  • Not prefillable: signature, dsc, attachment, checkbox. Those must be completed by the recipient. Prefill keys aimed at them are skipped and reported as unmatched.
  • Unmatched keys are reported as prefill_unmatched: on the single-send response, and persisted per bulk row and returned by GET /bulk-send/{batch_id}/rows. Keys are echoed with your original casing (whitespace trimmed).
  • A bulk row can be status: "sent" and list unmatched labels. The envelope was sent with those blanks unfilled. Check prefill_unmatched on every row, not only on failed rows.

Prefilled values are editable unless the field is a tag

This is the single most important thing to get right when you prefill data you intend to rely on.

Prefill writes the field's default value. What happens next depends on who the field is assigned to in the template:

Field assigned to Signer sees Signer can change it? Use for
A signer role (text, date, number, …) Pre-populated input Yes Data you are suggesting, that the signer may correct — their address, a date they confirm
No recipient — a tag field Read-only text baked onto the page No Data you are asserting and must stay fixed — amounts, invoice numbers, account IDs, reference codes

tag fields are creator-only annotations (recipient_id is NULL). They render read-only in the signing UI and cannot be altered by any recipient, but they are prefillable — which makes them the correct carrier for values your own system needs to trust afterwards.

So if your portal computes an invoice total and the signed PDF must show exactly that total:

  • ❌ Do not put it in a text field assigned to the signer. They can overwrite it before signing.
  • ✅ Put it in a tag field. Prefill it by label; it is locked.

Build the template accordingly: tag for locked sender data, text/date/name for anything the signer legitimately fills or corrects.

Validation is all-or-nothing

Every row is validated before anything is written. A single bad row rejects the entire batch with 400 and no batch is created. The offending row number (1-based) is in error.row:

{
  "error": {
    "code": "invalid_recipients",
    "message": "Row 3: recipient for role 'supplier' needs an 'email'",
    "row": 3
  }
}

Over the ceiling:

{
  "error": {
    "code": "too_many_rows",
    "message": "Too many rows (1001). Maximum is 1000 per request — split the job into multiple calls.",
    "max_rows": 1000
  }
}

Note this is only request validation (shape, recipient emails, row count). Template-level problems — a signer with no fields, a DSC ordering violation — surface later as per-row failures, not as a 400.

Limits and internals

Constant Value
Maximum rows per request 1000
Rows per background chunk 25
Requests per minute per key 10

Rows are processed in chunks of 25 so each background task stays short and retryable. Each row is its own transaction: one failure never rolls back rows that already sent, and never aborts the batch.

Idempotency

Supply idempotency_key in the body or Idempotency-Key as a header (body wins if both are present). Keys are unique per organization.

  • First request → 202 with the new batch.
  • Any later request with the same key → 200 with the original batch plus "idempotent_replay": true. The rest of the body is ignored — the stored batch is returned as-is.
{
  "batch_id": 318,
  "status": "processing",
  "template_id": 41,
  "template_type": "user_template",
  "total_rows": 2,
  "sent_count": 1,
  "error_count": 0,
  "created_at": "2026-03-04T09:20:11.442310",
  "completed_at": null,
  "idempotent_replay": true
}

Always send an idempotency key. Without one, a network timeout you retry will send every envelope twice.

If the batch is stored but the worker queue is unreachable you get 503 queue_failed with batch_id — the batch exists and support can requeue it. Do not retry with a fresh idempotency key.


GET /bulk-send/{batch_id}

curl https://www.erpdocs.com/api/v1/bulk-send/318 \
  -H "Authorization: Bearer $ERPDOCS_API_KEY"
{
  "batch_id": 318,
  "status": "partial",
  "template_id": 41,
  "template_type": "user_template",
  "total_rows": 250,
  "sent_count": 247,
  "error_count": 3,
  "created_at": "2026-03-04T09:20:11.442310",
  "completed_at": "2026-03-04T09:26:48.900117"
}

Batch status lifecycle

queued → processing → completed | partial | failed
Status Meaning
queued Accepted; no row processed yet (sent_count + error_count == 0)
processing Some rows processed, some still pending
completed Every row sent; error_count == 0
partial All rows processed; some sent, some failed
failed All rows processed; nothing sent (sent_count == 0)

Status is derived from the row counters, not set by hand. completed, partial and failed are terminal and stamp completed_at.

partial is a success and a failure at once. Envelopes for the successful rows are out and legally in flight — do not re-send the whole batch. Fetch the failed rows, fix the cause, and re-submit only those rows (with a new idempotency key).


GET /bulk-send/{batch_id}/rows

Per-row status, paged.

Query param Default Notes
limit 100 Clamped to 1–500
offset 0
status — Filter by pending, sent or failed
curl "https://www.erpdocs.com/api/v1/bulk-send/318/rows?limit=100" \
  -H "Authorization: Bearer $ERPDOCS_API_KEY"
{
  "batch_id": 318,
  "data": [
    {
      "row": 3,
      "reference": "SUP-1003",
      "title": null,
      "status": "failed",
      "signpack_id": 9114,
      "error": "The following signer(s) have no fields assigned: Acme Signatory. Each signer must have at least 1 field.",
      "error_code": "signer_without_fields",
      "prefill_unmatched": [],
      "processed_at": "2026-03-04T09:23:07.221004"
    },
    {
      "row": 12,
      "reference": "SUP-1012",
      "title": null,
      "status": "sent",
      "signpack_id": 9123,
      "error": null,
      "error_code": null,
      "prefill_unmatched": ["Suplier Legal Name"],
      "processed_at": "2026-03-04T09:23:19.640228"
    },
    {
      "row": 88,
      "reference": "SUP-1088",
      "title": null,
      "status": "failed",
      "signpack_id": null,
      "error": "Sender account no longer exists",
      "error_code": "sender_missing",
      "prefill_unmatched": [],
      "processed_at": "2026-03-04T09:25:41.007712"
    }
  ],
  "total": 250,
  "limit": 100,
  "offset": 0
}

Row statuses: pending, sent, failed. Pending rows have signpack_id, error, error_code and processed_at all null, and prefill_unmatched as [].

A failed row may still have a signpack_id: the Draft envelope was created but the send was rejected. The Draft is kept deliberately so the organization can correct and send it from the UI rather than lose the work.

prefill_unmatched on a sent row

prefill_unmatched lists the prefill keys for that row that matched no prefillable field on the template, echoed with your original casing. It is independent of status. Row 12 above is sent and still reports "Suplier Legal Name": the envelope is with the counterparty and that field is blank.

Do not filter with ?status=failed and stop there. Read every row and treat any non-empty prefill_unmatched as an error in your own mapping — the usual cause is a label typo or a template label that was renamed. Correcting it does not change envelopes already sent; those must be recalled in the UI and re-sent.


GET /signpacks

curl "https://www.erpdocs.com/api/v1/signpacks?status=Sent&limit=50" \
  -H "Authorization: Bearer $ERPDOCS_API_KEY"
Query param Default Notes
status — Exact match on envelope status
limit 50 Clamped to 1–200
offset 0
{
  "data": [
    {
      "id": 9012,
      "title": "Acme Supplier T&C — Northwind Ltd",
      "status": "Sent",
      "signing_order": "parallel",
      "created_at": "2026-03-04T09:14:02.104881",
      "sent_at": "2026-03-04T09:14:03.551200",
      "completed_at": null,
      "expires_at": "2026-03-25T09:14:02.104881",
      "workspace_id": 5
    }
  ],
  "total": 1,
  "limit": 50,
  "offset": 0
}

Envelope statuses: Draft, Sent, In Progress, Completed, Declined, Expired, Cancelled, Correction Requested, Recalled, Imported. Results are newest-first by created_at.

Placement drafts (uploaded with placement=true, still Draft) carry two more keys, here and in GET /signpacks/{id}:

{
  "id": 9100,
  "title": "Vendor Agreement",
  "status": "Draft",
  "expires_at": null,
  "slots": [
    {"key": "signer_1", "label": "Buyer", "field_count": 3, "has_signature": true},
    {"key": "signer_2", "label": "Signer 2", "field_count": 0, "has_signature": false}
  ],
  "fields_placed": false
}

fields_placed is true only when there is at least one slot and every slot has a signature field, that is, when a send can succeed. expires_at is null until the send. Both keys disappear once the envelope is sent. Use ?status=Draft to list your open drafts.


POST /signpacks

Create and send an envelope from a raw PDF, DOCX or image using anchor tags.

This is the template-less path: the caller generates the document, drops anchor tags where fields should appear, and the API detects the tags, redacts them from the final PDF, places real fields at the same positions, and sends.

Anchor tags are written directly in the document text:

Tag Field type Example
{{sig:Role}} or {{signature:Role}} Signature {{sig:Signer 1}}
{{name:Role}} Signer name {{name:Signer 1}}
{{company:Role}} Company name {{company:Signer 1}}
{{title:Role}} or {{job_title:Role}} Job title {{title:Signer 1}}
{{phone:Role}} Phone number {{phone:Signer 1}}
{{date:Role}} A date the signer fills in {{date:Signer 1}}
{{datesigned:Role}} or {{date_signed:Role}} Date signed, stamped by ERPDocs when the signer signs. Can't be edited {{datesigned:Signer 1}}
{{text:Role:Label}} Free text {{text:Signer 1:Address}}
{{checkbox:Role:Label}} or {{check:Role:Label}} Checkbox {{checkbox:Signer 1:I agree}}
{{email:Role}} Email address {{email:Signer 1}}
{{number:Role:Label}} Number {{number:Signer 1:Amount}}
{{attachment:Role:Label}} or {{attach:Role:Label}} File attachment (up to 5 MB) {{attachment:Signer 1:Upload ID}}
{{location:Role}} Location {{location:Signer 1}}
{{tag:Value}} or {{tag:Label:Value}} Read-only tag {{tag:Invoice: 12345}}

The role in the anchor (e.g. Signer 1) must match a key in the recipients payload. Any recipient with at least one actionable field becomes a Signer; a recipient with none becomes CC.

Request (multipart/form-data):

curl -X POST https://www.erpdocs.com/api/v1/signpacks \
  -H "Authorization: Bearer $ERPDOCS_API_KEY" \
  -F "file=@contract.pdf" \
  -F "sender_email=alice@example.com" \
  -F 'recipients={"Signer 1":{"name":"Ravi","email":"ravi@example.com","embedded":true},"CC":{"name":"Accounts","email":"accounts@example.com"}}' \
  -F "title=Supplier Agreement"

Fields:

Field Required Notes
file yes PDF, DOCX or image (images and DOCX are converted to PDF)
sender_email yes Active member of the organization
recipients yes JSON object {role: {name, email, signature_method?, embedded?, role_type?, suppress_completion_email?}} or a list with role keys. signature_method is "esign" (default) or "dsc" (hardware token); case and surrounding spaces are ignored, anything else is 400 invalid_signature_method. See DSC signers. Role keys are case-insensitive and appear lower-cased in the field and message of errors.
title no Defaults to the filename
signing_order no parallel (default) or sequential
expires_in_days no 1–365, default 30
send no true (default) or false to create a Draft
brand_id no Brand profile id (integer, from GET /brands). Must belong to the calling org. Wins over the template, workspace and org default brand for this envelope. Omit to use the template's brand, then the workspace's, then the org default. The brand is fixed when the envelope is sent. A non-integer value returns 400 invalid_brand_id; an integer that is not one of your brands returns 404 brand_not_found.
placement no true to upload for embedded placement: the call creates a Draft and returns a placement_url; nothing is sent. Accepted: true, false, 1, 0, yes, no; anything else is 400 invalid_placement (a typo must never fall through to a send that emails people). See below.

Upload for placement (placement=true)

With placement=true the call never sends. file and sender_email are required; recipients is optional and only pre-fills signer slots (one per role, the label is the name). title, brand_id, signing_order and expires_in_days work as above. expires_in_days is remembered and counted from the send, not from the upload. Sandbox keys are blocked. The brand (brand_id, else the org default) is used from the first screen. The placement frame and its refusal pages show its colour and logo. It is fixed at the send for the emails and signing pages. These are white-labelled: signers see the brand's colour, logo and name in place of ERPDocs or your org name. Exceptions: the web address, the sending address, the legal links, the certificate of completion and the PDF seal.

Extra field Required Notes
origin If the key has two or more registered origins The https origin of the page that will frame the placement screen. Must be registered on the key. With exactly one registered origin it may be left out.
allowed_fields no Which field types the user may place: a comma-separated string (signature,name) or a JSON list. Subset of signature, name, date_signed, text; default all four. Must include signature, otherwise 400 invalid_allowed_fields (allowed).
redirect_url no Where the frame goes after a send that has no sign_after. Must be on the same origin as origin (400 invalid_redirect_url). ?event=sent is added.
curl -X POST https://www.erpdocs.com/api/v1/signpacks \
  -H "Authorization: Bearer $ERPDOCS_API_KEY" \
  -F "file=@vendor-agreement.pdf" \
  -F "sender_email=alice@example.com" \
  -F "placement=true" \
  -F "origin=https://app.yourcompany.com" \
  -F "allowed_fields=signature,name,date_signed" \
  -F "title=Vendor Agreement"

Response (201 Created):

{
  "success": true,
  "signpack_id": 9100,
  "status": "Draft",
  "title": "Vendor Agreement",
  "document_id": 311,
  "recipient_count": 0,
  "field_count": 0,
  "recipients": [],
  "anchor_unrecognised": [],
  "dsc_notices": [],
  "placement_url": "https://www.erpdocs.com/signpack/place/9100.k3J...",
  "placement_expires_at": "2026-11-20T10:30:00Z",
  "slots": []
}

placement_url is a bearer credential: it opens once and for 30 minutes (placement_expires_at). Hand it to your page right away and never log it or send it to another system. slots lists the pre-filled slots (and slots made from anchor tags) as {key, label, field_count, has_signature}; recipients lists the same slots with an empty email.

Only each role and its name are kept from recipients. If an entry also carries email, signature_method or any other key with a value, nothing of it is stored and the 201 says so (the people are given at send):

"warnings": [{"code": "placement_recipient_fields_ignored", "message": "email, signature_method in 'recipients' are not kept on a placement draft: only each role and its name (the signer label) are. Give the people (name, email, signature_method) when you send.", "fields": ["email", "signature_method"]}]

If origin, allowed_fields or redirect_url are sent without placement=true, they are ignored and the 201 carries a warning, so a forgotten flag is visible:

"warnings": [{"code": "placement_params_ignored", "message": "origin, allowed_fields only apply with placement=true and were ignored.", "fields": ["origin", "allowed_fields"]}]

Placement errors: 400 invalid_placement, 400 invalid_send (send=true together with placement=true), 400 file_conversion_failed (not a PDF, DOCX or image, or the conversion failed), 400 file_unreadable (password-protected, damaged or empty PDF), 400 too_many_pages (max_pages, page_count), 400 too_many_slots (max_slots), 400 origin_required (registered_origins when there are several), 400 invalid_origin, 403 origin_not_allowed (origin, registered_origins), 400 invalid_allowed_fields (allowed), 400 invalid_redirect_url, 400 invalid_recipients, 400 invalid_slot_label (max_length, 100), 400 invalid_signing_order, 400 invalid_expiry, 400 invalid_brand_id, 404 brand_not_found, 400 sender_email_required, 400 sender_not_found, 400 file_required, 403 sandbox_write_blocked. When a call fails, nothing is left behind: no draft and no stored file.

Response without placement (201 Created):

{
  "success": true,
  "signpack_id": 42,
  "status": "Sent",
  "title": "Supplier Agreement",
  "document_id": 99,
  "recipient_count": 2,
  "field_count": 5,
  "recipients": [
    {"id": 101, "role_key": "signer 1", "name": "Ravi", "email": "ravi@example.com", "role": "Signer", "embedded": true, "signature_method": "esign"}
  ],
  "anchor_unrecognised": [],
  "dsc_notices": []
}

dsc_notices lists any change ERPDocs made to the signing order because of DSC (see below). It is [] when nothing changed, and always [] with "send": false. Each recipient carries signature_method here and in GET /signpacks/{id}.

Sandbox keys are blocked with 403 sandbox_write_blocked.

Dropdown and radio fields can't be placed with anchor tags; use a template for those.

DSC signers on POST /signpacks

Set "signature_method": "dsc" on a recipient to make that signer use a DSC hardware token instead of a drawn, typed or uploaded mark. The choice is per recipient, so one envelope can mix e-sign and DSC signers.

curl -X POST https://www.erpdocs.com/api/v1/signpacks \
  -H "Authorization: Bearer $ERPDOCS_API_KEY" \
  -F "file=@contract.pdf" \
  -F "sender_email=alice@example.com" \
  -F 'recipients={"Signer 1":{"name":"Ravi","email":"ravi@example.com","signature_method":"dsc"},"Signer 2":{"name":"Priya","email":"priya@example.com"}}'
  • Only the recipient's {{sig:Role}} signature fields become token fields. Their name, date and other data fields stay normal.
  • The role must have a signature anchor, otherwise 400 dsc_signer_without_signature.
  • DSC must be on for your organization, otherwise 400 dsc_not_enabled. It also needs a plan that includes DSC signing (402 plan_upgrade_required on send).
  • A pack that mixes both methods is sent in sequence with the DSC signers last, even if you asked for parallel. dsc_notices says what was rearranged.
  • The DSC signer needs a Windows or Mac computer with Chrome, Edge or Brave, the ERPDocs browser extension, the ERPDocs DSC Bridge and their token. Phones, tablets and Linux are not supported. Embedded DSC signing needs extension 1.5.0 or later.
  • Send DSC signers to https://www.erpdocs.com/dsc/setup before they sign. It is public (no login), checks each piece live, offers the downloads for their computer and lets them test their token. The invitation email already links to it; link it from your own app too, especially for embedded signers who get no invitation email.

Errors: 400 file_required (no file part, or an empty filename), 400 file_conversion_failed (a DOCX or image could not be turned into a PDF), 400 sender_email_required, 400 sender_not_found, 400 invalid_recipients (recipients isn't valid JSON or has a bad entry), 400 recipients_required, 400 missing_recipients (an anchor names a role that isn't in recipients), 400 recipient_email_required, 400 invalid_signature_method (field, allowed: ["esign", "dsc"]), 400 dsc_signer_without_signature, 400 dsc_not_enabled, 400 invalid_signing_order, 400 invalid_expiry, 400 invalid_brand_id (not an integer), 404 brand_not_found (valid integer, but not a brand in your org), 403 sandbox_write_blocked. When send is true, any send-validation code can also come back.


POST /signpacks/{id}/placement-url

A new one-time placement link for a placement Draft. Use it to show the draft again (the first link is spent, expired or lost). Scope signpack.write. Blocked for sandbox keys.

The previous link and any open frame stop working at once. The old frame's next save fails with session_replaced; everything already saved is kept and comes back in the new frame.

The JSON body is optional. All keys are optional: origin (as at upload; the key's only origin by default), allowed_fields and redirect_url. Leave allowed_fields and redirect_url out to keep the values of the previous link; send "redirect_url": "" to clear it.

curl -X POST https://www.erpdocs.com/api/v1/signpacks/9100/placement-url \
  -H "Authorization: Bearer $ERPDOCS_API_KEY" -H "Content-Type: application/json" \
  -d '{"origin": "https://app.yourcompany.com"}'
{"placement_url": "https://www.erpdocs.com/signpack/place/9100.q8W...", "placement_expires_at": "2026-11-20T11:00:00Z"}

Errors: 404 signpack_not_found, 400 invalid_body (the body is not a JSON object), 409 draft_closed (already sent, or no longer a draft), 409 not_placement_draft (a draft that was not uploaded with placement=true), 400 origin_required, 400 invalid_origin, 403 origin_not_allowed, 400 invalid_allowed_fields, 400 invalid_redirect_url, 403 sandbox_write_blocked.


POST /signpacks/{id}/send

Send a placement Draft, giving every signer slot a person. Scope signpack.write. Blocked for sandbox keys. This is what your Send button calls (from your server), or what p.send(...) triggers in the browser; both run the same code and the same checks. One difference: from the browser the mapping and signer_authenticated come from the page, and a sign_after signer always confirms their email with an ERPDocs code first (see Sending from the browser or from your server). For strict control, send from your server.

curl -X POST https://www.erpdocs.com/api/v1/signpacks/9100/send \
  -H "Authorization: Bearer $ERPDOCS_API_KEY" -H "Content-Type: application/json" \
  -d '{
        "signers": {
          "signer_1": {"name": "Ravi Menon",  "email": "ravi@northwind.example", "signature_method": "dsc"},
          "signer_2": {"name": "Priya Raman", "email": "priya@northwind.example"}
        },
        "sign_after": "signer_2",
        "signer_authenticated": {"method": "password", "identifier": "priya@northwind.example", "at": "2026-11-20T10:30:00Z"}
      }'
Field Required Notes
signers Yes Object: slot key to {name, email, signature_method?}. Every slot must appear. name and email are text; name up to 255 characters, email a valid address (stored lower-case). signature_method is "esign" (default) or "dsc"
sign_after No A slot key. That person signs straight away in your page: no invitation email for them, and the response carries sign_url (or sign_after_status). Needs signer_authenticated
signer_authenticated With sign_after Your assertion of how you authenticated that signer, an object with method (text, up to 64; embed_handoff is reserved), identifier (text, up to 255) and at (ISO 8601 timestamp). authenticated_at is accepted as another name for at (at is preferred); both given with different times is refused (invalid_signer_authenticated). Recorded in the audit trail. Without sign_after it is refused (invalid_signer_authenticated)
origin, redirect_url, require_verification, ttl_seconds, suppress_completion_email No, and only with sign_after As on embed-token. origin and redirect_url default to the placement link's. Without sign_after they are refused with 400 sign_after_required (field)

What the send does, in this order, and nothing is changed unless every check passes:

  1. The draft must be a placement Draft (409 not_sendable, or 409 already_sent if it was sent already).
  2. Every slot needs at least one signature field (400 signer_without_signature) and an entry in signers with a name and an email (400 unmapped_slots). Entries for keys that are not slots are refused (400 unknown_slot). Names, emails and methods are checked per slot. The same email on two slots is refused (400 duplicate_signer_email). Every one of these errors lists the slot keys at fault in slots.
  3. The slots become recipients, in slot order (signer_1 first). A DSC signer's signature fields become DSC fields. DSC signers are then moved after every e-sign signer, and a pack that mixes both methods is switched from parallel to sequential. So slot order is the signing order only among signers who use the same method. dsc_notices lists these changes.
  4. The expiry starts now: expires_at is the time of the send plus the expires_in_days you gave at upload (default 30).
  5. The normal send runs: emails go out (branded if brand_id was set), signpack.sent fires, and the placement link and frame close. Errors of the send pipeline come back unchanged, with the draft untouched.

Response (200):

{
  "signpack_id": 9100,
  "status": "Sent",
  "recipients": [
    {"id": 20552, "name": "Priya Raman", "email": "priya@northwind.example", "role": "Signer", "template_role": "signer_2", "signing_order": 1, "embedded": true, "signature_method": "esign", "status": "Sent", "sent_at": "2026-11-20T10:31:00.100000", "signed_at": null},
    {"id": 20551, "name": "Ravi Menon", "email": "ravi@northwind.example", "role": "Signer", "template_role": "signer_1", "signing_order": 2, "embedded": false, "signature_method": "dsc", "status": "Pending", "sent_at": null, "signed_at": null}
  ],
  "dsc_notices": [
    "Switched to sequential signing: this SignPack mixes DSC and electronic signers, and DSC signers must sign last.",
    "Moved Ravi Menon to sign last — DSC token signatures must come after every electronic signature."
  ],
  "sign_url": "https://www.erpdocs.com/signpack/embed/abc123...",
  "sign_url_expires_in": 300
}

Ravi (signer_1, DSC) was moved after Priya (signer_2, e-sign), so it is Priya's turn and she gets the sign_url. If sign_after had named Ravi instead, the pack is sent the same way but the last key would be "sign_after_status": "not_your_turn" (no sign_url), because Priya must sign first. The last key(s) depend on sign_after:

Key(s) When
none No sign_after
sign_url, sign_url_expires_in It is that signer's turn. sign_url is single-use, like the embed-token link, and the key's verification floor applies (from the browser: always the ERPDocs email code). sign_url_expires_in is in seconds (default 300): open it now
sign_after_status: "not_your_turn" Signers before them have not signed yet. Mint a link later with embed-token
sign_after_status: "session_failed" and sign_after_error The envelope is sent but the signing session could not be started. sign_after_error is a code (sign_after_error codes). Use embed-token

Send codes and their extras

Code HTTP Meaning
invalid_body 400 The body is not a JSON object
invalid_signers 400 signers is missing, is not an object, or an entry is not an object with text name and email (slots lists the entries)
no_signers 400 The draft has no slots
signer_without_signature 400 These slots have no signature field (slots)
unmapped_slots 400 These slots have no name or no email in signers (slots)
unknown_slot 400 signers or sign_after names a key that is not a slot (slots, valid_slots)
invalid_signer_name 400 Name over 255 characters (slots)
invalid_signer_email 400 Not an email address, or over 255 characters (slots)
invalid_signature_method 400 Not esign or dsc (field, allowed, slots)
duplicate_signer_email 400 The same email on more than one slot (slots)
dsc_not_enabled 400 DSC is off for your organization (slots)
sign_after_required 400 origin, redirect_url, require_verification, ttl_seconds or suppress_completion_email without sign_after (field)
invalid_suppress_completion_email 400 suppress_completion_email is not true or false
invalid_signer_authenticated 400 Missing with sign_after, given without sign_after, or malformed (not an object, bad method, identifier, at or authenticated_at, or at and authenticated_at that differ)
invalid_require_verification 400 Not email_otp or none (allowed)
verification_downgrade_blocked 403 Weaker than the key's floor (requested, policy_minimum)
invalid_ttl 400 ttl_seconds outside 30–900 (max_ttl_seconds)
invalid_origin, origin_not_allowed, invalid_redirect_url 400, 403, 400 sign_after origin or redirect problems, as on embed-token
not_sendable 409 The envelope is not a placement Draft (another status, or a draft made in the ERPDocs app or from a template)
already_sent 409 It was sent already (a double click, or the helper and the API at once). Nothing was sent twice
save_pending 409 Frame only: unsaved changes in the placement screen
sender_not_found 400 The user the draft was created for is no longer an active member of your organization
plan_upgrade_required 402 DSC signing is not in the plan
plan_limit_reached 402 The monthly envelope limit is used up (entitlement, limit, used)
email_queue_failed 500 The envelope was sent (GET /signpacks/{id} shows Sent; the sent audit row and the signpack.sent webhook exist) but the invitation emails could not be queued, so they may not have gone out. Do not send again: a retry returns 409 already_sent. Deliver the links with POST /signpacks/{id}/remind: it emails each pending signer (not embedded signers) a reminder that carries their signing link. In a sequential envelope pass recipient_ids with the signer(s) whose turn it is (status Sent), or later signers get a link before their turn. Embedded signers (sign_after) are never emailed: open their session with embed-token
signpack_not_found 404 No such envelope in your organization
sandbox_write_blocked 403 Sandbox key

The other send-validation codes can also come back, unchanged.


DELETE /signpacks/{id}

Delete a Draft, with every file it stored. Scope signpack.write. Blocked for sandbox keys. Any key of the organization may delete.

Only drafts created through the API can be deleted: placement drafts and drafts from POST /signpacks with send=false. A draft made in the ERPDocs app or from a template is refused (not_deletable, with source), because it can point at documents that are not the API's to remove. Anything already sent is 409 not_deletable: use POST /signpacks/{id}/void.

curl -X DELETE https://www.erpdocs.com/api/v1/signpacks/9100 \
  -H "Authorization: Bearer $ERPDOCS_API_KEY"
{"success": true, "signpack_id": 9100}

An open placement frame for that draft reports draft_closed on its next save. The audit trail records the deletion with the key's name.

Errors: 404 signpack_not_found, 409 not_deletable (source), 403 sandbox_write_blocked.


GET /signpacks/{id}

curl https://www.erpdocs.com/api/v1/signpacks/9012 \
  -H "Authorization: Bearer $ERPDOCS_API_KEY"
{
  "id": 9012,
  "title": "Acme Supplier T&C — Northwind Ltd",
  "status": "In Progress",
  "signing_order": "parallel",
  "created_at": "2026-03-04T09:14:02.104881",
  "sent_at": "2026-03-04T09:14:03.551200",
  "completed_at": null,
  "expires_at": "2026-03-25T09:14:02.104881",
  "workspace_id": 5,
  "brand_id": null,
  "recipients": [
    {
      "id": 20551,
      "name": "Ravi Menon",
      "email": "ravi@northwind.example",
      "role": "Signer",
      "template_role": "Supplier",
      "signing_order": 1,
      "embedded": false,
      "signature_method": "esign",
      "status": "Signed",
      "sent_at": "2026-03-04T09:14:03.551200",
      "signed_at": "2026-03-04T10:02:19.884001"
    },
    {
      "id": 20552,
      "name": "Priya Raman",
      "email": "priya.raman@acme.example",
      "role": "Signer",
      "template_role": "Acme Signatory",
      "signing_order": 2,
      "embedded": false,
      "signature_method": "dsc",
      "status": "Sent",
      "sent_at": "2026-03-04T09:14:03.551200",
      "signed_at": null
    }
  ]
}

role is the ERPDocs recipient role (Signer, Reviewer, CC, Viewer). template_role is the template role name you addressed in recipients — use it to map back to your own data.

signature_method is "esign" or "dsc": how that recipient signs.

Recipient statuses: Pending, Sent, Viewed, Signed, Declined, Expired.


embedded is true when the recipient is driven into the document by your own application through embedded signing. Embedded recipients receive no invitation, reminder or your-turn email, so check this field first when an expected email did not arrive.

GET /signpacks/{id}/download

A URL for the completed document. Only valid once the envelope is Completed.

This returns the canonical PAdES-sealed PDF generated at completion — not the original unsigned source.

curl https://www.erpdocs.com/api/v1/signpacks/9012/download \
  -H "Authorization: Bearer $ERPDOCS_API_KEY"
{
  "signpack_id": 9012,
  "status": "Completed",
  "documents": [
    {
      "filename": "Acme Supplier TC  Northwind Ltd_9012_signed.pdf",
      "url": "https://.../signed.pdf?X-Amz-Signature=...",
      "sha256": "9f2c41e0b7a3...",
      "pades_valid": true,
      "finalized_at": "2026-03-04T10:44:04.221871"
    }
  ]
}

documents always contains exactly one entry: the sealed pack. There is no document_id — the array exists so a multi-document response can be added later without a breaking change.

Field Notes
filename Derived from the envelope title (alphanumerics, spaces, - and _ only, truncated to 60 chars) plus _<id>_signed.pdf. A suggestion, not an identifier.
url Time-limited, generated by the storage adapter. Fetch promptly; do not persist it.
sha256 Hash of the sealed PDF. Verify your download against it.
pades_valid Whether the PAdES seal verified at completion. May be null on older packs.
finalized_at When the seal was applied. May be null on older packs.

Errors:

{
  "error": {
    "code": "not_completed",
    "message": "SignPack is 'In Progress', not Completed — no final document yet."
  }
}
Code HTTP Meaning
signpack_not_found 404 No such envelope in this organization
not_completed 409 Envelope is not Completed yet
signed_pdf_unavailable 404 Envelope is Completed but the sealing step never produced a file — contact support
download_url_failed 500 Storage adapter could not mint a URL — retry, then contact support

POST /signpacks/{id}/remind

Queue manual reminder emails.

Field Type Required Notes
recipient_ids array of integers no Omit to remind all outstanding recipients
message string no Truncated to 1000 characters

Status gate

Reminders are allowed only for envelopes that can still be signed. Permitted statuses:

Status Remindable
Sent yes
In Progress yes
Correction Requested yes
anything else (Draft, Completed, Declined, Expired, Cancelled, Recalled, Imported) no

Any other status returns 409 not_remindable:

{
  "error": {
    "code": "not_remindable",
    "message": "SignPack is 'Draft' — reminders only apply to packs awaiting signature."
  }
}

Recipient gate

Beyond the envelope status, at least one selected recipient has to be emailable. Three groups are never reminded:

  • CC recipients — they are only copied, never chased.
  • Recipients who have already signed or declined.
  • Embedded signers — a reminder carries a signing link, and that link would let the signer bypass the host application's authentication. See Embedded signing.

If nothing remains after that filter, the call returns 409 no_remindable_recipients rather than reporting success and sending nothing:

{
  "error": {
    "code": "no_remindable_recipients",
    "message": "Every pending recipient on this envelope is an embedded signer. Embedded signers are driven by your application and are never reminded by email."
  }
}

Chasing an embedded signer is the host application's job.

Audit attribution

The reminder is attributed to the SignPack creator (created_by_id), not to the API key or to the key's creator. The audit trail and the reminder email therefore show the original sender. If you need the API's own activity traced, use the API key audit entries in Admin › API & Webhooks.

curl -X POST https://www.erpdocs.com/api/v1/signpacks/9012/remind \
  -H "Authorization: Bearer $ERPDOCS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"message": "Reminder: Acme supplier terms are pending your signature."}'
{"queued": true, "signpack_id": 9012}

queued: true means the reminder job was accepted, not that mail was delivered. Errors: 404 signpack_not_found, 409 not_remindable, 409 no_remindable_recipients, 503 queue_failed.


POST /signpacks/{id}/void

Permanently cancel an in-flight envelope. Requires signpack.write. Blocked for sandbox keys.

Unlike a recall, voiding does not reset signatures or regenerate tokens. The envelope becomes Cancelled, any unredeemed embedded handoff sessions expire immediately, and the recipients can no longer access the document. A best-effort cancellation email is sent to non-embedded recipients.

Request body:

Field Type Required Notes
reason string no Shown to recipients and recorded in the audit log. Truncated to 500 characters.

Permitted statuses: Sent, In Progress, Correction Requested, Recalled. Any other status returns 409 not_voidable.

curl -X POST https://www.erpdocs.com/api/v1/signpacks/9012/void \
  -H "Authorization: Bearer $ERPDOCS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"reason": "Supplier agreement no longer required."}'
{
  "success": true,
  "signpack_id": 9012,
  "status": "Cancelled",
  "previous_status": "Sent",
  "voided_at": "2026-03-10T16:45:00Z"
}

Errors: 404 signpack_not_found, 409 not_voidable.


POST /signpacks/{id}/recipients/{recipient_id}/embed-token

Mint a short-lived, single-use URL that drops a specific recipient into the signing experience inside your own product (iframe or redirect). Requires signpack.embed. Blocked for sandbox keys.

This is the embedded signing flow: your application authenticates the signer, calls this endpoint to get a one-time URL, and embeds or redirects to it.

Who verifies the signer. Controlled by require_verification:

Level What happens
email_otp ERPDocs emails the recipient a 6-digit code and verifies it inside your iframe before the document renders. Your assertion is still recorded, as provenance alongside our result.
none ERPDocs performs no check of its own and relies entirely on your signer_authenticated assertion.

API keys created before this feature default to none and are unchanged. New keys default to email_otp. The level on the key is a floor set by the org owner under Admin › API & Webhooks: a request may ask for something stronger, but a request for something weaker is rejected with 403 verification_downgrade_blocked. That floor is what stops a leaked API key from being enough on its own to produce a signature attributed to somebody else.

Registering origins. Before you can mint a token, the exact origin that will frame the signing page must be registered on the API key under Admin › API & Webhooks. The origin becomes the sole frame-ancestors value in the Content-Security-Policy header for that session, so an unregistered origin cannot frame the page. No wildcards, no paths — https://app.yourcompany.com, not https://*.yourcompany.com or https://app.yourcompany.com/sign.

Request body:

{
  "origin": "https://app.yourcompany.com",
  "redirect_url": "https://app.yourcompany.com/signing/done",
  "suppress_completion_email": false,
  "ttl_seconds": 300,
  "require_verification": "email_otp",
  "signer_authenticated": {
    "method": "password",
    "identifier": "user@example.com",
    "at": "2026-03-10T14:30:00Z"
  }
}
Field Required Notes
origin Yes Exact https origin that will frame the page. Must be registered on the key. http is accepted only for localhost during development.
redirect_url No URL to send the signer to after they complete or decline. Must be on the same origin. ERPDocs appends ?event=<outcome> to the query string, where <outcome> is signing_complete or decline. If omitted, the normal ERPDocs completion/decline page is shown.
suppress_completion_email No If true, the recipient will not receive the completion notification or the final signed-copy email. Use this when your application handles delivery of the signed document.
ttl_seconds No Token lifetime. Default 300, range 30–900. Mint it when you are about to display it, not when you create the envelope.
require_verification No email_otp or none. Defaults to the key's floor. May raise the floor, never lower it.
signer_authenticated No Your identity assertion. method (string, up to 64; embed_handoff is reserved), identifier (string), at (ISO 8601 timestamp). authenticated_at, which earlier revisions of this page showed, is accepted as another name for at (at is preferred); both given with different times is refused (invalid_signer_authenticated). Other keys are ignored. Recorded in the audit trail so the signature is attributable. Strongly recommended always, and effectively required when require_verification is none — without it a none token produces a certificate with no evidence of who was authenticated, and the response carries a no_identity_evidence warning.

Response (201 Created):

{
  "sign_url": "https://www.erpdocs.com/signpack/embed/abc123...",
  "signpack_id": 9012,
  "recipient_id": 4567,
  "origin": "https://app.yourcompany.com",
  "require_verification": "email_otp",
  "expires_at": "2026-03-10T14:35:00Z",
  "expires_in": 300,
  "single_use": true
}

Put sign_url in your iframe src (or redirect to it). It is a bearer credential — it dies on first use and cannot be refreshed. A second open returns 404.

require_verification in the response is the effective level after the key's floor is applied. Assert on it rather than assuming your requested value was used.

A non-fatal warnings array may be present. Today the only code is no_identity_evidence, emitted when a token performs no ERPDocs-side verification and carries no signer_authenticated assertion. Log it — it means the resulting signature will have no attribution evidence behind it.

What the signer sees when require_verification is email_otp. The iframe loads the ERPDocs verification step instead of the document: a "send code" button, then a 6-digit code entry. It posts {"type": "ready", "stage": "identity_verification"} to your parent window on load, and {"type": "identity_verified", "method": "email_otp"} when the code is accepted, immediately before the document loads. Neither is a security signal — they exist so you can manage your own spinner.

ERPDocs sign-in shortcuts are hidden in this step, because the ERPDocs login page cannot be framed.

OTP attempt limits for embedded signers. Codes are limited to one per 60 seconds and 3 per 15 minutes per recipient, 10 per hour per IP, and 10 per day per recipient (all sliding windows). A blocked send-verification returns 429 with reason, retry_after seconds and a Retry-After header. The daily cap is reset on every handoff, because an embedded recipient has no invitation or reminder email to fall back on. If a signer is stuck, mint a fresh token.

Lifecycle events (postMessage). When the signing page is loaded inside your iframe, it posts the following messages to the parent window, restricted to your registered origin:

Event type When Payload
ready Signing page loaded signpack_id, recipient_id
complete Signer submitted their signature signpack_id, recipient_id
decline Signer declined to sign signpack_id, recipient_id, reason
redirect About to redirect (if redirect_url was set) signpack_id, recipient_id, redirect_url, event (signing_complete or decline)
error Token is invalid or expired before the signer enters the document signpack_id, recipient_id, event (ttl_expired or already_redeemed), reason

These are for UX only (hiding a spinner, navigating). The authoritative completion signal is the signpack.completed webhook — do not treat a complete postMessage as proof of signing.

If the handoff token is invalid or expired before the signer enters the document, the frame posts an error event with event set to ttl_expired or already_redeemed and a reason field. The host should respond by minting a fresh token, not by navigating.

Marking recipients as embedded. You can also set "embedded": true per role when sending from a template. This suppresses invitation and reminder emails for that recipient from the start:

{
  "recipients": {
    "Signer 1": {"name": "Jane", "email": "jane@example.com", "embedded": true, "suppress_completion_email": true}
  }
}

Calling the embed-token endpoint also marks the recipient as embedded automatically, so reminders stop going out even if you forgot the flag at send time. Set the flag at send time anyway — the invitation email fires as soon as the envelope is sent, so if you only mint the token later, that first email has already gone out with a working standalone link.

Exactly which emails an embedded recipient does and does not get. The rule is that anything carrying a signing link is suppressed, because such a link would let the signer bypass your application's authentication. Everything else still goes out.

Email Sent to an embedded recipient?
Invitation / "please sign" No — suppressed
Reminder (automatic and manual) No — suppressed
Your-turn notification in sequential signing No — suppressed
Initial CC notification No — suppressed
Completion notification Yes
Final signed copy ("Your Signed Documents") Yes

The last two are Yes by default — sending the signer a copy of what they signed is expected practice under ESIGN and eIDAS, and your application may never provide one. Set suppress_completion_email: true on the embed-token request or the recipient assignment to opt out and handle delivery yourself. Note that this email is ERPDocs-branded, so plan for it if you are building a white-labelled flow.

Identity on the Certificate of Completion. The certificate records two independent facts and never collapses them into one:

Configuration Security Level shown Provenance block
require_verification: "none" Host Application Authentication States plainly that ERPDocs did not verify the signer's mailbox, and reproduces your signer_authenticated assertion
require_verification: "email_otp" Email OTP Verified (Embedded) States that you authenticated the signer and that ERPDocs then independently verified mailbox control, with both timestamps

Send signer_authenticated in both cases; without it the certificate can only show the origin. ESRD consent is still collected from embedded signers exactly as from everyone else.

Errors: 404 signpack_not_found, 404 recipient_not_found, 400 origin_required, 400 invalid_origin, 403 origin_not_allowed, 400 invalid_redirect_url (not on the same origin), 400 invalid_require_verification, 403 verification_downgrade_blocked, 400 invalid_signer_authenticated (not an object, method / identifier / at / authenticated_at malformed, reserved method, or at and authenticated_at that differ), 409 not_embeddable (envelope not sent / expired), 409 already_signed, 409 already_declined, 400 invalid_ttl (max_ttl_seconds), 500 embed_token_failed.

This endpoint has its own limit of 60 requests a minute per key.


GET /workspaces

Workspaces in the calling organization. Requires workspace.read.

GET /teams is a legacy alias that hits the same handler and returns the same body — the model was renamed from Team to Workspace after that path shipped. It is kept for existing integrations. New code should use /workspaces.

curl https://www.erpdocs.com/api/v1/workspaces \
  -H "Authorization: Bearer $ERPDOCS_API_KEY"
{
  "data": [
    {"id": 5, "name": "Procurement", "description": "Supplier contracts"},
    {"id": 6, "name": "Legal", "description": null}
  ]
}

Use an id from here as workspace_id on POST /bulk-send.


GET /users

Active members of the calling organization. Use this to find a valid sender_email.

curl https://www.erpdocs.com/api/v1/users \
  -H "Authorization: Bearer $ERPDOCS_API_KEY"
{
  "data": [
    {"id": 301, "email": "priya.raman@acme.example", "full_name": "Priya Raman"},
    {"id": 344, "email": "ops@acme.example", "full_name": "Acme Operations"}
  ]
}

Webhooks

Configure endpoints in Admin › API & Webhooks (/admin/api/webhooks). URLs must be HTTPS. The signing secret is shown once at creation and can be rotated.

Events

These are the ten SignPack events. ERPDocs Verify and Onboard add their own: see Verify webhooks. Every event offered in Admin › API & Webhooks is really sent.

Event Fires when
signpack.sent An envelope goes to Sent (single send, bulk row, or a send from the app)
signpack.completed Every recipient of an envelope has signed
signpack.declined A signer declines, which marks the envelope Declined
signpack.recalled The sender recalls an envelope (all recipients and signatures are reset)
signpack.correction_requested A signer asks for corrections
signpack.cancelled An envelope is voided through POST /signpacks/{id}/void
recipient.viewed A recipient opens the signing link for the first time
recipient.signed One recipient signs (once per signer, before signpack.completed)
email.bounced An email to a recipient bounces
bulk_send.completed A bulk batch reached completed, partial or failed

bulk_send.completed fires for partial and failed too — check status in the payload, not just the event name.

signpack.sent fires once per envelope. A 250-row bulk batch produces 250 signpack.sent deliveries plus one bulk_send.completed. Size your endpoint accordingly, or subscribe only to bulk_send.completed for high-volume batches.

recipient.signed fires per-signer. For a 5-signer sequential envelope you will receive 5 recipient.signed deliveries and one signpack.completed. Subscribe to recipient.signed for real-time per-signer tracking, or signpack.completed only if you just need to know when the whole envelope is done.

signpack.declined fires only when a Signer declines (not CC/Reviewer). recipient.viewed fires for all roles including CC.

Request

POST <your URL>
Content-Type: application/json
User-Agent: ERPDocs-Webhooks/1
X-ERPDocs-Event: signpack.completed
X-ERPDocs-Delivery: 88421
X-ERPDocs-Timestamp: 1772616384
X-ERPDocs-Signature: sha256=6f1c...e2

Every body has the same three top-level keys: event, data, ts.

Payloads

signpack.sent — includes every recipient on the envelope, in no guaranteed order, Signers, Reviewers and CC alike:

{
  "data": {
    "signpack_id": 9012,
    "title": "Acme Supplier T&C — Northwind Ltd",
    "status": "Sent",
    "signing_order": "parallel",
    "sent_at": "2026-03-04T09:14:03.551200",
    "recipients": [
      {"email": "ravi@northwind.example", "name": "Ravi Menon", "role": "Signer"},
      {"email": "priya.raman@acme.example", "name": "Priya Raman", "role": "Signer"}
    ]
  },
  "event": "signpack.sent",
  "ts": "2026-03-04T09:14:03.702441Z"
}

status is always "Sent" on this event. recipients[].role is the ERPDocs recipient role (Signer, Reviewer, CC, Viewer) — the payload does not carry the template role name; call GET /signpacks/{id} for that.

signpack.completed:

{
  "data": {
    "signpack_id": 9012,
    "title": "Acme Supplier T&C — Northwind Ltd",
    "completed_at": "2026-03-04T10:44:02.118773"
  },
  "event": "signpack.completed",
  "ts": "2026-03-04T10:44:02.501993Z"
}

bulk_send.completed carries the batch serialiser — the same object as GET /bulk-send/{batch_id} — in data:

{
  "data": {
    "batch_id": 318,
    "status": "partial",
    "template_id": 41,
    "template_type": "user_template",
    "total_rows": 250,
    "sent_count": 247,
    "error_count": 3,
    "created_at": "2026-03-04T09:20:11.442310",
    "completed_at": "2026-03-04T09:26:48.900117"
  },
  "event": "bulk_send.completed",
  "ts": "2026-03-04T09:26:49.114820Z"
}

Keys are JSON-serialised sorted and without whitespace. Verify against the raw bytes you received — never against a re-serialised copy.

Verification recipe

  1. Read X-ERPDocs-Timestamp and X-ERPDocs-Signature.
  2. Build the signed payload: "{X-ERPDocs-Timestamp}.{raw_request_body}" — the timestamp string, a literal dot, then the raw body bytes.
  3. Compute HMAC_SHA256(secret, signed_payload) and hex-encode it.
  4. Compare, in constant time, against the signature header, which is formatted sha256=<hex>.
  5. Reject if the timestamp is more than 5 minutes old. This is what stops a captured body being replayed.
import hmac, hashlib, time
from flask import Flask, request, abort

app = Flask(__name__)
WEBHOOK_SECRET = "…"          # from Admin › API & Webhooks
MAX_AGE_SECONDS = 300

@app.post("/erpdocs/webhook")
def erpdocs_webhook():
    timestamp = request.headers.get("X-ERPDocs-Timestamp", "")
    signature = request.headers.get("X-ERPDocs-Signature", "")
    raw_body = request.get_data()          # bytes, exactly as received

    try:
        if abs(time.time() - int(timestamp)) > MAX_AGE_SECONDS:
            abort(400, "stale timestamp")
    except ValueError:
        abort(400, "bad timestamp")

    expected = "sha256=" + hmac.new(
        WEBHOOK_SECRET.encode("utf-8"),
        timestamp.encode("ascii") + b"." + raw_body,
        hashlib.sha256,
    ).hexdigest()

    if not hmac.compare_digest(expected, signature):
        abort(401, "bad signature")

    event = request.headers.get("X-ERPDocs-Event")
    delivery_id = request.headers.get("X-ERPDocs-Delivery")
    # Handle, idempotently — de-duplicate on delivery_id.
    return "", 200

Delivery, retries and auto-disable

  • Any 2xx counts as success. Timeout is 10 seconds.
  • Retry backoff: 30s, 120s, 600s — up to 4 attempts total (1 initial + 3 retries).
  • verify.session.completed is retried faster, because its documents can be downloaded for 15 minutes only: 10s, 30s, 60s, 120s, 300s — up to 6 attempts, the last within 9 minutes.
  • 4xx other than 429 is treated as permanent and is not retried. Do not return 400 for a transient problem on your side; return 5xx or 429.
  • After 20 consecutive failures the webhook is auto-disabled. Re-enable it from Admin › API & Webhooks (that also resets the failure counter).
  • Deliveries that cannot be signed are not sent at all. A webhook created before signed delivery existed has no recoverable secret — rotate its secret to make it deliverable.
  • Deliveries are at-least-once. De-duplicate on X-ERPDocs-Delivery.

ERPDocs Verify and Onboard (early access)

Verify checks people and businesses with their consent: documents from DigiLocker and Entity Locker, and GSTIN / Udyam / PAN lookups (each lookup is switched on as its government approval arrives). Onboard takes one person through a whole flow: details, documents, checks, an agreement to sign, and a sealed evidence pack at the end.

Base path /api/v1/verify. Same bearer keys and error envelope as the rest of v1. The differences are below. Sandbox identifiers and the current limits are on /developers/verify.

Words in the app and in the API

The app and the API name the same things differently. The API names are fixed (changing them would break integrations).

In the app In the API What it is
Flow journey (journey_id, /onboard/journeys) The steps a person goes through
A person's onboarding run (/onboard/runs, object: "onboard_run") One person going through one flow
Test mode environment: "sandbox" Sandbox keys. No government system is ever called
Live environment: "live" Live keys
Consent request session (/sessions, object: "verification_session") One DigiLocker or Entity Locker consent
Check verification / request (/requests) Any session or lookup

Before you start

  • Register first. Register your organisation in Verify (Settings › Business). Sandbox keys work once the automated checks pass and you accept the Verify terms. Live keys work after ERPDocs vets your organisation and notifies NeGD. Until then live calls return 403 live_not_enabled (sandbox: 403 client_not_ready).
  • Sources are approved per organisation. Each government source (DigiLocker, Entity Locker, each lookup) is approved for your organisation separately. A live call to a source you haven't been approved for returns 403 source_not_approved; ask ERPDocs to add it (Settings › Business › Government sources). A source ERPDocs doesn't have live yet returns 403 source_not_available.
  • Keys. Create keys in Admin › API & Webhooks and tick the Verify scopes you need (below). Keys are shared with the SignPack API.
  • Plan. The Verify plan is checked on every call. Without it: 402 plan_feature_unavailable.
  • Purpose. Every session and lookup carries a purpose code from the purposes approved for your organisation. Anything else: 403 purpose_not_allowed.
  • Idempotency-Key header on every POST. 8–128 characters: letters, digits and . _ : -. Same key + same body returns the first response and is not billed again (200). Same key + different body: 422 idempotency_key_reused. The first call still running: 409 request_in_progress. A failed upstream call frees the key. Missing or malformed: 400 idempotency_key_required.
  • Allowlists (Verify › Settings › Developers): redirect_url must exactly match a return address you listed (400 redirect_not_allowed), and if you list server IP addresses, calls from anywhere else get 403 ip_not_allowed.

Scopes

Scope What it allows
verify.kyb GSTIN, Udyam and PAN lookups; adding to and removing from the re-verification watchlist
verify.digilocker Creating DigiLocker consent sessions
verify.entitylocker Creating Entity Locker consent sessions
verify.read Reading sessions, checks, usage, sources and the watchlist; cancelling a session
verify.documents Downloading a consented document (single use)
verify.onboard Listing and creating flows, starting runs, reading runs, downloading evidence packs and face images
verify.onboard.data Reading what people typed or uploaded in a run, with full values. Needs verify.onboard too. Every call is logged

Endpoints

Method Path Scope Notes
POST /sessions verify.digilocker or verify.entitylocker (by source) Body {source, documents[], purpose, subject_hint{name, dob, email, mobile, address}, redirect_url, reference_id}. 201 with hosted_url (15 minutes, single use)
GET /sessions/{id} verify.read Status, fields, match results, document availability
GET /sessions/{id}/documents/{doc_id} verify.documents Single use. Afterwards 410 document_purged
POST /sessions/{id}/cancel verify.read A session that has not finished. Finished: 409 invalid_state
POST /gstin · /udyam · /pan verify.kyb Lookups
GET /requests verify.read Your checks. Query reference_id, status, limit (1–100, default 25), page (from 1). Response {object: "list", data, page, has_more}
GET /requests/{id} verify.read Any check, session or lookup
GET /usage verify.read Quota and wallet
GET /sources verify.read Which sources are live for this key
POST /watchlist verify.kyb Add a GSTIN for monthly re-verification. Full list: 409 watchlist_full
GET /watchlist verify.read Your watchlist
POST /watchlist/{id}/remove verify.kyb Stop re-verifying
GET /onboard/journeys verify.onboard Your flows and their steps
POST /onboard/journeys verify.onboard Create a flow (body below). Usually flows are built in the app (Verify › Flows)
POST /onboard/runs verify.onboard Start a run for one person, or get their open run back (resumed). Optional return_url. See Putting a flow on your website
GET /onboard/runs/{id} verify.onboard Status, outcome, reference_id, client_data counts when the flow collects details or files, and link while the run is open
GET /onboard/runs/{id}/data verify.onboard + verify.onboard.data Details, files and acknowledgements the person gave you, with full values, and parties (below). Every call is logged. 410 data_purged once ERPDocs has deleted them
GET /onboard/runs/{id}/files/{key} verify.onboard + verify.onboard.data One uploaded file, with X-Content-SHA256. Can be downloaded again until the data is deleted
GET /onboard/runs/{id}/evidence verify.onboard The sealed evidence PDF (results and hashes only), with X-Content-SHA256. Before the run ends: 409 evidence_not_ready
GET /onboard/runs/{id}/face/{kind} verify.onboard {kind} is selfie or id. See Face check

Paging differs from the SignPack endpoints: Verify lists use limit + page and return has_more, not limit + offset.

Responses carry X-RateLimit-* headers and, on live keys, X-Quota-Remaining and X-Wallet-Balance. Every Verify response has Cache-Control: no-store.

Putting a flow on your website

There are two ways to send people into a flow. Pick by whether you already know the person:

Your situation Use
The person is already a user or record in your system (a vendor in your portal, a new hire in your HR system), and you have a developer 1. A link for each person, made by your server
You don't know them yet, or you have no developer: a "Become a supplier" button, a QR code at a counter or event, a newsletter 2. The flow's public link

1. A link for each person, made by your server.

  1. The person clicks "Verify" (or similar) on your site.
  2. Your server calls POST /onboard/runs with the flow, the person, your own id for them in reference_id, and optionally a return_url:
curl -X POST https://www.erpdocs.com/api/v1/verify/onboard/runs \
  -H "Authorization: Bearer $ERPDOCS_KEY" \
  -H "Idempotency-Key: vendor-8812-onboard-1" \
  -H "Content-Type: application/json" \
  -d '{
    "journey_id": 14,
    "subject": {"name": "Ravi Menon", "email": "ravi@northwind.example", "mobile": "9876543210"},
    "reference_id": "vendor-8812",
    "return_url": "https://portal.northwind.example/onboarding/done",
    "inputs": {"role": "Supplier"}
  }'

subject.name and subject.email are required; mobile, dob, gstin, pan and the other subject keys are optional. inputs answers the flow's start questions, if it has any (400 invalid_inputs otherwise). Send the person's real name and email in subject. Your platform already has them, and your users never see an email from you to get the link: you hand the link over yourself. subject.email is where the person is told the review result (turn it off with Email the person about the result on the review step), how a data rights request finds their runs, and who signs if the flow has an agreement. subject.name names the run for your team. If the person says they are the authorised signatory, their DigiLocker documents are compared with subject.name and with the people named for the business, so another director named on the documents also passes. Placeholder values send email to a stranger.

Sandbox doesn't read real documents. Its made-up documents carry the expected name, so a name check always passes there. To test a failed check, put the word mismatch in subject.name (for example Test mismatch): the document then comes back under another name.

  1. The response is the run plus link, the person's own page (valid 7 days), and resumed (see below). Redirect the person to link straight away, or email it yourself. ERPDocs doesn't email the link for runs started through the API.
  2. Save the run id against your user, not the link. The link is a key to the person's onboarding: treat it like a password and don't keep or show it longer than needed. If you need it again, GET /onboard/runs/{id} returns it while the run is open.
  3. When the person's part is over, their last page has a Back to <your name> button to return_url?run_id=<id>&status=<status>. Those two values are not signed and anyone can change them, so never act on them alone: confirm with the webhook or GET /onboard/runs/{id}.
  4. Follow the run with webhooks (onboard.run.*) or GET /onboard/runs/{id}. Every run response and webhook carries your reference_id.

One open run per person. If a run for the same reference_id is still open on the same flow (any version of it) in the same environment, POST /onboard/runs returns that run with 200, "resumed": true and the same link, instead of starting another. The person keeps their progress, you get no duplicate webhooks, and the flow's paid lookups don't run twice. On a resumed call:

  • Changed subject details and inputs are ignored: the run keeps what it started with. To correct them, cancel the run in the app and start a new one.
  • A new return_url replaces the old one.
  • A finished run (completed, failed, cancelled, expired) is never resumed: the next call starts a new run, as a new check.
  • Without a reference_id every call starts a new run (201, "resumed": false).

Other rules:

  • reference_id is any string up to 128 characters. Use an opaque id from your system, not an email, phone number or PAN: it appears in webhooks, the evidence pack and the run list in the app.
  • return_url must be https and exactly match one of your return addresses (Verify › Settings › Developers › Allowlists), or you get 400 redirect_not_allowed. Up to 1024 characters.
  • Retrying the same request with the same Idempotency-Key returns the same run and link (200). Same key with a different body: 422 idempotency_key_reused.
  • The person's pages can't be shown inside an iframe (frame-ancestors 'none'): the DigiLocker and Entity Locker steps go to the government's own sites, and the face check needs the camera. Redirect, or open a new tab.
  • With a live key, 409 flow_not_live means a check or document source the flow may use isn't live for you yet; the message names it. Sandbox keys always work.
  • link is never in webhooks.

2. The flow's public link. In the app, a flow can have one fixed public link and QR code (Verify › Flows › the flow › Public link). Anyone who opens it enters their name and email, ticks consent and starts their own run; ERPDocs emails them their personal link so they can come back. Runs started this way are always live (to try a flow yourself, use "Try it as the person" in the app).

  • The link doesn't change when people finish, or when you edit and publish a new version of the flow, so printed QR codes keep working. It changes only when you choose "Replace link" (the old one stops working).
  • It closes when you turn it off, the flow is turned off or archived, its end date passes (at most 12 months ahead), or the daily cap is reached (default 50 sign-ups a day, at most 1,000).
  • Someone with an open run on that flow who uses the same email gets their existing link emailed again instead of a new run. Once their run has finished, the same email can start a new one.
  • Because anyone can open it, the public link can only be turned on for a flow with a team review or face check step, so nobody reaches the agreement without your team's approval.
  • The public link carries no reference_id, so it can't tie a run to a user in your system. For logged-in users, use option 1.

Other people on a run (parties in /data). For each other person the flow involves (usually the authorised signatory): name and does_it_themselves (the person said they are that person, or the flow's "does it themselves if" held); identity.ok and identity.documents[] (document, how: on DigiLocker or uploaded, signed_by_issuer, ok, score): whether their ID names them; and, for a signatory, named_on_business_documents (ok, documents): whether the business's own documents (GST certificate signatories, partnership deed partners) list them. ok is true, false or null (couldn't check). These are flags for your team: they never change the run's status or webhooks. A check step whose name points at a question listing several people (such as "Directors, partners and signatories") compares the document with the person who shares it, not with the list.

Flows (POST /onboard/journeys)

Body: name, kind, steps, and optionally name_threshold (name-match pass mark), require_dob_match, and, for an agreement, template_id, signer_role, sender_user_id, sign_prefill. The response is the flow (object: "onboard_journey"), plus warnings when it saved but something is worth a look. The key needs a creating user to attribute the flow to (400 sender_required otherwise).

Brand. A schema 2 flow may name one of your brands (Settings › Brands) in steps.settings.brand_id. The person's pages and the flow's agreement use its colours and logo; the DigiLocker and Entity Locker step keeps its own look. Leave it out for your default brand, which is also used if the brand is deleted later. A brand that isn't yours: 400 brand_not_found.

Flows with conditions (schema 2). steps may be a list or an object:

{"schema": 2,
 "inputs": [{"key": "role", "label": "Role", "kind": "select", "options": ["Staff", "Intern"]}],
 "steps": [
   {"id": "about", "type": "collect", "fields": [
     {"key": "entity", "label": "Business type", "kind": "select", "options": ["Company", "LLP"]},
     {"key": "cin", "label": "CIN", "kind": "text",
      "show_if": {"match": "all", "rules": [{"ref": "data.entity", "op": "is", "value": "Company"}]}}]},
   {"id": "which", "type": "branch", "routes": [
     {"id": "co", "name": "Companies", "when": {"match": "all", "rules": [{"ref": "data.entity", "op": "is", "value": "Company"}]},
      "steps": [{"id": "reg", "type": "upload", "key": "registration", "label": "Incorporation certificate", "doc_kind": "registration"}]}],
    "otherwise": {"steps": [{"id": "stop", "type": "end", "outcome": "stop", "message": "We onboard companies only."}]}},
   {"id": "agree", "type": "sign", "template_id": 12, "signer_role": "Vendor", "sender_user_id": 3, "prefill": {}}]}
  • Any step may carry when; a field may carry show_if / require_if. Conditions read answers (data.*), start questions (input.*), whether a file was uploaded (file.*) and earlier check outcomes (check.<step id>). Never the contents of a DigiLocker or Entity Locker document, never Aadhaar. An answer to a hidden field is never stored.
  • branch: routes are checked top to bottom, the first that fits wins, otherwise catches the rest; routes rejoin afterwards. A route can't be decided by a question where people tick several (multiselect).
  • end: complete, review (to your team) or stop (the person sees message). sign carries the agreement; with schema 2 the flow-level template_id is refused.
  • A session step may set "on_decline": "continue": a declined consent records check.<id> = declined and the run carries on (for example to an upload asked only then).
  • A session step the person does themselves may set "upload_instead": true: when a needed document isn't in their locker they can upload it instead (GST certificate, certificate of incorporation, Udyam certificate, PAN card, driving licence, degree certificate). The upload is shown to your team as not from the locker, and check.<step id> = uploaded. Either way they can share again for just the missing documents (3 tries in all) or stop (stopped_at.status = "documents_missing", webhook onboard.run.failed).
  • A details field may carry fill_from: 1 to 3 refs such as "doc.gst_reg06_legal_name", "doc.gstin" or "doc.pan_pan". The first one read from a file the person uploaded (earlier in the flow, or on the field's own page) fills in the field; the person confirms or changes it. "doc.gst_reg06_signatories" on a text field offers the people named on the GST certificate as choices. A changed ID number (PAN, GSTIN, CIN, LLPIN, Udyam) needs a short reason, which your team sees. Refused when saving: refs ERPDocs can't read, the wrong kind of question, a field that decides which documents are asked, a list, your team's own questions, and anything from DigiLocker or Entity Locker. Without fill_from, nothing read from a file becomes an answer.
  • Optional on any step: stage (1–40 characters, the stage name in the person's progress bar) and why (up to 200 characters, shown beside the step as "Why we ask"). A collect, upload or documents step may set "editable": false so the person can't reopen it. A notice step may carry summary (up to 400 characters), shown as "In short" above the full text; the acknowledgement's hash covers the title, summary and text.
  • A session step's match can compare answers with the document: name, pan, cin, gstin, udyam and, from Entity Locker, address (passes at 50 shared words out of 100). Only the result is kept. signatory is refused: Entity Locker's GST certificate doesn't list signatories.
  • Invalid flows return 400 invalid_flow with error.problems: [{where, field, message, level}] (where is a step id, or <step id>/<field key>); too large: 413 invalid_flow. Warnings come back on the 201 as warnings and don't block saving.
  • Limits: 40 steps, 15 on one path, 6 routes per branch, branches 2 deep, 64 paths, 10 start questions, 256 KB.

Aadhaar is always optional: {"type": "ADHAR", "required": true} returns 400 aadhaar_cannot_be_required. You receive aadhaar_masked (last 4 digits), the issuer-signature check and match results only. Never the document, never demographics.

Face check step

{"type": "face", "reference": "upload", "deliver_images": false, "notify_person": true}, as the last step, after a DigiLocker or Entity Locker step. The person uploads a photo ID (PAN card, driving licence, passport or voter ID; Aadhaar is refused) and takes a live video selfie (Amazon Rekognition Face Liveness, Mumbai region). The selfie is compared with the uploaded ID only; photos inside DigiLocker documents are never read by a machine.

  • Results above the thresholds pass. Borderline results, all tries failed and declines move the run to review (webhook onboard.run.review) until your team approves or rejects it in the app. Reviews expire after 72 hours.
  • outcome.face gives id_type, decision, review_reason, reject_reason, images_available and per try result, liveness and similarity (0–100). No images, no IP addresses.
  • notify_person (default true) emails the person when the check goes to review and after the decision, in your name, without scores or reasons.
  • Billed per try. Sandbox keys simulate the selfie.
  • GET /onboard/runs/{id}/face/{selfie|id} works only when the flow has deliver_images: true. Single use JPEG with X-Content-SHA256. 410 image_gone once handed over or deleted (ERPDocs deletes its copy after the download, or 72 hours after capture); 409 in_review until the review is decided; 403 not_enabled otherwise. After download you hold the image under your own privacy policy.

What you get back, and for how long

From a DigiLocker or Entity Locker document. ERPDocs hands documents and their details over during the check and does not keep them afterwards (DigiLocker terms).

  • For 15 minutes after the fetch, GET /sessions/{id} returns results[].details = "full", details_until, and fields with everything read from the document (for example name, dob, pan, gstin, legal_name, address, cin, udyam, signatories) next to the masked identifiers. Each such response is logged as a hand-over. Save what you need in your own system then, for your declared purpose only. The document itself downloads once from /sessions/{id}/documents/{doc_id} in the same window.
  • After that ERPDocs deletes the details: details = "masked", and fields keeps masked identifiers only (pan_masked, dl_number_masked, gstin_masked such as 29ABCDE****F1Z5, cin_masked, udyam_masked) plus status, category and dates.
  • Webhooks always carry the masked form. On verify.session.completed, call GET /sessions/{id} straight away.
  • In an onboarding, each DigiLocker or Entity Locker step is a session like any other. It fires verify.session.completed as soon as the documents are fetched, with the run's reference_id and onboard: {run_id, step_id}; the run lists its session ids in verifications. Download the documents then. onboard.run.completed comes when the person finishes, often after the 15 minutes have passed, and never carries documents.
  • One download in all. If someone on your team opens a document with View once on the run page, that is its single hand-over: GET /sessions/{id}/documents/{doc_id} then returns 410 document_purged. A download through the API closes View once the same way.

From a GSTIN, Udyam or PAN lookup. The response to POST /gstin (or /udyam, /pan) carries the register's reply in result (GSTIN and Udyam: legal_name, trade_name, address, constitution …; PAN never returns the name, only the match score) with details = "full" and details_until (15 minutes). The same body comes back from GET /requests/{id} and an Idempotency-Key replay until then. Afterwards result keeps found, status, identifier (masked: 27ABCDE****F1Z0, UDYAM-MH-01-***0001, ABCDE****F), pan_type, match and details = "masked". In an onboarding the register's reply is never shown to the person; the result is stored on the run.

From an onboarding. Details and files the person gave are kept encrypted for your organisation's retention setting, then deleted (410 data_purged). Your organisation chooses the term, from 15 minutes to 8 years (Settings → Business and compliance); deletion happens within 10 minutes of the term ending. If your organisation uses hand-over retention, ERPDocs deletes them the time you chose after your first full download from /data, and at your limit after the run ends if you never take them. With a short term, fetch /data as soon as the run ends.

The evidence pack (GET /onboard/runs/{id}/evidence) holds results and hashes, never a government document, whether or not its 15 minutes have passed. For each document it states the type, issuer, masked identifiers, match result, issuer signature check and the document's SHA-256. To show which file was checked, compare the SHA-256 of the copy you downloaded with the one in the pack.

Limits

Limit Error
Calls per minute, per key family (lookups, sessions and run starts, reads; see /developers/verify for the numbers) 429 rate_limited
Same identifier looked up too often in 24 hours 429 subject_limit
More than 5 consent sessions for one person in a day 429 consent_limit
Daily and monthly units (your plan or contract) 429 quota_exceeded
Too many calls in flight at once 429 concurrency_limit
Prepaid wallet too low 402 insufficient_balance (balance_minor, needed_minor)
Government source at capacity 503 upstream_throttled

Every 429 and 503 carries Retry-After. Our limiter fails closed: if it can't be reached you get 503 limiter_unavailable, never an unchecked call. Failed government calls are not billed.

Verify error codes

These are in addition to the v1 common codes (missing_credentials, invalid_credentials, insufficient_scope, not_found and so on).

Code HTTP Meaning
plan_feature_unavailable 402 Your plan doesn't include Verify
insufficient_balance 402 Wallet too low
client_not_registered 403 This organisation hasn't registered for Verify
client_not_ready 403 Sandbox: finish the onboarding checks first
live_not_enabled 403 Live: not vetted yet (client_status)
client_suspended 403 Verify access is suspended
ip_not_allowed 403 Caller's IP isn't on your allowlist
source_not_available 403 ERPDocs doesn't have this source live (source)
source_not_approved 403 This source isn't approved for your organisation yet
purpose_not_allowed 403 Purpose not approved for you, or not allowed for this source
idempotency_key_required 400 Missing or malformed Idempotency-Key
idempotency_key_reused 422 Same key, different body
request_in_progress 409 The first call with this key is still running
invalid_json 400 Body isn't a JSON object
invalid_source 400 source isn't digilocker or entitylocker
invalid_documents / invalid_document_type 400 Bad documents list or an unknown document type
aadhaar_cannot_be_required 400 Aadhaar marked required
invalid_subject_hint 400 subject_hint isn't an object of allowed keys
redirect_not_allowed 400 redirect_url or return_url isn't https or not on your allowlist
invalid_identifier 400 GSTIN, Udyam or PAN fails format or checksum
invalid_paging 400 limit or page isn't an integer
invalid_state 409 The session or run can't do that now (for example already finished)
document_purged 410 Document already downloaded or deleted
watchlist_full 409 Watchlist at its size limit
journey_not_found 404 No active flow with that id
journey_archived 409 The flow is archived
flow_not_live 409 Live key, but a source the flow uses isn't live for you (message names it)
invalid_subject 400 subject missing, or no name / email
invalid_inputs 400 inputs doesn't match the flow's start questions
invalid_flow 400 / 413 Flow definition invalid (problems) or too large
steps_required / invalid_steps 400 Flow has no steps, or bad steps
invalid_name / invalid_kind 400 Bad flow name or kind
invalid_signer_role / invalid_prefill / template_not_found / agreement_field_unfilled 400 The flow's agreement step is set up wrong
sender_required 400 The key has no creating user to attribute the flow to
brand_not_found 400 steps.settings.brand_id isn't one of your brands
evidence_not_ready 409 Evidence pack is made when the run ends
data_purged 410 Details and files for this run were deleted (purged_at)
not_enabled / in_review / image_gone 403 / 409 / 410 Face images (see Face check)
rate_limited / subject_limit / consent_limit / quota_exceeded / concurrency_limit 429 See Limits
upstream_throttled / upstream_unavailable / upstream_timeout 503 Government source busy or down. Not billed; retry after Retry-After
limiter_unavailable / service_unavailable 503 ERPDocs Verify temporarily unavailable; retry

Verify webhooks

Subscribe in Admin › API & Webhooks, like the SignPack events. Same headers, same signing and the same retries (Webhooks). data holds the object shown; it never carries what a person typed, uploaded or shared. For those, call the API.

Event Fires when data
verify.session.completed A consent session finished and documents were fetched session (object: "verification_session", masked fields), plus onboard: {run_id, step_id} when the session is a step of an onboarding
verify.session.failed A session failed (upstream error, document missing …): see error_code session
verify.session.expired The person didn't finish within 15 minutes session
verify.session.consent_denied The person said no on DigiLocker or Entity Locker session
verify.reverification.changed A watched GSTIN's status changed at the monthly re-check watch (object: "watch") plus previous_status, request_id
onboard.run.completed A run finished run (object: "onboard_run")
onboard.run.mismatch A match (name, PAN, GSTIN …) failed, or your team rejected the run (stopped_at.status = "review_rejected") run
onboard.run.failed A run stopped for good (for example documents_missing) run
onboard.run.cancelled Your team cancelled the run (stopped_at.status = "cancelled_by_client"), or the person withdrew ("withdrawn_by_person") run
onboard.run.review The run needs your team's decision (for example a face check) run
onboard.run.paused The person said no to a step. Not final: they can still continue with the same link until it expires run
onboard.run.changes_requested Your team sent it back to the person for changes run
onboard.run.expired The run's link ran out before the person finished run
client.suspended ERPDocs suspended your Verify access {client_id, reason}
client.reinstated Access restored {client_id, status}
client.terminated Access ended {client_id}

Timing. verify.session.completed starts the documents' 15-minute window. It is retried after 10, 30, 60, 120 and 300 seconds, so even a delivery that needed every retry leaves a few minutes: download in your webhook handler, not in a later job.

onboard.run.* example:

{
  "data": {
    "object": "onboard_run",
    "id": "5f0c2a9e-3b1d-4f7a-9a51-0e6c1f2d7b44",
    "journey_id": 14,
    "environment": "live",
    "status": "completed",
    "reference_id": "vendor-8812",
    "verifications": ["c1d9…", "8a2f…"],
    "outcome": {"skipped": []},
    "signpack_id": 9012,
    "evidence": {"available": true, "sha256": "4be1…"},
    "client_data": {"fields": 6, "files": 2, "deleted": false, "path": "/api/v1/verify/onboard/runs/5f0c2a9e-…/data"},
    "created_at": "2026-11-02T09:14:03Z",
    "expires_at": "2026-11-09T09:14:03Z",
    "completed_at": "2026-11-02T09:40:51Z"
  },
  "event": "onboard.run.completed",
  "ts": "2026-11-02T09:40:52.118773Z"
}

Flow automations ("Call your system"). Separately from these webhooks, a flow's automation can post to an endpoint you add and verify in Verify › Settings › Developers. ERPDocs first sends {"event": "endpoint.verify", "challenge": "…"}; answer 200 with the challenge in the body. After that it posts onboard.invited, onboard.started, onboard.shared, onboard.submitted, onboard.approved, onboard.rejected, onboard.stopped, onboard.completed or onboard.expiring, as the flow's automations say:

{"event": "onboard.submitted", "delivery": 3311, "created": "2026-11-02T09:31:00Z", "environment": "live",
 "data": {"run_id": "5f0c2a9e-…", "reference_id": "vendor-8812", "flow_id": 14, "flow_version": 3,
          "status": "review", "checks": {"pan": "pass"}, "tags": ["priority"]}}

onboard.shared ("When they share documents") is sent once for each DigiLocker or Entity Locker share and adds verification_id: call GET /sessions/{verification_id} and download the documents within 15 minutes. It can only call your system.

Same signature headers as above, user agent ERPDocs-Onboard/1, a 10-second timeout, retries after 30, 120 and 600 seconds on 5xx and 429 (onboard.shared: after 10, 30, 60, 120 and 300 seconds). environment is sandbox or live, as in the other webhooks (before 3 November 2026 it said test instead of sandbox).

Limitations / not yet supported

Stated plainly so you do not design around something that does not exist.

  • Raw-PDF upload and send works via POST /signpacks when the uploaded PDF contains anchor tags. Without anchor tags, use embedded placement (your user places the fields in an iframe) or a template.
  • Embedded placement is not for every browser. Desktop Chrome, Edge, Brave and Firefox only; Safari and iOS are not supported for the embedded pages. The placement screen offers four field types (signature, name, date signed, text), at most 50 pages and 20 signers per document, and cannot edit the document itself. There is no API to set field coordinates.
  • Placement drafts are never deleted for you. They stay until you send or delete them (DELETE /signpacks/{id}, API-created drafts only).
  • DSC in a frame: a DSC signer continues in a new browser tab; the placement frame never runs the token itself. Windows or Mac only.
  • DSC on raw-PDF sends: set signature_method: "dsc" per recipient on POST /signpacks. No DSC via bulk send. Templates whose roles require DSC can hit dsc_rule_violation per row when bulk-sent. Do not build DSC volume on this API.
  • No SDKs. HTTP and JSON only. No official client library in any language.
  • Sandbox does not simulate signing. Sandbox keys are read-only for sends; there is no way to fake a completed envelope or a signpack.completed webhook.
  • No template creation, update or field coordinates over the API. Templates, roles and fields are UI-only; fields on an uploaded document are placed by a person in the placement screen.
  • No envelope recall or correction endpoints. Those are UI-only. Voiding is available via POST /signpacks/{id}/void.
  • No batch cancel. Once queued, a batch runs to a terminal status.
  • No cursor pagination. SignPack lists use limit / offset; Verify lists use limit / page with has_more.
  • Ten SignPack webhook events (listed under Webhooks), plus the Verify and Onboard events. There is no envelope-expired, document or user lifecycle event.
  • No webhook replay endpoint. Deliveries are visible in Admin › API & Webhooks; there is no API to re-request one.

Brand Profiles

An organization can hold multiple brand profiles — each one controls the visual identity applied to SignPacks (email templates, signing-UI colours, logo, footer text). Exactly one profile may be marked is_default: true. Brands can also be assigned to team workspaces and templates in the app, and the API can choose one per envelope by passing brand_id on send.

Branding resolves in this order: an explicit brand_id on the send call, then the template's brand, then the team workspace's brand, then the organization's default profile, then ERPDocs system defaults. The result is fixed on the envelope at send: changing a default, workspace or template later affects new envelopes only, and every email, reminder and signing page of an envelope uses the same brand.

Brand profiles are also manageable from the admin UI at Admin › Brands (/admin/brands): create, edit, delete and set-default.

All brand endpoints are scoped to the calling organization. A brand_id belonging to another org returns 404, not 403.

GET /brands

List all brand profiles in the calling organization. Scope: brand.read.

curl https://www.erpdocs.com/api/v1/brands \
  -H "Authorization: Bearer $ERPDOCS_API_KEY"
{
  "data": [
    {
      "id": 1,
      "name": "Acme Default",
      "is_default": true,
      "logo_path": "s3://acme-documents/vault/2/1788590518_acme-logo.png",
      "logo_url": "https://www.erpdocs.com/brand-logo/eyJ0eXAiOi...",
      "primary_color": "#0891b2",
      "email_sender_name": "Acme Legal",
      "reply_to_email": "legal@acme.example",
      "email_header_html": null,
      "email_footer_html": null,
      "created_at": "2026-02-01T10:00:00Z"
    },
    {
      "id": 7,
      "name": "Northwind Sub-brand",
      "is_default": false,
      "logo_path": null,
      "logo_url": null,
      "primary_color": "#0e7490",
      "email_sender_name": "Northwind Contracts",
      "reply_to_email": "contracts@northwind.example",
      "email_header_html": "<div>Northwind</div>",
      "email_footer_html": null,
      "created_at": "2026-02-15T09:30:00Z"
    }
  ]
}

Brand profile fields

Every brand endpoint except DELETE returns the profile wrapped in a data key.

Field Writable Notes
id no
name yes Required on create. Cannot be set to an empty string.
primary_color yes Hex colour, e.g. #0891b2. Applied to email headings and the signing UI.
email_sender_name yes Display name on outbound mail. Falls back to ERPDocs.
reply_to_email yes Reply-To on outbound mail.
email_header_html yes Injected above the email body.
email_footer_html yes Injected below the email body.
logo_path limited Opaque storage identifier, not directly fetchable. Accepts only the logo_path of one of your own brands (to reuse a logo on another profile) or null (to remove the logo). Anything else is 400 invalid_brand. To add a new logo, upload it as logo.
logo_url no Derived, permanent public URL for logo_path, served by ERPDocs at /brand-logo/<token>. Returns 404 once the brand or its logo is removed. null when no logo is set.
is_default no Set via POST /brands/{id}/set-default, not via PATCH.
created_at no

There is no updated_at field.

To upload a logo, send the request as multipart/form-data with a logo file part instead of JSON. All other fields are sent as ordinary form fields alongside it. The logo must be a PNG, JPEG or WebP image up to 2 MB (SVG is not accepted). ERPDocs stores it as a PNG, trims empty margins and scales it down to 1600 px on its longest side. Anything else is 400 invalid_logo, and the brand is left unchanged. Best results: a horizontal logo on a transparent or white background, at least 480 px wide.

POST /brands

Create a new brand profile. Scope: brand.write. Blocked for sandbox keys.

curl -X POST https://www.erpdocs.com/api/v1/brands \
  -H "Authorization: Bearer $ERPDOCS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
        "name": "Northwind Sub-brand",
        "primary_color": "#0e7490",
        "email_sender_name": "Northwind Contracts",
        "reply_to_email": "contracts@northwind.example"
      }'

To create the profile with a logo in one call, use multipart/form-data:

curl -X POST https://www.erpdocs.com/api/v1/brands \
  -H "Authorization: Bearer $ERPDOCS_API_KEY" \
  -F "name=Northwind Sub-brand" \
  -F "primary_color=#0e7490" \
  -F "email_sender_name=Northwind Contracts" \
  -F "reply_to_email=contracts@northwind.example" \
  -F "logo=@northwind-logo.png"

201 Created:

{
  "data": {
    "id": 7,
    "name": "Northwind Sub-brand",
    "is_default": false,
    "logo_path": "s3://acme-documents/vault/2/1788590519_brand_northwind-logo.png",
    "logo_url": "https://www.erpdocs.com/brand-logo/eyJ0eXAiOi...",
    "primary_color": "#0e7490",
    "email_sender_name": "Northwind Contracts",
    "reply_to_email": "contracts@northwind.example",
    "email_header_html": null,
    "email_footer_html": null,
    "created_at": "2026-02-15T09:30:00Z"
  }
}

The first brand profile created for an org is automatically marked is_default: true.

Brand names must be unique within the organization. Uploading a logo requires the API key to have a recorded creator, because the file is stored against that user's vault; a key with no creator is rejected with 400 invalid_brand.

Errors: 400 brand_name_required, 409 brand_name_exists, 400 invalid_brand, 400 invalid_logo, 500 logo_upload_failed, 500 brand_create_failed.

GET /brands/{id}

Read one brand profile. Scope: brand.read.

curl https://www.erpdocs.com/api/v1/brands/7 \
  -H "Authorization: Bearer $ERPDOCS_API_KEY"
{
  "data": {
    "id": 7,
    "name": "Northwind Sub-brand",
    "is_default": false,
    "logo_path": null,
    "logo_url": null,
    "primary_color": "#0e7490",
    "email_sender_name": "Northwind Contracts",
    "reply_to_email": "contracts@northwind.example",
    "email_header_html": null,
    "email_footer_html": null,
    "created_at": "2026-02-15T09:30:00Z"
  }
}

Errors: 404 brand_not_found.

PATCH /brands/{id}

Update an existing brand profile. Scope: brand.write. Blocked for sandbox keys. Only the fields you send are updated.

is_default cannot be changed here — use POST /brands/{id}/set-default.

curl -X PATCH https://www.erpdocs.com/api/v1/brands/7 \
  -H "Authorization: Bearer $ERPDOCS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
        "name": "Northwind Contracts Brand",
        "primary_color": "#059669"
      }'

To replace the logo, send multipart/form-data with a logo file part.

{
  "data": {
    "id": 7,
    "name": "Northwind Contracts Brand",
    "is_default": false,
    "logo_path": null,
    "logo_url": null,
    "primary_color": "#059669",
    "email_sender_name": "Northwind Contracts",
    "reply_to_email": "contracts@northwind.example",
    "email_header_html": null,
    "email_footer_html": null,
    "created_at": "2026-02-15T09:30:00Z"
  }
}

Sending "primary_color": "" (or any writable string field as an empty string) clears that field to null.

Errors: 404 brand_not_found, 400 brand_name_required, 409 brand_name_exists, 400 invalid_brand, 400 invalid_logo, 500 logo_upload_failed, 500 brand_update_failed.

DELETE /brands/{id}

Delete a brand profile. Scope: brand.write. Blocked for sandbox keys.

The default profile can be deleted. No other profile is promoted: the organization uses ERPDocs system defaults until a new default is set. There is no error for deleting the default.

Envelopes, templates and workspaces that used the deleted profile fall back to the default (template → workspace → org default → ERPDocs). Signed PDFs and certificates already issued are unchanged. New sends that still pass the deleted id are rejected with 404 brand_not_found.

curl -X DELETE https://www.erpdocs.com/api/v1/brands/7 \
  -H "Authorization: Bearer $ERPDOCS_API_KEY"

Note the response shape differs from the other brand endpoints — it is not wrapped in data:

{"success": true, "deleted_id": 7}

Errors: 404 brand_not_found, 500 brand_delete_failed.

POST /brands/{id}/set-default

Mark a brand profile as the org's default. Scope: brand.write. Blocked for sandbox keys.

This clears is_default on every other profile in the org and sets it on the target. The default profile is applied to all SignPacks that do not specify a brand_id at send time.

curl -X POST https://www.erpdocs.com/api/v1/brands/7/set-default \
  -H "Authorization: Bearer $ERPDOCS_API_KEY"
{
  "data": {
    "id": 7,
    "name": "Northwind Contracts Brand",
    "is_default": true,
    "logo_path": null,
    "logo_url": null,
    "primary_color": "#059669",
    "email_sender_name": "Northwind Contracts",
    "reply_to_email": "contracts@northwind.example",
    "email_header_html": null,
    "email_footer_html": null,
    "created_at": "2026-02-15T09:30:00Z"
  }
}

Errors: 404 brand_not_found, 500 brand_set_default_failed.


Changelog

v1 — initial public surface. Everything in this document is the first released version of the v1 API. There are no earlier versions and no deprecated endpoints, fields, scopes or webhook events to migrate away from. Breaking changes will be published here.

v1.1 — Added POST /signpacks (raw-PDF anchor-tag sending). Added brand profile management endpoints (GET/POST /brands, GET/PATCH/DELETE /brands/{id}, POST /brands/{id}/set-default) with brand.read and brand.write scopes, and brand_id as an optional send parameter on POST /templates/{id}/send and POST /signpacks.

v1.1.1 — brand profile documentation corrections. No API behaviour changed except the additive logo_url field. This page previously documented the brand profile field names incorrectly. If you built against the earlier names, update them:

Previously documented Actual field
logo_url (writable) logo_path (writable, opaque) — logo_url now also exists as a read-only derived URL (permanent since v1.2)
email_from_name email_sender_name
email_reply_to reply_to_email
updated_at does not exist

Because the API ignores unknown keys, a request sending email_from_name was accepted with a 200 and that field was silently discarded. Check any integration that sets brand fields.

Also corrected on this page:

  • Brand responses are wrapped in a data key (except DELETE, which returns {"success": true, "deleted_id": N}). The earlier examples showed bare objects.
  • email_header_html and email_footer_html were undocumented and are writable.
  • Deleting the default profile is allowed. The previously documented 409 cannot_delete_default error does not exist and was never returned. (Since v1.2 it no longer promotes another profile — see below.)
  • Passing a brand_id for a deleted profile returns 404 brand_not_found; it does not silently fall back to the default.
  • Documented the previously missing error codes: file_required, invalid_brand_id, brand_name_required, brand_name_exists, invalid_brand, logo_upload_failed, brand_create_failed, brand_update_failed, brand_delete_failed, brand_set_default_failed.

v1.2 — brand fixed per envelope. Envelopes now keep the brand resolved at send (brand_id → template → workspace → org default → ERPDocs). Previously the brand was looked up live, so changing the default rebranded envelopes already sent, including completed ones. DELETE /brands/{id} no longer promotes the oldest profile when the default is deleted, and envelopes that used a deleted profile fall back to the default. Legacy single-brand org settings are no longer consulted. logo_url is now a permanent ERPDocs link instead of a presigned storage URL that expired after an hour.

v1.1.1 — reminder recipient gate. POST /signpacks/{id}/remind now returns 409 no_remindable_recipients when no selected recipient can be emailed — most commonly when every pending recipient is an embedded signer. It previously returned {"queued": true} and then sent nothing, because the worker filters embedded signers out. If you relied on a 200 from this endpoint as confirmation that mail went out, note that it never was that: queued: true only ever meant the job was accepted.

v1.3 — documentation audit (2 November 2026). One behaviour change: a 500 response no longer copies internal exception text into message; it carries a fixed message and the same code as before. Corrected or added on this page:

  • 402 plan_feature_unavailable (every endpoint, when the plan stops including API access) and the send-time 402 plan_upgrade_required and 402 plan_limit_reached.
  • The 60-a-minute limit on POST /signpacks/{id}/recipients/{rid}/embed-token, and its missing error codes (signpack_not_found, recipient_not_found, invalid_redirect_url, invalid_signer_authenticated).
  • POST /signpacks: anchor tags for company, job title, phone and date signed, the check / attach aliases, and the missing error codes. {{date:Role}} was wrongly described as the date signed: it is a date the signer fills in. The date stamped at signing is {{datesigned:Role}}.
  • Prefillable field types now include company, job_title and phone; dropdown, radio and date signed can't be prefilled.
  • brand_id in envelope responses; logo_url examples show the ERPDocs link.
  • Verify and Onboard: the app-to-API word list, the verify.onboard.data scope, GET /onboard/runs/{id}/data and /files/{key}, POST /onboard/journeys, how to put a flow on your website, Verify paging, the Idempotency-Key characters, the consent limit, the full Verify error table, and all 15 Verify and Onboard webhook events with their payloads.

v1.4 — Onboard run links (3 November 2026). POST /onboard/runs returns the open run for the same reference_id (200, "resumed": true, same link) instead of starting a second one, and every response now carries resumed. An Idempotency-Key retry now includes link (it was missing). GET /onboard/runs/{id} includes link while the run is open. New optional return_url: the person's last page offers a way back to your site. Flow-automation messages say environment: "sandbox" instead of "test".

v1.5 — other people on a run (3 November 2026). GET /onboard/runs/{id}/data adds parties: for the authorised signatory (or any other person on the flow) who they are, whether their ID names them and whether the business's documents list them. Additive; nothing removed or renamed.

v1.6 — shared documents reach your system in time (7 November 2026). verify.session.completed for an onboarding step adds onboard: {run_id, step_id} and is retried after 10, 30, 60, 120 and 300 seconds. New webhook onboard.run.expired. New flow automation event onboard.shared with verification_id. Additive; nothing removed or renamed.

v1.7 — embedded placement (20 November 2026). Additive. POST /signpacks accepts placement=true (with origin, allowed_fields, redirect_url) and returns a Draft with a one-time placement_url. New: POST /signpacks/{id}/placement-url, POST /signpacks/{id}/send and DELETE /signpacks/{id}; slots and fields_placed on placement drafts in GET /signpacks and GET /signpacks/{id}; the erpdocs-embed.js helper and the placement frame events. Parameters origin, allowed_fields and redirect_url sent without placement=true are ignored and now come back as a placement_params_ignored warning. signer_authenticated takes its timestamp as at; authenticated_at (shown by earlier revisions of this page) is accepted as another name for it, and both with different times is refused. Placement drafts: recipients keys that are not kept at upload come back as a placement_recipient_fields_ignored warning; the sent frame event carries recipients, sign_after_status and sign_after_error (always a code); draft_closed carries reason (sent / deleted); a sign_after sent from the browser always uses the ERPDocs email code; the frame's send checks the key like the API (scope, plan, sandbox). email_queue_failed now says the envelope was sent and points to remind; it no longer carries internal error text.