Developers

Interactive Sign API Contract

This file is generated by _tools/gen_api_contract.py from the handlers in sites/InteractiveSign/api/v1. Do not edit it by hand: change the ' api: comment above the route in the handler and run the script again. The QA suite fails when this file is not current.

Base URL: https://sign.interactivelion.com/api/v1. Every request and response body is JSON (UTF-8) unless a route says it returns a PDF. Dates are ISO 8601 in UTC. Ids are GUIDs.

Authentication

Every route except the public verify route and the signing page routes is signed with the application's API key, using an HMAC signature that covers the method and path because this API is REST:

  • X-IS-Key: the key id, isk_test_... or isk_live_....
  • X-IS-Timestamp: Unix time in seconds. Refused when more than 300 seconds from the server's clock.
  • X-IS-Nonce: a random value, at most 100 characters, never reused with the same key. A repeated nonce is refused, so a captured request cannot be replayed.
  • X-IS-Signature: lowercase hex HMAC-SHA256, keyed with the key's secret, over these bytes: the timestamp, a line feed, the nonce, a line feed, the method in capitals, a line feed, the path and query exactly as sent (for example /api/v1/envelopes?status=Sent), a line feed, then the raw request body bytes (nothing for an empty body).

A test key creates only test envelopes. A live key creates live envelopes, which count toward the account's plan.

Idempotency

POST /envelopes and POST /bulk-sends accept an Idempotency-Key header (or an idempotencyKey body field), at most 100 characters. A retry with the same key and the same body returns the first response with the header X-IS-Idempotent-Replay: true and creates nothing. The same key with a different body answers 409 idempotency_mismatch.

Recipient Roles

Each recipient in POST /envelopes has a role. There are three roles.

  • signer is the default. A signer fills in fields and signs. Signers are numbered signer1, signer2 and so on in the order given, and that number is the default tagRole that text tags match.
  • approver reviews the document and approves it without signing. An approver takes a turn in the signing order like a signer.
  • viewer receives the completed copy by email and takes no action. cc is accepted as another name for viewer, the name Dropbox Sign uses, and the envelope reports the role as viewer. Viewers receive the completed copy whatever the delivery mode, including embedded envelopes.

Any other role is refused with 422 invalid.

Errors

Errors answer {"error": {"code": "...", "message": "..."}}. The message is a plain sentence that can be shown to a developer. Codes: unauthorized (401), not_found (404, also for anything that belongs to another account, so another account's ids cannot be discovered), invalid (422), card_number_found (422), wrong_state (409), link_used (409), idempotency_mismatch (409), refused (403), plan_limit_reached (403), feature_not_in_plan (403, the account's plan does not include SMS codes or bulk send), domain_not_allowed (403), invalid_file_type (422, an attachment that is not a PDF, PNG or JPEG), too_large (413), rate_limited (429), server_error (500).

Text Tags

When fieldPlacement is tags (the default), fields come from Dropbox Sign style text tags printed in the PDF, so a product moving from Dropbox Sign keeps its documents: [type|req|signerN] or [type|noreq|signerN], optionally with |label and |id. Types: sig or signature, initial or initials, date, text, check or checkbox, name or fullname, email, company, title. signerN matches a recipient's tagRole (by default the n-th signer). The tag text is painted over in the final document. The field starts at the tag's top left corner, takes a minimum size scaled to the tag's text, and stops before the next tag so fields never overlap.

Further Options of POST /envelopes

Every option below is additive: a request that leaves them out behaves as it did before these options existed.

  • SMS codes: a recipient with verification sms_code and a phone in international form (for example +15551234567; spaces, dots, dashes and brackets are dropped) is sent a six digit code by SMS when they open the document, with the same limits and lockout as email codes. Refused with 403 feature_not_in_plan when the account's plan does not include SMS codes. Each SMS sent counts as one sms.sent usage event.
  • Attachments: a signer may carry attachments, a list of at most ten objects with label (required), description and required (default true). The signer uploads a PDF, PNG or JPEG for each one before signing; required ones must be uploaded before Finish is accepted.
  • Form fields: fieldPlacement acroform makes envelope fields from the PDF's own form fields, by name. formFields maps a form field name to a tag role ("signer2") or to {"role", "type", "required", "label"}. A form field not named goes to the first signer. Text and choice fields become text, check boxes stay check boxes and signature fields become signature fields; radio buttons and push buttons are skipped. The form itself is removed from the document, so only Interactive Sign's fields remain.
  • Language: language en (the default) or es sets the language of the signing page, the landing page and the emails. The certificate stays in English. The application setting default.language changes the default.
  • Reassign: allowReassign true (default false, or the application setting default.allowReassign) lets a signer or approver of an email or link delivery envelope hand their place to another person, with a reason. It is refused for embedded delivery, and an application default does not apply there.

