Hatch
On this page

Accounts, sync, sharing and published sites. Every call is JSON unless it says otherwise, and errors answer { message, code? } with a message written for people.

Base URL

https://your-hatch-server

Authentication

  • session: send Authorization: Bearer <token>. The session token from signing in (or the session cookie in a browser on the same origin).

Endpoints

Account

Billing

EndpointWhat it does
GET /api/billingYour plan, and the plans there are
POST /api/billing/checkoutStart paying for a plan
POST /api/billing/portalOpen the billing portal

Sites

EndpointWhat it does
GET /api/sitesYour sites, and what this server can do for them
POST /api/sitesMake a site
PATCH /api/sites/{id}Change a site’s title, who can see it, or its invites
DELETE /api/sites/{id}Delete a site
PUT /api/sites/{id}/deployPublish a built site
GET /api/sites/{id}/activityWhat happened to a site, newest first
PATCH /api/sites/{id}/vaultLink a site to a synced vault, or unlink it
GET /api/sites/{id}/notificationsHow the owner hears about new responses
PUT /api/sites/{id}/notificationsChange how the owner hears about new responses

Analytics

EndpointWhat it does
GET /api/sites/{id}/statsVisits to a site

Roadmap

EndpointWhat it does
GET /api/sites/{id}/votesVotes for each roadmap item

Domains

EndpointWhat it does
GET /api/sites/{id}/domainA site’s own domain and the DNS records it needs
PUT /api/sites/{id}/domainGive a site its own domain
DELETE /api/sites/{id}/domainStop using a site’s own domain
POST /api/sites/{id}/domain/checkCheck a domain’s DNS records again

Newsletter

EndpointWhat it does
GET /api/sites/{id}/newsletterA site’s subscribers and the issues it sent
DELETE /api/sites/{id}/subscribers/{sid}Remove a subscriber
POST /api/sites/{id}/issuesEmail a page to subscribers, or a test to yourself

Forms

EndpointWhat it does
GET /api/sites/{id}/submissionsResponses to a site’s forms
DELETE /api/sites/{id}/submissions/{sid}Delete a form response
GET /api/sites/{id}/webhookA site’s form webhook, with its secret
PUT /api/sites/{id}/webhookSend new form responses to an address
DELETE /api/sites/{id}/webhookStop sending form responses
POST /api/sites/{id}/webhook/testSend a made-up response to the webhook now

Careers

EndpointWhat it does
GET /api/sites/{id}/applicationsApplications to a careers site
GET /api/sites/{id}/applications/{aid}/resumeDownload an applicant’s resume
DELETE /api/sites/{id}/applications/{aid}Delete an application
GET /api/sync/vaults/{vault}/careersThe careers site a vault is linked to

Sync

EndpointWhat it does
GET /api/sync/vaultsYour synced vaults, and ones shared with you
POST /api/sync/vaultsStart syncing a vault
PATCH /api/sync/vaults/{vault}/nameRename a vault
DELETE /api/sync/vaults/{vault}Delete a vault from the server, or leave one shared with you
GET /api/sync/vaults/{vault}/activityWhat happened in a vault, newest first
GET /api/sync/vaults/{vault}/changesFiles changed since a revision
GET /api/sync/vaults/{vault}/fileA file’s bytes
PUT /api/sync/vaults/{vault}/fileSave a file
DELETE /api/sync/vaults/{vault}/fileDelete a file
GET /api/sync/vaults/{vault}/versionsA file’s history, newest first
GET /api/sync/vaults/{vault}/versionOne older version’s bytes

Sharing

EndpointWhat it does
GET /api/sync/vaults/{vault}/peopleWho a vault is shared with, and open invites
POST /api/sync/vaults/{vault}/invitesInvite someone to a vault by email
PUT /api/sync/vaults/{vault}/people/{user}/roleChange what someone a vault is shared with may do
GET /api/sync/vaults/{vault}/rulesFolder rules: who may do what in which folder
PUT /api/sync/vaults/{vault}/rulesGive someone, or everyone, a role in one folder
POST /api/sync/vaults/{vault}/rules/moveA folder was renamed or moved: its rules go with it
DELETE /api/sync/vaults/{vault}/invites/{invite}Cancel an invite
DELETE /api/sync/vaults/{vault}/people/{user}Remove someone from a vault, or leave it
GET /api/sync/invitesInvites waiting for you
POST /api/sync/invites/{invite}/acceptJoin a vault you were invited to
POST /api/sync/invites/{invite}/declineTurn an invite down

Workspaces

EndpointWhat it does
GET /api/workspace-invitesInvites to workspaces waiting for this account. Shown once its address is confirmed, when the server can confirm addresses.
GET /api/workspaces/{workspace}A workspace’s rules, email domains and vaults. Members only; admins also see the records to add.
PATCH /api/workspaces/{workspace}Change a workspace’s rules. Owners and admins.
POST /api/workspaces/{workspace}/domainsStart proving the workspace owns an email domain. Answers the TXT record to add.
POST /api/workspaces/{workspace}/domains/{domain}/verifyCheck the domain’s TXT record
DELETE /api/workspaces/{workspace}/domains/{domain}Stop using an email domain
GET /api/workspaces/{workspace}/ssoThe workspace’s single sign-on, and the addresses to give its identity provider. Owners and admins.
PUT /api/workspaces/{workspace}/ssoSet up or replace single sign-on for a verified domain. Owners, after entering their password.
PATCH /api/workspaces/{workspace}/ssoMake single sign-on the only way in for members in the domain. Owners who have signed in with it.
DELETE /api/workspaces/{workspace}/ssoTurn single sign-on off. Owners, after entering their password.
GET /api/workspaces/{workspace}/scimWhether the workspace’s directory provisions its people (SCIM), and the address to give it. Owners and admins.
POST /api/workspaces/{workspace}/scimMake the directory’s bearer token, replacing any old one. Shown once. Owners, after entering their password.
DELETE /api/workspaces/{workspace}/scimStop the directory provisioning people. Those it added stay. Owners, after entering their password.
GET /api/workspaces/{workspace}/activityWho joined, left, signed in and changed roles, and every change to the rules, newest first. Owners and admins.
GET /api/workspaces/{workspace}/activity/exportDownload the workspace’s activity as CSV or JSON, with the same filters, up to 50,000 events. Owners and admins.
GET /api/workspaces/{workspace}/streamWhere the workspace’s activity is sent as it happens (to a SIEM), if anywhere. Owners and admins; admins see only its origin.
PUT /api/workspaces/{workspace}/streamSend each new activity event to this https address, signed like form webhooks. The signing secret is in the answer only when it’s new. Owners, after entering their password.
DELETE /api/workspaces/{workspace}/streamStop sending activity. Owners, after entering their password.
POST /api/workspaces/{workspace}/stream/testSend a test event now. Owners and admins.
PUT /api/sync/vaults/{vault}/workspaceShare a vault you made with a workspace you manage, or take it back (workspace: null)

Live editing

EndpointWhat it does
POST /api/live/ticketA one-time ticket to open a live editing connection