uniportOpen Uniport

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 & API

Then, 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 mcp

    Remote 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 user

    On 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 mcp

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

    Then, 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 list
node ~/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 document
GET/api/documents/{documentId}Read a document snapshot and encrypted relay page
DELETE/api/documents/{documentId}Delete the file forever
POST/api/documents/{documentId}/syncSynchronize a standard document with Yjs
POST/api/documents/{documentId}/encrypted-syncRelay E2EE Yjs updates, presence, and compaction snapshots
POST/api/documents/{documentId}/client-levelRaise the file’s client level
GET/api/documents/{documentId}/shareList non-owner sharing links
POST/api/documents/{documentId}/shareCreate an edit or view capability
PATCH/api/documents/{documentId}/shareRevoke every non-owner link now, or restore links revoked in the last 10 minutes
DELETE/api/documents/{documentId}/shareRevoke every non-owner capability
POST/api/documents/{documentId}/share/{linkId}Name, rename or unname a sharing link
PATCH/api/documents/{documentId}/share/{linkId}Revoke one link now
DELETE/api/documents/{documentId}/share/{linkId}Revoke one non-owner capability
GET/api/documents/{documentId}/historyList saved versions
POST/api/documents/{documentId}/historySave a checkpoint and return checkpoint metadata
GET/api/documents/{documentId}/history/{versionId}Read one historical snapshot
POST/api/documents/{documentId}/history/{versionId}Name, rename or unname a saved version
GET/api/documents/{documentId}/attachmentsList a file’s attachments
GET/api/documents/{documentId}/attachments/{attachmentId}Read a sealed attachment
PUT/api/documents/{documentId}/attachments/{attachmentId}Upload a sealed attachment
POST/api/documents/{documentId}/leaveRemove this client's presence now
POST/api/documents/{documentId}/owner-linkReplace the owner link
POST/api/documents/{documentId}/trashMove the file to Trash
POST/api/documents/{documentId}/restoreTake the file out of Trash

Drafting

Turn supplied details into contract, invoice or payment fields.

POST/api/draftExtract contract, invoice, or payment fields from a prompt

Signatures

Upload a PDF, place fields, create signing links, track recipients and download completed copies.

GET/api/sign/v1/healthCheck service and database health
GET/api/sign/v1/sampleDownload the test agreement
GET/api/sign/v1/signing-keyGet the Ed25519 receipt verification key
POST/api/sign/v1/envelopesCreate a draft or active signing request
GET/api/sign/v1/envelopes/{id}Get document details and signing status
PATCH/api/sign/v1/envelopes/{id}Replace fields while the request is a draft
DELETE/api/sign/v1/envelopes/{id}Permanently delete the signing request
GET/api/sign/v1/envelopes/{id}/accessCheck signer email-verification status
POST/api/sign/v1/envelopes/{id}/access-codeSend an email verification code
POST/api/sign/v1/envelopes/{id}/verify-codeVerify a code and create a 12-hour signer session
POST/api/sign/v1/envelopes/{id}/send-linkEmail one locked recipient link
POST/api/sign/v1/envelopes/{id}/activateLock the document and return signer links
POST/api/sign/v1/envelopes/{id}/voidCancel an unfinished signing request
GET/api/sign/v1/envelopes/{id}/eventsGet audit events
GET/api/sign/v1/envelopes/{id}/receiptGet the signed completion receipt
POST/api/sign/v1/envelopes/{id}/previewPreview signature placement without submitting
POST/api/sign/v1/envelopes/{id}/signRecord a signature with explicit consent
GET/api/sign/v1/envelopes/{id}/pdfDownload the original PDF
GET/api/sign/v1/envelopes/{id}/progressDownload the PDF with submitted signatures
GET/api/sign/v1/envelopes/{id}/completedDownload the completed PDF
GET/api/sign/inbox/keyRead the account's sign inbox key
PUT/api/sign/inbox/keyPublish the account's sign inbox key
GET/api/sign/inboxRead the sealed signing requests waiting for the account
POST/api/sign/inboxPost one signing request sealed to the account's inbox key
DELETE/api/sign/inboxDelete inbox rows a browser opened

Accounts

Account authentication, encrypted file libraries, settings and recovery.

