All articles

Add E-Signatures to Your App With a Coding Agent

Your app needs clients to sign something: a booking form, a services agreement, an onboarding pack. A coding agent such as Claude Code, Codex or Cursor can open the GoodSign account itself, hand you one payment link, and carry on building with a working API key. This guide shows the prompt, each request and the cost.

What you need

  • A coding agent that can run curl.
  • A business email address. Gmail, Outlook.com and similar are refused: sign up on the website with the Google, Microsoft or Apple button instead and create a key at /profile/apikeys.
  • A card for the first payment: 10 credits at US$1.50 each (NZ$/A$2.50 in New Zealand and Australia), so US$15.
  • The document as a PDF.

What should I tell my coding agent?

Paste this, with your own details:

Our app needs clients to sign a booking form (booking-form.pdf). Use the
GoodSign e-signature API. Read https://goodsign.io/api/help and
https://goodsign.io/esignature-api.md first.

If GOODSIGN_API_KEY is not set, open an account for me:
POST https://goodsign.io/api/agent/signup with
{"name": "Jane Smith", "email": "jane@acme.com", "agent": "Claude Code"}.
Save api_key, pay_url and status_url to .env.local straight away (they are
not shown again), check .env.local is in .gitignore, give me pay_url, then
poll status_url until status is "active".

Rules: never commit or log the key. Call GoodSign from server code only.
Use "draft": true while testing. Ask me before any send that emails a
real person.

How does the agent get an API key?

The agent sends one request:

curl -X POST https://goodsign.io/api/agent/signup \
  -H "Content-Type: application/json" \
  -d '{"name": "Jane Smith", "email": "jane@acme.com", "agent": "Claude Code"}'

It gets back a key and two links (trimmed):

{
  "api_key": "...",
  "status": "payment_required",
  "pay_url": "https://goodsign.io/agent/pay/...",
  "status_url": "https://goodsign.io/api/agent/status/...",
  "first_payment": {"credits": 10, "auto_topup": true},
  "expires_in_days": 30
}

Nothing is stored on GoodSign yet, and every API call made with the key answers 402.

The one approval. You open pay_url, check the price, choose whether to keep auto top-up, and pay by card on Stripe. Your bank may ask you to approve the payment. The agent cannot pay for you. The payment creates the account and switches the key on, and GoodSign sends you one email with a link to set a password.

The agent polls status_url (no header needed):

{
  "status": "active",
  "account_email": "jane@acme.com",
  "credits": 10,
  "auto_topup": true,
  "pay_url": "https://goodsign.io/agent/pay/...",
  "summary": "Ready to send. Each envelope costs 1 credit, however many signers it has."
}

A new account is sometimes held for a manual check after payment: the status is under_review and API calls answer 403, usually for a few hours. A link not paid within 30 days expires, and nothing was created.

Where the key lives: an environment variable, in a file your repository ignores while you build and in your host's secret store in production. Never commit it. /api/* accepts requests from any origin, so a key in browser code can be read from the page's network traffic. Keep every call on your server.

The app uses the REST API, so nothing needs restarting. Adding the MCP server for the agent itself is optional and needs a client restart.

How do I send a document from my app?

The agent prints text tags in the PDF where fields go, such as [name|Client], [sign|Client] and [date|Client]. Each distinct key is one signer. It uploads the PDF once:

curl -X POST https://goodsign.io/api/uploadpdf \
  -H "Authorization: Bearer $GOODSIGN_API_KEY" \
  -F "file=@booking-form.pdf"
{
  "success": true,
  "uuid": "6b2f0c1e-...",
  "badtags": [],
  "signers_found": 1,
  "send_payload": {"uuid": "6b2f0c1e-...", "signers": [{"key": "Client"}]}
}

That response is trimmed. The app keeps the uuid in its config. A template built in the dashboard works too: GET /api/templates lists its uuid and signer keys.

For each booking the app calls POST /api/usetemplate:

curl -X POST https://goodsign.io/api/usetemplate \
  -H "Authorization: Bearer $GOODSIGN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "uuid": "6b2f0c1e-...",
    "duplicate": true,
    "doc_name": "Booking form for Sam Lee",
    "webhook": "https://app.acme.com/webhooks/goodsign",
    "metadata": {"booking_id": 4812},
    "signers": [
      {"key": "Client", "name": "Sam Lee", "email": "sam@example.com", "reminder_days": 2}
    ]
  }'

