Credits & Rate Limits
Two account limits can affect your API integration: your credit balance and your plan’s API rate limits. This page shows how to handle both. (For how credit costs are calculated, see How Credits Work.)
Insufficient credits (HTTP 402)
Section titled “Insufficient credits (HTTP 402)”A live document is admitted only when your available balance covers its
smallest possible charge: one unit of it (20 credits for a filled PDF form or a
Word document, 4 for a PDF from an HTML template, a page design or a combined
PDF), plus 60 credits for each signature request that asks for a signature, or 4
for each source PDF of a combined PDF. When your balance can’t cover that, or
storage credits have been due for more than seven days, requests that would
generate a live document return
402 Payment Required:
{ "error": { "code": "insufficient_credits", "message": "Insufficient credits. This submission will be processed automatically once you add credits in Billing. If it's still waiting after 30 days, it won't be processed.", "details": [], "request_id": "req_1234567890abcdef01", "submission_id": "sub_1234567890abcdef01" }}Key points for your integration:
- The submission is saved (except for a signature request that DocSpring
emails: see below). The error’s
submission_id(combined_pdf_idfor a combined PDF,submission_batch_idfor a batch) is its ID. It’s held in theinsufficient_creditsstate and automatically resumes once enough credits are available, so you don’t need to resubmit. If support has turned off automatic resumption for your account, themessagesays so: add credits and send a new request; the saved request won’t resume. - If storage credits are overdue, the
messagesays so (“Live processing is paused because 20 storage credits are due. Add credits in Billing to resume. Your stored documents remain available.”) and the submission waits the same way. Adding credits pays the storage charge first, then resumes waiting work. - No webhook is sent when a submission starts waiting for credits. If you rely on webhooks, poll submissions that haven’t finished, or watch for the alert on the Billing page.
- Waiting submissions are not kept forever. A submission or combined
PDF that is still waiting for credits 30 days after it first ran out
of credits moves to the
errorstate (“Not processed: this request waited 30 days for credits.”), and DocSpring sends thesubmission.failedwebhook (or, for a combined PDF,combined_submission.failed, which version 4 webhooks receive ascombined_pdf.failed) with the reason inerror_message. You can also discard waiting work yourself, all at once from the Billing page or one at a time from the submission’s page. Through the API, expire a waiting submission or combined PDF to discard it. Discarded submissions move toerrorthe same way. - Creating a batch returns
402when any submission in the batch is blocked, with the batch’s ID insubmission_batch_id. Other submissions in the same batch may already be processed and charged, so get the batch and check each submission’sstateanderror_messagerather than resubmitting the whole batch. The blocked submissions resume automatically. - A batch stays
pendingwhile any of its submissions are waiting for credits (they are counted inpending_count), so a client polling the batch keeps waiting until those submissions resume. Check the submissions’stateto see which ones are blocked. - Combined PDF requests behave the same way:
the combined PDF is created in the
insufficient_creditsstate and resumes automatically after you add credits. Combined jobs have no test mode and consume credits even with a test API token or watermarked source PDFs. - A submission can also enter
insufficient_creditsafter being accepted, if the balance runs out while it’s in the queue. If you poll for results, handle this state alongsideprocessedand the failure states such aserror. - Synchronous requests return
402if processing runs out of credits before the response is returned, with the same error and record ID. Keep the ID even when your HTTP client raises for a non-2xx response. - The
402on creation is a best-effort check against the balance at that moment; it does not reserve credits. A batch, or several requests sent close together, can all be accepted and some may still enterinsufficient_creditsonce the earlier ones consume the balance. Always check each submission’sstaterather than relying on the creation status alone. - A live submission whose signers DocSpring emails (
send_email, the default in API v2) is checked before anything is saved: your balance must cover its PDF and its signatures, and on the Developer plan and during a trial, your other requests still waiting for signers too. Otherwise it returns402with the codeinsufficient_credits_to_sendand nothing is saved, so there’s no submission to resume: add credits and send the request again. - Signature requests you send the links for yourself (
send_email: false) can be created without credits. Credit admission happens when the signers finish and the live PDF is ready to render. - Either way, the final charge includes the PDF’s own cost plus 60 credits for each signature request.
- Test submissions never consume credits and are not blocked by a low credit balance. They remain subject to API request limits.
To avoid hitting 402 in production, enable
automatic top-ups.
Plan features (HTTP 403)
Section titled “Plan features (HTTP 403)”Some features depend on your plan: the number of templates, users and active
integrations, and the embedded template editor (see Plans). Live signature requests need your
account to have made a payment first: a credit pack or a paid plan. A request that needs a higher plan or a first
payment returns 403 Forbidden before anything is created:
{ "error": { "code": "upgrade_required", "message": "Your Developer plan includes 10 templates. Upgrade to Starter or higher to add more.", "details": [], "request_id": "req_1234567890abcdef01" }}Unlike 402, nothing is queued: upgrade the plan (or buy a credit pack), then send the request again.
Setting a template’s slack_webhook_url (or, in API v1, its legacy
webhook_url) to a new URL that would go over the limit on active integrations
is a 422 validation error instead, with the same message in its details. The
template editor shows it the same way.
Only accounts on a plan purchased before prepaid credits can be suspended. A
suspended account gets the same 403 with "code": "account_suspended" when it
tries to create submissions, batches or combined PDFs. Nothing is stored, and
reading existing submissions still works. Submissions and combined PDFs that
were already saved wait in the account_suspended state and are generated if
the account is reactivated within 30 days. Reactivating it from the Billing
page moves it to the free Developer plan (the earlier plan can’t be restored);
subscribe to a paid plan there for more credits and higher limits.
An account that its owner has deleted gets this 403 for every request, reads
included, until one of its users signs in to cancel the deletion.
Rate limits (HTTP 429)
Section titled “Rate limits (HTTP 429)”API limits are shared across all API keys and IP addresses on the account. Live and test API tokens have separate limits. The mode comes from the token: a live token still uses the live limit when it requests a watermarked test PDF.
Signed-in web app requests normally share the live limit. Template and submission reads, including the editor’s status polling, and the template editor’s autosaves use a separate, larger per-account allowance (300 requests burst, refilling at 600 per minute) so editing and viewing progress do not use your integration’s limit. The exception requires a signed-in browser session; API-key requests to those endpoints still count. Creating PDFs in the web app continues to use the account’s live limit.
A synchronous request (wait=true) counts once. The status polling DocSpring
performs on your behalf while it waits for the PDF is not counted against your limit.
| Plan | Live requests | Test requests |
|---|---|---|
| Developer | 10/min (burst 20) | 5/min (burst 15) |
| Starter | 60/min (burst 120) | 5/min (burst 15) |
| Growth | 120/min (burst 240) | 5/min (burst 15) |
| Scale | 300/min (burst 600) | 5/min (burst 15) |
Each limit refills continuously at the listed rate, up to its burst capacity. For example, Developer can send 20 live requests at once after an idle period; after exhausting that burst, capacity returns at one request every six seconds. Creating another API key or changing IP addresses does not reset the limit.
Every response to a rate-limited API request includes the limit’s current state, so you can slow down before you reach the limit:
| Header | Meaning |
|---|---|
RateLimit-Limit | The limit’s burst capacity |
RateLimit-Remaining | Requests you can send right now |
RateLimit-Reset | Seconds until the limit has refilled to full capacity |
Requests over the limit receive 429 Too Many Requests with a Retry-After
header containing the minimum delay in seconds, and an error with the code
rate_limited. These requests have not reached
the API action and are safe to retry. Wait at least that long and use exponential
backoff with jitter if retries are also limited. Spread large workloads with
the batch endpoint,
which counts as a single request.
These limits count API requests, not PDFs within a batch or simultaneous PDF renders. Credit availability is checked separately for each live document.
The emails DocSpring sends about signature requests have a daily limit of their
own: 2,000 a day, or 50 on the Developer plan and during a trial. A request that
would go over it returns 429 Too Many Requests with the code
daily_email_limit_reached and a Retry-After header with the seconds until
midnight UTC. Nothing is saved, so send it again after that, or send the signing
links yourself (send_email: false). See
Create signature requests.
If you need a higher rate limit than your plan provides, contact support@docspring.com.
Plans purchased before prepaid credits
Section titled “Plans purchased before prepaid credits”On a plan purchased before prepaid credits, the limit is a number of requests in each 30-second period: 120, unless we’ve agreed a different limit with you. Your live API tokens and your test API tokens each have this limit, counted across all the tokens of that mode and all IP addresses.
API v2 responses include the RateLimit-* headers described above, and a
request over the limit gets 429 Too Many Requests with a Retry-After header
and the rate_limited error code.
API v1 sends none of these headers for this limit. A request over it gets
429 Too Many Requests with the plain-text body Retry later. Each period
starts on the minute or the half minute, so wait for the next one before you
retry, and use exponential backoff with jitter if retries are also limited.