Health

GET /health

Public. Answers {"status": "ok", "database": ..., "environment": ..., "utc": ...} when the site and its database answer.

Account

Handler: api/v1/account.ashx. Signed with an API key.

GET /account

The account behind the key: name, status, plan, the plan's limits (null means no limit) and features, and this month's usage counts. Test envelopes never count.

Bulk Sends

Handler: api/v1/bulk-sends.ashx. Signed with an API key.

POST /bulk-sends

Phase 4. Send one template to many recipients. Body: templateId (required), and either rows (a list; each row has recipients, a list of roleKey, name, email and optionally phone, verification and accessCode, plus mergeValues and externalReference) or csv (a CSV list with a header row naming the columns {roleKey}.name, {roleKey}.email, {roleKey}.phone, merge.{key} and externalReference). Every row's envelope shares subject, message, delivery, signingOrder, expiresInDays, expiresAt, reminderDays, language, allowReassign, allowDecline, allowDownloadBeforeSign, signatureMethods, callbackUrl, metadata and lockMergeFields, and testMode. At most BulkSend.MaxRows rows (default 500). Accepts an idempotency key in the Idempotency-Key header or the idempotencyKey field; a retry with the same key returns the same bulk send and queues nothing new. Refused with 403 feature_not_in_plan when bulk send is not in the account's plan, with 403 plan_limit_reached when the rows would pass the plan's monthly envelope limit (test envelopes never count), and with 403 sending_paused while the account has been past due for 7 days. Answers 202 with the bulk send, status queued. The worker then creates and sends one envelope per row with the idempotency key bulk:{bulk send id}:{row number}; GET /bulk-sends/{id} gives each row's result, sent with its envelopeId or failed with errorCode and errorMessage.

GET /bulk-sends

Phase 4. List this application's bulk sends, newest first, with their counts of rows sent and failed.

GET /bulk-sends/{id}

Phase 4. One bulk send with its status (queued, running or completed), counts, shared options and a result for every row: row, status (pending, sent or failed), envelopeId, errorCode, errorMessage, processedAt.

Envelopes

Handler: api/v1/envelopes.ashx. Signed with an API key.

POST /envelopes

Create an envelope from one to ten PDF documents and send it (send defaults to true). Fields come from Dropbox Sign text tags in the documents (fieldPlacement tags, the default) or from a fields list (fieldPlacement coordinates). Accepts an idempotency key in the Idempotency-Key header or the idempotencyKey field; a retry with the same key returns the first response and creates nothing. Refused with 422 card_number_found when a document holds a full card number, and with 403 plan_limit_reached when the account's monthly envelope limit is used up. Test envelopes never count. Refused with 403 sending_paused while the account has been past due for 7 days; envelopes already sent can still be signed and viewed. Answers 201 with the envelope.

GET /envelopes

List this application's envelopes, newest first. Query filters: status, externalReference, from and to (ISO dates), top (1 to 500, default 100).

GET /envelopes/{id}

Get one envelope with its documents, recipients, fields and status. This is the polling fallback for webhooks.

POST /envelopes/{id}/send

Send a draft envelope (one created with send false). The plan limit is checked here, and it is refused with 403 sending_paused while the account has been past due for 7 days.

POST /envelopes/{id}/void

Void an envelope that is not finished. Body: reason (required). Unused signing URLs stop working.

POST /envelopes/{id}/signing-url

