Uniport API
Invoices, contracts, documents, spreadsheets, shops and signatures. Agents fill in invoices and contracts, choose their design, paper and logo, and edit clauses with one file, uniport.mjs.
AI agents
After the #, a Uniport link carries an access capability and, for encrypted content, its keys. An agent that holds the link can read and edit what it opens, a document, sheet, invoice, contract or shop, in the role the link grants. The agent library encrypts and decrypts on the agent’s machine and sends only your API key and the link’s capability; content keys never reach the server.
The API is for Pro accounts. Create an API key in Settings › AI apps & API and keep it in UNIPORT_API_KEY: the library sends it with every request as Authorization: Bearer, with the link’s capability in X-Uniport-Capability. People using Uniport in a browser never need one.
curl -fsSLO https://uniport.sh/uniport.mjs # Node.js 22+, one file
export UNIPORT_API_KEY="$(cat api-key.txt)" # from Settings › AI apps & APIThen, in a script beside uniport.mjs:
import { open } from './uniport.mjs';
const h = await open(process.env.UNIPORT_LINK);
console.log(await h.read());uniportopen(link) · create(kind, options)Open what a link points to, or create a document, note, sheet, invoice, contract, task list or shop. A new handle’s link() is its owner link.hread() · refresh() · link()Read the content, pull the latest state, or return the full link.hsetTitle() · share() · shares() · unshare() · checkpoint()Documents, notes, sheets, invoices, contracts and task lists: rename, manage sharing links and save a version.hversions() · restore() · delete()List saved versions, bring one back as a new change, or delete the file.docmarkdown() · blocks() · outline() · comments()Read a document as Markdown or as blocks with their styles, its headings, and its comment threads.docappend() · insert() · update() · remove() · replace()Edit with Markdown, block by block or the whole body.docupdateTextStyle() · updateParagraphStyle() · createParagraphBullets()Format words and paragraphs, apply Title and heading styles, and make lists.docinsertTable() · insertPageBreak() · insertTableOfContents() · setPageSetup() · createFooter()Add tables, page breaks and a table of contents, set the paper and margins, and write headers and footers with page numbers.docreplaceText() · comment() · reply() · resolve()Replace text in place, keeping its formatting, and comment in the agent’s name.doctext() · html() · docx()Download the document as plain text, a web page or a Word file.notemarkdown() · blocks() · append() · update() · comment()Read and edit a note’s blocks with Markdown, and comment on them.sheetread() · write() · append() · clear() · format()Read values or formulas; enter values as typed into the grid; style cells.sheetinsertRows() · deleteRows() · insertColumns() · deleteColumns()Insert and delete rows and columns; formulas follow their cells.sheetsheets() · addSheet() · renameSheet() · deleteSheet() · importCSV() · exportCSV()Manage sheets, and import or export CSV as the app does.invoicedata() · update() · totals()Read and change the fields and lines of an invoice, quote, credit note, purchase order, receipt or remittance.invoicesetDesign() · setPaper() · setLogo()Choose the design and paper of its PDF, and set the issuer’s logo.contractread() · issues() · setTerms() · setParty()Read a contract’s terms, parties and clauses, change terms and parties, and list what to fix before signing.contractaddClause() · editClause() · resetClause() · moveClause() · removeClause()Add the pack’s optional clauses or your own, and rewrite, reset, reorder or remove clauses.contractsetDesign() · setPaper() · setLogo()Choose the design and paper of its PDF, and set the logo.contractreopen()Return a contract sent for signing to draft, so it can be changed and sent again.listread() · tasks() · get() · add() · update() · move() · complete() · remove()Read a task list as a Markdown checklist, filter its tasks, and add, change, move, complete and delete them, subtasks included.liststatuses() · addStatus() · renameStatus() · removeStatus() · members() · comment() · comments()Manage the list’s statuses, see who tasks can be assigned to, and comment on a task.listimportChecklist() · exportMarkdown() · exportCsv()Add tasks from a Markdown checklist, and download the list as Markdown or CSV.shopsettings.update() · products.import() · products.setPhoto()Set up the shop and its pricing rules, and import products from CSV with their photos.shopcodes.add() · links.add() · links.url()Create discount codes and customer links.shoporders.list() · orders.mark() · setOpen()Read orders, mark them paid or done, and pause or resume orders.shoprequests.list() · requests.mark() · setPassword()Read contact requests and mark them handled, and set the shop password customers enter.shopsuppliers.join() · suppliers.list() · suppliers.leave()Sell another Uniport shop’s products as its reseller: join with its reseller link, choose products, or leave.calevents() · add() · update() · remove()Read and change the calendar’s events, repeating ones included.calinvite() · uninvite() · rsvps()Email invitations, updates and cancellations, and read guests’ answers.calpages.add() · bookings.sync() · feed.on()Publish booking pages, add their bookings as events, and turn on the subscribe link.signsend() · status() · remind() · cancel() · pdf() · receipt() · list()Send a PDF for signature, follow it, remind signers, cancel it, download the signed PDF and its receipt, and list what this machine sent.MCP
Uniport has two MCP servers. The local server runs uniport.mjs on your machine and works on everything the library opens, end-to-end encrypted files included, with the links you add to it; their keys never leave the machine, and a link it makes for you to send reaches the AI app with its own key. The remote server at https://uniport.sh/mcp holds no keys: it sends PDFs for signature and follows them, creates and edits standard documents, and drafts invoice and contract fields. Both take your Pro account’s API key, and the remote server also takes a sign-in.
Use Uniport with Claude or ChatGPT: claude.ai, ChatGPT and Claude Desktop in three steps.
Claude Code, Codex and Cursor
- Claude Code
Local server:
curl -fsSLo ~/uniport.mjs https://uniport.sh/uniport.mjs claude mcp add uniport -s user -e UNIPORT_API_KEY="${UNIPORT_API_KEY:?set UNIPORT_API_KEY first}" -- node ~/uniport.mjs mcpRemote server: add it, then run /mcp in Claude Code and sign in to Uniport.
claude mcp add --transport http uniport-web https://uniport.sh/mcp -s userOn a machine without a browser, add it with your API key instead, which Claude Code keeps in ~/.claude.json:
claude mcp add --transport http uniport-web https://uniport.sh/mcp -s user -H "Authorization: Bearer ${UNIPORT_API_KEY:?set UNIPORT_API_KEY first}" - Codex
Local server:
curl -fsSLo ~/uniport.mjs https://uniport.sh/uniport.mjs codex mcp add uniport --env UNIPORT_API_KEY="${UNIPORT_API_KEY:?set UNIPORT_API_KEY first}" -- node ~/uniport.mjs mcpRemote server:
codex mcp add uniport-web --url https://uniport.sh/mcp --bearer-token-env-var UNIPORT_API_KEY - Cursor
Download the library:
curl -fsSLo ~/uniport.mjs https://uniport.sh/uniport.mjsThen, in ~/.cursor/mcp.json:
{ "mcpServers": { "uniport": { "command": "node", "args": ["${userHome}/uniport.mjs", "mcp"], "env": { "UNIPORT_API_KEY": "${env:UNIPORT_API_KEY}" } }, "uniport-web": { "url": "https://uniport.sh/mcp", "headers": { "Authorization": "Bearer ${env:UNIPORT_API_KEY}" } } } }
From a terminal, add the links the local server works on. It names each file by its label, and the links stay in ~/.config/uniport/links.json, readable only by you.
UNIPORT_LINK="$(cat q3-plan-link.txt)" node ~/uniport.mjs mcp add - --label "Q3 plan"List the links, show one in your browser, or forget one; the file stays in Uniport:
node ~/uniport.mjs mcp listnode ~/uniport.mjs mcp open "Q3 plan"node ~/uniport.mjs mcp remove "Q3 plan"Create a document
curl https://uniport.sh/api/documents \
-H "Authorization: Bearer $UNIPORT_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"privacy":"standard","title":"Project notes","markdown":"## Next steps\n\nConfirm the scope."}'The response returns the document ID and owner capability. Send that capability as X-Uniport-Capability, beside the API key, on later requests.
Encrypted documents
Create and encrypt the Yjs state on the client. Uniport stores the encrypted snapshot and relays encrypted changes. A sharing link contains an access capability and a separate content key; send only the capability to the API.
The agent library opens encrypted links and seals every change before it leaves the process. For raw Yjs state, the same file exports UniportClient and envelope. The guide defines document, spreadsheet and business-document state, encryption contexts, permissions and limits.
Documents & collaboration
Create documents, contracts, spreadsheets and business documents. Sync edits, manage sharing, and save and read checkpoints.
POST/api/documentsCreate a standard or end-to-end encrypted documentGET/api/documents/{documentId}Read a document snapshot and encrypted relay pageDELETE/api/documents/{documentId}Delete the file foreverPOST/api/documents/{documentId}/syncSynchronize a standard document with YjsPOST/api/documents/{documentId}/encrypted-syncRelay E2EE Yjs updates, presence, and compaction snapshotsPOST/api/documents/{documentId}/client-levelRaise the file’s client levelGET/api/documents/{documentId}/shareList non-owner sharing linksPOST/api/documents/{documentId}/shareCreate an edit or view capabilityPATCH/api/documents/{documentId}/shareRevoke every non-owner link now, or restore links revoked in the last 10 minutesDELETE/api/documents/{documentId}/shareRevoke every non-owner capabilityPOST/api/documents/{documentId}/share/{linkId}Name, rename or unname a sharing linkPATCH/api/documents/{documentId}/share/{linkId}Revoke one link nowDELETE/api/documents/{documentId}/share/{linkId}Revoke one non-owner capabilityGET/api/documents/{documentId}/historyList saved versionsPOST/api/documents/{documentId}/historySave a checkpoint and return checkpoint metadataGET/api/documents/{documentId}/history/{versionId}Read one historical snapshotPOST/api/documents/{documentId}/history/{versionId}Name, rename or unname a saved versionGET/api/documents/{documentId}/attachmentsList a file’s attachmentsGET/api/documents/{documentId}/attachments/{attachmentId}Read a sealed attachmentPUT/api/documents/{documentId}/attachments/{attachmentId}Upload a sealed attachmentPOST/api/documents/{documentId}/leaveRemove this client's presence nowPOST/api/documents/{documentId}/owner-linkReplace the owner linkPOST/api/documents/{documentId}/trashMove the file to TrashPOST/api/documents/{documentId}/restoreTake the file out of TrashDrafting
Turn supplied details into contract, invoice or payment fields.
POST/api/draftExtract contract, invoice, or payment fields from a promptSignatures
Upload a PDF, place fields, create signing links, track recipients and download completed copies.
GET/api/sign/v1/healthCheck service and database healthGET/api/sign/v1/sampleDownload the test agreementGET/api/sign/v1/signing-keyGet the Ed25519 receipt verification keyPOST/api/sign/v1/envelopesCreate a draft or active signing requestGET/api/sign/v1/envelopes/{id}Get document details and signing statusPATCH/api/sign/v1/envelopes/{id}Replace fields while the request is a draftDELETE/api/sign/v1/envelopes/{id}Permanently delete the signing requestGET/api/sign/v1/envelopes/{id}/accessCheck signer email-verification statusPOST/api/sign/v1/envelopes/{id}/access-codeSend an email verification codePOST/api/sign/v1/envelopes/{id}/verify-codeVerify a code and create a 12-hour signer sessionPOST/api/sign/v1/envelopes/{id}/send-linkEmail one locked recipient linkPOST/api/sign/v1/envelopes/{id}/activateLock the document and return signer linksPOST/api/sign/v1/envelopes/{id}/voidCancel an unfinished signing requestGET/api/sign/v1/envelopes/{id}/eventsGet audit eventsGET/api/sign/v1/envelopes/{id}/receiptGet the signed completion receiptPOST/api/sign/v1/envelopes/{id}/previewPreview signature placement without submittingPOST/api/sign/v1/envelopes/{id}/signRecord a signature with explicit consentGET/api/sign/v1/envelopes/{id}/pdfDownload the original PDFGET/api/sign/v1/envelopes/{id}/progressDownload the PDF with submitted signaturesGET/api/sign/v1/envelopes/{id}/completedDownload the completed PDFGET/api/sign/inbox/keyRead the account's sign inbox keyPUT/api/sign/inbox/keyPublish the account's sign inbox keyGET/api/sign/inboxRead the sealed signing requests waiting for the accountPOST/api/sign/inboxPost one signing request sealed to the account's inbox keyDELETE/api/sign/inboxDelete inbox rows a browser openedAccounts
Account authentication, encrypted file libraries, settings and recovery.
GET/api/accountRead the signed-in account and vault envelopePOST/api/account/setupCreate the account vault metadataGET/api/account/libraryList encrypted library entriesPOST/api/account/libraryCreate or replace one encrypted library entryPOST/api/account/privacySet the default document privacy modePOST/api/account/passwordReplace the derived login credential and wrapped vault keyPOST/api/account/recoverRecover an account with a derived recovery credentialPOST/api/account/recover/keyProve a recovery key and read the vault key sealed under itPOST/api/account/recoveryReplace the recovery keyPOST/api/account/emailChange the account emailGET/api/account/deleteWhat deleting the account takesPOST/api/account/deleteDelete the accountPOST/api/account/delete/startStart deleting the accountGET/api/account/switchesRead the privacy switchesPOST/api/account/switchesTurn Uni and AI off, or Lockdown on or offPOST/api/auth/sign-up/emailCreate an account and sessionPOST/api/auth/sign-in/emailCreate a sessionPOST/api/auth/sign-outEnd the current sessionPOST/api/auth/revoke-sessionRevoke one sessionPOST/api/auth/revoke-sessionsRevoke every sessionPOST/api/auth/revoke-other-sessionsRevoke every session except the current onePOST/api/auth/update-userUpdate the signed-in profileGET/api/auth/get-sessionRead the current sessionGET/api/auth/list-sessionsList active sessionsCalendar
Invitations and guests’ answers, booking pages and their bookings, and the subscribe feed. Programs act as the API key’s account.
POST/api/calendar/invitesStore a sealed invite and email each guestGET/api/calendar/invites/rsvpsRead guests' answers to the account's invitesPATCH/api/calendar/invites/{inviteId}Update or cancel an invite and email itPUT/api/calendar/book/pages/{pageId}Publish a booking pageDELETE/api/calendar/book/pages/{pageId}Remove a booking pageGET/api/calendar/book/inboxRead bookings the calendar hasn't appliedPOST/api/calendar/book/inbox/processedMark bookings appliedPOST/api/calendar/book/inbox/cancelCancel bookings whose locks don't match their sealed timePUT/api/calendar/feedUpload the subscribe feedDELETE/api/calendar/feedTurn the subscribe feed offGET/api/calendar/feed/{token}.icsRead the subscribe feedShops
Read a shop’s encrypted catalog and photos, and send encrypted orders and contact requests. Owners register, publish, read orders and requests, and manage customer links.
POST/api/shops/{shopId}Register a shopGET/api/shops/{shopId}Read the owner's shop rowPATCH/api/shops/{shopId}Pause or resume ordersDELETE/api/shops/{shopId}Delete a shopGET/api/shops/{shopId}/catalogRead the sealed catalogPUT/api/shops/{shopId}/catalogPublish a catalogPUT/api/shops/{shopId}/stateReplace the owner stateGET/api/shops/{shopId}/ordersList order metadataPOST/api/shops/{shopId}/ordersPlace a sealed orderPOST/api/shops/{shopId}/orders/readRead sealed ordersPOST/api/shops/{shopId}/orders/deleteDelete ordersGET/api/shops/{shopId}/requestsList contact requestsPOST/api/shops/{shopId}/requestsSend a sealed contact requestDELETE/api/shops/{shopId}/requests/{requestId}Delete a contact requestGET/api/shops/{shopId}/summaryRead a shop summaryGET/api/shops/{shopId}/backupRead when the shop was last backed upPUT/api/shops/{shopId}/backupStore new backup words' backupDELETE/api/shops/{shopId}/backupDelete the shop's backupGET/api/shops/backupFind a shop backup by its words' lookupGET/api/shops/{shopId}/linksList customer linksPOST/api/shops/{shopId}/linksCreate a customer linkDELETE/api/shops/{shopId}/links/{accessId}Revoke a customer linkGET/api/shops/{shopId}/photosList stored photo IDsGET/api/shops/{shopId}/photos/{photoId}Read a sealed photoPUT/api/shops/{shopId}/photos/{photoId}Upload a sealed photoDELETE/api/shops/{shopId}/photos/{photoId}Delete a photoPUT/api/shops/{shopId}/gateSet, change or remove the shop passwordDELETE/api/shops/{shopId}/stagedDelete staged photosPUT/api/shops/{shopId}/staged/{photoId}Stage a photo for a password changeGET/api/shops/{shopId}/peopleList the people on a shopPOST/api/shops/{shopId}/peopleAdd a person's linkPOST/api/shops/{shopId}/claimJoin with a person's linkPOST/api/shops/{shopId}/takeTake a shop handed overPOST/api/shops/{shopId}/rotateChange the shop keyPOST/api/shops/{shopId}/leaveLeave a shopPOST/api/shops/{shopId}/backUndo leavingPOST/api/shops/{shopId}/restore/{accessId}Undo a removalPUT/api/shops/{shopId}/taker/{accessId}Make ownerDELETE/api/shops/{shopId}/taker/{accessId}Cancel Make ownerPUT/api/shops/{shopId}/keysAdd to the key ringGET/api/shops/{shopId}/archiveList the archive of finished ordersPOST/api/shops/{shopId}/archiveArchive finished ordersGET/api/shops/{shopId}/archive/{chunkId}Read an archive chunkPrivacy and access
Standard documents and signing PDFs are readable by the server. Encrypted documents reach it only as ciphertext; their plaintext, content keys and file-library keys stay on the client. Sharing-link names in encrypted documents are sealed with the document key. AI drafting sends the prompt in readable form to Google Gemini, outside end-to-end encryption. Calendar invitations go out by email with the event’s title, time and guests’ addresses, and a subscribe feed is readable by anyone with its link. The remote MCP server refuses links that carry a key and sees only what Sign and standard documents show the server.
View, edit, owner, sender and signer capabilities have different permissions. Use the least access the operation needs. Signing requires the recipient’s explicit consent and the current document hash.