"duplicate": true makes each send a copy, so the uploaded PDF stays reusable. Without it the first send uses the upload up. The response:

{
  "success": true,
  "doc": {"uuid": "9d1c4a7e-...", "name": "Booking form for Sam Lee.pdf", "status": "sent", "webhook": "https://app.acme.com/webhooks/goodsign"},
  "warnings": "",
  "credit": 9
}

Store doc.uuid against the booking. Other fields the endpoint accepts: send_in_order, cc_email, email_subject, email_message, fields (prefill values by key), ignore_missing_signers, smsverify, draft, email_external, and brand and hide_chat on the PRO plan. A signer address the mailer cannot deliver to, such as "TBC", gets a 400 before any credit is spent.

How does my app know the document is signed?

GoodSign POSTs JSON to the webhook URL:

{"uuid": "9d1c4a7e-...", "status": "document_complete"}

Four events are delivered: signer_opened, signer_complete, document_complete (instead of signer_complete when the last signer finishes) and signer_attachments_complete. The payload is not signed and a failed delivery is not retried. Treat each call as a nudge: fetch GET /api/document/{uuid} and act only when master_doc.status is complete. Also poll open documents on a schedule, to catch missed webhooks.

Then download the signed PDF:

curl -H "Authorization: Bearer $GOODSIGN_API_KEY" \
  -o booking-4812.pdf https://goodsign.io/api/download/9d1c4a7e-...

Until the PDF exists this answers 404 with "Document is not complete". It is rendered after the last signature, so retry a minute later if a download straight after the webhook gets that 404. /api/downloadzip/{uuid} returns every file in a multi-file envelope.

Should GoodSign email the signer, or should I embed signing?

By default GoodSign emails each signer their link and the finished PDF. Add "email_external": true and GoodSign emails the signer nothing. The response gains a signing_links array, one link per signer with its key, to put in your own email or an iframe. "email_external": "notifyonly" skips the invite but still emails the finished PDF. The reminder endpoints skip external signers, so chasing them is your app's job. The iframe details are in the embedded signing guide.

How do I test without emailing anyone?

There is no free sandbox: every real send costs a credit, test or not. What the API gives you:

  • Uploading a PDF spends nothing. Check badtags is empty and signers_found matches your keys.
  • "draft": true saves the document with its signers and fields, emails nobody and spends no credit. Inspect it with GET /api/document/{uuid}, then remove it with POST /api/document/{uuid}/delete. With an uploaded PDF, send "duplicate": true as well, or the draft uses the upload up.
  • To try the signing pages, webhooks and download, make one real send to your own address, or with email_external: true and open the returned link yourself. Each costs 1 credit.

What does it cost?

  • First payment: 10 credits, US$15, at the standard price. The half-price welcome top-up is only for accounts opened on the website.
  • While building: five real test sends cost US$7.50 and leave 5 credits, where auto top-up buys another 10 (US$15) unless you unticked it.
  • In production: 60 bookings a month is 60 credits, US$90, however many people sign each one. SMS verification adds 1 credit per signer, so the same 60 with it cost US$180.
  • Auto top-up repeats the first pack, so at 60 a month a 10-credit pack charges your card six times. Have the agent ask for "credits": 100 at signup (US$150 a charge). A 500-credit payment gets the 20% bulk discount: US$600.
  • No monthly fee for the API. hide_chat and per-customer brands need PRO, $10 per user per month.

See the pricing page.

What the e-signature API does not do

  • No official client libraries. The agent writes the HTTP calls.
  • No webhook signature, no retries, and no webhook for a document being sent or voided.
  • No scheduled sends.
  • No published rate limit. Ask before sending in large bursts.
  • No payment collection from signers, no dropdown or date-picker fields (a date-signed field fills itself in), no document expiry, and signers cannot decline with a reason.
  • The agent cannot buy credits. When they run out, it gives you the same pay_url again.

Where to go next

The API docs have a page for each of the main calls. The agent signup section of the API page has the signup request and its optional fields.

Need documents signed? Make a free electronic signature for your own PDFs, or send documents for signing at $1.50 each with no subscription.

Ready to simplify your document signing?

No subscription. Pay only when you send: $1.50 per envelope.

Try a Free Electronic Signature →

All rights reserved © GoodSign Limited 2026
2 Stuart St, Ponsonby, Auckland 1011, New Zealand...