Skip to content
Start free

REST API

Open in ClaudeOpen in ChatGPT

Changes to the REST API’s responses, states and limits. Changes to the API clients are listed in each client’s own changelog.

Signatures come only from signature requests

Section titled “Signatures come only from signature requests”
  • A value for a signature or initials field, in data or in a field override’s default, makes a submission invalid_data in both API versions, with or without signature requests, in test mode too. Before, only submissions with signature requests were checked. To print a signature image or a name you send, use an Image or Text field. See Create signature requests. DocSpring Enterprise installs keep accepting them.
  • Web forms (Web Forms JS 3.0.0 and the hosted web form) and visual forms (Visual Forms JS 2.22.0 and the hosted visual form) no longer create their submissions through the API. Earlier versions of the embeds still do.
  • DocSpring emails the signers of an API v2 signature request a link to sign, and the signed PDF once everyone has signed. Set send_email to false, for the submission or for one signature request, when your app sends the links or embeds the signing form. API v1 never emails signers. See Emails from DocSpring.
  • New parameters for creating a submission: send_email, signing_order, email_subject, email_message, cc, reply_to, notification_emails, notify_when_signed and reminders, and each signature request’s send_email and signing_step. A signature request that DocSpring emails needs an email, and its auth_type is email_link by default.
  • Signature requests have send_email, signing_step, sent_at and email_status, and submissions have signing_order.
  • With signing_order: sequential, a signer can’t sign until everyone in the steps before theirs has: the signing page says so, and Signature Requests JS’s onError gets not_your_turn.
  • New webhook events: signature_request.sent and signature_request.email_bounced (submission_data_request.sent and submission_data_request.email_bounced in version 3). New webhooks get them by default.
  • Creating a submission that DocSpring emails can return 402 with "code": "insufficient_credits_to_send", 429 with "code": "daily_email_limit_reached" when it would go over your account’s daily email limit, and 403 while your account’s emails are paused. Nothing is saved.
  • Templates have settings for these emails: signature_request_from_name, signature_request_from_address, signature_request_signing_url, signature_request_include_signing_token, signature_request_reply_to, signature_request_notification_emails and signature_request_email_attachments.
  • API v2 is the current version of the API, and the 4.x API clients call it. API v1 and the 3.x clients keep working.
  • API v2 calls data requests signature requests. New data requests get IDs that start with srq_ instead of drq_, in both API versions. Existing ones keep their IDs.
  • Signing links expire, in both API versions. A signature request token’s link (api, the default) opens the signing form for 24 hours, and an email token’s for 7 days. A signing page that opened in time keeps working for 7 more days, so the signer can finish later. Before, links never expired, whatever API v1’s expires_at said. Tokens created before this change get the same lifetimes, counted from when they were created: an older link no longer opens the form, but a page the signer opened in the last 7 days still works.
  • Live signature requests (data requests in API v1) work on every plan, including the free Developer plan, once your account has made a payment: a credit pack or a paid plan. Before that, creating one returns 403 Forbidden with "code": "upgrade_required". Test signature requests are free on every plan.
  • A webhook with Include submission data turned off no longer sends any form values: each data request’s (signature request’s) data, ip_address and user_agent, and the submission’s truncated_text, are null.
  • The events of a test submission created with a live API token go to “Test only” webhooks, not “Live only” ones.
  • API v1 changes for signature requests (data requests):
    • A signature or initials value in the data of a submission with data requests makes it an invalid_data submission: only the signer signs. A signed PDF is always static, whatever editable says.
    • On a public template, only the template’s own account can send data_requests, html, css, password, expires_in or editable: other callers get a 422. Their field_overrides only keep hidden, backgroundColor and required.
    • The data request events API only takes send_request events, and a completed, declined or expired data request takes no more updates, tokens or events (422).
    • A test API token gets a 403 when it creates a token or an event for a live data request, or updates one.
    • A submission with data requests can’t be reprocessed, and a published template version’s PDF can’t be replaced.
  • Other API v1 fixes:
    • POST /templates with html and no template_type creates an HTML template.
    • POST /custom_files without a cache_id, and downloading a combined submission that has no PDF, are 422s.
    • EAN-13, EAN-8 and UPC-A barcode fields take the code with its check digit, and a wrong check digit is a data error when you create the submission.

These changes apply to accounts on the current plans (Developer, Starter, Growth and Scale), except the account_suspended change, which applies to every account. Accounts on a plan purchased before prepaid credits keep their existing pricing and API rate limits.

  • Submissions and combined submissions have a new state, insufficient_credits: a live PDF your credit balance can’t cover is saved and resumes automatically when you add credits. Work that is still waiting after 30 days, or that you discard, moves to error, and DocSpring sends the submission.failed or combined_submission.failed webhook. No webhook is sent when work starts waiting.
  • Creating a submission, batch or combined submission that your balance can’t cover returns 402 Payment Required with "code": "insufficient_credits" and the saved submission in the body. Synchronous requests return 402 too.
  • Requests that need a higher plan (adding templates over your plan’s limit, live data requests, the embedded template editor) return 403 Forbidden with "code": "upgrade_required". Nothing is saved.
  • On the Developer plan, creating or turning on a webhook when the account already has 2 active integrations (storage destinations, webhooks and Slack notifications) returns 403 Forbidden with "code": "upgrade_required". Editing, turning off and deleting webhooks keep working. Setting a template’s slack_webhook_url (or, in API v1, webhook_url) to a new URL over the limit returns 422 with the same message.
  • Creating submissions, batches or combined PDFs on a suspended account returns 403 Forbidden with "code": "account_suspended". Nothing is saved.
  • Submissions and combined submissions that were already saved when an account was suspended wait in the account_suspended state instead of moving to error, and are generated when the account is reactivated. As with insufficient_credits, work still waiting after 30 days, or that you discard, moves to error.
  • API requests are limited per account by plan, with separate limits for live and test API tokens. Responses include RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset, and requests over the limit get 429 Too Many Requests with Retry-After.
  • If you use a DocSpring API client, upgrade it to the latest version. Older versions of the Ruby, Python, PHP, Java and C# clients raise an error when they read the insufficient_credits state.

These expiry changes apply to every account:

  • Expiring a submission also clears its metadata, schema errors, overflow text, PDF password, error message, rendered HTML, and the submitter’s IP address, browser and location. An expired submission returns metadata and truncated_text as {}, json_schema_errors as [], and password and error_message as null. A request that was waiting for credits keeps its “Not processed” error message. The submission.expired webhook has the cleared values too, so match it to your records by its id.
  • Expiring a combined submission also clears its metadata, password and error message, and removes the URLs from source_pdfs.
  • The actions of an expired submission or combined submission keep their state, with result_data as {} and error_message as null.
  • A submission that doesn’t process (any state other than processed, such as error or invalid_data) is kept for at least 48 hours before it expires, even when expires_in or the template’s expiry is shorter, so you can debug it and a retry still has its data. Its expires_at shows when. A processed submission keeps your expiry setting, and a failed submission that is later processed expires that long after processing.
  • Submissions saved with invalid data now expire like any other. Before, they were never deleted.
  • A combined submission with expires_in that fails now expires too, after at least 48 hours. Before, failed combined submissions were never deleted.

This processing change applies to every account:

  • A submission or combined submission that hits an unexpected error on our side is retried for about a minute while it stays pending, then moves to error and stays there, with a message saying what happened. Before, it moved to error and could still be retried and reach processed hours or days later.