All articles

How to Get a Contract Signed With Claude Code

You have a short agreement that needs two signatures today, yours and the other company's, and no e-signature account. Claude Code can open a GoodSign account, turn the agreement into a signable PDF, send it and save the signed copy. The one thing it needs from you is a card payment.

The example is a mutual NDA between Acme Ltd and Northwind Ltd.

What you need

  • Claude Code, or another agent that can run curl in a shell.
  • A business email address for the account. Gmail, Outlook.com and similar addresses are refused. The other party can use any address.
  • A card for the first credits.
  • The agreement wording. Use your own, or have a draft checked. GoodSign records who signed and when; it does not review what the document says.

What do I tell Claude Code?

I need a mutual NDA signed today by Acme Ltd (me: Jane Smith, jane@acme.com)
and Northwind Ltd (Sam Lee, sam@example.com). The wording is in nda.txt.

1. Open a GoodSign account for me with POST https://goodsign.io/api/agent/signup
   (agent "Claude Code"). Give me the pay link, then poll status_url until
   the status is "active".
2. Make mutual-nda.pdf from nda.txt with GoodSign text tags: a signature,
   name and date for each party, keys Acme and Northwind.
3. Upload it to https://goodsign.io/api/uploadpdf with curl. Show me
   what it found before you send.
4. Send it, tell me when both have signed, and save the signed PDF here.

Step 1: the agent asks for an account

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"}'

The reply, trimmed:

{
  "api_key": "...",
  "status": "payment_required",
  "credits": 0,
  "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, so the agent must keep the key and both links: they are not shown again. Until you pay, every API call made with the key answers 402.

Step 2: the one approval

The agent gives you pay_url. The page says an AI agent (Claude Code) is opening an account for Jane Smith, shows 10 credits and their price, and has a "Top up automatically" box, ticked. You pay by card on Stripe. Your bank may ask you to approve the payment. The agent cannot pay for you.

Paying creates the account and switches the key on. The agent polls the status link (no header needed):

curl https://goodsign.io/api/agent/status/...

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

GoodSign then emails you a link to set a password, so you can sign in and see what the agent sends.

Step 3: the PDF and its text tags

The agent writes the PDF with any tool that produces real text, such as Python's reportlab, and prints text tags where the fields go. Each distinct key becomes one signer. The signature block:

Signed for Acme Ltd

[sign|Acme]


Name: [name|Acme                    ]
Date: [date|Acme]

Signed for Northwind Ltd

[sign|Northwind]


Name: [name|Northwind               ]
Date: [date|Northwind]
  • [sign|Key] is the signature, [name|Key] a text box filled in with that signer's name, [date|Key] the signing date, filled in by itself.
  • Keys are letters and digits only, spelt the same way on every tag.
  • Each tag sits on one line as text, never inside an image.
  • No other square brackets in the document: "[insert date]" is read as a tag.
  • The tag's font size sets the field's size. Spaces before the closing bracket widen a name box. Leave blank lines around signature tags.

Signers see the fields, never the brackets.

Step 4: upload and send

With the REST API, in the same session

The key works in curl as soon as the status is active. Uploading uses no credits:

curl -X POST https://goodsign.io/api/uploadpdf \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@mutual-nda.pdf"

{"success": true, "uuid": "6b2f0c1e-...", "badtags": [], "signers_found": 2, ...}

Check that signers_found is 2 and badtags is empty, confirm the names and emails, then send:

curl -X POST https://goodsign.io/api/usetemplate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"uuid": "6b2f0c1e-...", "doc_name": "Mutual NDA Acme Northwind",
       "signers": [
         {"key": "Acme", "name": "Jane Smith", "email": "jane@acme.com"},
         {"key": "Northwind", "name": "Sam Lee", "email": "sam@example.com"}
       ]}'

{"success": true, "doc": {"uuid": "6b2f0c1e-...", "name": "Mutual NDA Acme Northwind.pdf",
 "status": "sent", "webhook": ""}, "warnings": "", "credit": 9}

You and Sam both get a signing email at once. To sign one after the other, add "send_in_order": true; the order is the order of the list.

With the MCP server, after a restart

The GoodSign MCP server takes the same key, but the client has to load it first. You, or the agent from its shell, add it:

claude mcp add --transport http goodsign https://goodsign.io/mcp --header "Authorization: Bearer YOUR_API_KEY"

Most clients load MCP servers at start-up, so plan on restarting Claude Code (claude --continue reopens the conversation). The agent then calls create_upload_url, PUTs the PDF to the link it gets (valid 15 minutes), calls create_document_from_upload, checks the keys with get_document and sends with send_from_template. For one document today, curl is quicker.

Step 5: who has signed, reminders and the signed PDF

curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://goodsign.io/api/document/6b2f0c1e-...

Each entry in master_doc.signers has complete, which is true once that person has signed. The document's status becomes complete when both have. Without a webhook, nothing tells the agent: it has to check.

To chase Sam (this emails him straight away):

curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
  -d "signer_email=sam@example.com" \
  https://goodsign.io/api/document/6b2f0c1e-.../remind

When the status is complete:

curl -H "Authorization: Bearer YOUR_API_KEY" \
  -o mutual-nda-signed.pdf https://goodsign.io/api/download/6b2f0c1e-...

Before then it answers 404, "Document is not complete". The last pages of the signed PDF are the audit trail: IP address, browser, device and the time of each step. Each signer is also emailed the finished PDF.

What did this one job cost?

First payment 10 credits at US$1.50 (NZ$/A$2.50 in New Zealand and Australia): US$15.00
This NDA, two signers 1 credit
Left over 9 credits, which do not expire

One credit covers the envelope however many people sign. SMS verification, a witness, or asking a signer to upload files would each add a credit per signer. There is no subscription. Agent-opened accounts pay the standard price; the half-price first top-up is for accounts opened on the website.

With auto top-up ticked, your card is charged for another 10 credits when the balance falls to 5. Untick it on the pay page to approve each purchase yourself; the same link buys more later. See pricing.

What can go wrong?

  • business_email_required: a Gmail, Outlook.com or similar address. Sign up on the website with the Google, Microsoft or Apple button, create a key at /profile/apikeys and give it to the agent.
  • account_exists: that email already has an account. Sign in and create a key on the same page.
  • 402 payment_required: the link is not paid yet. The agent should poll status_url, not retry. An unpaid link expires after 30 days.
  • under_review: paid, but the account is held for a manual check, for example when the card is from a different country to the person paying. API calls answer 403 until it clears, usually within a few hours.
  • A placeholder email such as "TBC": refused with a 400 before anything is sent or charged.
  • Keys that do not match: a send with no entry for a key in the PDF fails with a 400 that names the key. A misspelt tag type, such as [signature|Acme], is dropped without appearing in badtags, so compare the fields in GET /api/document/{uuid} with the tags printed.
  • Retrying a refused send: upload the PDF again and send the new uuid. A retry on the first uuid answers "This document has already been used".

The agent cannot buy credits; you do, through the pay link or the dashboard. To cancel a sent document, POST /api/document/{uuid}/void.

Where to go next

The full signup request and response are in the agent signup reference. Every send option is in the API reference.

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...