GET/api/accountRead the signed-in account and vault envelope
POST/api/account/setupCreate the account vault metadata
GET/api/account/libraryList encrypted library entries
POST/api/account/libraryCreate or replace one encrypted library entry
POST/api/account/privacySet the default document privacy mode
POST/api/account/passwordReplace the derived login credential and wrapped vault key
POST/api/account/recoverRecover an account with a derived recovery credential
POST/api/account/recover/keyProve a recovery key and read the vault key sealed under it
POST/api/account/recoveryReplace the recovery key
POST/api/account/emailChange the account email
GET/api/account/deleteWhat deleting the account takes
POST/api/account/deleteDelete the account
POST/api/account/delete/startStart deleting the account
GET/api/account/switchesRead the privacy switches
POST/api/account/switchesTurn Uni and AI off, or Lockdown on or off
POST/api/auth/sign-up/emailCreate an account and session
POST/api/auth/sign-in/emailCreate a session
POST/api/auth/sign-outEnd the current session
POST/api/auth/revoke-sessionRevoke one session
POST/api/auth/revoke-sessionsRevoke every session
POST/api/auth/revoke-other-sessionsRevoke every session except the current one
POST/api/auth/update-userUpdate the signed-in profile
GET/api/auth/get-sessionRead the current session
GET/api/auth/list-sessionsList active sessions

Calendar

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 guest
GET/api/calendar/invites/rsvpsRead guests' answers to the account's invites
PATCH/api/calendar/invites/{inviteId}Update or cancel an invite and email it
PUT/api/calendar/book/pages/{pageId}Publish a booking page
DELETE/api/calendar/book/pages/{pageId}Remove a booking page
GET/api/calendar/book/inboxRead bookings the calendar hasn't applied
POST/api/calendar/book/inbox/processedMark bookings applied
POST/api/calendar/book/inbox/cancelCancel bookings whose locks don't match their sealed time
PUT/api/calendar/feedUpload the subscribe feed
DELETE/api/calendar/feedTurn the subscribe feed off
GET/api/calendar/feed/{token}.icsRead the subscribe feed

Shops

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 shop
GET/api/shops/{shopId}Read the owner's shop row
PATCH/api/shops/{shopId}Pause or resume orders
DELETE/api/shops/{shopId}Delete a shop
GET/api/shops/{shopId}/catalogRead the sealed catalog
PUT/api/shops/{shopId}/catalogPublish a catalog
PUT/api/shops/{shopId}/stateReplace the owner state
GET/api/shops/{shopId}/ordersList order metadata
POST/api/shops/{shopId}/ordersPlace a sealed order
POST/api/shops/{shopId}/orders/readRead sealed orders
POST/api/shops/{shopId}/orders/deleteDelete orders
GET/api/shops/{shopId}/requestsList contact requests
POST/api/shops/{shopId}/requestsSend a sealed contact request
DELETE/api/shops/{shopId}/requests/{requestId}Delete a contact request
GET/api/shops/{shopId}/summaryRead a shop summary
GET/api/shops/{shopId}/backupRead when the shop was last backed up
PUT/api/shops/{shopId}/backupStore new backup words' backup
DELETE/api/shops/{shopId}/backupDelete the shop's backup
GET/api/shops/backupFind a shop backup by its words' lookup
GET/api/shops/{shopId}/linksList customer links
POST/api/shops/{shopId}/linksCreate a customer link
DELETE/api/shops/{shopId}/links/{accessId}Revoke a customer link
GET/api/shops/{shopId}/photosList stored photo IDs
GET/api/shops/{shopId}/photos/{photoId}Read a sealed photo
PUT/api/shops/{shopId}/photos/{photoId}Upload a sealed photo
DELETE/api/shops/{shopId}/photos/{photoId}Delete a photo
PUT/api/shops/{shopId}/gateSet, change or remove the shop password
DELETE/api/shops/{shopId}/stagedDelete staged photos
PUT/api/shops/{shopId}/staged/{photoId}Stage a photo for a password change
GET/api/shops/{shopId}/peopleList the people on a shop
POST/api/shops/{shopId}/peopleAdd a person's link
POST/api/shops/{shopId}/claimJoin with a person's link
POST/api/shops/{shopId}/takeTake a shop handed over
POST/api/shops/{shopId}/rotateChange the shop key
POST/api/shops/{shopId}/leaveLeave a shop
POST/api/shops/{shopId}/backUndo leaving
POST/api/shops/{shopId}/restore/{accessId}Undo a removal
PUT/api/shops/{shopId}/taker/{accessId}Make owner
DELETE/api/shops/{shopId}/taker/{accessId}Cancel Make owner
PUT/api/shops/{shopId}/keysAdd to the key ring
GET/api/shops/{shopId}/archiveList the archive of finished orders
POST/api/shops/{shopId}/archiveArchive finished orders
GET/api/shops/{shopId}/archive/{chunkId}Read an archive chunk

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