All articles

How to Send Documents for Signature From OpenAI Codex

You work in Codex and a document needs signing. Add GoodSign's MCP server to Codex's config file and Codex can send it, tell you who has signed, remind the slow ones and save the signed PDF. With no GoodSign account, Codex can open one, and you approve it once by paying a link.

The example: Jane Smith of Acme Ltd sends Tom Reid of Harbour Bikes a services agreement from a template, then a statement of work that Codex writes.

What you need

  • Codex: the CLI, the IDE extension or the desktop app. All three read ~/.codex/config.toml.
  • A GoodSign API key from /profile/apikeys, or a business email so Codex can open an account. Gmail, Outlook.com and similar addresses are refused.
  • A card for the first credits.
  • Your own wording, or a draft you have had checked. GoodSign records who signed and when; it does not review the document.

What do I tell Codex?

Get two documents signed by Tom Reid (tom@example.com) of Harbour Bikes
with GoodSign. I am Jane Smith, jane@acme.com, Acme Ltd.

1. No goodsign MCP tools and no API key? Open an account with POST
   https://goodsign.io/api/agent/signup (agent "Codex"), give me pay_url,
   poll status_url until "active", add the server to ~/.codex/config.toml
   and tell me to restart Codex.
2. Send our "Website Services Agreement" template, me as provider, Tom as
   client. Draft it first.
3. Make sow.md a PDF with GoodSign text tags (key Client), upload it and
   show me what GoodSign found before sending.
4. When both are signed, save the PDFs here.

No account yet: Codex opens one

Codex runs this from its shell:

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

Codex's sandbox blocks network access by default, so it asks you first; that prompt is Codex's own. The reply has "status": "payment_required", an api_key, a pay_url and a status_url. Nothing is stored on GoodSign yet, and the key answers 402 to every call until the link is paid. An unpaid link expires after 30 days.

The one approval. You open pay_url. The page says an AI agent (Codex) is opening an account for Jane Smith, shows 10 credits and their price, and has "Top up automatically" ticked. You pay by card on Stripe; your bank may ask you to confirm. Codex cannot pay. Paying creates the account and switches the key on. Codex polls status_url until it reads "status": "active" and "credits": 10.

A new account is sometimes held for a manual check (under_review), usually for a few hours. GoodSign emails you once, after payment, with a link to set a password.

How do I add GoodSign to Codex?

codex mcp add cannot set a static header, so the setup is four lines in ~/.codex/config.toml. This appends them unless a goodsign entry exists:

grep -q '\[mcp_servers.goodsign\]' ~/.codex/config.toml 2>/dev/null || printf '\n[mcp_servers.goodsign]\nurl = "https://goodsign.io/mcp"\n\n[mcp_servers.goodsign.http_headers]\nAuthorization = "Bearer YOUR_API_KEY"\n' >> ~/.codex/config.toml

Or paste them in by hand:

[mcp_servers.goodsign]
url = "https://goodsign.io/mcp"

[mcp_servers.goodsign.http_headers]
Authorization = "Bearer YOUR_API_KEY"

Codex can run it with its new key; the file is outside your workspace, so Codex asks first. The key sits there as plain text: keep the file out of version control. Check it:

$ codex mcp list
Name      Url                      Bearer Token Env Var  Status   Auth
goodsign  https://goodsign.io/mcp  -                     enabled  Bearer token

To load the server, quit Codex and start it again (codex resume --last reopens the conversation), then type /mcp to see the GoodSign tools. In the desktop app, OpenAI's docs say to select Restart; in the IDE extension, Restart extension.

How does Codex send from a template?

Codex calls account_status for credits and list_templates for the template's uuid. get_document {"uuid": "3c9e71d2-..."} then shows the signer keys: "signers": [{"key": "provider", ...}, {"key": "client", ...}].

send_from_template needs one signer for each key. A draft first:

send_from_template {
  "template_uuid": "3c9e71d2-...",
  "doc_name": "Website Services Agreement Harbour Bikes",
  "signers": [
    {"key": "provider", "name": "Jane Smith", "email": "jane@acme.com"},
    {"key": "client", "name": "Tom Reid", "email": "tom@example.com"}
  ],
  "draft": true
}

The answer says "sent": false. A copy marked Draft is on your dashboard with the signers filled in; nobody is emailed and no credit is spent. Send it from there, or tell Codex to go ahead: it repeats the call without draft, which sends a fresh copy, so delete the leftover draft. That answer:

{"sent": true, "summary": "Sent. Each signer has been emailed their signing link. 1 credit spent.",
 "document": {"uuid": "a81f4b07-..."}, "credits_remaining": 9}

Other arguments: send_in_order, fields, email_subject, email_message, cc_email, and reminder_days per signer.

How does Codex send a PDF it wrote?

Codex writes the PDF as real text and prints text tags where the fields go:

Accepted for Harbour Bikes

[sign|Client]


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

Each distinct key is one signer. Keys are letters and digits, spelt the same on every tag, and the document may have no other square brackets. Then:

  1. create_upload_url (no arguments) returns an upload_url, valid for 15 minutes, and an upload_id.
  2. Codex PUTs the file: curl -T sow.pdf -H "Content-Type: application/pdf" "UPLOAD_URL".
  3. create_document_from_upload {"upload_id": "...", "doc_name": "SOW Harbour Bikes"} returns the new uuid, signers_found: 1 and signer_keys: ["Client"].
  4. send_from_template with that uuid as template_uuid and one signer, Client.

Skip draft here: an uploaded document can be sent once, and a draft uses that up. Uploading spends no credit.

How do I check who has signed?

  • get_document {"uuid": "a81f4b07-..."}: each signer has complete, and the document's status becomes complete when everyone has signed. Codex sees whether each field is filled in, never what anyone typed or drew.
  • remind_signers {"uuid": "a81f4b07-...", "signer_email": "tom@example.com"} emails Tom his link again at once; without signer_email it reminds everyone pending.
  • download_document {"uuid": "a81f4b07-..."} returns a link that needs the same bearer header, so Codex fetches it in its shell:
curl -L -H "Authorization: Bearer YOUR_API_KEY" -o agreement.pdf \
  https://goodsign.io/api/download/a81f4b07-...

Until the document is complete the link answers 404, "Document is not complete". The last pages of the signed PDF are the audit trail. Nothing tells Codex when someone signs: ask it to check.

What does GoodSign tell Codex before it emails anyone?

Codex reads the instructions an MCP server sends when it connects. GoodSign's say send_from_template "EMAILS REAL PEOPLE and spends 1 credit: confirm names and email addresses with the user before sending, or pass draft=true to stage without emailing." They tell Codex never to invent a signer's email address but to ask you, and placeholders such as "TBC" are refused.

void_document is marked destructive, and OpenAI's docs say Codex always asks before a destructive MCP tool call. For Codex to ask before every GoodSign tool that changes something (sending, reminding, uploading, voiding), add this line under url:

default_tools_approval_mode = "writes"

What does this job cost?

First payment 10 credits at US$1.50 (NZ$/A$2.50 in New Zealand and Australia): US$15.00
Services agreement, two signers 1 credit
Statement of work 1 credit
Draft, upload, checks, reminders, downloads 0
Left over 8 credits, which do not expire

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 buys another 10 credits when the balance falls to 5; untick it on the pay page to approve each purchase. SMS verification, a witness or a file request each add a credit per signer. See pricing.

What are the limits?

An account can make 200 tool calls an hour and upload PDFs up to 100MB. Codex cannot buy credits, lay out a template field by field, or manage team members and webhooks.

How do I switch it off?

Delete the key at /profile/apikeys. It stops working at once, for MCP and the REST API. Then delete both goodsign tables from config.toml, or run codex mcp remove goodsign. To pause it and keep the lines, add enabled = false under url.

Where to go next

Setup for other clients is on the GoodSign MCP server page. The full signup request and response are in the agent signup reference, and 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...