Get a short lived, single use embedded signing URL for one signer. Body: recipientId (required), productUserId (the product's own user id, recorded in the audit trail as the product session verification). Open the URL with interactive-sign.js on a page whose domain is listed for the application; test envelopes skip the domain check.

POST /envelopes/{id}/recipient-link

Get a signing link for one signer or approver of an email or link delivery envelope, for the product to deliver itself (link delivery) or show again. Body: recipientId (required). The link opens the landing page, which uses it up only when the signer chooses Open Document; it lasts EmailLink.LifetimeDays (default 30) or until the envelope expires. Embedded envelopes use signing-url instead.

POST /envelopes/{id}/remind

Email a reminder now to every signer and approver of an email delivery envelope whose turn it is and who has not finished. Answers reminded, the number queued.

POST /envelopes/{id}/recipients/{id}

Correct a recipient's name or email before they finish. Body: name, email (either or both). Their unused links stop working; on an email delivery envelope a recipient already invited gets a new invitation at the new address.

POST /envelopes/{id}/handoff-confirm

Hand off retention: confirm that the product has downloaded and stored the final file. Body: sha256 (the SHA-256 of the final file, which must match finalSha256). The worker then erases the stored bytes of every file of the envelope. Rows, hashes and the audit trail stay, so the public verify page still recognizes the final file. Refused with 409 unless the application's retention mode is handoff.

GET /envelopes/{id}/emails

The emails of this envelope: kind (invitation, reminder, relink, email_code, completed, declined, voided, expired), recipient, address, subject, status (queued, sent, delivered, bounced, failed, suppressed) and times. Never a link or a code.

GET /envelopes/{id}/files/final

Download the final sealed PDF: every document with its fields applied, then the certificate of completion, sealed with a PAdES signature. Available once status is Completed.

GET /envelopes/{id}/files/certificate

Download the certificate of completion alone, sealed.

GET /envelopes/{id}/files/original

Download an original document as signers saw it (scripts and embedded files removed). Query: documentId (default the first document).

GET /envelopes/{id}/audit

The envelope's audit trail, oldest first, each event with the exact fields that are hashed and its previousHash and rowHash. _docs/audit_chain.md defines how to recompute every hash.

GET /envelopes/{id}/webhook-deliveries

Webhook deliveries queued for this envelope, each with its attempts, so a product can see what was sent and when it will be retried.

POST /envelopes/{id}/in-person-url

Get a single use in person signing link: a host opens it on their own device (a tablet at a counter, for example) and hands the device to the signer. Body: recipientId (required), host (required): type product_user (with name and productUserId), or account_user (with the email of a user of this account; name defaults to theirs). The host is named in the audit trail and on the certificate, and their presence is the signer's verification, so no email or SMS code is asked for. The link lasts InPerson.LinkLifetimeSeconds (default 3600) and opens a page that cannot be framed.

GET /envelopes/{id}/attachments

The attachments requested from this envelope's signers, each with whether it was uploaded and the file's name, type, size and SHA-256.

GET /envelopes/{id}/attachments/{id}

Download one uploaded attachment (a PDF, PNG or JPEG, as the signer sent it, with any PDF script removed). Answers 409 not_ready until it is uploaded and 410 purged after retention erased it.

GET /envelopes/{id}/sms

The SMS of this envelope (verification codes): recipient, masked phone number, status (queued, sent, failed, suppressed), provider and times. Never a code.

Signing

Handler: api/v1/signing.ashx. Signing page only. POST /signing/session takes the signing token; every other route takes Authorization: Bearer <sessionToken>.

POST /signing/session

Signing page only. Exchange the single use token from the signing URL for a signing session. Body: token, parentOrigin (the embedding page's origin). For a live embedded envelope the parent origin must be one of the application's allowed domains; a test envelope skips that check. The token is used up here, never by a plain GET. An email or link delivery token is opened as a page of its own, so it has no parent origin; it is used up only when the signer chooses Open Document. Refused with 409 not_your_turn while earlier recipients of a sequential envelope have not finished. The answer says whether the session is verified; a session that still owes an email code or an access code can read only the limited context until POST /signing/verify passes.

POST /signing/verify/send-code

Signing page only. Send a six digit verification code to a recipient whose verification is email_code (by email) or sms_code (by SMS, Phase 4). Answers channel email with the masked address, or channel sms with the masked phone number. At most EmailCode.SendsPerHour codes an hour (default 5), for SMS as for email; a new code replaces the one before. Refused with 429 while the recipient is locked out, and with 403 feature_not_in_plan when SMS codes are not in the account's plan.

POST /signing/verify

Signing page only. Check an email code, an SMS code or an access code. Body: code. Answers outcome passed, failed (with remaining tries), locked (with lockedUntil) or no_code (ask for a new code). After Verification.MaxFailures wrong codes in a row (default 5) the recipient is locked out for Verification.LockoutMinutes (default 30). Codes are stored only as keyed hashes. Every try is in the audit trail.

POST /signing/relink

Signing page only. Ask for a new email link when the one followed was already used or has expired. Body: token (the old link's token). No session is needed. Answers outcome queued, limited (Relink.PerHour, default 3) or not_possible. The new link goes only to the recipient's own address, never to the page.

POST /signing/approve

Signing page only. An approver approves the envelope, after accepting the disclosure. The envelope moves on to the next recipient, or to Completing when nobody is left.

GET /signing/context

Signing page only. Everything the page shows: the envelope, the recipient, the brand, the disclosure text, the documents with page sizes, this signer's fields and the signature fonts. Before verification passes it answers only the envelope subject, the brand, the recipient's name and the verification state, with no document, field or disclosure.

GET /signing/documents/{id}

Signing page only. The PDF of one document as the signer sees it. The page renders it with the self hosted PDF.js.

POST /signing/consent

Signing page only. Record that the signer accepted the electronic records and signatures disclosure. Body: disclosureSource, disclosureVersion, disclosureSha256 (must match the text shown).

POST /signing/finish

Signing page only. Finish signing. Body: fields (list of fieldId and value), signature (method typed, drawn or click; typedText and font, or imagePng as base64), initials (same shape, when the signer has initials fields). Values are saved, the signature is adopted for every signature field, and the signer is marked Signed. When the last signer signs, the envelope becomes Completing and the worker seals it.

POST /signing/decline

Signing page only. Decline to sign. Body: reason (required). The envelope becomes Declined.

GET /signing/status

Signing page only. The signer's and the envelope's status, and whether the completed copy can be downloaded yet.

GET /signing/final

Signing page only. The completed, sealed PDF, once every signer has signed.

POST /signing/reassign

Signing page only, Phase 4. Hand this place to another person, where the envelope allows it (allowReassign). Body: name, email, reason (all required), phone (required when the recipient is verified by SMS code). The session ends. The new person gets their own link (an email delivery envelope emails them an invitation; a link delivery product asks recipient-link again), accepts the disclosure and signs or approves themselves. Both people and the reason are in the audit trail and on the certificate, and recipient.reassigned is sent to the webhook.

POST /signing/attachments/{id}

Signing page only, Phase 4. Upload the file for one requested attachment, or replace it. Body: fileName, contentBase64. Only a PDF, PNG or JPEG is accepted, judged by its content, at most Attachment.MaxBytes (default 10 MB); scripts in a PDF are removed. The file is stored encrypted with the envelope, listed on the certificate with its SHA-256, and erased with the envelope's other files by retention.

Templates

Handler: api/v1/templates.ashx. Signed with an API key.

POST /templates

Create a template. Body: name (required), description, subject and message (the defaults for envelopes made from it), documents (one to ten PDFs as name and contentBase64), roles (key, name, role signer, approver or viewer, routingOrder, verification) and fields (documentIndex, roleKey, type, page, x, y, width and height in PDF points from the page's top left corner, required, label, mergeKey, defaultValue, readOnly). Only signer roles take fields. A mergeKey goes on a text, name, email, company or title field. Answers 201 with the template. Refused with 403 plan_limit_reached when the plan's template limit is used up.

GET /templates

List this application's templates by name, with their role and field counts.

GET /templates/{id}

Get one template with its documents, roles, fields and the merge keys an envelope can fill.

POST /templates/{id}

Change a template. Body: any of name, description, subject, message. documents replaces the documents; roles and fields together replace the roles and fields. Envelopes already made are not changed.

DELETE /templates/{id}

Delete a template. Envelopes already made from it keep their own copy of every document.

GET /templates/{id}/documents/{id}

Download one document of a template as a PDF.

Verify

Handler: api/v1/verify.ashx. Public. No key.

POST /verify

Public, no key. Send the PDF itself (Content-Type application/pdf) or JSON with sha256. Answers whether it matches a completed envelope, when it was completed and sealed, and, for a PDF, whether the seal is intact and covers the whole file. Rate limited per IP address.

Webhook Endpoints

Handler: api/v1/webhook-endpoints.ashx. Signed with an API key.

POST /webhook-endpoints

Create a webhook endpoint. Body: url (https), eventKinds (optional list; empty means every event). Answers 201 with signingSecret, shown only this once.

GET /webhook-endpoints

List the application's webhook endpoints (secrets are never returned).

POST /webhook-endpoints/{id}/rotate

Rotate an endpoint's signing secret. Answers with the new signingSecret and signingKeyId, shown only this once; deliveries from now on use it.

DELETE /webhook-endpoints/{id}

Delete an endpoint (soft delete). No further deliveries are queued for it.

POST /webhook-endpoints/{id}/test

Queue a webhook.test event to the endpoint, delivered by the worker like any other event.