docs
Test mode and credits
Test mode lets you build and try an integration without emailing anyone and without using live credits. This page says what test mode separates from live, what it shares, how credits work in both modes, and what changes when you go live.
What test mode is
typesign.dev serves two modes at the same address: live and test. There is no separate test domain. The same API root, the same dashboard and the same workspace serve both. Test mode is a separate environment inside that workspace: it has its own envelopes, its own API keys, its own credits and its own seal key.
In API responses and webhook payloads the two modes appear as the environment value: production for live and sandbox for test mode.
How the mode is chosen
For the API, the key decides. The prefix shows the mode, and a key works in that mode only. There is no parameter or header that changes it.
osk_test_… test mode environment "sandbox"
osk_live_… live mode environment "production"
curl https://typesign.dev/api/v1/me -H "Authorization: Bearer osk_test_…"
→ { "kind": "api_key", "environment": "sandbox", "test_mode_available": true, … }For people, the dashboard has a “Test mode” switch in the header. It applies to your browser session. While it is on, the dashboard shows test envelopes, test keys and test credits, and a key you create is a test key. Switch it off to create a live key. Signing out switches it off.
What is kept apart
| Thing | In test mode |
|---|---|
| Envelopes | Separate. A list shows only the envelopes of the current mode, and asking for an envelope of the other mode by id gives 404 not_found. Their approvals, signing, audit trail and artifacts follow the envelope. |
| API keys | Separate. Each mode lists only its own keys. |
| Credits | Separate. Each mode has its own balance and its own ledger view. See Credits below. |
| Email to recipients | Not sent. It is kept in the Test inbox. |
| Seal key and certificate | Separate. Test evidence is sealed with a test key, and test PDFs are never signed with the live certificate. |
| Workspace, members, settings | Shared. The setting that requires approval for API sends applies in both modes. |
| Uploaded documents | Shared. An upload made with a test key can be used by a live key and the other way round. Test uploads and test envelopes count against the same storage limit as live ones. |
| Webhook endpoints | Shared. One endpoint receives events from both modes; the handler must check environment. |
The shared rows matter. Do not upload a private document with a test key on the assumption that test data is somewhere else: it is stored in the same workspace. And read Live and test events before you connect a webhook handler to anything real.
Email in test mode
In test mode no email from your workspace reaches a recipient. Invitations, one-time codes, reminders and completion mail are stored instead. You read them in the dashboard under Test inbox, which is shown while the switch is on. You can use any recipient address in a test envelope; nothing is sent to it.
Sign-in mail is different. The link you request to sign in to the dashboard is always sent for real, in either mode.
So that you can test without opening the inbox for the link, the send response in test mode lists a signing link for each recipient who was just invited. With signing_order: "sequential" that is the first recipient only. Live responses never have this property.
curl -X POST $BASE/envelopes/env_…/send \
-H "Authorization: Bearer $OSK" -H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" -d '{}'
→ { "id": "env_…", "state": "sent", "environment": "sandbox", …, "sandbox_signing_links": [ { "recipient_id": "rcp_…", "url": "https://typesign.dev/sign/…", "expires_at": "…" } ] }Opening the link shows what the signer sees. The signer still has to enter a one-time code; in test mode the code is in the Test inbox. The inbox is for signed-in people: an API key cannot read it. A person still signs every test envelope. Test mode adds no way to sign or approve for someone.
The test seal and certificate
Every completed envelope gets evidence sealed with the deployment's seal key. Test mode has its own key. Evidence from a test envelope names that key and carries the trust label untrusted_test_key. The key is published at /api/seal-keys with test_mode: true, next to the live key.
The verifier reports the result for test evidence as indeterminate, with a note that it was sealed with an untrusted test key. That means: the integrity checks can pass, but the seal is not a trusted signature. Expect indeterminate in your tests, not valid.
The PDF signature is separate from the evidence seal. Test PDFs are signed with a sandbox certificate that belongs to test mode, never with the live certificate. The server refuses to start test mode with a certificate that is not marked as a sandbox certificate. A deployment that has no test certificate configured leaves test PDFs without a PDF signature.
An honest limit for live as well: the live certificate on typesign.dev is TypeSign's own. It is on no trust list, so a PDF reader shows an unknown issuer, and the verifier reports certificate trust as indeterminate for live evidence too. The difference is that live evidence is labelled self_managed_key and carries no TEST marks.
TEST marks on documents
The signed PDF of a test envelope is marked in three places:
- The footer line on every page starts with TEST, before the envelope id and the evidence id.
- Each signature block says “TEST: sandbox or test key, not a valid signature” where a live one says how the signer was verified.
- The certificate page at the end has a red line that says it is a test envelope sealed with an untrusted test key.
The evidence manifest also lists a limitation that starts with SANDBOX, and the invitation text stored in the Test inbox says it is a test envelope. The original PDF you uploaded is not changed.
Credits
Sending is paid for with credits. One credit pays for one completed envelope, whatever its number of pages, fields or recipients. The same rule applies in both modes; only the balance differs.
| When | What happens to the credit |
|---|---|
| You create or change a draft | Nothing. Drafts and uploads use no credits. |
| You send the envelope | 1 credit is reserved. If fewer than 1 is available, the send is refused with 402 insufficient_credits and the envelope is not sent. |
| Everyone has signed and the signed PDF and evidence are stored | The reserved credit is charged: the balance goes down by 1. |
| The envelope is declined, canceled or expires | The reserved credit is released. Nothing is charged. |
The balance has three numbers. balance is what the workspace holds. reserved is held by envelopes that are out for signing. available is the difference, and it is what a new send needs. A key reads the balance of its own mode with the billing:read scope:
curl $BASE/billing/balance -H "Authorization: Bearer $OSK"
→ { "object": "credit_balance", "environment": "sandbox", "balance": 100, "reserved": 1, "available": 99, "credits_per_envelope": 1 }GET /v1/billing/ledger lists every grant, reservation, charge and release of the current mode. An API key can also have a monthly credit limit; a send that would pass it is refused with 402 key_budget_exceeded.
Live credits and test credits never mix. A test envelope can only use test credits and a live envelope only live credits. Test credits cannot become live credits, and there is no transfer between the two.
Free credits
| A new workspace gets | On typesign.dev | Default in the code when the operator sets nothing |
|---|---|---|
| Live credits | 25 | 0 |
| Test credits | 100 | 100 |
These numbers are settings of the deployment and can change. See Limits for the limits that apply now.
More test credits are free. Switch the dashboard to test mode, open Credits and press +10, +100 or +1,000. One request adds at most 1,000, and a request that would take the test balance above 10,000 is refused. Only a signed-in owner or admin can do this; an API key cannot add credits. The request behind the buttons is POST /v1/billing/test-credits, and it is refused in live mode.
More live credits cannot be bought. Payments do not exist yet and prices are not decided. When your live credits run out, sending is refused with 402 insufficient_credits; envelopes already sent keep their reserved credit and can still be signed and completed. Write to hi@typesign.dev to ask for more.
Going from test to live
The address and the requests stay the same. These things change:
- A new key. Switch Test mode off in the dashboard and create a key. It starts with osk_live_. A test key cannot be turned into a live key.
- Real email goes out. Each recipient gets the invitation and the one-time codes at the address you gave. Check the addresses before you send.
- No links in the send response. sandbox_signing_links is absent. Code that reads it must cope with that.
- Live credits are used. Each completed envelope costs 1 of them.
- Nothing carries over. Test envelopes are not visible to a live key. Uploads and webhook endpoints are shared, so the same endpoint now also receives production events.
- The CLI asks for confirmation. typesign send with a live key stops unless you add --yes (or use --approval, which asks a person instead of sending).
# With a test key: sends at once.
typesign send contract.pdf --to customer@example.com
# With a live key: refused without --yes, because a real email goes out and a credit is reserved.
typesign send contract.pdf --to customer@example.com --yesSigned PDFs and evidence from live envelopes carry no TEST marks. TypeSign makes no statement about what a signature is worth under any law; that depends on your agreement and your jurisdiction.
Running locally
typesign serve starts a local server with the API and the signing page, stored in SQLite on your machine. It is test mode only: it refuses to start as a production server, its keys start with osk_test_, and it seals with a local untrusted test key. It has no dashboard.
typesign serve
# TypeSign server (sandbox) listening on http://localhost:8080
# mailbox http://localhost:8080/dev/mailbox
# api key created; saved to ~/.local/share/typesign/local-api-key
export OSK=$(cat ~/.local/share/typesign/local-api-key)
export BASE=http://localhost:8080/api/v1- It listens on port 8080 on 127.0.0.1 unless you pass --port or --host.
- Every email the server would send is shown at /dev/mailbox: invitations, signing links and one-time codes. The mailbox is on only while the server listens on this machine alone.
- The first start creates an API key, saves it to local-api-key in the data directory and prints the path.
- The workspace starts with 100 test credits.
- Webhooks may point at http://localhost there. See URL rules.
The typesign CLI and the SDKs are not published to a package registry yet, and the source repository is not public yet. Until they are, test mode on typesign.dev is the way to try the API.
Notes for agents
- Look at the key prefix, or call GET /v1/me, before you send. Build and test with an osk_test_ key. Ask the user for a live key only when real people should sign.
- With a live key every send emails real people and reserves a live credit. Do not send a live envelope to try something out.
- On 402 insufficient_credits or key_budget_exceeded, stop and tell a person. You cannot add credits in either mode.
- Give each link in sandbox_signing_links only to its recipient. You cannot read the Test inbox, and you cannot complete the signing yourself: a person enters the code and signs.
- Uploads are shared between the modes. Use synthetic documents in tests.
- Do not present a test result as a real one. Evidence sealed with untrusted_test_key verifies as indeterminate, and the PDF says TEST.