---
title: "API reference · Hypamoon API docs"
description: "Every endpoint of the Hypamoon API with its scope, parameters, responses and errors."
url: https://hypamoon.com/docs/reference
---

**Start for free.** [Sign up](https://app.hypamoon.com/?mode=signup&utm_source=docs&utm_campaign=banner) without a card and connect your chat, or create a test key for the API. Going live with something real asks for a quick check of your company first.

# API reference

Every endpoint of the Hypamoon API with its scope, parameters, responses and errors.

Generated from [`openapi.json`](https://hypamoon.com/docs/openapi.json) (version 1.0.0). Feed that file to your code generator or agent; this page shows the same content.

Hypamoon is the infrastructure a chat or an agent builds on for a business: sites and apps (with server code, sign-in and their own database), data and forms, a media library, domains, email from your own domain, phone numbers with voice AI, SMS and chat, payments (see [https://hypamoon.com/docs/payments](https://hypamoon.com/docs/payments)) and agents. The same project is reachable from a connected chat over MCP and from your own code over this REST API.

Calls are inbound, plus outbound calls your assistant makes to people who expect them (POST /calls).

Every request needs an API key: `Authorization: Bearer hm_live_...`, or `hm_test_...` in test mode. Each key has scopes and a rate limit of 120 requests per 60 seconds.

An OAuth access token (`hm_oat_...`, from connecting an assistant such as Claude.ai or ChatGPT) works on every /api/v1 route as well, with the scopes the user granted on the consent screen. For your own app, create an API key in the portal instead.

Every error is `application/problem+json` with a `type` URL that explains the fix (`https://hypamoon.com/docs/errors/<slug>`). Every response carries an `X-Request-Id` header; include it when you ask us for help.

Field names are snake\_case, except inside a call plan, which is stored exactly as you send it (camelCase). New fields may be added to a response at any time; renaming or removing one requires a new version.

All paths are relative to the base URL:

```
https://api.hypamoon.com/api/v1
```

## Endpoints

| Method | Path | Scope |  |
| --- | --- | --- | --- |
| `GET` | `/domains` | `sites:read` | List the domains |
| `POST` | `/domains` | `sites:write` | Connect a domain the user owns |
| `GET` | `/domains/health` | `sites:read` | List watched domains and their health |
| `POST` | `/domains/watch` | `sites:write` | Watch a domain, or park it |
| `GET` | `/domains/{id}/dns-cleanup` | `sites:read` | Suggest a cleanup of left-over DNS records |
| `POST` | `/domains/{id}/dns-cleanup` | `sites:write` | Remove left-over DNS records in one step |
| `POST` | `/domains/{id}/dns-cleanup/restore` | `sites:write` | Put the records of a cleanup back |
| `GET` | `/domains/check` | `sites:read` | Check whether a domain is available |
| `GET` | `/domains/suggestions` | `sites:read` | Suggest available domains |
| `POST` | `/domains/register` | `sites:write` | Register a domain |
| `GET` | `/domains/{id}` | `sites:read` | Get a domain |
| `PATCH` | `/domains/{id}` | `sites:write` | Update the settings of a domain |
| `DELETE` | `/domains/{id}` | `sites:write` | Disconnect a domain |
| `POST` | `/domains/{id}/activate` | `sites:write` | Check a domain and attach its site |
| `PUT` | `/domains/{id}/site` | `sites:write` | Set the site of a domain |
| `POST` | `/domains/{id}/authcode` | `sites:write` | Get the transfer code of a domain |
| `GET` | `/domains/{id}/dns-records` | `sites:read` | List the DNS records |
| `POST` | `/domains/{id}/dns-records` | `sites:write` | Add, change or delete a DNS record |
| `POST` | `/domains/{id}/dns-records/undo` | `sites:write` | Undo the last DNS change |
| `GET` | `/domains/diagnose` | `sites:read` | Check a domain and suggest fixes |
| `POST` | `/domains/{id}/zone-file` | `sites:write` | Import a zone file |
| `GET` | `/domains/{id}/preflight` | `sites:read` | Compare the old and the new DNS |
| `POST` | `/domains/{id}/restore` | `sites:write` | Restore the DNS records |
| `POST` | `/domains/{id}/nameservers` | `sites:write` | Switch the nameservers |
| `POST` | `/domains/transfer` | `sites:write` | Transfer a domain to Hypamoon |
| `GET` | `/project` | `project:read` | Get the project |
| `PUT` | `/project/company` | `project:write` | Set the company or personal details |
| `GET` | `/advice` | `project:read` | Get the blueprint for a kind of application |
| `POST` | `/project/move-to-live` | `project:write` | Move sites from the test project to the live project |
| `POST` | `/project/move-to-live/undo` | `project:write` | Undo a move to live |
| `GET` | `/errors` | `project:read` | List recent errors |
| `GET` | `/balance` | `project:read` | Get the prepaid balance |
| `GET` | `/numbers` | `numbers:read` | List the numbers |
| `POST` | `/numbers` | `numbers:write` | Order a number |
| `GET` | `/numbers/available` | `numbers:read` | Search for numbers to order |
| `DELETE` | `/numbers/{id}` | `numbers:write` | Release a test number |
| `GET` | `/assistant` | `assistant:write` | Get the assistant |
| `PUT` | `/assistant` | `assistant:write` | Set the assistant |
| `GET` | `/numbers/{id}/call-plan` | `numbers:read` | Get the call plan of a number |
| `PUT` | `/numbers/{id}/call-plan` | `numbers:write` | Set the call plan of a number |
| `GET` | `/calls` | `calls:read` | List the calls |
| `POST` | `/calls` | `calls:write` | Call someone with your assistant |
| `GET` | `/calls/{id}` | `calls:read` | Get a call with transcript and summary |
| `GET` | `/calls/{id}/events` | `calls:read` | Get the timeline of a call |
| `GET` | `/call-consents` | `calls:read` | List recorded consent for marketing calls |
| `POST` | `/call-consents` | `calls:write` | Record consent for marketing calls |
| `DELETE` | `/call-consents/{id}` | `calls:write` | Revoke consent for marketing calls |
| `GET` | `/webhooks` | `webhooks:write` | List the webhook endpoints |
| `POST` | `/webhooks` | `webhooks:write` | Create a webhook endpoint |
| `DELETE` | `/webhooks/{id}` | `webhooks:write` | Delete a webhook endpoint |
| `POST` | `/webhooks/{id}/enable` | `webhooks:write` | Switch a webhook endpoint back on |
| `POST` | `/webhooks/{id}/test` | `webhooks:write` | Send a test event |
| `GET` | `/messages` | `messages:read` | List the messages |
| `POST` | `/messages` | `messages:write` | Send an SMS |
| `GET` | `/messages/{id}` | `messages:read` | Get a message |
| `GET` | `/conversations` | `chat:read` | List the conversations |
| `POST` | `/conversations` | `chat:write` | Start a chat conversation |
| `GET` | `/conversations/{id}` | `chat:read` | Get a conversation with its messages and summary |
| `POST` | `/conversations/{id}/messages` | `chat:write` | Send a customer message and get the reply |
| `POST` | `/conversations/{id}/close` | `chat:write` | Close a conversation |
| `GET` | `/chat-tokens` | `chat:read` | List the public chat tokens |
| `POST` | `/chat-tokens` | `chat:write` | Create a public chat token for the chat widget |
| `GET` | `/chat-tokens/{id}` | `chat:read` | Get a public chat token |
| `PATCH` | `/chat-tokens/{id}` | `chat:write` | Change a public chat token |
| `DELETE` | `/chat-tokens/{id}` | `chat:write` | Revoke a public chat token |
| `GET` | `/public/config` |  | Get the widget settings (public) |
| `POST` | `/public/conversations` |  | Start a conversation from the widget (public) |
| `GET` | `/public/conversations/{id}` |  | Get the visitor's conversation (public) |
| `POST` | `/public/conversations/{id}/messages` |  | Send a visitor message and get the reply (public) |
| `GET` | `/public/challenge` |  | The bot check page for the widget (public) |
| `GET` | `/public/texts` |  | Get the texts for checkout.js, cart.js and form.js (public) |
| `GET` | `/sites` | `sites:read` | List the sites |
| `POST` | `/sites` | `sites:write` | Publish a static site |
| `POST` | `/sites/uploads` | `sites:write` | Get upload links for large files |
| `POST` | `/sites/drops` | `sites:write` | Create a drop link where the user uploads files in a browser |
| `GET` | `/sites/drops/{id}` | `sites:read` | Get a drop link and the files the user uploaded |
| `GET` | `/sites/{id}` | `sites:read` | Get a site |
| `PUT` | `/sites/{id}` | `sites:write` | Change the files, the name or the password of a site |
| `DELETE` | `/sites/{id}` | `sites:write` | Delete a site |
| `GET` | `/sites/deleted` | `sites:read` | List the deleted sites that can be restored |
| `POST` | `/sites/{id}/restore` | `sites:write` | Restore a deleted site |
| `GET` | `/sites/address-suggestions` | `sites:read` | Suggest an address for a site |
| `PUT` | `/sites/{id}/address` | `sites:write` | Change the address or visibility of a site |
| `POST` | `/sites/{id}/rotate-secret-url` | `sites:write` | Make a new secret link for an unlisted site |
| `GET` | `/sites/{id}/versions` | `sites:read` | List the versions of a site |
| `GET` | `/sites/{id}/diff` | `sites:read` | Show what changed between two versions |
| `POST` | `/sites/{id}/rollback` | `sites:write` | Roll a site back to an earlier version |
| `POST` | `/sites/{id}/restore-files` | `sites:write` | Restore a few files from an earlier version |
| `POST` | `/sites/{id}/versions/{versionId}/promote` | `sites:write` | Publish a preview |
| `PUT` | `/sites/{id}/versions/{versionId}/label` | `sites:write` | Label a version |
| `GET` | `/sites/{id}/store-readiness` | `sites:read` | Check whether a site is ready for the App Store and Google Play |
| `GET` | `/sites/{id}/store-listing` | `sites:read` | Draft the store listing for a site's app |
| `GET` | `/sites/{id}/privacy-answers` | `sites:read` | Answers for Apple App Privacy and Google Play Data safety |
| `POST` | `/sites/{id}/app-export` | `sites:write` | Export a Capacitor app project for a site |
| `GET` | `/sites/{id}/readiness` | `sites:read` | Check what works on a site and what is missing before going live |
| `POST` | `/search-console/verify` | `sites:write` | Verify a site or domain in Google Search Console |
| `GET` | `/sites/{id}/stats` | `sites:read` | Get the visits of a site |
| `GET` | `/sites/{id}/fetch` | `sites:read` | Fetch a page of a site or app, live |
| `GET` | `/sites/{id}/file` | `sites:read` | Read one text file of a site |
| `GET` | `/sites/{id}/recipients` | `sites:read` | List the recipient passwords of a site |
| `POST` | `/sites/{id}/recipients` | `sites:write` | Create a personal password for one recipient |
| `PATCH` | `/sites/{id}/recipients/{recipientId}` | `sites:write` | Change the end date of a recipient password |
| `DELETE` | `/sites/{id}/recipients/{recipientId}` | `sites:write` | Revoke a recipient password |
| `POST` | `/sites/import` | `sites:write` | Import an existing site |
| `POST` | `/sites/inspect-wordpress` | `sites:read` | Inspect a WordPress site |
| `POST` | `/sites/import-wordpress` | `sites:write` | Import a WordPress site |
| `POST` | `/sites/migrate-wordpress` | `sites:write` | Move a WordPress site, step by step |
| `GET` | `/media` | `sites:read` | List the media library |
| `POST` | `/media/links` | `sites:write` | Create an upload page for the media library |
| `GET` | `/media/{id}` | `sites:read` | Get a file from the media library |
| `PATCH` | `/media/{id}` | `sites:write` | Rename or move a file, set its alt text, title or tags, or restore it |
| `DELETE` | `/media/{id}` | `sites:write` | Move a file from the media library to the trash |
| `GET` | `/collections` | `data:read` | List the collections |
| `POST` | `/collections` | `data:write` | Create a collection |
| `GET` | `/collections/{id}` | `data:read` | Get a collection |
| `PATCH` | `/collections/{id}` | `data:write` | Change a collection |
| `DELETE` | `/collections/{id}` | `data:write` | Delete a collection |
| `GET` | `/collections/{id}/documents` | `data:read` | List the documents |
| `POST` | `/collections/{id}/documents` | `data:write` | Add a document |
| `GET` | `/collections/{id}/documents/{docId}` | `data:read` | Get a document |
| `PATCH` | `/collections/{id}/documents/{docId}` | `data:write` | Change a document |
| `DELETE` | `/collections/{id}/documents/{docId}` | `data:write` | Delete a document |
| `GET` | `/public/collections/{name}/documents` |  | Read the newest documents (public) |
| `POST` | `/public/collections/{name}/documents` |  | Send a form entry (public) |
| `POST` | `/test/calls` | `calls:read` | Simulate a call |
| `POST` | `/wordpress/connect-codes` | `data:write` | Create a code to connect a WordPress site |
| `GET` | `/wordpress/connections` | `data:read` | List connected WordPress sites |
| `GET` | `/wordpress/connections/{id}` | `data:read` | Get the inventory of a connected WordPress site |
| `DELETE` | `/wordpress/connections/{id}` | `data:write` | Revoke a WordPress connection |
| `PUT` | `/wordpress/connections/{id}/selection` | `data:write` | Choose what moves from a WordPress site |
| `GET` | `/wordpress/connections/{id}/suggestion` | `data:read` | Read the compact inventory and the open suggestion |
| `PUT` | `/wordpress/connections/{id}/suggestion` | `data:write` | Suggest a selection for a WordPress site |
| `GET` | `/wordpress/connections/{id}/embeds` | `data:read` | Read the chat and forms on a WordPress site |
| `PUT` | `/wordpress/connections/{id}/embeds` | `data:write` | Put the chat and forms on a WordPress site |
| `POST` | `/wordpress/connect` | none | Connect the plugin with a code (plugin) |
| `GET` | `/wordpress/connection` |  | Read the connection (plugin) |
| `DELETE` | `/wordpress/connection` |  | Disconnect (plugin) |
| `PUT` | `/wordpress/connection/inventory` |  | Send the inventory (plugin) |
| `PUT` | `/wordpress/connection/integrity` |  | Send the clean-move check (plugin) |
| `GET` | `/wordpress/connection/selection` |  | Pull the selection (plugin) |
| `PUT` | `/wordpress/connection/selection` |  | Change the selection (plugin) |
| `DELETE` | `/wordpress/connection/suggestion` |  | Close the suggestion of the chat (plugin) |
| `GET` | `/wordpress/connection/embeds` |  | Pull the chat and forms for the site (plugin) |
| `PUT` | `/wordpress/connection/embeds` |  | Turn the chat on or off (plugin) |
| `POST` | `/wordpress/exports` |  | Start an export round (plugin) |
| `POST` | `/wordpress/exports/{id}/batches` |  | Send a batch (plugin) |
| `POST` | `/wordpress/exports/{id}/finish` |  | Finish an export round (plugin) |
| `POST` | `/mcp` | `project:read` | Model Context Protocol endpoint |
| `GET` | `/openapi.json` | none | This OpenAPI document |
| `GET` | `/status` | none | Check whether Hypamoon is working |
| `GET` | `/recipes` | none | List the recipes |
| `GET` | `/recipes/{id}` | none | Get a recipe |
| `GET` | `/agents` | `project:read` | List the agents |
| `POST` | `/agents` | `project:write` | Create an agent |
| `GET` | `/agents/{id}` | `project:read` | Get an agent |
| `PATCH` | `/agents/{id}` | `project:write` | Change an agent |
| `DELETE` | `/agents/{id}` | `project:write` | Delete an agent |
| `GET` | `/agents/{id}/runs` | `project:read` | List the runs of an agent |
| `POST` | `/agent-actions/{id}/decide` | `project:write` | Approve or reject an agent action |
| `GET` | `/apps` | `sites:read` | List the apps |
| `POST` | `/apps` | `sites:write` | Deploy an app |
| `GET` | `/apps/{id}` | `sites:read` | Get an app |
| `DELETE` | `/apps/{id}` | `sites:write` | Delete an app |
| `POST` | `/apps/{id}/rollback` | `sites:write` | Roll an app back |
| `GET` | `/apps/{id}/logs` | `sites:read` | Read the log of an app |
| `GET` | `/apps/{id}/users` | `sites:read` | List the users of an app |
| `POST` | `/apps/{id}/users` | `sites:write` | Invite someone to an app |
| `GET` | `/apps/{id}/mails` | `sites:read` | List the emails an app sent |
| `POST` | `/apps/{id}/users/import` | `sites:write` | Import users from a collection |
| `PATCH` | `/apps/{id}/users/{userId}` | `sites:write` | Change the role of a user |
| `DELETE` | `/apps/{id}/users/{userId}` | `sites:write` | Remove a user from an app |
| `POST` | `/apps/{id}/users/{userId}/email` | `sites:write` | Change the email address of a user |
| `POST` | `/apps/{id}/users/{userId}/test-login` | `sites:write` | Sign in as a test user |
| `POST` | `/apps/{id}/users/{userId}/export` | `sites:write` | Export everything of one user (GDPR) |
| `DELETE` | `/apps/{id}/users/{userId}/data` | `sites:write` | Delete everything of one user (GDPR) |
| `POST` | `/apps/{id}/subjects/export` | `sites:write` | Export everything about one person the app keeps data on (GDPR) |
| `POST` | `/apps/{id}/subjects/delete` | `sites:write` | Delete everything about one person the app keeps data on (GDPR) |
| `PUT` | `/apps/{id}/tables/{table}/owner` | `sites:write` | Make a table private per user |
| `DELETE` | `/apps/{id}/tables/{table}/owner` | `sites:write` | Make a per-user table shared again |
| `GET` | `/apps/{id}/files` | `sites:read` | List the files of an app |
| `DELETE` | `/apps/{id}/files/{fileId}` | `sites:write` | Delete a file from an app |
| `GET` | `/apps/{id}/migrations` | `sites:read` | List the migrations of an app |
| `POST` | `/apps/{id}/migrations` | `sites:write` | Apply migrations to the database of an app |
| `GET` | `/apps/{id}/schema` | `sites:read` | Read the schema of an app's database |
| `GET` | `/apps/{id}/code` | `sites:read` | Read the server code of an app |
| `POST` | `/apps/{id}/query` | `sites:read` | Run one read-only query on an app's database |
| `GET` | `/app-files` | `data:read` | List the files (from an app) |
| `POST` | `/app-files` | `data:write` | Get an upload link (from an app) |
| `GET` | `/app-files/{id}` | `data:read` | Get a download link (from an app) |
| `DELETE` | `/app-files/{id}` | `data:write` | Delete a file (from an app) |
| `GET` | `/app-files/{id}/text` | `data:read` | Read a file's text (from an app) |
| `GET` | `/app-files/{id}/content` | `data:read` | Read a file's content (from an app) |
| `GET` | `/app-users` | `data:read` | List the users (from an app, as admin) |
| `POST` | `/app-users` | `data:write` | Invite someone (from an app, as admin) |
| `GET` | `/app-users/{id}` | `data:read` | Get one user (from an app, as admin) |
| `PATCH` | `/app-users/{id}` | `data:write` | Change a user's role (from an app, as admin) |
| `DELETE` | `/app-users/{id}` | `data:write` | Remove a user (from an app, as admin) |
| `GET` | `/apps/{id}/secrets` | `sites:read` | List the secrets of an app |
| `PUT` | `/apps/{id}/secrets/{name}` | `sites:write` | Set a secret of an app |
| `DELETE` | `/apps/{id}/secrets/{name}` | `sites:write` | Delete a secret of an app |
| `GET` | `/apps/{id}/groups` | `sites:read` | List the groups of an app |
| `POST` | `/apps/{id}/groups` | `sites:write` | Create a group in an app |
| `POST` | `/apps/{id}/groups/{key}/members` | `sites:write` | Add a user to a group |
| `GET` | `/emails` | `messages:read` | List sent emails |
| `POST` | `/emails` | `messages:write` | Send one email |
| `GET` | `/app-emails` | `data:read` | List the emails of an app (from the app) |
| `POST` | `/app-emails` | `data:write` | Send one email (from an app) |
| `POST` | `/emails/batch` | `messages:write` | Send a batch of emails |
| `POST` | `/app-emails/batch` | `data:write` | Send a batch of emails (from an app) |
| `GET` | `/emails/{id}` | `messages:read` | Get one email |
| `GET` | `/app-emails/{id}` | `data:read` | Get one email of an app (from the app) |
| `GET` | `/email-domains` | `sites:read` | List sending domains |
| `POST` | `/email-domains` | `sites:write` | Add a sending domain |
| `GET` | `/email-domains/{id}` | `sites:read` | Get a sending domain |
| `DELETE` | `/email-domains/{id}` | `sites:write` | Remove a sending domain |
| `POST` | `/email-domains/{id}/verify` | `sites:write` | Check a sending domain now |
| `POST` | `/email-recipients` | `messages:write` | Confirm a recipient (owner only) |
| `POST` | `/email-recipients/check` | `messages:read` | Check email addresses |
| `GET` | `/email-deliverability` | `messages:read` | Get delivery per sending domain |
| `GET` | `/email-domains/{id}/bimi` | `sites:read` | Get the inbox logo (BIMI) of a sending domain |
| `POST` | `/email-domains/{id}/bimi` | `sites:write` | Set the inbox logo (BIMI) of a sending domain |
| `POST` | `/email-dedicated-ip` | `messages:write` | Request a dedicated sending IP |
| `GET` | `/inbound-addresses` | `messages:read` | List inbound addresses |
| `POST` | `/inbound-addresses` | `messages:write` | Receive email on an address |
| `DELETE` | `/inbound-addresses/{id}` | `messages:write` | Stop receiving on an address |
| `GET` | `/inbound-emails` | `messages:read` | List received emails |
| `DELETE` | `/inbound-emails` | `messages:write` | Delete all email from one sender |
| `GET` | `/inbound-emails/{id}` | `messages:read` | Get a received email |
| `DELETE` | `/inbound-emails/{id}` | `messages:write` | Delete a received email |
| `POST` | `/inbound-emails/{id}/reply` | `messages:write` | Reply to a received email |
| `GET` | `/email-templates` | `messages:read` | List email templates |
| `POST` | `/email-templates` | `messages:write` | Create an email template |
| `GET` | `/email-templates/{id}` | `messages:read` | Get an email template |
| `PATCH` | `/email-templates/{id}` | `messages:write` | Update an email template |
| `DELETE` | `/email-templates/{id}` | `messages:write` | Delete an email template |
| `POST` | `/email-templates/{id}/preview` | `messages:read` | Preview an email template |
| `GET` | `/email-automations` | `messages:read` | List email automations |
| `POST` | `/email-automations` | `messages:write` | Create an email automation |
| `PATCH` | `/email-automations/{id}` | `messages:write` | Update an email automation |
| `DELETE` | `/email-automations/{id}` | `messages:write` | Delete an email automation |
| `GET` | `/scheduled-emails` | `messages:read` | List scheduled emails |
| `GET` | `/scheduled-emails/{id}` | `messages:read` | Get a scheduled email |
| `POST` | `/scheduled-emails/{id}/cancel` | `messages:write` | Cancel a scheduled email |
| `GET` | `/email-sequences` | `messages:read` | List email sequences |
| `POST` | `/email-sequences` | `messages:write` | Create an email sequence |
| `GET` | `/email-sequences/{id}` | `messages:read` | Get an email sequence |
| `DELETE` | `/email-sequences/{id}` | `messages:write` | Delete an email sequence |
| `POST` | `/email-sequences/{id}/enrollments` | `messages:write` | Add someone to an email sequence |
| `POST` | `/email-sequences/{id}/stop` | `messages:write` | Stop an email sequence for someone |
| `GET` | `/clients` | `clients:read` | List your client projects |
| `POST` | `/clients` | `clients:write` | Set up a project for a client |
| `POST` | `/clients/access-requests` | `clients:write` | Ask a client for access to their project |
| `POST` | `/clients/{id}/owner-invite` | `clients:write` | Invite the client to own the project |
| `GET` | `/clients/{id}/access` | `clients:read` | See who has direct access to a client project |
| `POST` | `/clients/{id}/access` | `clients:write` | Give a client direct access to a project |
| `DELETE` | `/clients/{id}/access` | `clients:write` | Remove a client's direct access |
| `DELETE` | `/clients/{id}` | `clients:write` | Stop working on a client project |
| `POST` | `/clients/{id}/transfer` | `clients:write` | Hand over a client project |
| `DELETE` | `/clients/{id}/transfer` | `clients:write` | Cancel a handover |
| `POST` | `/clients/{id}/restore` | `clients:write` | Restore an ended client project |
| `GET` | `/clients/{id}/usage` | `clients:read` | Get the usage of a client project |
| `PUT` | `/clients/{id}/payer` | `clients:write` | Change who pays for a client project |
| `PUT` | `/clients/{id}/budget` | `clients:write` | Set the monthly budget for a client project |
| `GET` | `/clients/{id}/invoice-lines` | `clients:read` | Export invoice lines for a client project |
| `POST` | `/clients/{id}/payment-links` | `clients:write` | Create a payment link for a client |
| `POST` | `/clients/{id}/subscriptions` | `clients:write` | Create a subscription for a client |
| `GET` | `/clients/{id}/payments` | `clients:read` | List payment links and subscriptions for a client |
| `DELETE` | `/clients/{id}/subscriptions/{subscriptionId}` | `clients:write` | Cancel a client subscription |
| `DELETE` | `/clients/{id}/payment-links/{linkId}` | `clients:write` | Withdraw an open payment link |
| `GET` | `/clients/{id}/activity` | `clients:read` | Read the activity log of a client project |
| `GET` | `/agencies` | `project:read` | List the agencies on this project |
| `DELETE` | `/agencies/{id}` | `project:write` | Revoke an agency's access |
| `GET` | `/containers` | `sites:read` | List containers |
| `POST` | `/containers` | `sites:write` | Deploy a container on a site |
| `GET` | `/containers/{id}` | `sites:read` | Get a container |
| `DELETE` | `/containers/{id}` | `sites:write` | Delete a container |
| `GET` | `/containers/{id}/versions` | `sites:read` | List the versions of a container |
| `POST` | `/containers/{id}/rollback` | `sites:write` | Roll a container back |
| `POST` | `/containers/{id}/restart` | `sites:write` | Restart a container |
| `GET` | `/containers/{id}/logs` | `sites:read` | Get the log of a container |
| `GET` | `/marketplaces/{id}` | `data:read` | Get the marketplace of an app |
| `PUT` | `/marketplaces/{id}` | `data:write` | Set up or change the marketplace |
| `GET` | `/marketplaces/{id}/rules` | `data:read` | The rules for a seller, a delivery and a category |
| `GET` | `/marketplaces/{id}/sellers` | `data:read` | List the sellers |
| `POST` | `/marketplaces/{id}/sellers` | `data:write` | Invite a seller |
| `GET` | `/marketplaces/{id}/sellers/{sellerId}` | `data:read` | Get one seller |
| `PATCH` | `/marketplaces/{id}/sellers/{sellerId}` | `data:write` | Activate, suspend or close a seller |
| `POST` | `/marketplaces/{id}/sellers/{sellerId}/suspend` | `data:write` | Suspend a seller |
| `POST` | `/marketplaces/{id}/sellers/{sellerId}/reinstate` | `data:write` | Lift a seller's suspension |
| `PUT` | `/marketplaces/{id}/sellers/{sellerId}/onboarding` | `data:write` | The seller's own details |
| `PATCH` | `/marketplaces/{id}/sellers/{sellerId}/credentials/{type}` | `data:write` | Approve or reject a credential |
| `PUT` | `/marketplaces/{id}/sellers/{sellerId}/tin` | `data:write` | The seller's tax number, above the reporting threshold |
| `GET` | `/marketplaces/{id}/sellers/{sellerId}/shipping` | `data:read` | A seller's shipping methods |
| `PUT` | `/marketplaces/{id}/sellers/{sellerId}/shipping` | `data:write` | Set a seller's shipping methods |
| `POST` | `/marketplaces/{id}/sellers/{sellerId}/payments` | `data:write` | A link to the verification by Stripe for a seller |
| `GET` | `/marketplaces/{id}/listings` | `data:read` | List the products of the sellers |
| `POST` | `/marketplaces/{id}/listings` | `data:write` | Add a product (seller) |
| `GET` | `/marketplaces/{id}/listings/{listingId}` | `data:read` | Get one product |
| `PATCH` | `/marketplaces/{id}/listings/{listingId}` | `data:write` | Change, approve or remove a product |
| `GET` | `/marketplaces/{id}/suborders` | `data:read` | List the sub-orders |
| `GET` | `/marketplaces/{id}/suborders/{suborderId}` | `data:read` | Get one sub-order |
| `PATCH` | `/marketplaces/{id}/suborders/{suborderId}` | `data:write` | Mark a sub-order shipped or delivered |
| `POST` | `/marketplaces/{id}/suborders/{suborderId}/refund` | `data:write` | Refund one sub-order |
| `POST` | `/marketplaces/{id}/suborders/{suborderId}/reverse` | `data:write` | Take a payout back after a dispute |
| `GET` | `/marketplaces/{id}/payments` | `data:read` | The connection with the holder's Stripe account |
| `PUT` | `/marketplaces/{id}/payments` | `data:write` | Connect the holder's Stripe account |
| `DELETE` | `/marketplaces/{id}/payments` | `data:write` | Disconnect the holder's Stripe account |
| `POST` | `/marketplaces/{id}/quote` | `data:write` | Quote a cart over several sellers |
| `POST` | `/marketplaces/{id}/checkout` | `data:write` | Start the checkout over several sellers |
| `GET` | `/marketplaces/{id}/orders/{orderId}` | `data:read` | Get an order with its sub-orders |
| `GET` | `/marketplaces/{id}/payouts` | `data:read` | Payouts per seller |
| `GET` | `/marketplaces/{id}/readiness` | `data:read` | Is the marketplace ready to go live? |

## Errors on every endpoint

Any request with an API key can return these. Errors listed under an endpoint come in addition to these.

| Status | Type |
| --- | --- |
| 401 | [`unauthorized`](https://hypamoon.com/docs/errors/unauthorized) |
| 401 | [`missing_api_key`](https://hypamoon.com/docs/errors/missing_api_key) |
| 401 | [`invalid_api_key`](https://hypamoon.com/docs/errors/invalid_api_key) |
| 401 | [`api_key_revoked`](https://hypamoon.com/docs/errors/api_key_revoked) |
| 401 | [`api_key_expired`](https://hypamoon.com/docs/errors/api_key_expired) |
| 401 | [`project_deleted`](https://hypamoon.com/docs/errors/project_deleted) |
| 403 | [`project_not_enabled`](https://hypamoon.com/docs/errors/project_not_enabled) |
| 403 | [`key_mode_mismatch`](https://hypamoon.com/docs/errors/key_mode_mismatch) |
| 403 | [`missing_scope`](https://hypamoon.com/docs/errors/missing_scope) |
| 403 | [`ip_not_allowed`](https://hypamoon.com/docs/errors/ip_not_allowed) |
| 403 | [`verification_required`](https://hypamoon.com/docs/errors/verification_required) |
| 429 | [`rate_limited`](https://hypamoon.com/docs/errors/rate_limited) |
| 500 | [`internal_error`](https://hypamoon.com/docs/errors/internal_error) |
| 503 | [`service_unavailable`](https://hypamoon.com/docs/errors/service_unavailable) |

## Domains

Your own domain for a site: connect a domain the user owns (nameservers, with existing records copied), or register a new one. DNS records are managed here.

### GET /domains

**List the domains.**

The domains of the project, newest first, each with its status, nameservers, site and next\_step.

Scope: `sites:read`

#### 200 The domains.

### POST /domains

**Connect a domain the user owns.**

Connects a domain. method nameservers (default): we create a DNS zone for it, copy its existing records (mail included), and return the two nameservers the user sets at their registrar. method cname: www (for a domain) or one subdomain (like shop.example.com), through a CNAME and one TXT record (proof of ownership) at the user's own DNS provider; the certificate is issued and renewed automatically. Connecting through the nameservers is free on every plan; the cname method carries a surcharge of EUR 2 a month excl. VAT (cname\_surcharge), except for a subdomain of a domain the project already has on Hypamoon's nameservers, which is free. Registering a new domain costs its registration price. Connecting a domain that is already in this project only changes its site. A subdomain that still has an A, AAAA or CNAME record pointing elsewhere in the zone here returns confirmation\_required with preflight, diagnosis (what it points to and what answers there) and fix (the same call with replace\_existing true); undo\_dns\_change puts the old record back. Every error of a domain route carries diagnosis and fix.

Scope: `sites:write`

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `domain` (required) | string | The domain, like example.com. |
| `site_id` | string or null (uuid) | Optional. A site of this project (from deploy\_site or list\_sites) to serve on the domain and on www. |
| `method` | `"nameservers"`, `"cname"` | nameservers (default): the user points the domain's nameservers to the two we return; existing records, mail included, are copied first. cname: fallback when the nameservers cannot change: only www, through a CNAME and a TXT record at the user's DNS provider. |
| `dkim_selectors` | string\[\] | Optional. The DKIM selector(s) of the user's mail provider (like google or selector1), so their DKIM records are copied too. |
| `replace_existing` | boolean | Optional, default false. For a subdomain of a domain this project has on Hypamoon's nameservers: if the subdomain still has an A, AAAA or CNAME record pointing elsewhere (like an old host), the call is refused with what is live there now. true replaces those records (only after the user agreed); undo\_dns\_change puts them back for 30 days. |

JSON

```
{
  "domain": "example.com",
  "site_id": "6f1c2d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f"
}
```

#### 200 The domain was already connected; its site is updated.

#### 201 The domain, with nameservers, mail\_check and next\_step.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`phone_verification_required`](https://hypamoon.com/docs/errors/phone_verification_required) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 409 | [`confirmation_required`](https://hypamoon.com/docs/errors/confirmation_required) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 502 | [`upstream_error`](https://hypamoon.com/docs/errors/upstream_error) |

### GET /domains/health

**List watched domains and their health.**

The domains this project watches (watch\_domain), each with status ok, warning or problem, the reason in one sentence, the findings (dangling DNS that points to a host where the domain is not set up, spam on the homepage, a changed title or host, expiry in 30 or 7 days, the certificate, and mail advice), whether ownership is proven, and whether the domain is parked. Checked once a day; the owner gets one mail per domain per day at most, for a new problem. Watching is included in the plan, up to limit domains. dns\_cleanup lists, for every domain of the project on Hypamoon's nameservers (watched or not), how many records the previous host left behind: safe\_to\_remove and ask; GET /domains/{id}/dns-cleanup has the details.

Scope: `sites:read`

#### 200 The watched domains.

### POST /domains/watch

**Watch a domain, or park it.**

Watches a domain the user owns, registered anywhere, without connecting it to a site. Ownership is proven with the same TXT record as connect\_domain (ownership.challenge); a domain that is already active in this project or bought through Hypamoon needs none. Until it is proven the status is pending (202) and nothing is checked. park page or redirect also moves the domain to Hypamoon's nameservers (like connect\_domain without a site) and then shows a neutral page or sends visitors to redirect\_to with a 301; a domain without mail gets a null MX, SPF -all and DMARC p=reject against spoofing. park off stops parking. remove true stops watching.

Scope: `sites:write`

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `domain` (required) | string | The domain, like example.com. It can be registered anywhere. |
| `expected_hosts` | `"vercel"`, `"netlify"`, `"github"`, `"heroku"`, `"aws"`, `"azure"`, `"shopify"`, `"fly"`, `"render"`\[\] | Optional. Where the domain is hosted on purpose (vercel, netlify, github, heroku, aws, azure, shopify, fly, render). If its DNS points to another one of these, that is a problem. Leave it out and we remember the host from the first check, and warn when it changes. |
| `expected_language` | string or null | Optional. The language of the site, as a two-letter code like en or nl. A homepage in another language is a warning. |
| `park` | `"off"`, `"page"`, `"redirect"` | Optional. page: park the domain on Hypamoon with a page that shows the domain name and park\_text (by default "Reserved by its owner. There is no website at this address."); a Hypamoon mention only on the Free plan. redirect: park it and send visitors to redirect\_to with a 301. off: stop parking. Parking moves the domain's DNS to Hypamoon (nameservers), so nobody can claim it elsewhere. |
| `park_text` | string or null | Only with park page: the line under the domain name, at most 300 characters, in the user's words. An empty string shows only the domain name; null goes back to the default line. Leave it out to keep what is there. |
| `redirect_to` | string | Only with park redirect: the address to send visitors to, like [https://example.com](https://example.com). Path and query of the request are kept. |
| `remove` | boolean | true: stop watching the domain. Parking stays as it is. |

JSON

```
{
  "domain": "example.com",
  "expected_hosts": [
    "netlify"
  ],
  "park": "page"
}
```

#### 200 The watched domain, with its health.

#### 202 Watched, waiting for the ownership proof in ownership.challenge.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 402 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 403 | [`phone_verification_required`](https://hypamoon.com/docs/errors/phone_verification_required) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 409 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 502 | [`upstream_error`](https://hypamoon.com/docs/errors/upstream_error) |

### GET /domains/{id}/dns-cleanup

**Suggest a cleanup of left-over DNS records.**

For a domain on Hypamoon's nameservers: which records were left behind by the previous host, such as the names a hosting control panel (cPanel, Plesk, DirectAdmin) creates by itself, old certificate tokens and names that still point to the previous host. Each record has a label (safe\_to\_remove, ask or keep), a group and the reason. Microsoft 365, Google Workspace, everything Hypamoon manages, SPF, DMARC and the domain's MX are always keep. spf\_advice suggests how to tighten the SPF; it is never changed by a cleanup. Names that point to the previous host are checked over https (live\_checked). recent\_cleanups lists the cleanups of the last 30 days. Read-only.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the domain. |

#### 200 The cleanup suggestion.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |

### POST /domains/{id}/dns-cleanup

**Remove left-over DNS records in one step.**

Removes the records labeled safe\_to\_remove, minus exclude\_record\_ids, plus the ask-records in include\_record\_ids, in one step. The suggestion is made again at that moment; a record labeled keep is never removed (422). Before anything is removed, the records are written to the audit log as a zone file; the answer has the same zone\_file and a cleanup\_id. For 30 days the cleanup can be undone with POST /domains/{id}/dns-cleanup/restore.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the domain. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `include_record_ids` | string\[\] | Optional. Records labeled ask (from get\_dns\_cleanup) that the user chose to remove too. Records labeled keep are never removed; naming one is refused. |
| `exclude_record_ids` | string\[\] | Optional. Records labeled safe\_to\_remove that the user wants to keep this time. |

JSON

```
{
  "include_record_ids": [
    "372e67954025e0ba6aaa6d586b9e0b59"
  ]
}
```

#### 200 What was removed, what failed, the zone file and until when it can be restored.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### POST /domains/{id}/dns-cleanup/restore

**Put the records of a cleanup back.**

Within 30 days of a cleanup: adds the removed records again, only those that are missing now. A name that now serves a Hypamoon site is skipped. Records that were put back are not suggested for a cleanup again unless the user chooses them.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the domain. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `cleanup_id` (required) | string (uuid) | The id of the cleanup to undo (recent\_cleanups in get\_dns\_cleanup). |

JSON

```
{
  "cleanup_id": "0b6f0e0e-2a7c-4d39-9a8e-1d3c5b7a9e21"
}
```

#### 200 What was added again, what was already there and what failed.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /domains/check

**Check whether a domain is available.**

Whether the domain can be registered, the price of the first year and of a renewal, and the URL of the registry's terms. Results are cached for a minute; checks are rate limited per project.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `domain` (required) | query | string | The domain, like example.com. |

#### 200 The check.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 502 | [`upstream_error`](https://hypamoon.com/docs/errors/upstream_error) |

### GET /domains/suggestions

**Suggest available domains.**

Available domains based on a few words, or on names you came up with yourself. With query, Hypamoon makes the candidates: the words themselves on .nl and .com first, then short variants like getbakery, trybakery and bakeryhq. With names, up to ten names of your own are checked in one call; a name without an extension is tried on .nl and .com first. At most ten names are checked per call, and each one counts as a check in the rate limit. unavailable lists the names that are taken; rejected lists the names that are not valid.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `query` | query | string | A few words, like 'corner bakery'. Required without names. |
| `tlds` | query | string | Optional. Comma-separated extensions, like nl,com. |
| `names` | query | string | Optional. Up to ten comma-separated names to check, with or without extension, like getcrumb,crumbhq.com. |

#### 200 The available domains.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 502 | [`upstream_error`](https://hypamoon.com/docs/errors/upstream_error) |

### POST /domains/register

**Register a domain.**

Registers the domain in the user's name, with DNS and DNSSEC set up here, and whois privacy where the extension allows it. accept\_registry\_terms must be true: the user explicitly accepted the registry's terms (registry\_terms\_url from the check). max\_price\_eur is the total the user confirmed for all years; a higher price is refused. A name with a higher registry price (premium in the check) is bought for 1 year only, with accept\_price\_eur exactly the price the user confirmed, and only up to a ceiling; if the registry price changed just before the purchase, nothing is bought. Needs an Idempotency-Key; the same key returns the same domain, and a key whose attempt failed is never retried (use a new key). In live mode the price is deducted from the balance; in test mode nothing is bought. Real purchases in live mode are not open yet: until they are, a live key gets service\_unavailable, and test mode works as described.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `Idempotency-Key` (required) | header | string | A unique key for this purchase, like a UUID. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `domain` (required) | string | The domain, like example.com. |
| `years` | integer | Registration period in years. Most extensions only allow 1. |
| `accept_registry_terms` (required) | boolean | Must be true: the user (the registrant) explicitly accepted the terms of the registry at registry\_terms\_url from check\_domain. |
| `max_price_eur` (required) | number | The highest total the user agreed to pay for all years together, as shown by check\_domain. Refused if the price is higher. |
| `accept_price_eur` | number | Only for a name with a higher registry price (premium true in check\_domain): the price\_eur for the first year exactly as check\_domain showed it and the user confirmed. Without it, or if the price changed, nothing is bought. |
| `site_id` | string or null (uuid) | Optional. A site of this project to serve on the domain once it is active. |

JSON

```
{
  "domain": "example.nl",
  "years": 1,
  "accept_registry_terms": true,
  "max_price_eur": 7.32
}
```

#### 201 The registered domain.

| Header |  |
| --- | --- |
| `Idempotent-Replayed` | Present when this is the stored response to an earlier request with the same Idempotency-Key. |

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 400 | [`idempotency_key_missing`](https://hypamoon.com/docs/errors/idempotency_key_missing) |
| 400 | [`idempotency_key_invalid`](https://hypamoon.com/docs/errors/idempotency_key_invalid) |
| 402 | [`payment_mandate_missing`](https://hypamoon.com/docs/errors/payment_mandate_missing) |
| 402 | [`billing_blocked`](https://hypamoon.com/docs/errors/billing_blocked) |
| 402 | [`insufficient_balance`](https://hypamoon.com/docs/errors/insufficient_balance) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 403 | [`phone_verification_required`](https://hypamoon.com/docs/errors/phone_verification_required) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`idempotency_key_reused`](https://hypamoon.com/docs/errors/idempotency_key_reused) |
| 409 | [`idempotency_request_in_progress`](https://hypamoon.com/docs/errors/idempotency_request_in_progress) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`company_details_missing`](https://hypamoon.com/docs/errors/company_details_missing) |
| 422 | [`spend_cap_missing`](https://hypamoon.com/docs/errors/spend_cap_missing) |
| 502 | [`upstream_error`](https://hypamoon.com/docs/errors/upstream_error) |

### GET /domains/{id}

**Get a domain.**

One domain as it is stored: status, nameservers, mail\_check, site and next\_step. Read-only; POST /domains/{id}/activate checks activation. For a purchased domain, it also includes the registration details and the registrant verification status.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the domain. |

#### 200 The domain.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### PATCH /domains/{id}

**Update the settings of a domain.**

Changes a setting of the domain. hsts tells browsers to always open the domain over https: off (default), on (for one year) or on\_with\_subdomains (the same, for every subdomain too). Once on, browsers that visited the site remember it for about a year and will only open the domain over https, even if you turn it off again. Only choose on\_with\_subdomains if every subdomain of the domain (like mail or shop) works over https too. It can only be turned on when a site is live on the domain and every host of it has a valid certificate; otherwise the request returns conflict. You can always turn it off. auto\_renew is for a domain bought or transferred through Hypamoon: true (default) renews it for a year before it expires, from the project's balance; false lets it expire. For a connected domain it returns conflict. primary chooses the main address: apex (default, example.com) or www ([www.example.com](http://www.example.com)). The other address redirects to it permanently (301) with path and query, and canonical links and the sitemap follow it. Only for method nameservers; while the site is live, the new main address needs a valid certificate first, otherwise the request returns conflict.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the domain. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `hsts` | `"off"`, `"on"`, `"on_with_subdomains"` | Tells browsers to always open the domain over https (HSTS). off (default): no such instruction. on: for one year. on\_with\_subdomains: the same, for every subdomain too. Once on, browsers that visited the site remember it for about a year and will only open the domain over https, even if you turn it off again. Only choose on\_with\_subdomains if every subdomain of the domain (like mail or shop) works over https too. Only possible when the site is live on the domain with a valid certificate. |
| `auto_renew` | boolean | Only for a domain bought or transferred through Hypamoon. true (default): Hypamoon renews it for a year before it expires, from the project's balance. false: it is not renewed and expires on its expiry date. |
| `primary` | `"apex"`, `"www"` | Which address of the domain is the main one. apex (default): example.com, and [www.example.com](http://www.example.com) redirects to it. www: [www.example.com](http://www.example.com), and example.com redirects to it. The redirect is permanent (301) and keeps the path and query; canonical links and the sitemap follow the main address. Only for method nameservers. |

JSON

```
{
  "hsts": "on"
}
```

#### 200 The domain, with hsts, primary and registration.auto\_renew.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### DELETE /domains/{id}

**Disconnect a domain.**

Takes the site off the domain and deletes its DNS zone (or the www connection). A domain purchased through Hypamoon cannot be disconnected; remove its site instead.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the domain. |

#### 200 Disconnected, with the previous nameservers to restore.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |

### POST /domains/{id}/activate

**Check a domain and attach its site.**

Checks whether the nameservers (or the CNAME records) are in place, scans the previous DNS again while it waits, and attaches the site once the domain is active. While a WordPress move on this domain is paused by the clean-move check, a domain that is not active yet answers 409 migration\_paused.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the domain. |

#### 200 The domain.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`migration_paused`](https://hypamoon.com/docs/errors/migration_paused) |

### PUT /domains/{id}/site

**Set the site of a domain.**

Puts one of the project's sites on the domain and on www, or removes it with null.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the domain. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `site_id` (required) | string or null (uuid) | The site to serve on the domain, or null for none. |

JSON

```
{
  "site_id": "6f1c2d3e-4b5a-4c7d-8e9f-0a1b2c3d4e5f"
}
```

#### 200 The domain.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`phone_verification_required`](https://hypamoon.com/docs/errors/phone_verification_required) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### POST /domains/{id}/authcode

**Get the transfer code of a domain.**

The transfer (auth) code of a domain bought through Hypamoon, to move it to another registrar. Only the account owner gets it, in the Hypamoon portal (Domains, Show transfer code) after confirming their second factor. A chat (OAuth) and an API key get forbidden; the error names the page in the portal. Each request is logged and the owner receives an email. The domain is unlocked for a transfer for 14 days, then locked again.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the domain. |

#### 200 The transfer code.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 502 | [`upstream_error`](https://hypamoon.com/docs/errors/upstream_error) |

### GET /domains/{id}/dns-records

**List the DNS records.**

The DNS records of a domain connected through its nameservers. managed\_by\_hypamoon marks the records that serve the site.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the domain. |

#### 200 The records.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |

### POST /domains/{id}/dns-records

**Add, change or delete a DNS record.**

Without record\_id a new record (a new A, AAAA or CNAME replaces the A, AAAA or CNAME on that name); with record\_id that record is replaced; with delete true it is deleted. The records that serve the site cannot be changed here. On an active domain, a change that replaces or deletes a live record returns 409 confirmation\_required with preflight (what changes, what is live there now, mail\_affected) and nothing changes; call again with confirm\_overwrite true once the user agreed. Every change keeps the previous state for POST /domains/{id}/dns-records/undo.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the domain. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `record_id` | string | Optional. The id from list\_dns\_records of the record to change or delete. Without it, a new record is added. |
| `type` (required) | `"A"`, `"AAAA"`, `"CNAME"`, `"MX"`, `"TXT"`, `"SRV"`, `"CAA"`, `"NS"` | The record type. |
| `name` (required) | string | The name: @ for the domain itself, or a subdomain like www, mail or \_dmarc. |
| `content` | string | The value: an IP address, a hostname, or the text of a TXT record. For SRV: 'priority weight port target'. For CAA: 'flags tag "value"'. |
| `ttl` | integer | Seconds; 1 means automatic. |
| `priority` | integer | For MX: the priority (lower is preferred). |
| `proxied` | boolean | For A, AAAA and CNAME: through the CDN (true) or DNS only (false, default). |
| `delete` | boolean | true deletes the record with record\_id. |
| `confirm_overwrite` | boolean | Optional, default false. A change that replaces or deletes a record that is live now (on an active domain) is refused first with a preflight: what changes, what is live there now, and whether mail is affected. Show it to the user; only after they agree, call again with true. undo\_dns\_change reverses it for 30 days. |

JSON

```
{
  "type": "TXT",
  "name": "@",
  "content": "google-site-verification=abc123"
}
```

#### 200 The record (or deleted: true), what it replaced, and how to undo it.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 409 | [`confirmation_required`](https://hypamoon.com/docs/errors/confirmation_required) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### POST /domains/{id}/dns-records/undo

**Undo the last DNS change.**

Reverses the last DNS change made through Hypamoon on the domain, within 30 days: a record set, replaced or deleted, an old record replaced when a subdomain was connected, a cleanup, a zone file import or a restore. Calling it again goes one change further back. Without confirm true nothing changes: the answer is 409 confirmation\_required with preflight (the change and what undoing it does). A record that changed again since is not undone blindly (conflict).

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the domain. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `confirm` | boolean | Optional, default false. Without it nothing changes: the answer (confirmation\_required) shows which change would be undone and what that does. Show it to the user; after they agree, call again with true. |

JSON

```
{
  "confirm": true
}
```

#### 200 What was undone: removed, restored and skipped records.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 409 | [`confirmation_required`](https://hypamoon.com/docs/errors/confirmation_required) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /domains/diagnose

**Check a domain and suggest fixes.**

What is set up on a domain or subdomain right now: the nameservers (at Hypamoon or not), the DNS records here with labels (left by a previous host or not), what answers on the domain, www, the subdomain and the main names (status, server, certificate), email (MX, SPF, DKIM, DMARC, Microsoft 365 or Google Workspace), conflicts and a connection or transfer in progress. Each item in problems has diagnosis, fix (a tool with arguments, or a portal link) and user\_message. Read-only, also for a domain that is not connected here. Lookups have short timeouts and never reach private addresses.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `domain` | query | string | The domain or subdomain, like example.com or portal.example.com. |
| `domain_id` | query | string (uuid) | Instead of domain: the id of a domain of this project. |

#### 200 The diagnosis: nameservers, names, mail, records, problems with a fix each, and user\_message.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### POST /domains/{id}/zone-file

**Import a zone file.**

Imports the records of a BIND zone file (exported from the current DNS provider) into the domain's DNS zone here. NS and SOA of the domain itself and unsupported types are skipped and listed. Also accepts the file itself as text/plain (with ?replace\_existing=true). Keeps two restore points: the file (the previous DNS) and the zone as it was just before.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the domain. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `zone_file` (required) | string | The zone file in BIND format, as exported from the current DNS provider (often called 'export zone' or 'download zone file'). At most 256 KB. |
| `replace_existing` | boolean | Optional, default false. true: for every name and type in the file, records here that are not in the file are deleted. false: records are only added. |

JSON

```
{
  "zone_file": "$ORIGIN example.com.\n@ 3600 IN MX 10 mail.example.com.\n@ 3600 IN TXT \"v=spf1 include:_spf.example.net ~all\"\n",
  "replace_existing": false
}
```

#### 200 What was added, removed, skipped and failed, with the restore point to undo it.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /domains/{id}/preflight

**Compare the old and the new DNS.**

Queries every known record at both the current nameservers and ours (directly, not through a cache) and lists the differences. ready is true only when mail (MX, SPF, DKIM, DMARC), the domain itself and www match. Read-only.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the domain. |

#### 200 The checks, the blocking ones first, and ready.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |

### POST /domains/{id}/restore

**Restore the DNS records.**

Sets the domain's DNS zone back to a restore point (by default the newest one of the previous DNS), and returns it as a zone file plus the previous nameservers, so the move can be undone. The zone as it was is kept as a new restore point.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the domain. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `snapshot_id` | string (uuid) | Optional. The id of a restore point from dns\_snapshots in get\_domain. Without it: the newest restore point of the previous DNS (a zone file, or the scan when the domain was connected). |

JSON

```
{}
```

#### 200 What changed, the zone file and the way back.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### POST /domains/{id}/nameservers

**Switch the nameservers.**

For a domain registered or transferred through Hypamoon: point its nameservers to the DNS zone here (refused with confirmation\_required and the preflight while it is not ready, unless ignore\_preflight), or back to the previous ones.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the domain. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `use` (required) | `"hypamoon"`, `"previous"` | hypamoon: the nameservers of the DNS zone here. previous: back to the nameservers the domain had before (to undo the move). |
| `ignore_preflight` | boolean | Optional, default false. With use hypamoon, the switch is refused while preflight\_domain is not ready; true switches anyway (only when the user accepts the listed differences). |

JSON

```
{
  "use": "hypamoon"
}
```

#### 200 The domain, with the nameservers now set at the registry.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 409 | [`confirmation_required`](https://hypamoon.com/docs/errors/confirmation_required) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 502 | [`upstream_error`](https://hypamoon.com/docs/errors/upstream_error) |

### POST /domains/transfer

**Transfer a domain to Hypamoon.**

Moves the registration of a domain the user owns to Hypamoon, with the transfer code of the current registrar. accept\_registry\_terms must be true and max\_price\_eur is the amount the user confirmed. dns hypamoon switches the nameservers to the zone here when the transfer completes, so it is refused with confirmation\_required (nothing charged) while the preflight is not ready, unless ignore\_preflight; keep leaves them as they are. Needs an Idempotency-Key; a key whose attempt failed is never retried. 201 when the transfer completes immediately, 202 while it is in progress (follow it with GET /domains/{id}). In live mode the price is deducted from the balance and refunded if the transfer fails. Transfers in live mode are not open yet: until they are, a live key gets service\_unavailable, and test mode works as described.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `Idempotency-Key` (required) | header | string | A unique key for this transfer, like a UUID. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `domain` (required) | string | The domain to move to Hypamoon, like example.com. |
| `authcode` | string | The transfer code (auth code, EPP code; for .nl the token) the user got from their current registrar. Required for most extensions. Never stored. |
| `accept_registry_terms` (required) | boolean | Must be true: the user (the registrant) explicitly accepted the terms of the registry at registry\_terms\_url from check\_domain. |
| `max_price_eur` (required) | number | The highest amount the user agreed to pay for the transfer. Refused if the price is higher. |
| `dns` | `"hypamoon"`, `"keep"` | hypamoon (default): the nameservers switch to the DNS zone here when the transfer completes; run preflight\_domain first. keep: the nameservers stay as they are; switch later with switch\_domain\_nameservers. |
| `site_id` | string or null (uuid) | Optional. A site of this project to serve on the domain once it is active. |
| `dkim_selectors` | string\[\] | Optional. The DKIM selector(s) of the user's mail provider, so their DKIM records are copied too. |
| `ignore_preflight` | boolean | Optional, default false. With dns hypamoon the nameservers switch when the transfer completes, so the transfer is refused (confirmation\_required, nothing charged) while preflight\_domain is not ready. true transfers anyway, only when the user accepts the listed differences. |

JSON

```
{
  "domain": "example.nl",
  "authcode": "AbC123xyz!",
  "accept_registry_terms": true,
  "max_price_eur": 7.32,
  "dns": "hypamoon"
}
```

#### 201 The transfer completed.

| Header |  |
| --- | --- |
| `Idempotent-Replayed` | Present when this is the stored response to an earlier request with the same Idempotency-Key. |

#### 202 The transfer was requested and is in progress; transfer.status shows where it stands.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 400 | [`idempotency_key_missing`](https://hypamoon.com/docs/errors/idempotency_key_missing) |
| 400 | [`idempotency_key_invalid`](https://hypamoon.com/docs/errors/idempotency_key_invalid) |
| 402 | [`payment_mandate_missing`](https://hypamoon.com/docs/errors/payment_mandate_missing) |
| 402 | [`billing_blocked`](https://hypamoon.com/docs/errors/billing_blocked) |
| 402 | [`insufficient_balance`](https://hypamoon.com/docs/errors/insufficient_balance) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`idempotency_key_reused`](https://hypamoon.com/docs/errors/idempotency_key_reused) |
| 409 | [`idempotency_request_in_progress`](https://hypamoon.com/docs/errors/idempotency_request_in_progress) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 409 | [`confirmation_required`](https://hypamoon.com/docs/errors/confirmation_required) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`company_details_missing`](https://hypamoon.com/docs/errors/company_details_missing) |
| 422 | [`spend_cap_missing`](https://hypamoon.com/docs/errors/spend_cap_missing) |
| 502 | [`upstream_error`](https://hypamoon.com/docs/errors/upstream_error) |

## Project

The project behind the key and its company details.

### GET /project

**Get the project.**

The project behind the API key: one app, with its own numbers, one assistant, its calls and its webhooks. verification lists the four verification levels with what each still needs and what it unlocks. access says whether this key or connection is limited to some sites and apps (an owner or admin sets that in the portal); a limited key gets only id, name, edition, created\_at, mode and access.

Scope: `project:read`

#### 200 The project.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the project. |
| `name` (required) | string | The name of the project. The assistant uses it in its greeting. |
| `edition` (required) | string | Always api for a project of the Hypamoon API. |
| `created_at` (required) | string (date-time) | When the project was created. |
| `spending_limit_eur` | number or null | The most the project can spend per month, in euros. Null in test mode: a test project costs nothing. Left out for a key or connection limited to some sites and apps. |
| `numbers_count` | integer | How many numbers the project has. Left out for a limited key or connection. |
| `mode` (required) | `"live"`, `"test"` | live or test: the mode of the key, which is always the mode of its project. |
| `live_project_id` | string or null (uuid) | Only in test mode: the live project this test project belongs to, or the project itself when it has no separate test project. |
| `rails` | object | Per function with real-world effects, for this request: live (in use) or test (simulated: not used yet, or a test key). A function on test becomes live the first time it is asked for, once the project is verified for it; until then the request answers verification\_required with a link. A test key is test everywhere. Left out for a limited key or connection. Sites, data and apps are always real and have no mode. |
| `verification` | object | The verification (KYC) of the project. In test mode: the verification of the live project. |
| `access` (required) | object or null | Null: this key or connection can use the whole project. Otherwise only these sites, apps and collections: lists show only those, and anything for the whole project (billing, team, domains, numbers, a new site or app) is refused with 403 and a user\_message. |

JSON

```
{
  "id": "7d4e2b10-3c5a-4f6e-9b8d-1a2b3c4d5e6f",
  "name": "Acme Plumbing",
  "edition": "api",
  "created_at": "2026-10-01T09:00:00.000Z",
  "spending_limit_eur": 100,
  "numbers_count": 0,
  "mode": "live",
  "rails": {
    "phone": "live",
    "outbound": "live",
    "sms": "live",
    "email": "live",
    "payments": "live",
    "domains": "test"
  },
  "verification": {
    "account_type": "business",
    "levels": [
      {
        "level": "test",
        "status": "approved",
        "reason": null,
        "missing": [],
        "unlocks": [
          "test_keys",
          "test_numbers",
          "simulated_calls"
        ]
      },
      {
        "level": "company",
        "status": "not_started",
        "reason": null,
        "missing": [
          "payment_mandate",
          "payment_authentication",
          "phone_verification"
        ],
        "unlocks": [
          "live_keys",
          "national_numbers",
          "inbound_calls"
        ]
      },
      {
        "level": "number_documents",
        "status": "not_started",
        "reason": null,
        "missing": [
          "level.company",
          "document.proof_of_address",
          "document.identity",
          "document.company_registration"
        ],
        "unlocks": [
          "geographic_numbers"
        ]
      },
      {
        "level": "full",
        "status": "not_started",
        "reason": null,
        "missing": [
          "level.company",
          "director_identity",
          "ubo_confirmation",
          "review"
        ],
        "unlocks": [
          "outbound_calls",
          "spending_cap_above_500_eur",
          "more_concurrent_calls"
        ]
      }
    ]
  },
  "access": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### PUT /project/company

**Set the company or personal details.**

A phone number is registered to a business or a person. For a business, set the company name, the address with its country, a contact person and the number in its country's business register (kvk\_number in the Netherlands, registration\_number elsewhere) before you order a number. Without a company, send account\_type personal with the user's address and the user as contact: no registration number needed. A national number needs a business; a personal account can order a geographic number. In test mode no registration or VAT number is needed to order a test number. Switching to account\_type personal is refused while the project has a national number (account\_type\_change\_blocked); every switch resets the number\_documents and full verification levels to not\_started. In the EU send vat\_number: we check it with VIES before saving (vat\_number\_invalid when VIES says it is not valid; vat\_status unverified when VIES does not respond, and we retry). A country we cannot serve returns country\_not\_supported. Which numbers you can order is what GET /numbers/available returns. PUT replaces all fields, except registrar\_contact\_name, which keeps its saved value when left out. When the project has domains registered or transferred through Hypamoon, the contact, email, phone and address also go to each domain's contact at the registry; domain\_contacts in the response says per domain updated, unchanged, skipped or failed, with the reason. A change of organization, registration number or (personal account) person is a change of holder: never sent automatically, it needs Hypamoon support.

Scope: `project:write`

#### Request body

Who the project belongs to, and who its phone numbers are registered to: a business or a personal account (account\_type). For a business: company\_name, the address, the number in its country's business register (kvk\_number in the Netherlands, registration\_number elsewhere) and, in the EU, vat\_number (checked with VIES). For a personal account: the user's address and the contact (the user), without company fields.

| Field | Type |  |
| --- | --- | --- |
| `account_type` | `"personal"`, `"business"` | personal (someone without a company: no company\_name, kvk\_number, registration\_number or vat\_number) or business. Leave it out to keep the project's current type. A national number needs business. When a personal account is not available for the address, validation\_failed says so. |
| `company_name` | string or null | The legal name. Required for a business, not allowed for a personal account. |
| `kvk_number` | string or null | For a company in the Netherlands (required there): the KvK number, 8 digits. Spaces and dots are removed. |
| `registration_number` | string or null | For a company outside the Netherlands: the number in its country's business register (like a UK Companies House number or a German HRB number). Needed for the company verification level outside the EU. |
| `vat_number` | string or null | The VAT number. In the EU outside the Netherlands it is needed for the company verification level and checked with VIES: send it with or without the country prefix. A number that VIES rejects returns vat\_number\_invalid. |
| `address` (required) | object |  |
| `contact` (required) | object | A person the regulator can reach today. For a personal account: the user. |
| `registrar_contact_name` | string or null | Optional, for a business: the name on the contacts of the domains registered or transferred through Hypamoon, when it should differ from contact.name. Use a role, like Administration or Webmaster, so the domain registration carries no personal name while contact.name stays the person that number registration needs. Leave it out to keep the saved value; send null to use contact.name again. Not allowed for a personal account. |

JSON

```
{
  "company_name": "Acme Plumbing Ltd",
  "registration_number": "01234567",
  "address": {
    "street": "Main Street",
    "house_number": "40",
    "postal_code": "SW1A 1AA",
    "city": "London",
    "country": "GB"
  },
  "contact": {
    "name": "Jane Smith",
    "phone": "+447700900123"
  }
}
```

#### 200 The company details as saved.

| Field | Type |  |
| --- | --- | --- |
| `account_type` (required) | `"personal"`, `"business"` | personal (your own details, no business register number) or business. |
| `company_name` (required) | string or null | The legal company name; null for a personal account. |
| `kvk_number` (required) | string or null | 8 digits, for a company in the Netherlands; null elsewhere. |
| `registration_number` (required) | string or null | The number in the business register of the company's country, for a company outside the Netherlands (there it is kvk\_number). |
| `vat_number` (required) | string or null | The VAT number, with country prefix in the EU (like DE123456789). |
| `vat_status` (required) | `"valid"`, `"invalid"`, `"unverified"`, `"missing"`, `"not_required"` | For a company in the EU: the VIES check of vat\_number (unverified when VIES did not answer; we retry automatically). missing: no VAT number yet. not\_required: no VIES check needed for this country. |
| `vat_checked_at` (required) | string or null | When VIES last checked vat\_number, ISO 8601. |
| `address` (required) | object |  |
| `contact` (required) | object |  |
| `registrar_contact_name` | string or null | Only for a business: the name on the domain contacts at the registry when it differs from contact.name, or null (then contact.name is used). |
| `complete` (required) | boolean | The details are complete enough for the company or personal verification level: a business needs its business register number and, in the EU, a valid VAT number; a personal account needs a complete address. |
| `domain_contacts` | object\[\] | Only when the project has domains registered or transferred through Hypamoon: per domain, whether the new details reached the domain's contact at the registry. A change of organization, registration number or (for a personal account) person is never sent: that is a change of holder. |

JSON

```
{
  "account_type": "business",
  "company_name": "Acme Plumbing Ltd",
  "kvk_number": null,
  "registration_number": "01234567",
  "vat_number": null,
  "vat_status": "not_required",
  "vat_checked_at": null,
  "address": {
    "street": "Main Street",
    "house_number": "40",
    "postal_code": "SW1A 1AA",
    "city": "London",
    "country": "GB"
  },
  "contact": {
    "name": "Jane Smith",
    "phone": "+447700900123"
  },
  "registrar_contact_name": null,
  "complete": true
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`vat_number_invalid`](https://hypamoon.com/docs/errors/vat_number_invalid) |
| 422 | [`country_not_supported`](https://hypamoon.com/docs/errors/country_not_supported) |
| 422 | [`account_type_change_blocked`](https://hypamoon.com/docs/errors/account_type_change_blocked) |

### GET /advice

**Get the blueprint for a kind of application.**

Advice for building a webshop, appointments and bookings, a restaurant site, or a course or membership: the questions that matter (each with why and a default when the user does not know; only the ones marked blocking stop a working result), the build plan with the Hypamoon tools in order, the go-live checklist for the country (EU in detail, UK and US basics, a general fallback), the common mistakes, and a structured-data (JSON-LD) snippet for search engines. Advice only: nothing here is required of the user. The checklist is guidance, not legal or tax advice.

Scope: `project:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `type` | query | `"webshop"`, `"bookings"`, `"restaurant"`, `"course_membership"`, `"wordpress_portal"`, `"app"`, `"form"` | The kind of application. Required, unless you ask for a topic. app: a build plan for an app with accounts, data per user and uploads, from description; a public form, survey or quiz in that description (nobody signs in to fill it in) gets the form plan instead. form: a public form, survey, quiz or Typeform replacement: a collection with public\_write on a site, no app. |
| `description` | query | string | Only with type app or form: what to build, in the user's words (one or two sentences). |
| `topic` | query | `"sandbox_blocks_upload"`, `"image_too_large"`, `"version_conflict"`, `"phone_verification_required"`, `"site_not_visible"`, `"is_hypamoon_down"` | Instead of type: one known problem (an upload blocked by a sandbox, an image too large, version\_conflict, phone verification, a site nobody else can see, is Hypamoon down) with what to do and what to tell the user. Every blueprint also lists them in known\_problems. |
| `country` | query | string | Where the business is: an ISO country code like GB, US or DE, or a name. Leave it out to use the project's company details; with neither, no country is assumed (country is null and the country question is blocking). |
| `audience` | query | `"consumers"`, `"businesses"`, `"both"` | Who the user sells to; consumers (the default) adds the consumer rules. |

#### 200 The blueprint, with a short markdown summary. With topic: that one known problem (id, symptom, what\_to\_do, tell\_user, other\_topics).

| Field | Type |  |
| --- | --- | --- |
| `type` (required) | `"webshop"`, `"bookings"`, `"restaurant"`, `"course_membership"`, `"wordpress_portal"` |  |
| `title` (required) | string |  |
| `summary` (required) | string |  |
| `country` (required) | string or null | The country the advice is for; null when none is known: nothing is assumed, the country question is then blocking. |
| `country_source` (required) | `"argument"`, `"company_details"`, `null` | Where the country came from: the country argument, or the project's company details (set\_company\_details). Null when no country is known. |
| `region` (required) | `"eu"`, `"uk"`, `"us"`, `"other"` | eu (detailed), uk and us (basics), other (a general fallback, also when no country is known). |
| `audience` (required) | `"consumers"`, `"businesses"`, `"both"` |  |
| `how_to_use` (required) | string | For the agent: inform yourself, ask only the blocking questions, use the defaults for the rest, and offer the checklist; never a questionnaire or a gate. |
| `ask_first` (required) | object\[\] |  |
| `build_plan` (required) | object\[\] |  |
| `go_live_checklist` (required) | object\[\] |  |
| `pitfalls` (required) | object\[\] |  |
| `structured_data` (required) | object | Structured data for search engines, ready to fill in and add with deploy\_site. |
| `note` (required) | string | Guidance, not legal or tax advice. |
| `other_types` (required) | object |  |
| `known_problems` (required) | object\[\] | Known problems (an upload blocked by a sandbox, an image too large, version\_conflict, phone verification, a site nobody else can see, is Hypamoon down), each with what to do and what to tell the user. GET /advice?topic=<id> returns one. |
| `recipes` (required) | object\[\] | Recipes to build with existing tools and adjust to the user's words, like dunning for course\_membership: reminder emails on subscription.payment\_failed on day 1, 4 and 10 with the buyer's signed pay\_url. Empty when there are none. |
| `summary_markdown` (required) | string |  |

JSON

```
{
  "type": "webshop",
  "title": "Webshop",
  "summary": "A shop on the user's own site: products, a real checkout (or an honest order request while payments are not on), order emails and the pages a shop needs to go live.",
  "country": "NL",
  "country_source": "argument",
  "region": "eu",
  "audience": "consumers",
  "how_to_use": "This is for you, the agent, to inform yourself; it is not a questionnaire for the user. Ask only the questions marked blocking (at most two or three), in plain words, and only if the user has not answered them already. For everything else use the default and mention briefly which defaults you used. If the user says \"just build it\" or skips a question, use the defaults and build. Follow build_plan with the real tools. Offer the go-live checklist afterwards as an option (\"Want me to go through what you might want to arrange before going live?\"), never as a condition for building or deploying. Name collections and their fields, and an app's tables and columns, in English and snake_case, descriptive (job_applications, contact_messages, full_name); the content and the texts on the site stay in the site's language.",
  "ask_first": [
    {
      "id": "country",
      "question": "Which country is your business in, and where do you sell to?",
      "why": "It decides the rules (returns, VAT, what the site must show), the currency and the language.",
      "default": "NL.",
      "blocking": false
    },
    {
      "id": "products",
      "question": "What do you sell, and roughly how many products? Do they come in variants like size or color?",
      "why": "It decides how the product list is built and whether every variant needs its own price and stock.",
      "default": "A small catalogue (up to 20 products) without variants; each variant would be its own product.",
      "blocking": true
    },
    {
      "id": "seller",
      "question": "Do you sell as a business or as a private person, and to consumers or to other businesses?",
      "why": "Consumer rules (14 days to withdraw, prices with VAT) apply when a business sells to consumers.",
      "default": "A business selling to consumers.",
      "blocking": false
    },
    {
      "id": "shipping",
      "question": "How do you ship, and what does shipping cost?",
      "why": "Shipping costs must be clear before the customer orders.",
      "default": "One flat shipping rate within the country, shown on every product page and before checkout; pickup on request.",
      "blocking": false
    },
    {
      "id": "returns",
      "question": "How do you handle returns?",
      "why": "Consumers in the EU and UK can usually withdraw within 14 days; the site has to explain how.",
      "default": "The legal minimum: 14 days to withdraw, the customer pays return shipping, refund within 14 days.",
      "blocking": false
    },
    {
      "id": "stock",
      "question": "Do you want the shop to track stock?",
      "why": "With stock tracking a product goes off sale when it runs out.",
      "default": "No stock tracking (unlimited); the owner takes a product off sale by hand.",
      "blocking": false
    },
    {
      "id": "payment_methods",
      "question": "Which payment methods do you want to offer?",
      "why": "Buyers expect their usual method (iDEAL in the Netherlands, cards elsewhere).",
      "default": "What the user's own payment account offers (in the Netherlands usually iDEAL and cards).",
      "blocking": false
    },
    {
      "id": "order_emails",
      "question": "Who should receive the order emails?",
      "why": "Someone has to see every order and ship it.",
      "default": "The project's billing email address.",
      "blocking": false
    },
    {
      "id": "language_currency",
      "question": "Which language and currency should the shop use?",
      "why": "Prices and texts must match where the customers are.",
      "default": "The language the user writes in, and the currency of the business's country (or of the user's payment account).",
      "blocking": false
    }
  ],
  "build_plan": [
    {
      "id": "pages",
      "title": "Pages first",
      "how": "deploy_site with a home page, a product list, a product page per product (or one page with all products), /contact with the company details, /terms, /privacy, /returns with the withdrawal form, and /404.html. Use the user's real texts and prices; leave out what they do not have yet.",
      "tools": [
        "deploy_site"
      ]
    },
    {
      "id": "products",
      "title": "Products as data",
      "how": "With payments available: create_product_collection, then insert_document per product (name, price_cents including VAT, optional stock). Without payments: create_collection \"products\" with access {\"public_read\": true} and insert_document per product, so the site and the assistant read the same list.",
      "tools": [
        "create_product_collection",
        "create_collection",
        "insert_document"
      ]
    },
    {
      "id": "checkout",
      "title": "A real checkout, or an honest order request",
      "how": "Call get_payments_status: when ready is true, get_checkout_snippet per product and put the buy button on the product page. When the payment account is not connected yet, connect_payments gives the owner the link. When payments are not available (no such tool, or the user does not want them yet): build an order request instead. create_collection \"order_requests\" with access {\"public_write\": true} and triggers {\"email_on_insert\": true}, get_form_snippet, and a button that says \"Send order request\". The page says plainly that the shop confirms availability and sends payment details, and that nothing is paid yet. Never a \"Pay now\" button that does not take a payment.",
      "tools": [
        "get_payments_status",
        "connect_payments",
        "get_checkout_snippet",
        "create_collection",
        "get_form_snippet"
      ]
    },
    {
      "id": "orders",
      "title": "Orders and emails",
      "how": "Paid orders: list_orders and get_order, update_order_status to shipped. Order requests: query_documents on order_requests. With the Mail module on, send the buyer a confirmation with send_email (transactional) from the user's own domain (add_email_domain, verify_email_domain); otherwise tell the user to send it themselves.",
      "tools": [
        "list_orders",
        "get_order",
        "update_order_status",
        "query_documents",
        "send_email",
        "add_email_domain",
        "verify_email_domain"
      ]
    },
    {
      "id": "contact_form",
      "title": "Contact form that really arrives",
      "how": "create_collection \"contact\" with access {\"public_write\": true} and triggers {\"email_on_insert\": true}, then get_form_snippet on /contact.",
      "tools": [
        "create_collection",
        "get_form_snippet"
      ]
    },
    {
      "id": "accounts",
      "title": "Customer accounts (optional)",
      "how": "Only if the user wants customers to log in and see their orders: deploy_app with auth, and set_table_owner_column so each customer sees only their own rows. A shop works fine without accounts.",
      "tools": [
        "deploy_app",
        "set_table_owner_column"
      ],
      "optional": true
    },
    {
      "id": "chat",
      "title": "Chat that knows the shop (optional)",
      "how": "create_collection \"faq\" with access {\"assistant_read\": true}, insert_document with shipping, returns and opening hours, then create_chat_widget with the site's origin and put the embed code on the site.",
      "tools": [
        "create_collection",
        "insert_document",
        "create_chat_widget"
      ],
      "optional": true
    },
    {
      "id": "structured_data",
      "title": "Structured data for search",
      "how": "Add the Product block from structured_data.snippet to the head of each product page (one Product block per product, with that product's own name, price and image) with deploy_site and keep_existing: true. Replace every YOUR ... placeholder with the user's real details from the answers so far; never invent an address, phone number, price or opening hours, and leave out optional fields you do not know. check_readiness flags blocks that are incomplete or still have placeholders.",
      "tools": [
        "deploy_site"
      ],
      "optional": true
    },
    {
      "id": "launch",
      "title": "Before launch",
      "how": "check_readiness for the site, fix what you can, and label_site_version \"before launch\" so this state is kept. Then tell the user in plain words what works and what does not yet.",
      "tools": [
        "check_readiness",
        "label_site_version"
      ]
    }
  ],
  "go_live_checklist": [
    {
      "id": "company_details",
      "level": "usually_required",
      "description": "Company details on the site, easy to find (footer or contact page): the legal name, the geographic address, an email address and a phone number, the chamber of commerce or company registration number, and the VAT number if the business has one. In the Netherlands: the KvK number and the btw-id.",
      "why": "EU and UK rules for online services and distance selling ask businesses to say who they are and how to reach them. Customers also trust a shop more when they see a real business behind it.",
      "how_on_hypamoon": "Ask the user for these details (never invent them), put them on /contact and in the footer of every page with deploy_site.",
      "checked_by_check_readiness": true
    },
    {
      "id": "privacy_statement",
      "level": "usually_required",
      "description": "A privacy statement that says which personal data the site collects (forms, orders, bookings, chat), why, how long it is kept, who processes it, and how people can see or delete their data.",
      "why": "The GDPR (EU) and UK GDPR require this as soon as you collect personal data; in the US, California (CalOPPA) requires a posted privacy policy for sites that collect personal information from California residents.",
      "how_on_hypamoon": "Write it with the user from what the site really collects, put it on /privacy with deploy_site and link it in the footer and next to every form.",
      "checked_by_check_readiness": true
    },
    {
      "id": "cookie_notice",
      "level": "recommended",
      "description": "A cookie notice with a real choice, but only if the site uses non-essential cookies or trackers (analytics with personal data, advertising pixels, embedded videos that set cookies). A site with only functional storage needs no banner.",
      "why": "The ePrivacy rules (EU) and PECR (UK) require consent before non-essential cookies are set. A banner that is not needed only gets in the way.",
      "how_on_hypamoon": "Hypamoon sites, forms, checkout and the chat widget need no cookie banner by themselves. If the user adds a tracker, add a consent banner that loads it only after a yes.",
      "checked_by_check_readiness": false
    },
    {
      "id": "accessibility",
      "level": "recommended",
      "description": "Basic accessibility: readable contrast, alt text on images, labels on form fields, keyboard navigation, and an accessibility statement for online shops and services.",
      "why": "The European Accessibility Act applies to e-commerce and many consumer services since 28 June 2025; micro-enterprises (fewer than 10 staff and at most 2 million euro turnover) are usually exempt for services. Accessible sites also sell better.",
      "how_on_hypamoon": "Build the pages with labels, alt text and enough contrast; add /accessibility if the business is not a micro-enterprise.",
      "checked_by_check_readiness": false
    },
    {
      "id": "prices_incl_vat",
      "level": "usually_required",
      "description": "Prices for consumers shown as the total price, VAT included, with the currency (for example € 19,95).",
      "why": "Consumer law in the EU and UK requires the total price including taxes; a price without currency or VAT confuses buyers.",
      "how_on_hypamoon": "Show prices with the currency on the page; with checkout, price_cents in the product collection is the price including VAT.",
      "checked_by_check_readiness": true
    },
    {
      "id": "terms_and_conditions",
      "level": "recommended",
      "description": "Terms and conditions on /terms, linked in the footer and in the order flow, that the customer can read and save before ordering.",
      "why": "Not every country requires them, but if the shop uses them, customers must be able to read them before they order; they also set delivery, payment and liability.",
      "how_on_hypamoon": "Write them with the user, put them on /terms with deploy_site and link them next to the order button.",
      "checked_by_check_readiness": true
    },
    {
      "id": "withdrawal_right",
      "level": "usually_required",
      "description": "Information about the 14-day right of withdrawal (cancellation): how to withdraw, who pays return shipping, the refund within 14 days, the exceptions (for example made-to-order or sealed hygiene products), and the model withdrawal form.",
      "why": "The EU Consumer Rights Directive and the UK Consumer Contracts Regulations give consumers 14 days to cancel most online purchases; without the information the period can be extended by up to 12 months.",
      "how_on_hypamoon": "Put it on /returns with the model withdrawal form, link it in the footer and from the order flow (deploy_site).",
      "checked_by_check_readiness": true
    },
    {
      "id": "withdrawal_function",
      "level": "usually_required",
      "description": "An easy way to withdraw online: a clearly labelled withdrawal function (like \"withdraw from contract here\") where the customer confirms their withdrawal, followed by a confirmation.",
      "why": "An EU amendment to the Consumer Rights Directive (Directive 2023/2673) asks for an online withdrawal function for contracts made online, applying from 19 June 2026.",
      "how_on_hypamoon": "A form on /returns that saves the withdrawal in a collection (create_collection with public_write and email_on_insert, get_form_snippet) and shows a confirmation.",
      "checked_by_check_readiness": false
    },
    {
      "id": "shipping_costs_upfront",
      "level": "usually_required",
      "description": "Shipping costs, delivery restrictions (countries) and the expected delivery time shown before the customer starts ordering.",
      "why": "In the EU and UK this information must be clear at the start of the ordering process; everywhere, hidden costs at the end are the main reason people abandon a purchase.",
      "how_on_hypamoon": "Show shipping costs on the product pages and next to the order button (deploy_site).",
      "checked_by_check_readiness": false
    },
    {
      "id": "payment_methods_upfront",
      "level": "usually_required",
      "description": "The accepted payment methods shown at the latest at the start of the ordering process.",
      "why": "The Consumer Rights Directive asks for this at the start of the order.",
      "how_on_hypamoon": "List the methods of the user's payment account on the product page or in the footer.",
      "checked_by_check_readiness": false
    },
    {
      "id": "order_button_text",
      "level": "usually_required",
      "description": "The final order button says clearly that ordering means paying, like \"Order with obligation to pay\" or in Dutch \"Bestellen en betalen\"; not just \"Next\" or \"Continue\".",
      "why": "The EU Consumer Rights Directive and the UK rules require this; without it the customer may not be bound by the order.",
      "how_on_hypamoon": "Set the button text on the checkout button (get_checkout_snippet html) or the order request button.",
      "checked_by_check_readiness": false
    },
    {
      "id": "order_confirmation",
      "level": "usually_required",
      "description": "An order confirmation by email (a durable medium) with what was ordered, the price, the company details and the withdrawal information.",
      "why": "EU and UK consumer law ask for a confirmation on a durable medium at the latest at delivery; customers everywhere expect one right away.",
      "how_on_hypamoon": "Check what the checkout or the payment provider already sends; add one with send_email (Mail module) if needed, or tell the user to send it.",
      "checked_by_check_readiness": false
    },
    {
      "id": "legal_guarantee",
      "level": "recommended",
      "description": "A line about the legal guarantee: products must be as promised, and consumers keep their legal rights when something is wrong.",
      "why": "The legal guarantee applies anyway (at least two years in most EU countries; in the Netherlands what the buyer may reasonably expect); saying so avoids disputes.",
      "how_on_hypamoon": "Add it to /terms or /returns with deploy_site.",
      "checked_by_check_readiness": false
    },
    {
      "id": "complaints",
      "level": "recommended",
      "description": "How to complain, with an email address and a reasonable answer time, and the dispute body if the business is a member of one (in the Netherlands for example the Geschillencommissie or a trade association).",
      "why": "The EU ODR platform closed on 20 July 2025 and the link is no longer needed, but a clear complaint route is still expected, and members of a dispute body must mention it.",
      "how_on_hypamoon": "Add it to /terms or /contact with deploy_site.",
      "checked_by_check_readiness": false
    },
    {
      "id": "age_check",
      "level": "usually_required",
      "description": "An age check when selling age-restricted products (alcohol, tobacco and vapes, knives, some games): ask for confirmation online and check the ID at delivery.",
      "why": "Selling these to minors is forbidden; in the Netherlands the Alcoholwet requires an age check at the door for alcohol delivered to the home.",
      "how_on_hypamoon": "Only if relevant: add an age statement to the order form and tell the user to arrange the check at delivery.",
      "checked_by_check_readiness": false
    },
    {
      "id": "vat_registration",
      "level": "recommended",
      "description": "VAT set up correctly: the right rate in the prices, and the EU One Stop Shop (OSS) when sales to consumers in other EU countries pass 10,000 euro a year.",
      "why": "Above that threshold the VAT of the buyer's country applies.",
      "how_on_hypamoon": "Nothing to build; mention it to the user so they check it with their accountant.",
      "checked_by_check_readiness": false
    },
    {
      "id": "checkout_real",
      "level": "usually_required",
      "description": "Every buy, order or add-to-cart button leads to a real checkout or a real order request; a cart always ends in one.",
      "why": "A button that does nothing loses the sale and makes the shop look fake.",
      "how_on_hypamoon": "get_checkout_snippet when payments are ready, otherwise an order request form (create_collection, get_form_snippet).",
      "checked_by_check_readiness": true
    },
    {
      "id": "structured_data",
      "level": "recommended",
      "description": "Structured data (JSON-LD from schema.org) that tells search engines what the business or product is: name, address, phone, opening hours, prices.",
      "why": "Search engines can then show richer results, like opening hours, a price or a location on the map, instead of a plain link.",
      "how_on_hypamoon": "Add the block from get_advice (structured_data.snippet) with the user's real details, with deploy_site and keep_existing: true.",
      "checked_by_check_readiness": true
    },
    {
      "id": "forms_saved",
      "level": "usually_required",
      "description": "Every form really saves what a visitor sends (in a collection or through an app), and the owner sees or gets each entry.",
      "why": "A form that goes nowhere loses customers without anyone noticing. This is not a law; it is what makes the site work.",
      "how_on_hypamoon": "create_collection with public_write (and email_on_insert so the owner gets each entry), then get_form_snippet and deploy_site.",
      "checked_by_check_readiness": true
    },
    {
      "id": "no_placeholders",
      "level": "usually_required",
      "description": "No lorem ipsum, example.com, \"your text here\" or other placeholder text, and no invented reviews, customers or numbers presented as real.",
      "why": "Placeholders look unfinished; invented reviews or customers are misleading and, for consumers, an unfair commercial practice in the EU and UK.",
      "how_on_hypamoon": "Replace placeholders with the user's real text, or leave the section out until they have it (deploy_site with keep_existing).",
      "checked_by_check_readiness": true
    },
    {
      "id": "no_test_wording",
      "level": "usually_required",
      "description": "No test wording on the live site, like \"this is a test form\" or \"test environment\", once it is meant for real visitors.",
      "why": "Visitors stop trusting a form that says it is a test, and they will not send real requests.",
      "how_on_hypamoon": "Change the texts (and data-hypamoon-success on forms) with deploy_site, and make sure the form uses the live public token.",
      "checked_by_check_readiness": true
    },
    {
      "id": "internal_links",
      "level": "recommended",
      "description": "Every link inside the site leads to a page that exists, and buttons go somewhere real.",
      "why": "Broken links and dead buttons make a site look like a mockup.",
      "how_on_hypamoon": "Add the missing pages or fix the links with deploy_site.",
      "checked_by_check_readiness": true
    },
    {
      "id": "not_found_page",
      "level": "recommended",
      "description": "A friendly not-found page (/404.html) with a link back home and the contact details.",
      "why": "Old links and typos end there; a plain error page loses the visitor.",
      "how_on_hypamoon": "Add /404.html with deploy_site.",
      "checked_by_check_readiness": true
    },
    {
      "id": "no_fake_login",
      "level": "usually_required",
      "description": "No login that checks a password in JavaScript, and no member area that only hides content in the browser.",
      "why": "Anyone can read the password in the page source; it protects nothing and gives the owner a false sense of safety.",
      "how_on_hypamoon": "One shared password: password on deploy_site. Accounts per person: deploy_app with auth. Paid access: create_access_product and set_site_access.",
      "checked_by_check_readiness": true
    },
    {
      "id": "no_local_storage_db",
      "level": "usually_required",
      "description": "Orders, bookings, sign-ups and messages are not kept in the visitor's browser (localStorage) as if it were a database.",
      "why": "localStorage stays on the visitor's own device: the owner never sees it, and it is gone when they clear their browser.",
      "how_on_hypamoon": "Save it in a collection (create_collection, get_form_snippet) or through an app (deploy_app). localStorage is fine for a theme or language choice.",
      "checked_by_check_readiness": true
    }
  ],
  "pitfalls": [
    {
      "id": "fake_checkout",
      "pitfall": "A \"Pay now\" or \"Add to cart\" button that does nothing, or a cart that only lives in the browser.",
      "instead": "The real checkout when payments are ready, otherwise an honest order request that says payment follows later."
    },
    {
      "id": "price_in_page",
      "pitfall": "Trusting a price that the page sends to the server.",
      "instead": "The checkout always reads price_cents from the product collection; show the price as text on the page."
    },
    {
      "id": "no_shipping_costs",
      "pitfall": "Shipping costs that only appear at the end.",
      "instead": "Show shipping costs on the product page and before the order button."
    },
    {
      "id": "no_withdrawal",
      "pitfall": "No returns page or withdrawal form for consumers.",
      "instead": "A /returns page with the 14-day rules and the model form, linked in the footer."
    },
    {
      "id": "invented_reviews",
      "pitfall": "Invented reviews, star ratings or \"1,000 happy customers\".",
      "instead": "Only real reviews from the user, or none."
    },
    {
      "id": "variants_as_one",
      "pitfall": "Variants with different prices in one product.",
      "instead": "Each variant with its own price as its own product."
    },
    {
      "id": "forgot_order_email",
      "pitfall": "Orders that nobody sees.",
      "instead": "email_on_insert on order requests, list_orders for paid orders, and a clear owner email."
    },
    {
      "id": "users_round_trip",
      "pitfall": "App code that fetches /app-users itself on every page to show the people of the app.",
      "instead": "Read users via env.HYPAMOON.users: env.HYPAMOON.users.list() or env.HYPAMOON.users.get(id) in the app's server code, usually answered next to the app without a round trip."
    }
  ],
  "structured_data": {
    "schema_type": "Product",
    "why": "Search engines can show the product with its price and whether it is in stock. Use one block per product page, with that product's own details.",
    "snippet": "<script type=\"application/ld+json\">\n{\n  \"@context\": \"https://schema.org\",\n  \"@type\": \"Product\",\n  \"name\": \"YOUR PRODUCT NAME\",\n  \"description\": \"YOUR PRODUCT DESCRIPTION\",\n  \"image\": \"YOUR PRODUCT IMAGE URL (absolute, https)\",\n  \"offers\": {\n    \"@type\": \"Offer\",\n    \"price\": \"YOUR PRICE (like 19.95)\",\n    \"priceCurrency\": \"YOUR CURRENCY CODE (like EUR)\",\n    \"availability\": \"https://schema.org/InStock\",\n    \"url\": \"YOUR PRODUCT PAGE URL\"\n  }\n}\n</script>",
    "required": [
      "name",
      "offers.price",
      "offers.priceCurrency"
    ]
  },
  "note": "This is guidance to help the user prepare, not legal or tax advice. Rules differ per country and change over time; for anything that matters, the user checks with an advisor or the official sources (in the Netherlands for example ACM ConsuWijzer for consumer law, the Belastingdienst for VAT and the Autoriteit Persoonsgegevens for privacy).",
  "other_types": {
    "available": [
      "webshop",
      "bookings",
      "restaurant",
      "course_membership",
      "wordpress_portal"
    ],
    "planned": [
      "events",
      "portfolio",
      "internal_tool",
      "saas"
    ]
  },
  "known_problems": [
    {
      "id": "sandbox_blocks_upload",
      "symptom": "The PUT to an upload_url fails or is blocked from your own environment (a 403, a network error, \"host not allowed\"), or deploy_site says upload_not_received.",
      "what_to_do": "This is your sandbox, not Hypamoon: do not say Hypamoon is down or blocked. Send images under ~3 MB as base64 in deploy_site content instead. Files that are already online go as source_url in deploy_site (up to 100 per call). For larger or many local files, create_drop_link, give the user the url, and after they are done call get_drop and deploy its deploy_files; the user can also add them at https://app.hypamoon.com/media, after which deploy_site finds them by path, sha256 and bytes.",
      "tell_user": "Your chat app blocked the upload, not Hypamoon. I will send the file another way, or give you a link to upload it yourself in your browser."
    },
    {
      "id": "image_too_large",
      "symptom": "site_too_large, or one request over 4 MB because of an image.",
      "what_to_do": "Make a lighter copy first: at most about 2000 px wide, JPEG or WebP at quality ~80; that is usually under 500 KB and looks the same on screen. A file that must stay large goes through create_upload_urls, or create_drop_link if your environment cannot upload. The limits per file are in the error and in limits of create_upload_urls.",
      "tell_user": "That image is bigger than a website needs. I will make a lighter copy that looks the same on screen."
    },
    {
      "id": "version_conflict",
      "symptom": "version_conflict (409 or 412) on deploy_site or set_call_plan.",
      "what_to_do": "Something changed since you read it (another chat, a team member, the portal). Read it again (get_site or get_call_plan), apply your change on top of the current version, and send it with if_match_version set to current_version from the error. Never retry without reading, and never overwrite blindly.",
      "tell_user": "The site changed in the meantime, so I did not overwrite it. I will apply your change to the latest version."
    },
    {
      "id": "phone_verification_required",
      "symptom": "phone_verification_required (403) when making a site public or connecting a domain.",
      "what_to_do": "The account owner verifies their phone once at the verify_url in the error (https://app.hypamoon.com/verify-phone); a payment method also counts. Until then the site works with a password or as unlisted. Do not try to work around it.",
      "tell_user": "Before the site can be public, please confirm your phone number once at the link I give you. It takes about a minute."
    },
    {
      "id": "site_not_visible",
      "symptom": "The user says the site works for them but not for others, or it does not show up in Google.",
      "what_to_do": "Check get_site: an unlisted site only opens with its secret link, and a site with a password asks every visitor for it. update_site_address makes it public (that may need phone verification); rotate_site_secret_url makes a new secret link. A new public site takes days to appear in Google; check_readiness covers findability.",
      "tell_user": "Your site is live, but it is set to private, so only people with the secret link can open it. I can make it public if you want."
    },
    {
      "id": "is_hypamoon_down",
      "symptom": "A step failed and it looks like Hypamoon might be down.",
      "what_to_do": "Call get_status before you say anything about an outage. Operational: the problem is in the failing step or in your own environment; read its user_message and fix that step. A reported problem: tell the user what is affected and link https://status.hypamoon.com; retry later instead of inventing a workaround.",
      "tell_user": "Hypamoon is working normally. The problem is likely in your chat app. (Use the user_message from get_status; it says so when there is a real problem.)"
    }
  ],
  "recipes": [],
  "summary_markdown": "## Webshop (EU, NL, selling to consumers)\nA shop on the user's own site: products, a real checkout (or an honest order request while payments are not on), order emails and the pages a shop needs to go live.\n\n**Ask only these, if not answered yet:** What do you sell, and roughly how many products? Do they come in variants like size or color?\n**Defaults for the rest:** country: NL.; seller: A business selling to consumers.; shipping: One flat shipping rate within the country, shown on every product page and before checkout; pickup on request.; returns: The legal minimum: 14 days to withdraw, the customer pays return shipping, refund within 14 days.; stock: No stock tracking (unlimited); the owner takes a product off sale by hand.; payment_methods: What the user's own payment account offers (in the Netherlands usually iDEAL and cards).; order_emails: The project's billing email address.; language_currency: The language the user writes in, and the currency of the business's country (or of the user's payment account).\n\n**Build plan:**\n1. Pages first: deploy_site\n2. Products as data: create_product_collection, create_collection, insert_document\n3. A real checkout, or an honest order request: get_payments_status, connect_payments, get_checkout_snippet, create_collection, get_form_snippet\n4. Orders and emails: list_orders, get_order, update_order_status, query_documents, send_email, add_email_domain, verify_email_domain\n5. Contact form that really arrives: create_collection, get_form_snippet\n6. Customer accounts (optional) (optional): deploy_app, set_table_owner_column\n7. Chat that knows the shop (optional) (optional): create_collection, insert_document, create_chat_widget\n8. Structured data for search (optional): deploy_site\n9. Before launch: check_readiness, label_site_version\n\n**Before going live (offer it, do not impose it):** 16 usually required and 9 recommended points; check_readiness verifies 14 of them on the site.\n\n**Common mistakes:** A \"Pay now\" or \"Add to cart\" button that does nothing, or a cart that only lives in the browser. Trusting a price that the page sends to the server. Shipping costs that only appear at the end. No returns page or withdrawal form for consumers. Invented reviews, star ratings or \"1,000 happy customers\". Variants with different prices in one product. Orders that nobody sees. App code that fetches /app-users itself on every page to show the people of the app.\n\n_This is guidance to help the user prepare, not legal or tax advice. Rules differ per country and change over time; for anything that matters, the user checks with an advisor or the official sources (in the Netherlands for example ACM ConsuWijzer for consumer law, the Belastingdienst for VAT and the Autoriteit Persoonsgegevens for privacy)._"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### POST /project/move-to-live

**Move sites from the test project to the live project.**

Moves the chosen sites of the test project (default: all) to its live project, with every version, label, password and address, the collections they use with all documents, an app on the site with its sign-in users, files and database, the agents on those collections (paused) and domains connected for real. Simulated domains do not come along. The test form token (hm\_pubtest\_) in the site files is replaced by a new live token with the same allowed origins, as a new site version labelled 'moved to live'. A collection that a site staying in test also uses is refused by default (409 with the list); shared\_collections copy gives the live project its own copy. Everything in the database happens in one transaction, and a move log keeps the rows from before, so the move can be undone within 24 hours. Works with a test or a live key of the same project, but only for an owner (through OAuth, or a key made by an owner) and only when the live project is verified: otherwise verification\_required with the missing steps (company details, a payment with SCA, a verified phone). The plan limits of the live project apply (sites, files, data, apps). A chat connected through OAuth to the test project stays on test: reconnect and choose the live project, or switch the connection to live in the portal under Connections.

Scope: `project:write`

#### Request body

Move sites from the test project to the live project.

| Field | Type |  |
| --- | --- | --- |
| `sites` | string\[\] | Optional. The sites to move, by id or slug. Leave it out to move every site of the test project. |
| `collections` | string\[\] | Optional. The collections to move, by name or id. Leave it out to move the collections the chosen sites use (a site uses a collection when its files name it, like a form from get\_form\_snippet). |
| `shared_collections` | `"refuse"`, `"copy"` | What to do with a collection that a site staying in test also uses. refuse (default): nothing is moved and the answer lists them. copy: the live project gets its own copy with all documents; the test site keeps the original. |

JSON

```
{
  "sites": [
    "bakkerij-jansen"
  ]
}
```

#### 200 What moved, what stayed, and the next step.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string | The id of this move, for undo\_move\_to\_live. |
| `status` (required) | `"done"`, `"partly_done"` | partly\_done: some steps after the move did not finish; see errors. Support is notified. |
| `from_project` (required) | object |  |
| `to_project` (required) | object |  |
| `moved` (required) | object |  |
| `stayed_in_test` (required) | object |  |
| `warnings` (required) | string\[\] |  |
| `errors` (required) | string\[\] |  |
| `undo` (required) | object |  |
| `connection` (required) | object or null | For a chat connected through OAuth: which project the connection points to now. |
| `summary` (required) | string |  |
| `next_step` (required) | string |  |

JSON

```
{
  "id": "0f6c2a8e-7d3b-4c1e-9a55-2b8f6d4e1c90",
  "status": "done",
  "from_project": {
    "id": "6b1d2c3e-4f50-4a6b-8c7d-9e0f1a2b3c4d",
    "name": "Bakkerij Jansen (test)",
    "mode": "test"
  },
  "to_project": {
    "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
    "name": "Bakkerij Jansen",
    "mode": "live"
  },
  "moved": {
    "sites": [
      {
        "id": "3c4d5e6f-7a8b-4c9d-8e0f-1a2b3c4d5e6f",
        "slug": "bakkerij-jansen",
        "url": "https://bakkerij-jansen.hypamoon.app",
        "new_version": 7,
        "form_token_replaced": true
      }
    ],
    "collections": [
      {
        "id": "7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d",
        "name": "contact",
        "documents": 12
      }
    ],
    "copied_collections": [],
    "apps": [],
    "agents": [],
    "domains": [],
    "form_tokens": [
      {
        "name": "Website form",
        "live_token_id": "9c0d1e2f-3a4b-4c5d-8e6f-7a8b9c0d1e2f",
        "replaces_test_token_id": "2f3a4b5c-6d7e-4f8a-9b0c-1d2e3f4a5b6c"
      }
    ],
    "webhooks": 0
  },
  "stayed_in_test": {
    "sites": [],
    "collections": [],
    "simulated_domains": []
  },
  "warnings": [],
  "errors": [],
  "undo": {
    "until": "2026-10-10T09:00:00.000Z",
    "how": "undo_move_to_live with move_id 0f6c2a8e-7d3b-4c1e-9a55-2b8f6d4e1c90 (POST /project/move-to-live/undo with {\"move_id\": \"0f6c2a8e-7d3b-4c1e-9a55-2b8f6d4e1c90\"}), until 2026-10-10T09:00:00.000Z."
  },
  "connection": {
    "mode": "test",
    "note": "This connection still points to the test project, where these sites no longer are. It keeps working there until it is reconnected or switched."
  },
  "summary": "Moved 1 site (bakkerij-jansen) with all versions, 1 collection with 12 documents and a new live form token from Bakkerij Jansen (test) to Bakkerij Jansen. Nothing else was in the test project. This can be undone until 2026-10-10T09:00:00.000Z with undo_move_to_live.",
  "next_step": "Reconnect your chat to Hypamoon and choose Bakkerij Jansen (not test), or switch this connection in the portal under Connections (Switch to live; you confirm the access again there). Check the sites at their address; forms now save to the live project. To put the user's own domain on a site: connect_domain with the site_id from the live project (through the nameservers it is free)."
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 402 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 409 | [`migration_paused`](https://hypamoon.com/docs/errors/migration_paused) |
| 409 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### POST /project/move-to-live/undo

**Undo a move to live.**

Moves the sites, collections, apps and agents of a move back to the test project, within 24 hours. The sites get the test form token back as a new version, and the live token is revoked. A copied collection stays in the live project. Without move\_id the latest move of this project. After 24 hours: 409 with how support can still help.

Scope: `project:write`

#### Request body

Undo a move to live within 24 hours.

| Field | Type |  |
| --- | --- | --- |
| `move_id` | string (uuid) | Optional. The id from move\_to\_live. Leave it out to undo the latest move of this project. |

JSON

```
{
  "move_id": "0f6c2a8e-7d3b-4c1e-9a55-2b8f6d4e1c90"
}
```

#### 200 What went back.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string |  |
| `status` (required) | `"undone"`, `"partly_undone"` |  |
| `sites` (required) | string\[\] |  |
| `collections` (required) | number |  |
| `apps` (required) | number |  |
| `agents` (required) | number |  |
| `domains` (required) | number |  |
| `errors` (required) | string\[\] |  |
| `summary` (required) | string |  |
| `next_step` (required) | string |  |

JSON

```
{
  "id": "0f6c2a8e-7d3b-4c1e-9a55-2b8f6d4e1c90",
  "status": "undone",
  "sites": [
    "3c4d5e6f-7a8b-4c9d-8e0f-1a2b3c4d5e6f"
  ],
  "collections": 1,
  "apps": 0,
  "agents": 0,
  "domains": 0,
  "errors": [],
  "summary": "Moved 1 site and 1 collection back from Bakkerij Jansen to Bakkerij Jansen (test).",
  "next_step": "The sites are in the test project again, with the test form token. Use the test connection or a test key to work on them."
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /errors

**List recent errors.**

The failed MCP tool calls and API requests of this project (live and test) from the last 14 days, newest first: when, which app (chatgpt, claude, grok, oauth, mcp or api), the tool or route, the error type, the status, the detail the caller got, how long it took and the request id. Arguments are only summarized (field names, types, lengths and counts), never their values; email addresses, phone numbers, keys and URL paths in the detail are masked. Pass request\_id to find one error the user mentions. At most 1000 errors per project per day are kept; dropped\_today counts the ones above that.

Scope: `project:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `limit` | query | integer | Errors per page, 1 to 100. |
| `before` | query | string | next\_before from the previous page, for older errors. |
| `request_id` | query | string | Only the errors of this request (the request id from an error message or the X-Request-Id header). |
| `tool` | query | string | Only the errors of this MCP tool, like deploy\_site. |

#### 200 The errors, newest first.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | RecentError\[\] |  |
| `next_before` (required) | string or null |  |
| `dropped_today` (required) | integer |  |

JSON

```
{
  "data": [
    {
      "id": "48213",
      "at": "2026-10-12T14:03:11.402Z",
      "source": "mcp",
      "client": "chatgpt",
      "tool": "deploy_site",
      "route": null,
      "error": "validation_failed",
      "status": 422,
      "detail": "Some files could not be fetched. See 'errors'.",
      "duration_ms": 8123,
      "request_id": "req_7Hq2LmX9pRt4VwZ1aB3c",
      "mode": "live",
      "arguments": {
        "name": "string(12)",
        "files": {
          "type": "array",
          "n": 14,
          "fields": {
            "path": 14,
            "content": 11,
            "source_url": 3
          },
          "chars": 48211
        }
      },
      "field_errors": [
        {
          "path": "files.12.source_url",
          "message": "images.example.com answered HTTP 403: it blocks downloads by servers. Upload the file with create_upload_urls instead."
        }
      ]
    }
  ],
  "next_before": null,
  "dropped_today": 0
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_parameter`](https://hypamoon.com/docs/errors/invalid_parameter) |

## Billing

The prepaid balance: every SMS, call minute and number is deducted from it, and AI usage (chat replies, agents, the portal assistant) is billed per use. Top up in the portal.

### GET /balance

**Get the prepaid balance.**

A live project pays in advance: you top up a balance in the portal ([https://app.hypamoon.com/balance](https://app.hypamoon.com/balance?utm_source=docs&utm_campaign=reference)) and every SMS, call minute and number is deducted from it immediately. This returns the balance, what was spent this calendar month against the spending cap, the automatic top-up settings and the latest 20 transactions, newest first. All amounts are in euro, excluding VAT. Read-only: topping up and the automatic top-up settings are in the portal. With a test key you see the balance of the live project with test: true. Test mode is free, except AI above the free daily test budget (chat replies, agent model calls), which is deducted from this balance.

Scope: `project:read`

#### 200 The balance with the latest transactions.

| Field | Type |  |
| --- | --- | --- |
| `balance_eur` (required) | number | The prepaid balance in euro, excluding VAT. Can be slightly below zero after a call that ran on. |
| `currency` (required) | `"EUR"` | Always EUR. |
| `spent_this_month_eur` (required) | number | What was deducted this calendar month (minus refunds). Counts toward the spending cap. |
| `spend_cap_eur` (required) | number or null | The spending cap per calendar month, or null without one. |
| `auto_reload` (required) | AutoReload | Automatic top-up with a saved card. |
| `transactions` (required) | Transaction\[\] | The latest 20 transactions, newest first. |
| `test` (required) | boolean | true with a test key: you see the balance of the live project, read-only. Test mode is free and never touches the balance. |

JSON

```
{
  "balance_eur": 24.46,
  "currency": "EUR",
  "spent_this_month_eur": 0.3,
  "spend_cap_eur": 100,
  "auto_reload": {
    "enabled": true,
    "active": true,
    "threshold_eur": 5,
    "amount_eur": 20,
    "max_per_month": 10,
    "used_this_month": 1,
    "disabled_reason": null,
    "card": {
      "brand": "Visa",
      "last4": "4242",
      "expiry": "2028-12-31"
    }
  },
  "transactions": [
    {
      "id": "6e5d4c3b-2a19-4f8e-8d7c-6b5a4e3d2c1b",
      "type": "charge",
      "source": "sms",
      "amount_eur": -0.3,
      "balance_after_eur": 24.46,
      "description": "SMS, 2 segments",
      "quantity": 2,
      "unit": "segment",
      "reference_id": "8f7e6d5c-4b3a-4291-8f0e-1d2c3b4a5968",
      "created_at": "2026-10-01T10:02:00.000Z"
    },
    {
      "id": "4c3b2a19-0f8e-4d7c-9b6a-5e4d3c2b1a09",
      "type": "top_up",
      "source": "payment",
      "amount_eur": 20,
      "balance_after_eur": 24.76,
      "description": "Top-up",
      "quantity": null,
      "unit": null,
      "reference_id": "b7e5a1c4-2d93-4f60-8a1e-9c3d5b7f2e10",
      "created_at": "2026-10-01T09:30:00.000Z"
    }
  ],
  "test": false
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

## Numbers

Search for, order and list phone numbers.

### GET /numbers

**List the numbers.**

The phone numbers of the project, oldest first. Released numbers are left out.

Scope: `numbers:read`

#### 200 The numbers.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | Number\[\] |  |

JSON

```
{
  "data": [
    {
      "id": "5f0c9a2e-8b1d-4c3f-a6e7-2d9b0c1e4f53",
      "e164": "+•••••••••42",
      "type": "national",
      "status": "active",
      "created_at": "2026-10-01T09:00:00.000Z",
      "test": false
    }
  ]
}
```

### POST /numbers

**Order a number.**

Orders a number for the project. The Idempotency-Key header is required: when your request times out, send it again with the same key and you receive the same number, never a second one. Before ordering we check the company details, the spending cap, the payment method, a verified phone with one payment confirmed with your bank (iDEAL or a card with 3D Secure; verification\_required otherwise), and the prepaid balance; each has its own error. A national number needs a business: a personal account receives business\_required, and a business may need its registration number checked against the business register (verification\_required with missing kvk\_check). A live number is deducted from the balance: the first month when you order it, then on the first of every month. A geographic number also needs the number\_documents verification level (see verification in GET /project).

Scope: `numbers:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `Idempotency-Key` (required) | header | string | 1 to 255 visible ASCII characters without spaces, like a UUID. A new one per order; reuse it when you retry. We remember a key for 24 hours. |

#### Request body

Send either phone\_number or area, not both.

| Field | Type |  |
| --- | --- | --- |
| `phone_number` | string | A number from GET /numbers/available, in E.164. With a test key: a test number from that same search. |
| `area` | string | Instead of phone\_number: we pick the first free number with this area code, as GET /numbers/available returns it. |

JSON

```
{
  "area": "020"
}
```

#### 201 The number was ordered. status is active (it works now) or pending (the registration is with the carrier).

| Header |  |
| --- | --- |
| `Idempotent-Replayed` | Present when this is the stored response to an earlier request with the same Idempotency-Key. |

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the number. Use it for the call plan. |
| `e164` (required) | string | The number in E.164, like +447700900123. |
| `type` (required) | string | national (non-geographic), geographic (with an area code), mobile or tollfree. |
| `status` (required) | string | pending (the registration is with the carrier, usually active within one business day), active or porting. |
| `created_at` (required) | string (date-time) | When the number was added to the project. |
| `test` (required) | boolean | true for a test number (test mode), from the range +447700900000 to +447700900999. It can never be called for real. |
| `from_stock` (required) | boolean | Whether the number came from our stock. A number from stock works right away. |

JSON

```
{
  "id": "5f0c9a2e-8b1d-4c3f-a6e7-2d9b0c1e4f53",
  "e164": "+•••••••••42",
  "type": "national",
  "status": "active",
  "created_at": "2026-10-01T09:00:00.000Z",
  "test": false,
  "from_stock": true
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`idempotency_key_missing`](https://hypamoon.com/docs/errors/idempotency_key_missing) |
| 400 | [`idempotency_key_invalid`](https://hypamoon.com/docs/errors/idempotency_key_invalid) |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 402 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 402 | [`payment_mandate_missing`](https://hypamoon.com/docs/errors/payment_mandate_missing) |
| 402 | [`billing_blocked`](https://hypamoon.com/docs/errors/billing_blocked) |
| 402 | [`insufficient_balance`](https://hypamoon.com/docs/errors/insufficient_balance) |
| 403 | [`phone_verification_required`](https://hypamoon.com/docs/errors/phone_verification_required) |
| 403 | [`number_limit_reached`](https://hypamoon.com/docs/errors/number_limit_reached) |
| 409 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 409 | [`idempotency_key_reused`](https://hypamoon.com/docs/errors/idempotency_key_reused) |
| 409 | [`idempotency_request_in_progress`](https://hypamoon.com/docs/errors/idempotency_request_in_progress) |
| 409 | [`number_unavailable`](https://hypamoon.com/docs/errors/number_unavailable) |
| 409 | [`number_already_yours`](https://hypamoon.com/docs/errors/number_already_yours) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`company_details_missing`](https://hypamoon.com/docs/errors/company_details_missing) |
| 422 | [`business_required`](https://hypamoon.com/docs/errors/business_required) |
| 422 | [`spend_cap_missing`](https://hypamoon.com/docs/errors/spend_cap_missing) |
| 422 | [`regulatory_documents_missing`](https://hypamoon.com/docs/errors/regulatory_documents_missing) |
| 422 | [`no_numbers_available`](https://hypamoon.com/docs/errors/no_numbers_available) |
| 422 | [`test_number_limit_reached`](https://hypamoon.com/docs/errors/test_number_limit_reached) |
| 502 | [`order_status_unknown`](https://hypamoon.com/docs/errors/order_status_unknown) |
| 502 | [`upstream_error`](https://hypamoon.com/docs/errors/upstream_error) |
| 503 | [`telephony_unavailable`](https://hypamoon.com/docs/errors/telephony_unavailable) |

### GET /numbers/available

**Search for numbers to order.**

Available numbers you can order with POST /numbers. Everything returned can be ordered right now. type=national returns non-geographic numbers that work across the country; numbers from our stock come first and work immediately. Regional numbers (type=geographic) need documents that cannot be uploaded through the API yet. With a test key, it returns free test numbers from +447700900000 to +447700900999 instead (test: true); they never reach the carrier.

Scope: `numbers:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `type` | query | `"national"`, `"geographic"` | national or geographic. Without it, the type follows from area: the national prefix or nothing is national. |
| `area` | query | string | The area code. Required for geographic; leave it out for national. |

#### 200 The available numbers.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | AvailableNumber\[\] |  |

JSON

```
{
  "data": [
    {
      "e164": "+•••••••••42",
      "type": "national",
      "from_stock": true,
      "test": false
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 502 | [`upstream_error`](https://hypamoon.com/docs/errors/upstream_error) |
| 503 | [`telephony_unavailable`](https://hypamoon.com/docs/errors/telephony_unavailable) |

### DELETE /numbers/{id}

**Release a test number.**

Test mode only. Removes a test number from the test project, so you can take another one (a test project has at most 3). Its call plan is removed with it; calls and messages are kept. A live key gets 409 number\_release\_not\_supported: releasing a live number cancels it at the carrier for good and is not possible through the API.

Scope: `numbers:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the number. |

#### 200 The test number was released.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the number that was released. |
| `e164` (required) | string | The number in E.164, like +447700900123. |
| `released` (required) | `true` | Always true: the number is no longer in the project. |
| `test` (required) | `true` | Always true: only test numbers can be released through the API. |

JSON

```
{
  "id": "0d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6",
  "e164": "+447700900042",
  "released": true,
  "test": true
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`number_release_not_supported`](https://hypamoon.com/docs/errors/number_release_not_supported) |

## Assistant

The voice AI that answers your calls. One per project.

### GET /assistant

**Get the assistant.**

The assistant of the project: its voice, languages, instructions, website and fixed greeting.

Scope: `assistant:write`

#### 200 The assistant.

| Field | Type |  |
| --- | --- | --- |
| `configured` (required) | boolean | Whether the assistant was ever set up with PUT /assistant. |
| `voice` (required) | string or null | The voice, like ava. It speaks the language. |
| `language` (required) | string | The language the assistant opens and speaks in, like en. |
| `languages` (required) | string\[\] | The languages your callers speak, with language first. |
| `speech_recognition` (required) | string | The language of speech recognition: the one language, or multi when there are two or more. |
| `instructions` (required) | string | What the assistant does: your instructions. |
| `website` (required) | string or null | The website the assistant reads for opening hours, address and services. |
| `greeting` (required) | string | The first sentence callers hear. Your own (greeting on PUT), or the default that follows from the project name and the language. It always says the caller is talking to a digital assistant. |
| `greeting_custom` (required) | boolean | true when greeting is your own text; false for the default. |
| `synced_at` (required) | string or null (date-time) | When the assistant was last updated at the carrier. |

JSON

```
{
  "configured": true,
  "voice": "ava",
  "language": "en",
  "languages": [
    "en"
  ],
  "speech_recognition": "en",
  "instructions": "You answer for Acme Plumbing. Ask for the address and the problem, and tell the caller we call back within the hour. Never quote prices.",
  "website": "https://acme-plumbing.example/",
  "greeting": "You are speaking with the digital assistant of Acme Plumbing. How can I help you?",
  "greeting_custom": false,
  "synced_at": "2026-10-01T09:00:00.000Z"
}
```

### PUT /assistant

**Set the assistant.**

One assistant per project. PUT replaces all fields; any field you leave out reverts to its default. greeting is the exception: leave it out and it stays. Your own greeting must say the caller is talking to an AI (EU AI Act, article 50); without that we put a short disclosure in front and return warnings. Without your own greeting, the default comes from your project name and the language.

Scope: `assistant:write`

#### Request body

PUT replaces all fields: a field you leave out goes back to its default.

| Field | Type |  |
| --- | --- | --- |
| `voice` | `"saar"`, `"fenna"`, `"merel"`, `"julia"`, `"roos"`, `"tim"`, `"bram"`, `"daan"`, `"ruben"`, `"ava"`, `"nora"`, `"liam"`, `"owen"`, `"lena"`, `"mara"`, `"jonas"`, `"felix"`, `"chloe"`, `"manon"`, `"hugo"`, `"theo"`, `"lucia"`, `"elena"`, `"pablo"`, `"diego"` | The voice. It must speak the language: nl saar, fenna, merel, julia, roos, tim, bram, daan, ruben; en ava, nora, liam, owen; de lena, mara, jonas, felix; fr chloe, manon, hugo, theo; es lucia, elena, pablo, diego. Case does not matter. Default: the first voice of the language. |
| `language` | `"nl"`, `"en"`, `"de"`, `"fr"`, `"es"` | The language the assistant opens and speaks in: en (English), nl (Dutch), de (German), fr (French) or es (Spanish). The greeting follows it. Default: the language of the country of your first number (Dutch while the project has no number yet). |
| `languages` | `"nl"`, `"en"`, `"de"`, `"fr"`, `"es"`\[\] | The languages your callers speak; language always comes first. One language is the most reliable, because speech recognition never has to guess. Two or more switch it to multi, which follows the caller sentence by sentence, and the assistant switches with them. auto and multi are not accepted. Default: \[language\]. |
| `instructions` | string | What the assistant does, as free text. Default empty. |
| `website` | string or null | Optional. We read the page and use it for opening hours, address and services. Must be a public web address. |
| `greeting` | string or null | Optional. The first sentence callers hear, in the language set by language, at most 300 characters; keep it short, callers can only speak after it. It must say the caller is talking to an AI (EU AI Act, article 50), like "digital assistant", "virtual assistant" or "AI": if it does not, we put a short disclosure in front and say so in warnings. null or an empty string goes back to the default greeting. Unlike the other fields, leaving it out keeps the greeting you have. |

JSON

```
{
  "language": "en",
  "voice": "ava",
  "instructions": "You answer for Acme Plumbing. Ask for the address and the problem, and tell the caller we call back within the hour. Never quote prices.",
  "website": "https://acme-plumbing.example"
}
```

#### 200 The assistant as saved.

| Field | Type |  |
| --- | --- | --- |
| `configured` (required) | boolean | Whether the assistant was ever set up with PUT /assistant. |
| `voice` (required) | string or null | The voice, like ava. It speaks the language. |
| `language` (required) | string | The language the assistant opens and speaks in, like en. |
| `languages` (required) | string\[\] | The languages your callers speak, with language first. |
| `speech_recognition` (required) | string | The language of speech recognition: the one language, or multi when there are two or more. |
| `instructions` (required) | string | What the assistant does: your instructions. |
| `website` (required) | string or null | The website the assistant reads for opening hours, address and services. |
| `greeting` (required) | string | The first sentence callers hear. Your own (greeting on PUT), or the default that follows from the project name and the language. It always says the caller is talking to a digital assistant. |
| `greeting_custom` (required) | boolean | true when greeting is your own text; false for the default. |
| `synced_at` (required) | string or null (date-time) | When the assistant was last updated at the carrier. |
| `sync` (required) | `"synced"`, `"failed"`, `"skipped_test_mode"` | synced when the assistant was updated right away; failed when not. Your settings are saved either way and applied with the next PUT. skipped\_test\_mode with a test key: a test project has no live assistant. |
| `call_plan` (required) | `"added"`, `"in_plan"`, `"not_in_plan"` | added: the project only had the default plan (voicemail), so it now has a call plan where the assistant answers every call, with voicemail if the assistant is not available. in\_plan: the call plan already sends calls to the assistant. not\_in\_plan: your own call plan does not use the assistant yet; add an ai\_agent node with PUT /numbers/{id}/call-plan. |
| `next_step` (required) | string | What to do next. |
| `user_message` (required) | string | A sentence you can show the user as it is. |
| `warnings` | string\[\] | Only when something was adjusted, like a greeting without the AI disclosure: we put a short disclosure in front. Tell the user and offer to choose their own wording. |

JSON

```
{
  "configured": true,
  "voice": "ava",
  "language": "en",
  "languages": [
    "en"
  ],
  "speech_recognition": "en",
  "instructions": "You answer for Acme Plumbing. Ask for the address and the problem, and tell the caller we call back within the hour. Never quote prices.",
  "website": "https://acme-plumbing.example/",
  "greeting": "You are speaking with the digital assistant of Acme Plumbing. How can I help you?",
  "greeting_custom": false,
  "synced_at": "2026-10-01T09:00:00.000Z",
  "sync": "synced",
  "call_plan": "added",
  "next_step": "The project's main call plan was changed: it only had the default plan (voicemail), so now the assistant answers every call, and callers can leave a message if it is not available. Nothing else is needed. To ring a team first, PUT /numbers/{id}/call-plan.",
  "user_message": "Your assistant is ready, and your call plan now sends every call to it. If it is ever not available, callers can leave a message."
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 409 | [`version_conflict`](https://hypamoon.com/docs/errors/version_conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

## Call plans

What happens when your number is called: ring your team, read out a text, hand over to the assistant.

### GET /numbers/{id}/call-plan

**Get the call plan of a number.**

The call plan of one number, with its version. The version is also in the ETag header; send it back as If-Match with PUT.

Scope: `numbers:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the number. |

#### 200 The call plan that calls to this number follow: its own plan (source number) or, without one, the plan of the project (source project, version 0).

| Header |  |
| --- | --- |
| `ETag` | The version of the call plan, like "3". Send it back as If-Match. |

| Field | Type |  |
| --- | --- | --- |
| `number_id` (required) | string (uuid) |  |
| `version` (required) | integer | The version of the number's own plan; 0 when the number has no own plan yet. Also in the ETag header. |
| `source` (required) | `"number"`, `"project"`, `"none"` | Where plan comes from. number: the number has its own plan. project: the number has no own plan and follows the plan of the project (set\_assistant sets that one up); this is what callers get. none: no plan at all. |
| `plan` (required) | one of | The plan that calls to this number follow: its own plan, or else the plan of the project; null when there is none. |

JSON

```
{
  "number_id": "5f0c9a2e-8b1d-4c3f-a6e7-2d9b0c1e4f53",
  "version": 1,
  "source": "number",
  "plan": {
    "entry": "team",
    "nodes": {
      "team": {
        "id": "team",
        "type": "forward",
        "strategy": "sequential",
        "targets": [
          {
            "kind": "external",
            "e164": "+447700900123"
          }
        ],
        "ringSeconds": 20,
        "onNoAnswer": "ai"
      },
      "ai": {
        "id": "ai",
        "type": "ai_agent"
      }
    }
  }
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### PUT /numbers/{id}/call-plan

**Set the call plan of a number.**

Replaces the call plan of one number. A plan with an ai\_agent node needs the assistant (PUT /assistant; voice AI is always included) and updates the assistant with this plan. Send If-Match with the ETag from GET to avoid overwriting a newer plan.

Scope: `numbers:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the number. |
| `If-Match` | header | string | The version from the ETag of GET, like "3". An outdated version returns 412 version\_conflict. |

#### Request body

A call plan: a small graph. entry is the first node; every node points to the next by id. At most 50 nodes, and every node must be reachable from entry. Field names inside the plan are camelCase: the plan is stored exactly as you send it.

| Field | Type |  |
| --- | --- | --- |
| `entry` (required) | string | The id of the first node. |
| `nodes` (required) | object | The nodes by id. The key must be the same as the node's id. |

JSON

```
{
  "entry": "team",
  "nodes": {
    "team": {
      "id": "team",
      "type": "forward",
      "strategy": "sequential",
      "targets": [
        {
          "kind": "external",
          "e164": "+447700900123"
        }
      ],
      "ringSeconds": 20,
      "onNoAnswer": "ai"
    },
    "ai": {
      "id": "ai",
      "type": "ai_agent"
    }
  }
}
```

#### 200 The call plan as saved, with its new version.

| Header |  |
| --- | --- |
| `ETag` | The version of the call plan, like "3". Send it back as If-Match. |

| Field | Type |  |
| --- | --- | --- |
| `number_id` (required) | string (uuid) |  |
| `version` (required) | integer | The version of the number's own plan; 0 when the number has no own plan yet. Also in the ETag header. |
| `plan` (required) | CallPlan | A call plan: a small graph. entry is the first node; every node points to the next by id. At most 50 nodes, and every node must be reachable from entry. Field names inside the plan are camelCase: the plan is stored exactly as you send it. |
| `assistant_sync` (required) | `"synced"`, `"failed"`, `"not_needed"`, `"skipped_test_mode"` | Whether the assistant was updated with this plan. not\_needed for a plan without ai\_agent; skipped\_test\_mode with a test key. |

JSON

```
{
  "number_id": "5f0c9a2e-8b1d-4c3f-a6e7-2d9b0c1e4f53",
  "version": 1,
  "plan": {
    "entry": "team",
    "nodes": {
      "team": {
        "id": "team",
        "type": "forward",
        "strategy": "sequential",
        "targets": [
          {
            "kind": "external",
            "e164": "+447700900123"
          }
        ],
        "ringSeconds": 20,
        "onNoAnswer": "ai"
      },
      "ai": {
        "id": "ai",
        "type": "ai_agent"
      }
    }
  },
  "assistant_sync": "synced"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_parameter`](https://hypamoon.com/docs/errors/invalid_parameter) |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 402 | [`voice_ai_not_enabled`](https://hypamoon.com/docs/errors/voice_ai_not_enabled) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`version_conflict`](https://hypamoon.com/docs/errors/version_conflict) |
| 412 | [`version_conflict`](https://hypamoon.com/docs/errors/version_conflict) |
| 422 | [`team_targets_not_allowed`](https://hypamoon.com/docs/errors/team_targets_not_allowed) |
| 422 | [`forward_target_not_allowed`](https://hypamoon.com/docs/errors/forward_target_not_allowed) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`assistant_not_configured`](https://hypamoon.com/docs/errors/assistant_not_configured) |

## Calls

Your calls, inbound and outbound, with transcript and summary. Your assistant can also call one person who expects it, like a customer with an appointment.

### GET /calls

**List the calls.**

The calls of the project, inbound and outbound, newest first, without transcript and summary. Follow next\_cursor while has\_more is true. A call your assistant made with POST /calls has direction outbound and an outbound object with its status, reference and metadata.

Scope: `calls:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `limit` | query | integer | Calls per page, default 25. A value above 100 is capped at 100. |
| `cursor` | query | string | The next\_cursor of the previous page. |
| `direction` | query | `"inbound"`, `"outbound"` | Only inbound calls, or only outbound calls (the ones your assistant made with POST /calls). Without it, both. |

#### 200 A page of calls.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | Call\[\] |  |
| `has_more` (required) | boolean | Whether there is a next page. |
| `next_cursor` (required) | string or null | Pass this as cursor to get the next page. Null on the last page. |

JSON

```
{
  "data": [
    {
      "id": "c1a2b3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
      "direction": "inbound",
      "from": "+447700900456",
      "to": "+•••••••••42",
      "status": "ai_handled",
      "created_at": "2026-10-01T09:14:02.000Z",
      "started_at": "2026-10-01T09:14:02.000Z",
      "answered_at": "2026-10-01T09:14:03.000Z",
      "ended_at": "2026-10-01T09:15:37.000Z",
      "duration_sec": 94,
      "hangup_cause": "normal_clearing",
      "has_summary": true,
      "summary_ready_at": null,
      "test": false,
      "outbound": null
    }
  ],
  "has_more": false,
  "next_cursor": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_parameter`](https://hypamoon.com/docs/errors/invalid_parameter) |

### POST /calls

**Call someone with your assistant.**

Your project's assistant calls one person who expects the call: to confirm an appointment, follow up a callback request or agree on a delivery time. Not for cold calling or sales: telemarketing to consumers needs their prior consent under telemarketing law, and numbers in a national do-not-call register must be respected. Only call people who asked for it or have an appointment with you. purpose (required) says why you call and is recorded with the call: transactional (an answer to the person's own question, confirming or reminding of an appointment, an order or delivery status, a callback they asked for) or marketing (anything that sells or promotes). Under Dutch rules a marketing call needs the person's prior consent, since 1 July 2026 also for existing customers: purpose marketing only calls when consent for this number is recorded (POST /call-consents), otherwise consent\_required and nobody is called. The assistant always opens by saying it is the digital assistant of your company and asks whether this is a good time; that cannot be switched off. assistant\_instructions adds what this call is about, on top of the assistant's own instructions (PUT /assistant). It calls from one of your project's numbers (from, or your first active number), so the person can call back. Calling hours: by default 09:00 to 20:00, Monday to Saturday, in the local time of the person called; calling\_window can narrow or move that, but never before 08:00 or after 21:00. Outside those hours the request returns outside\_calling\_hours with next\_window\_start. Public holidays are not recognized yet. Limits per project: 5 calls per minute, 100 per day and 2 at the same time (concurrent\_call\_limit, with Retry-After). A new live project starts lower (10 calls per day, 30 after 7 days and a first top-up, the full limit after 30 days and €25 paid). The same number can be called at most 3 times in 24 hours per project and 10 times across all projects: 429 call\_limit\_reached with scope per\_number or per\_number\_platform, retry\_at and a user\_message; test numbers do not count. A call lasts at most max\_duration\_sec (default 600, at most 1200). Live: mobile and geographic numbers in a country your project can call; never premium-rate, service, toll-free or short numbers like 112. An unsupported destination returns destination\_not\_allowed with a reason. A live key needs the full verification level (requested in the portal under Verification) plus the company level (company details, spending cap, payment method, a verified phone and one payment confirmed with your bank: iDEAL or a card with 3D Secure). In live mode, the cost of a call is deducted from your prepaid balance when it ends: the voice AI minutes plus the line minutes, each billed per started minute (the rates are under Billing in the portal), and it counts toward the spending cap. Unanswered, busy and failed calls cost nothing; a call that reaches an answering machine is charged for the line minutes. Before we call, the balance must cover the call at its full max\_duration\_sec; otherwise the request returns insufficient\_balance (or billing\_blocked when the call would exceed the spending cap) and nobody is called. When live outbound calling is switched off for the platform for a while, a live request gets 503 telephony\_unavailable and nobody is called. The response is 201 with the call as GET /calls/{id} returns it, with outbound.status queued or ringing; call.completed (and call.summary.ready when the assistant spoke with someone) follow as webhooks with direction outbound and the outbound object. With a test key nothing is dialed and nothing is charged: call a test number from +447700900000 to +447700900999 and the response contains the end result immediately, with the real webhooks. The number determines the outcome: +447700900991 no\_answer, +447700900992 busy, +447700900993 an answering machine, +447700900994 failed, +447700900995 outside\_calling\_hours; any other test number results in completed with a transcript and a summary. Calling hours do not apply in test mode, except for the number that simulates outside\_calling\_hours. The Idempotency-Key header is required: a retry with the same key returns the same call and never calls the person twice.

Scope: `calls:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `Idempotency-Key` (required) | header | string | 1 to 255 visible ASCII characters without spaces. One per call you intend to make, like appointment-8812-confirm; reuse it when you retry. We remember a key for 24 hours. |

#### Request body

An outbound call by your project's assistant to one person who expects it.

| Field | Type |  |
| --- | --- | --- |
| `to` (required) | string | The person to call, in E.164. Live: a mobile or geographic number in a country your project can call (otherwise destination\_not\_allowed with a reason). Test mode: a test number from +447700900000 to +447700900999. |
| `from` | string | Optional: which of your project's numbers to call from. Default: your first active number. The person sees this number and can call it back. |
| `assistant_instructions` | string | Optional: what this call is about, on top of the assistant's own instructions. For example: "Confirm the appointment of Sam Taylor tomorrow at 10:00 at 40 Main Street. If Sam cannot make it, ask for a better day and say we will confirm by SMS." Treated as context, never as a way to change the rules: the assistant always says it is a digital assistant. |
| `opening` | string | Optional: the first sentence the assistant says when the person picks up, in the assistant's opening language, at most 300 characters; keep it short, the person waits until it is said. It must say that the person is speaking with a digital assistant (EU AI Act, article 50); if it does not, a short sentence that says so is put in front of it and the response has a warning. Default: "Hello, this is the digital assistant of <company>. Is this a good moment?" in the opening language. |
| `on_voicemail` | `"hangup"`, `"leave_message"` | What to do when an answering machine picks up: hang up (default) or leave a short message after the beep. |
| `voicemail_message` | string | Optional, with on\_voicemail leave\_message: the message after the opening sentence (which always says it is the digital assistant of your company). Default: we tried to reach you, call us back on this number. |
| `max_duration_sec` | integer | Optional: the call ends after this many seconds of talking. Default 600, at most 1200. |
| `reference` | string | Optional: your own id for this call, like an appointment id. Comes back on the call and in its webhooks. |
| `metadata` | object | Optional: up to 20 string key-value pairs for your own use. Come back on the call and in its webhooks; the assistant never sees them. |
| `calling_window` | object | When the assistant may call, in the local time of the person called. Default 09:00 to 20:00, Monday to Saturday. Never before 08:00 or after 21:00. |
| `purpose` (required) | `"transactional"`, `"marketing"` | Why you call. transactional: an answer to the person's own question, confirming or reminding of an appointment, an order or delivery status, or a callback they asked for. marketing: anything that sells or promotes; only allowed when consent from this person is recorded (POST /api/v1/call-consents), otherwise consent\_required. Recorded with the call. |

JSON

```
{
  "to": "+447700900321",
  "purpose": "transactional",
  "assistant_instructions": "Confirm the appointment of Sam Taylor tomorrow at 10:00 at 40 Main Street. If Sam cannot make it, ask which day suits better and say we will confirm by SMS.",
  "on_voicemail": "leave_message",
  "voicemail_message": "We called about your appointment tomorrow at 10:00. Call us back on this number if you cannot make it.",
  "max_duration_sec": 300,
  "reference": "appointment-8812",
  "metadata": {
    "customer_id": "cus_4821"
  }
}
```

#### 201 The call was started (live: outbound.status queued or ringing) or, in test mode, simulated to its end result. The same shape as GET /calls/{id}.

| Header |  |
| --- | --- |
| `Idempotent-Replayed` | Present when this is the stored response to an earlier request with the same Idempotency-Key. |

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the call. |
| `direction` (required) | `"inbound"`, `"outbound"`, `null` | inbound, or outbound for a call your assistant made with POST /calls. |
| `from` (required) | string or null | The caller, in E.164. |
| `to` (required) | string or null | The number that was called, in E.164. |
| `status` (required) | string or null | The status as we track it: ringing, active, completed, missed, failed, voicemail, ai\_handled. New values may be added; treat an unknown value like completed. |
| `created_at` (required) | string or null (date-time) | When the call reached us. |
| `started_at` (required) | string or null (date-time) | When the call started. |
| `answered_at` (required) | string or null (date-time) | When the platform picked up. With a call plan the platform always picks up first, so this does not prove a person answered. |
| `ended_at` (required) | string or null (date-time) | When the call ended. |
| `duration_sec` (required) | integer or null | The length of the call in seconds. |
| `hangup_cause` (required) | string or null | Why the call ended, as reported by the carrier, like normal\_clearing. |
| `has_summary` (required) | boolean | Whether the call has a summary. Fetch it with GET /calls/{id}. |
| `summary_ready_at` (required) | string or null (date-time) | When the summary of a recorded call was ready. Empty for a call handled by the voice AI; look at has\_summary instead. |
| `test` (required) | boolean | true for a simulated call from POST /test/calls or POST /calls with a test key (test mode). Also in webhooks, so you can keep test traffic apart. |
| `outbound` (required) | object or null | The request behind an outbound call started with POST /calls. |
| `transcript` (required) | string or null | The transcript. Only here, never in a webhook. |
| `summary` (required) | one of | The summary of a call. |
| `warnings` | string\[\] | Only in the response of POST /calls, when something was adjusted: for example an opening without the AI disclosure got a short sentence in front of it. Tell the user. |

JSON

```
{
  "id": "b7c8d9e0-f1a2-4b3c-8d4e-5f6a7b8c9d0e",
  "direction": "outbound",
  "from": "+•••••••••42",
  "to": "+447700900321",
  "status": "ringing",
  "created_at": "2026-10-01T09:00:00.000Z",
  "started_at": "2026-10-01T09:00:00.000Z",
  "answered_at": null,
  "ended_at": null,
  "duration_sec": null,
  "hangup_cause": null,
  "has_summary": false,
  "summary_ready_at": null,
  "test": false,
  "outbound": {
    "status": "ringing",
    "answered_by": null,
    "voicemail_left": false,
    "on_voicemail": "leave_message",
    "max_duration_sec": 300,
    "reference": "appointment-8812",
    "metadata": {
      "customer_id": "cus_4821"
    },
    "error": null,
    "purpose": "transactional"
  },
  "transcript": null,
  "summary": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`idempotency_key_missing`](https://hypamoon.com/docs/errors/idempotency_key_missing) |
| 400 | [`idempotency_key_invalid`](https://hypamoon.com/docs/errors/idempotency_key_invalid) |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 402 | [`payment_mandate_missing`](https://hypamoon.com/docs/errors/payment_mandate_missing) |
| 402 | [`insufficient_balance`](https://hypamoon.com/docs/errors/insufficient_balance) |
| 402 | [`billing_blocked`](https://hypamoon.com/docs/errors/billing_blocked) |
| 403 | [`phone_verification_required`](https://hypamoon.com/docs/errors/phone_verification_required) |
| 403 | [`consent_required`](https://hypamoon.com/docs/errors/consent_required) |
| 409 | [`idempotency_key_reused`](https://hypamoon.com/docs/errors/idempotency_key_reused) |
| 409 | [`idempotency_request_in_progress`](https://hypamoon.com/docs/errors/idempotency_request_in_progress) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`destination_not_allowed`](https://hypamoon.com/docs/errors/destination_not_allowed) |
| 422 | [`outside_calling_hours`](https://hypamoon.com/docs/errors/outside_calling_hours) |
| 422 | [`company_details_missing`](https://hypamoon.com/docs/errors/company_details_missing) |
| 422 | [`spend_cap_missing`](https://hypamoon.com/docs/errors/spend_cap_missing) |
| 422 | [`assistant_not_configured`](https://hypamoon.com/docs/errors/assistant_not_configured) |
| 422 | [`number_required`](https://hypamoon.com/docs/errors/number_required) |
| 429 | [`call_limit_reached`](https://hypamoon.com/docs/errors/call_limit_reached) |
| 429 | [`concurrent_call_limit`](https://hypamoon.com/docs/errors/concurrent_call_limit) |
| 502 | [`upstream_error`](https://hypamoon.com/docs/errors/upstream_error) |
| 503 | [`telephony_unavailable`](https://hypamoon.com/docs/errors/telephony_unavailable) |

### GET /calls/{id}

**Get a call with transcript and summary.**

One call, with its transcript and summary. The transcript is only here, never in a webhook.

Scope: `calls:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the call. |

#### 200 The call.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the call. |
| `direction` (required) | `"inbound"`, `"outbound"`, `null` | inbound, or outbound for a call your assistant made with POST /calls. |
| `from` (required) | string or null | The caller, in E.164. |
| `to` (required) | string or null | The number that was called, in E.164. |
| `status` (required) | string or null | The status as we track it: ringing, active, completed, missed, failed, voicemail, ai\_handled. New values may be added; treat an unknown value like completed. |
| `created_at` (required) | string or null (date-time) | When the call reached us. |
| `started_at` (required) | string or null (date-time) | When the call started. |
| `answered_at` (required) | string or null (date-time) | When the platform picked up. With a call plan the platform always picks up first, so this does not prove a person answered. |
| `ended_at` (required) | string or null (date-time) | When the call ended. |
| `duration_sec` (required) | integer or null | The length of the call in seconds. |
| `hangup_cause` (required) | string or null | Why the call ended, as reported by the carrier, like normal\_clearing. |
| `has_summary` (required) | boolean | Whether the call has a summary. Fetch it with GET /calls/{id}. |
| `summary_ready_at` (required) | string or null (date-time) | When the summary of a recorded call was ready. Empty for a call handled by the voice AI; look at has\_summary instead. |
| `test` (required) | boolean | true for a simulated call from POST /test/calls or POST /calls with a test key (test mode). Also in webhooks, so you can keep test traffic apart. |
| `outbound` (required) | object or null | The request behind an outbound call started with POST /calls. |
| `transcript` (required) | string or null | The transcript. Only here, never in a webhook. |
| `summary` (required) | one of | The summary of a call. |
| `warnings` | string\[\] | Only in the response of POST /calls, when something was adjusted: for example an opening without the AI disclosure got a short sentence in front of it. Tell the user. |

JSON

```
{
  "id": "c1a2b3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
  "direction": "inbound",
  "from": "+447700900456",
  "to": "+•••••••••42",
  "status": "ai_handled",
  "created_at": "2026-10-01T09:14:02.000Z",
  "started_at": "2026-10-01T09:14:02.000Z",
  "answered_at": "2026-10-01T09:14:03.000Z",
  "ended_at": "2026-10-01T09:15:37.000Z",
  "duration_sec": 94,
  "hangup_cause": "normal_clearing",
  "has_summary": true,
  "summary_ready_at": null,
  "test": false,
  "outbound": null,
  "transcript": "Assistant: U spreekt met de digitale assistent van Acme Plumbing. Waarmee kan ik u helpen?\nCaller: My kitchen tap is leaking, can someone come today?",
  "summary": {
    "text": "The caller has a leaking kitchen tap and wants someone to come today.",
    "topics": [
      "leak",
      "appointment"
    ],
    "sentiment": "neutral",
    "action_items": [
      "Call back within the hour to plan a visit."
    ],
    "next_step": "Plan a visit today."
  }
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### GET /calls/{id}/events

**Get the timeline of a call.**

What happened in one call: its legs (the caller, and every forward by the call plan to a number or to the app or web phone of a member), the events per leg in order (started, answered, ended), the outcome the way the portal says it (answered, missed, no\_answer, voicemail, assistant, in\_progress, failed) and who on your side picked up (answered\_by). The id can be any leg of the call that GET /calls lists.

Scope: `calls:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the call. |

#### 200 The timeline.

| Field | Type |  |
| --- | --- | --- |
| `call_id` (required) | string (uuid) | The call you asked for. |
| `outcome` (required) | `"answered"`, `"missed"`, `"no_answer"`, `"voicemail"`, `"assistant"`, `"in_progress"`, `"failed"`, `"unknown"` | How the call went, the same way the portal says it: answered, missed (inbound and nobody picked up), no\_answer (outbound and nobody picked up), voicemail, assistant (the voice AI handled it), in\_progress, failed or unknown. |
| `answered_by` (required) | one of | Who on your side picked up: the first forward that was answered, else the assistant when it handled the call, else null. |
| `legs` (required) | object\[\] | The legs, primary first, then the forwards oldest first. |
| `events` (required) | object\[\] | What happened, oldest first. |

JSON

```
{
  "call_id": "c1a2b3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
  "outcome": "answered",
  "answered_by": {
    "type": "device",
    "user_id": "8d2c4b6a-1e3f-4a5b-8c7d-9e0f1a2b3c4d"
  },
  "legs": [
    {
      "leg_id": "c1a2b3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
      "role": "primary",
      "direction": "inbound",
      "target": null,
      "status": "completed",
      "started_at": "2026-10-01T09:14:02.000Z",
      "answered_at": "2026-10-01T09:14:03.000Z",
      "ended_at": "2026-10-01T09:15:37.000Z",
      "hangup_cause": "normal_clearing"
    },
    {
      "leg_id": "5b1f8e2a-3c4d-4e6f-9a0b-1c2d3e4f5a6b",
      "role": "forward",
      "direction": "outbound",
      "target": {
        "type": "device",
        "user_id": "8d2c4b6a-1e3f-4a5b-8c7d-9e0f1a2b3c4d"
      },
      "status": "completed",
      "started_at": "2026-10-01T09:14:05.000Z",
      "answered_at": "2026-10-01T09:14:11.000Z",
      "ended_at": "2026-10-01T09:15:36.000Z",
      "hangup_cause": "normal_clearing"
    }
  ],
  "events": [
    {
      "type": "call.started",
      "occurred_at": "2026-10-01T09:14:02.000Z",
      "leg_id": "c1a2b3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
    },
    {
      "type": "call.answered",
      "occurred_at": "2026-10-01T09:14:03.000Z",
      "leg_id": "c1a2b3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
    },
    {
      "type": "forward.started",
      "occurred_at": "2026-10-01T09:14:05.000Z",
      "leg_id": "5b1f8e2a-3c4d-4e6f-9a0b-1c2d3e4f5a6b"
    },
    {
      "type": "forward.answered",
      "occurred_at": "2026-10-01T09:14:11.000Z",
      "leg_id": "5b1f8e2a-3c4d-4e6f-9a0b-1c2d3e4f5a6b"
    },
    {
      "type": "forward.ended",
      "occurred_at": "2026-10-01T09:15:36.000Z",
      "leg_id": "5b1f8e2a-3c4d-4e6f-9a0b-1c2d3e4f5a6b",
      "hangup_cause": "normal_clearing"
    },
    {
      "type": "call.ended",
      "occurred_at": "2026-10-01T09:15:37.000Z",
      "leg_id": "c1a2b3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
      "hangup_cause": "normal_clearing"
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### GET /call-consents

**List recorded consent for marketing calls.**

The project's recorded consents for marketing calls, newest first, active and revoked. With phone\_number only those for that number. The number itself is never stored, only a keyed hash plus its last two digits (phone\_number\_ending).

Scope: `calls:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `phone_number` | query | string | Optional: only the consents for this number, in E.164. |

#### 200 The consents.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | CallConsent\[\] | The consents, newest first (at most 100). |

JSON

```
{
  "data": [
    {
      "id": "5b8e2c1d-7a4f-4e3b-9c6d-1f2a3b4c5d6e",
      "phone_number_ending": "21",
      "source": "form",
      "evidence": "Newsletter sign-up form, entry 7f3c2a, box 'call me about offers' ticked",
      "consented_at": "2026-10-01T09:30:00.000Z",
      "recorded_at": "2026-10-01T09:30:02.000Z",
      "revoked_at": null,
      "status": "active"
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_parameter`](https://hypamoon.com/docs/errors/invalid_parameter) |

### POST /call-consents

**Record consent for marketing calls.**

Records that one person agreed to receive marketing calls from this project, so POST /calls with purpose marketing may call them. Under Dutch telemarketing rules a sales or promotional call to a consumer needs prior consent; since 1 July 2026 that also applies to existing customers. source says where it came from (form, call, import, manual) and evidence is your reference to the proof (a form entry id, a call id, a file and row), so it can be shown later. Record only consent the person really gave. The number is stored only as a keyed hash plus its last two digits. If valid consent for this number already exists, it is returned unchanged with 200. Only the project owner, or an API key with calls:write, can record consent.

Scope: `calls:write`

#### Request body

Consent from one person to receive marketing calls from this project.

| Field | Type |  |
| --- | --- | --- |
| `phone_number` (required) | string | The number of the person who gave consent, in E.164. Stored only as a keyed hash plus its last two digits. |
| `source` (required) | `"form"`, `"call"`, `"import"`, `"manual"` | Where the consent came from: form (a form the person filled in), call (they said yes on a call), import (from your own records), manual (recorded by hand). |
| `evidence` (required) | string | A reference to the proof, so it can be shown later: a form entry id, a call id, a file and row, or a short note. Not the proof itself and no other personal data. |
| `consented_at` | string (date-time) | When the person gave consent (ISO 8601). Default: now. Cannot be in the future. |

JSON

```
{
  "phone_number": "+447700900321",
  "source": "form",
  "evidence": "Newsletter sign-up form, entry 7f3c2a, box 'call me about offers' ticked",
  "consented_at": "2026-10-01T09:30:00Z"
}
```

#### 200 Valid consent for this number already existed; it is returned unchanged.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the consent. |
| `phone_number_ending` (required) | string | The last two digits of the number. The number itself is never stored, only a keyed hash. |
| `source` (required) | `"form"`, `"call"`, `"import"`, `"manual"` | Where the consent came from: form, call, import or manual. |
| `evidence` (required) | string | Your reference to the proof. |
| `consented_at` (required) | string (date-time) | When the person gave consent. |
| `recorded_at` (required) | string (date-time) | When it was recorded here. |
| `revoked_at` (required) | string or null (date-time) | When it was revoked; null while it is valid. |
| `status` (required) | `"active"`, `"revoked"` | active: marketing calls to this number are allowed. revoked: no longer. |

JSON

```
{
  "id": "5b8e2c1d-7a4f-4e3b-9c6d-1f2a3b4c5d6e",
  "phone_number_ending": "21",
  "source": "form",
  "evidence": "Newsletter sign-up form, entry 7f3c2a, box 'call me about offers' ticked",
  "consented_at": "2026-10-01T09:30:00.000Z",
  "recorded_at": "2026-10-01T09:30:02.000Z",
  "revoked_at": null,
  "status": "active"
}
```

#### 201 Recorded.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the consent. |
| `phone_number_ending` (required) | string | The last two digits of the number. The number itself is never stored, only a keyed hash. |
| `source` (required) | `"form"`, `"call"`, `"import"`, `"manual"` | Where the consent came from: form, call, import or manual. |
| `evidence` (required) | string | Your reference to the proof. |
| `consented_at` (required) | string (date-time) | When the person gave consent. |
| `recorded_at` (required) | string (date-time) | When it was recorded here. |
| `revoked_at` (required) | string or null (date-time) | When it was revoked; null while it is valid. |
| `status` (required) | `"active"`, `"revoked"` | active: marketing calls to this number are allowed. revoked: no longer. |

JSON

```
{
  "id": "5b8e2c1d-7a4f-4e3b-9c6d-1f2a3b4c5d6e",
  "phone_number_ending": "21",
  "source": "form",
  "evidence": "Newsletter sign-up form, entry 7f3c2a, box 'call me about offers' ticked",
  "consented_at": "2026-10-01T09:30:00.000Z",
  "recorded_at": "2026-10-01T09:30:02.000Z",
  "revoked_at": null,
  "status": "active"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### DELETE /call-consents/{id}

**Revoke consent for marketing calls.**

Revokes a consent: from now on a marketing call to this number returns consent\_required. Nothing is deleted; revoked\_at is set and the evidence stays. Revoking twice is harmless. Do this as soon as the person says they no longer want to be called. Only the project owner, or an API key with calls:write, can revoke consent.

Scope: `calls:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the consent. |

#### 200 The consent, now revoked.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the consent. |
| `phone_number_ending` (required) | string | The last two digits of the number. The number itself is never stored, only a keyed hash. |
| `source` (required) | `"form"`, `"call"`, `"import"`, `"manual"` | Where the consent came from: form, call, import or manual. |
| `evidence` (required) | string | Your reference to the proof. |
| `consented_at` (required) | string (date-time) | When the person gave consent. |
| `recorded_at` (required) | string (date-time) | When it was recorded here. |
| `revoked_at` (required) | string or null (date-time) | When it was revoked; null while it is valid. |
| `status` (required) | `"active"`, `"revoked"` | active: marketing calls to this number are allowed. revoked: no longer. |

JSON

```
{
  "id": "5b8e2c1d-7a4f-4e3b-9c6d-1f2a3b4c5d6e",
  "phone_number_ending": "21",
  "source": "form",
  "evidence": "Newsletter sign-up form, entry 7f3c2a, box 'call me about offers' ticked",
  "consented_at": "2026-10-01T09:30:00.000Z",
  "recorded_at": "2026-10-01T09:30:02.000Z",
  "revoked_at": "2026-10-12T14:00:00.000Z",
  "status": "revoked"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

## Webhooks

Receive an event for every call, signed with Hypamoon-Signature.

### GET /webhooks

**List the webhook endpoints.**

The project's webhook endpoints, oldest first. The secret is never included.

Scope: `webhooks:write`

#### 200 The endpoints.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | WebhookEndpoint\[\] |  |

JSON

```
{
  "data": [
    {
      "id": "9e8d7c6b-5a49-4382-9716-a5b4c3d2e1f0",
      "url": "https://your-app.example/hooks/hypamoon",
      "events": [
        "call.completed",
        "call.summary.ready"
      ],
      "active": true,
      "secret_prefix": "whsec_Xk3p",
      "created_at": "2026-10-01T09:00:00.000Z",
      "last_success_at": null,
      "last_failure_at": null,
      "consecutive_failures": 0
    }
  ]
}
```

### POST /webhooks

**Create a webhook endpoint.**

Creates an endpoint that receives the events you choose, signed with Hypamoon-Signature. The secret is in this response only. At most 10 endpoints per project.

Scope: `webhooks:write`

#### Request body

A new webhook endpoint.

| Field | Type |  |
| --- | --- | --- |
| `url` (required) | string | An https URL with a domain name on the default port, without credentials, that resolves to a public address. |
| `events` (required) | `"call.completed"`, `"call.summary.ready"`, `"message.delivered"`, `"message.failed"`, `"conversation.summary.ready"`, `"balance.low"`, `"balance.topped_up"`, `"balance.reload_failed"`, `"document.created"`, `"email.sent"`, `"email.delivered"`, `"email.delayed"`, `"email.bounced"`, `"email.complained"`\[\] | The events to receive, from call.completed, call.summary.ready, message.delivered, message.failed, conversation.summary.ready, balance.low, balance.topped\_up, balance.reload\_failed, document.created, email.sent, email.delivered, email.delayed, email.bounced, email.complained. The email events come once per recipient. |
| `app_id` | string (uuid) | Optional, for email events only: receive only the email events of emails this app sent (an id from list\_apps). Without it, the endpoint gets the events of every email of the project. |

JSON

```
{
  "url": "https://your-app.example/hooks/hypamoon",
  "events": [
    "call.completed",
    "call.summary.ready"
  ]
}
```

#### 201 The endpoint, with its secret.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `url` (required) | string |  |
| `events` (required) | string\[\] | The subscribed events, from call.completed, call.summary.ready, message.delivered, message.failed, conversation.summary.ready, balance.low, balance.topped\_up, balance.reload\_failed, document.created. |
| `active` (required) | boolean | false after 50 failed deliveries in a row; switch it back on with POST /webhooks/{id}/enable. |
| `secret_prefix` (required) | string | The first characters of the secret, to recognize it. |
| `created_at` (required) | string (date-time) | When the endpoint was created. |
| `last_success_at` (required) | string or null (date-time) | The last delivery that got a 2xx. |
| `last_failure_at` (required) | string or null (date-time) | The last delivery that failed. |
| `consecutive_failures` (required) | integer | Failed deliveries in a row. |
| `app_id` | string (uuid) | Only with a filter on one app: the endpoint gets the email events of that app's emails only. |
| `secret` (required) | string | The signing secret, whsec\_ plus 43 characters. Shown only in this response: store it now. |

JSON

```
{
  "id": "9e8d7c6b-5a49-4382-9716-a5b4c3d2e1f0",
  "url": "https://your-app.example/hooks/hypamoon",
  "events": [
    "call.completed",
    "call.summary.ready"
  ],
  "active": true,
  "secret_prefix": "whsec_Xk3p",
  "created_at": "2026-10-01T09:00:00.000Z",
  "last_success_at": null,
  "last_failure_at": null,
  "consecutive_failures": 0,
  "secret": "whsec_Xk3pQ9vT2mLr8sYw4nBc6dFh1jKz5aGe7uIo0pRtVxE"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 400 | [`invalid_webhook_endpoint`](https://hypamoon.com/docs/errors/invalid_webhook_endpoint) |
| 409 | [`webhook_limit_reached`](https://hypamoon.com/docs/errors/webhook_limit_reached) |

### DELETE /webhooks/{id}

**Delete a webhook endpoint.**

Deletes the endpoint, its pending deliveries and its delivery log.

Scope: `webhooks:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the webhook endpoint. |

#### 204 Deleted.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### POST /webhooks/{id}/enable

**Switch a webhook endpoint back on.**

An endpoint is switched off after 50 failed deliveries in a row. This switches it back on and resets the counter; events from the time it was off are not resent.

Scope: `webhooks:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the webhook endpoint. |

#### 200 The endpoint.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `url` (required) | string |  |
| `events` (required) | string\[\] | The subscribed events, from call.completed, call.summary.ready, message.delivered, message.failed, conversation.summary.ready, balance.low, balance.topped\_up, balance.reload\_failed, document.created. |
| `active` (required) | boolean | false after 50 failed deliveries in a row; switch it back on with POST /webhooks/{id}/enable. |
| `secret_prefix` (required) | string | The first characters of the secret, to recognize it. |
| `created_at` (required) | string (date-time) | When the endpoint was created. |
| `last_success_at` (required) | string or null (date-time) | The last delivery that got a 2xx. |
| `last_failure_at` (required) | string or null (date-time) | The last delivery that failed. |
| `consecutive_failures` (required) | integer | Failed deliveries in a row. |
| `app_id` | string (uuid) | Only with a filter on one app: the endpoint gets the email events of that app's emails only. |

JSON

```
{
  "id": "9e8d7c6b-5a49-4382-9716-a5b4c3d2e1f0",
  "url": "https://your-app.example/hooks/hypamoon",
  "events": [
    "call.completed",
    "call.summary.ready"
  ],
  "active": true,
  "secret_prefix": "whsec_Xk3p",
  "created_at": "2026-10-01T09:00:00.000Z",
  "last_success_at": null,
  "last_failure_at": null,
  "consecutive_failures": 0
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### POST /webhooks/{id}/test

**Send a test event.**

Immediately sends a webhook.test event to the endpoint and reports the result. When it fails, we retry it like any other delivery: up to 8 attempts over about 45 hours, or 3 attempts within about 6 minutes for an endpoint of a test project.

Scope: `webhooks:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the webhook endpoint. |

#### 200 The outcome of the first delivery.

| Field | Type |  |
| --- | --- | --- |
| `delivery_id` (required) | string (uuid) |  |
| `event_id` (required) | string | The id of the webhook.test event, evt\_ plus 32 hex characters. |
| `status` (required) | `"delivered"`, `"pending"`, `"failed"` | delivered: your endpoint answered 2xx. pending: it did not, and we retry with backoff. failed: we gave up. |
| `response_status` (required) | integer or null | The HTTP status your endpoint answered with, if any. |
| `error` (required) | `"timeout"`, `"connection_failed"`, `"non_2xx_status"`, `"not_public_host"`, `"invalid_url"`, `"response_too_large"`, `"secret_unreadable"`, `"endpoint_disabled"`, `"call_deleted"`, `"summary_deleted"`, `"message_deleted"`, `"conversation_deleted"`, `"document_deleted"`, `"invalid_reference"`, `"delivery_failed"`, `null` | Why the delivery did not succeed, as a short code. |

JSON

```
{
  "delivery_id": "3b2a1908-f7e6-4d5c-8b4a-392817160514",
  "event_id": "evt_4f1c2a9b8e7d6c5b4a39281706f5e4d3",
  "status": "delivered",
  "response_status": 204,
  "error": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`webhook_endpoint_disabled`](https://hypamoon.com/docs/errors/webhook_endpoint_disabled) |

## Messages

Transactional SMS to mobile numbers: order confirmations, shipping updates, reminders. Not for marketing.

### GET /messages

**List the messages.**

The SMS messages the project sent through the API, newest first, with their status. Follow next\_cursor while has\_more is true.

Scope: `messages:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `limit` | query | integer | Messages per page, default 25. A value above 100 is capped at 100. |
| `cursor` | query | string | The next\_cursor of the previous page. |

#### 200 A page of messages.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | Message\[\] |  |
| `has_more` (required) | boolean | Whether there is another page. |
| `next_cursor` (required) | string or null | Pass this as cursor to get the next page. |

JSON

```
{
  "data": [
    {
      "id": "8f7e6d5c-4b3a-4291-8f0e-1d2c3b4a5968",
      "to": "+447700900321",
      "from": "Acme Shop",
      "body": "Hi Sam, thanks for your order 10432 at Acme Shop. We are packing it now; you get a track and trace link as soon as it ships.",
      "segments": 1,
      "encoding": "gsm7",
      "status": "queued",
      "error": null,
      "reference": "order-10432",
      "created_at": "2026-10-01T09:00:00.000Z",
      "status_updated_at": "2026-10-01T09:00:00.000Z",
      "test": true
    }
  ],
  "has_more": false,
  "next_cursor": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_parameter`](https://hypamoon.com/docs/errors/invalid_parameter) |

### POST /messages

**Send an SMS.**

Sends one transactional SMS: an order confirmation, a shipping update with track and trace, an appointment reminder. Not for marketing: promotional SMS needs the recipient's prior consent under marketing law, and this endpoint is not built for bulk. A message goes to a mobile number in a country your project can text; an unsupported destination returns destination\_not\_allowed with a reason. It comes from an alphanumeric sender (your project name, or from); your phone numbers cannot send SMS. At most 6 segments per message, 30 messages per minute and 200 per day per project. A new live project starts lower (20 per day, 60 after 7 days and a first top-up, the full limit after 30 days and €25 paid). The same number gets at most 3 messages in 24 hours per project and 10 across all projects: 429 message\_limit\_reached with scope per\_number or per\_number\_platform, retry\_at and a user\_message; test numbers do not count. A live key needs the company verification level (company details, spending cap, payment method, a verified phone and one payment confirmed with your bank: iDEAL or a card with 3D Secure); a business may also need its registration number checked against the business register, and a personal account may need our approval of its identity documents (the number\_documents level); otherwise the request returns verification\_required. Live messages are deducted from your prepaid balance per segment (the rate is under Billing in the portal; test mode is free) and count toward the spending cap. If the balance is too low for this message, the request returns insufficient\_balance; if this month's spending plus this message would exceed the cap, it returns billing\_blocked. In both cases nothing is sent. The response says queued; message.delivered or message.failed follows as a webhook, and GET /messages/{id} shows the status. With a test key nothing is sent: use a test number from +447700900000 to +447700900999; the message is delivered immediately, and +447700900999 simulates a failure. Send an Idempotency-Key (one per order event, like order-10432-shipped) so a retry never sends the SMS twice.

Scope: `messages:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `Idempotency-Key` | header | string | Optional but recommended: 1 to 255 visible ASCII characters without spaces. Reuse it when you retry; the same key within 24 hours returns the same message instead of sending a second one. |

#### Request body

A transactional SMS to one recipient.

| Field | Type |  |
| --- | --- | --- |
| `to` (required) | string | The recipient in E.164. Live: a mobile number in a country your project can text (otherwise destination\_not\_allowed with a reason). Test mode: a test number from +447700900000 to +447700900999. |
| `body` (required) | string | The text. At most 6 SMS segments: 918 characters in plain text (GSM-7), 402 with an emoji or another character outside GSM-7. Typographic quotes and dashes are replaced by plain ones. |
| `from` | string | Optional sender name: 1 to 11 letters, digits and spaces, with at least one letter. Default: your project name. A phone number is not possible. |
| `reference` | string | Optional: your own id for this message, like an order number. Comes back in the message and its webhooks. |

JSON

```
{
  "to": "+447700900321",
  "body": "Hi Sam, thanks for your order 10432 at Acme Shop. We are packing it now; you get a track and trace link as soon as it ships.",
  "reference": "order-10432"
}
```

#### 201 The message was accepted (or, in test mode, simulated).

| Header |  |
| --- | --- |
| `Idempotent-Replayed` | Present when this is the stored response to an earlier request with the same Idempotency-Key. |

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the message. |
| `to` (required) | string | The recipient, in E.164. |
| `from` (required) | string | The sender the recipient sees: an alphanumeric name of up to 11 characters. |
| `body` (required) | string | The text as it was sent, after typographic quotes and dashes were made SMS-safe. |
| `segments` (required) | integer | How many SMS segments the text took. A segment is 160 GSM-7 or 70 UCS-2 characters (153 and 67 when split). |
| `encoding` (required) | `"gsm7"`, `"ucs2"`, `null` | gsm7, or ucs2 when the text has a character outside GSM-7 (an emoji, for example), which makes every segment shorter. |
| `status` (required) | `"queued"`, `"sent"`, `"delivered"`, `"failed"` | queued: accepted. sent: handed to the mobile network. delivered: the phone confirmed it. failed: it did not arrive; see error. |
| `error` (required) | string or null | With status failed: a short code, like delivery\_failed or sending\_failed. Otherwise null. |
| `reference` (required) | string or null | Your own id for this message, as you sent it (an order number, for example). |
| `created_at` (required) | string (date-time) | When we accepted the message. |
| `status_updated_at` (required) | string or null (date-time) | When the status last changed. |
| `test` (required) | boolean | true for a message sent with a test key to a test number. It never reaches a phone. |

JSON

```
{
  "id": "8f7e6d5c-4b3a-4291-8f0e-1d2c3b4a5968",
  "to": "+447700900321",
  "from": "Acme Shop",
  "body": "Hi Sam, thanks for your order 10432 at Acme Shop. We are packing it now; you get a track and trace link as soon as it ships.",
  "segments": 1,
  "encoding": "gsm7",
  "status": "queued",
  "error": null,
  "reference": "order-10432",
  "created_at": "2026-10-01T09:00:00.000Z",
  "status_updated_at": "2026-10-01T09:00:00.000Z",
  "test": true
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`idempotency_key_invalid`](https://hypamoon.com/docs/errors/idempotency_key_invalid) |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 402 | [`payment_mandate_missing`](https://hypamoon.com/docs/errors/payment_mandate_missing) |
| 402 | [`billing_blocked`](https://hypamoon.com/docs/errors/billing_blocked) |
| 402 | [`insufficient_balance`](https://hypamoon.com/docs/errors/insufficient_balance) |
| 403 | [`phone_verification_required`](https://hypamoon.com/docs/errors/phone_verification_required) |
| 409 | [`idempotency_key_reused`](https://hypamoon.com/docs/errors/idempotency_key_reused) |
| 409 | [`idempotency_request_in_progress`](https://hypamoon.com/docs/errors/idempotency_request_in_progress) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`destination_not_allowed`](https://hypamoon.com/docs/errors/destination_not_allowed) |
| 422 | [`message_too_long`](https://hypamoon.com/docs/errors/message_too_long) |
| 422 | [`sender_not_allowed`](https://hypamoon.com/docs/errors/sender_not_allowed) |
| 422 | [`company_details_missing`](https://hypamoon.com/docs/errors/company_details_missing) |
| 422 | [`spend_cap_missing`](https://hypamoon.com/docs/errors/spend_cap_missing) |
| 429 | [`message_limit_reached`](https://hypamoon.com/docs/errors/message_limit_reached) |
| 502 | [`upstream_error`](https://hypamoon.com/docs/errors/upstream_error) |
| 503 | [`telephony_unavailable`](https://hypamoon.com/docs/errors/telephony_unavailable) |

### GET /messages/{id}

**Get a message.**

One SMS message with its current status: queued, sent, delivered or failed.

Scope: `messages:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the message. |

#### 200 The message.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the message. |
| `to` (required) | string | The recipient, in E.164. |
| `from` (required) | string | The sender the recipient sees: an alphanumeric name of up to 11 characters. |
| `body` (required) | string | The text as it was sent, after typographic quotes and dashes were made SMS-safe. |
| `segments` (required) | integer | How many SMS segments the text took. A segment is 160 GSM-7 or 70 UCS-2 characters (153 and 67 when split). |
| `encoding` (required) | `"gsm7"`, `"ucs2"`, `null` | gsm7, or ucs2 when the text has a character outside GSM-7 (an emoji, for example), which makes every segment shorter. |
| `status` (required) | `"queued"`, `"sent"`, `"delivered"`, `"failed"` | queued: accepted. sent: handed to the mobile network. delivered: the phone confirmed it. failed: it did not arrive; see error. |
| `error` (required) | string or null | With status failed: a short code, like delivery\_failed or sending\_failed. Otherwise null. |
| `reference` (required) | string or null | Your own id for this message, as you sent it (an order number, for example). |
| `created_at` (required) | string (date-time) | When we accepted the message. |
| `status_updated_at` (required) | string or null (date-time) | When the status last changed. |
| `test` (required) | boolean | true for a message sent with a test key to a test number. It never reaches a phone. |

JSON

```
{
  "id": "8f7e6d5c-4b3a-4291-8f0e-1d2c3b4a5968",
  "to": "+447700900321",
  "from": "Acme Shop",
  "body": "Hi Sam, thanks for your order 10432 at Acme Shop. We are packing it now; you get a track and trace link as soon as it ships.",
  "segments": 1,
  "encoding": "gsm7",
  "status": "queued",
  "error": null,
  "reference": "order-10432",
  "created_at": "2026-10-01T09:00:00.000Z",
  "status_updated_at": "2026-10-01T09:00:00.000Z",
  "test": true
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

## Chat

Text chat with the same assistant that answers your phone: same instructions, languages, opening hours and website. For a chat in your app or website, called from your backend.

### GET /conversations

**List the conversations.**

The project's chat conversations, newest first, without messages. Follow next\_cursor while has\_more is true.

Scope: `chat:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `limit` | query | integer | Conversations per page, default 25. A value above 100 is capped at 100. |
| `cursor` | query | string | The next\_cursor of the previous page. |
| `status` | query | `"open"`, `"closed"` | Only open or only closed conversations. |

#### 200 A page of conversations.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | Conversation\[\] |  |
| `has_more` (required) | boolean | Whether there is another page. |
| `next_cursor` (required) | string or null | Pass this as cursor to get the next page. |

JSON

```
{
  "data": [
    {
      "id": "2c9d8e7f-6a5b-4c3d-9e2f-1a0b9c8d7e6f",
      "channel": "chat",
      "status": "closed",
      "reference": "session-8841",
      "metadata": {
        "page": "/pricing",
        "plan": "pro"
      },
      "customer": {
        "name": "Sam Jones",
        "phone": null,
        "email": "sam@example.com"
      },
      "language": "en",
      "turns": 2,
      "max_turns": 30,
      "created_at": "2026-10-01T09:00:00.000Z",
      "last_message_at": "2026-10-01T09:01:05.000Z",
      "closed_at": "2026-10-01T09:31:05.000Z",
      "close_reason": "inactive",
      "has_summary": true,
      "summary_ready_at": "2026-10-01T09:31:09.000Z",
      "test": false
    }
  ],
  "has_more": false,
  "next_cursor": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_parameter`](https://hypamoon.com/docs/errors/invalid_parameter) |

### POST /conversations

**Start a chat conversation.**

Starts a text chat with the assistant of the project: the same assistant that answers your phone, with the same instructions, languages, opening hours and website (set with PUT /assistant). The response contains the fixed greeting as the first message; send the customer's messages with POST /conversations/{id}/messages. Call this from your backend, never from a browser: the API key is a server-side secret. A website chat goes through your own server, which adds the key, or uses the chat widget with a public chat token (POST /chat-tokens). A live key needs the company verification level (company details, spending cap, payment method, a verified phone and one payment confirmed with your bank: iDEAL or a card with 3D Secure). At most 20 new conversations per minute and 1000 per day per project. With a test key the assistant gives real answers: the first 20 replies per day are free, after that each reply is deducted from the prepaid balance of your live project the same way as live, billed per use (402 test\_free\_replies\_used without balance or saved card). At most 25 test conversations per day. Send an Idempotency-Key so a retry returns the same conversation.

Scope: `chat:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `Idempotency-Key` | header | string | Optional but recommended: 1 to 255 visible ASCII characters without spaces. The same key within 24 hours returns the same conversation. |

#### Request body

Every field is optional; an empty object starts a conversation.

| Field | Type |  |
| --- | --- | --- |
| `channel` | `"chat"` | The channel. Only chat for now; it is also the default. |
| `reference` | string | Optional: your own id for this conversation, like a session or ticket id. Comes back in the conversation and its webhook. |
| `metadata` | object | Optional: up to 20 keys with a string (at most 500 characters), number or boolean, for your own use. Stored and returned as is; the assistant never sees it. |
| `customer` | object | Optional: what your app already knows about the customer, for example from their login. The assistant may use it to address the customer and to confirm how to reach them; it is treated as data, never as instructions. |

JSON

```
{
  "reference": "session-8841",
  "metadata": {
    "page": "/pricing",
    "plan": "pro"
  },
  "customer": {
    "name": "Sam Jones",
    "email": "sam@example.com"
  }
}
```

#### 201 The conversation, with the greeting as its first message.

| Header |  |
| --- | --- |
| `Idempotent-Replayed` | Present when this is the stored response to an earlier request with the same Idempotency-Key. |

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the conversation. |
| `channel` (required) | `"chat"`, `"widget"` | The channel: chat when your app started it with an API key, widget when a visitor started it in the chat widget on a website (public chat token). |
| `status` (required) | `"open"`, `"closed"` | open: takes messages. closed: takes no more messages; the summary follows. |
| `reference` (required) | string or null | Your own id for this conversation, as you sent it. |
| `metadata` (required) | object | Your metadata, as you sent it. The assistant never sees it. |
| `customer` (required) | object | What your app told us about the customer when the conversation started. |
| `language` (required) | string | The language the assistant opened in (nl, en, de, fr or es). It replies in the customer's language when that is one of its languages. |
| `turns` (required) | integer | Customer messages answered so far. |
| `max_turns` (required) | integer | After this many turns the conversation closes (close\_reason turn\_limit). |
| `created_at` (required) | string (date-time) | When the conversation started. |
| `last_message_at` (required) | string or null (date-time) | When the last message was sent. |
| `closed_at` (required) | string or null (date-time) | When the conversation closed. |
| `close_reason` (required) | `"closed"`, `"inactive"`, `"turn_limit"`, `null` | closed: POST /conversations/{id}/close. inactive: no message for 30 minutes. turn\_limit: max\_turns reached. |
| `has_summary` (required) | boolean | Whether the summary is ready. Fetch it with GET /conversations/{id}. |
| `summary_ready_at` (required) | string or null (date-time) | When the summary was ready. |
| `test` (required) | boolean | true for a conversation in test mode (hm\_test\_): real replies, free, with a low daily limit. |
| `messages` (required) | ChatMessage\[\] | All messages, oldest first, starting with the greeting. |
| `summary` (required) | one of | The summary, after the conversation closed. Same shape as the summary of a call. |

JSON

```
{
  "id": "2c9d8e7f-6a5b-4c3d-9e2f-1a0b9c8d7e6f",
  "channel": "chat",
  "status": "open",
  "reference": "session-8841",
  "metadata": {
    "page": "/pricing",
    "plan": "pro"
  },
  "customer": {
    "name": "Sam Jones",
    "phone": null,
    "email": "sam@example.com"
  },
  "language": "en",
  "turns": 0,
  "max_turns": 30,
  "created_at": "2026-10-01T09:00:00.000Z",
  "last_message_at": "2026-10-01T09:00:00.000Z",
  "closed_at": null,
  "close_reason": null,
  "has_summary": false,
  "summary_ready_at": null,
  "test": false,
  "messages": [
    {
      "id": "4e5f6a7b-8c9d-4e0f-a1b2-c3d4e5f6a7b8",
      "role": "assistant",
      "text": "You are chatting with the digital assistant of Acme Plumbing. How can I help you?",
      "created_at": "2026-10-01T09:00:00.000Z"
    }
  ],
  "summary": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`idempotency_key_invalid`](https://hypamoon.com/docs/errors/idempotency_key_invalid) |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 402 | [`payment_mandate_missing`](https://hypamoon.com/docs/errors/payment_mandate_missing) |
| 402 | [`billing_blocked`](https://hypamoon.com/docs/errors/billing_blocked) |
| 402 | [`insufficient_balance`](https://hypamoon.com/docs/errors/insufficient_balance) |
| 409 | [`idempotency_key_reused`](https://hypamoon.com/docs/errors/idempotency_key_reused) |
| 409 | [`idempotency_request_in_progress`](https://hypamoon.com/docs/errors/idempotency_request_in_progress) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`company_details_missing`](https://hypamoon.com/docs/errors/company_details_missing) |
| 422 | [`spend_cap_missing`](https://hypamoon.com/docs/errors/spend_cap_missing) |
| 422 | [`assistant_not_configured`](https://hypamoon.com/docs/errors/assistant_not_configured) |
| 429 | [`conversation_limit_reached`](https://hypamoon.com/docs/errors/conversation_limit_reached) |

### GET /conversations/{id}

**Get a conversation with its messages and summary.**

One conversation with all its messages, oldest first, and the summary once it is closed. The messages are only here, never in a webhook.

Scope: `chat:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the conversation. |

#### 200 The conversation.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the conversation. |
| `channel` (required) | `"chat"`, `"widget"` | The channel: chat when your app started it with an API key, widget when a visitor started it in the chat widget on a website (public chat token). |
| `status` (required) | `"open"`, `"closed"` | open: takes messages. closed: takes no more messages; the summary follows. |
| `reference` (required) | string or null | Your own id for this conversation, as you sent it. |
| `metadata` (required) | object | Your metadata, as you sent it. The assistant never sees it. |
| `customer` (required) | object | What your app told us about the customer when the conversation started. |
| `language` (required) | string | The language the assistant opened in (nl, en, de, fr or es). It replies in the customer's language when that is one of its languages. |
| `turns` (required) | integer | Customer messages answered so far. |
| `max_turns` (required) | integer | After this many turns the conversation closes (close\_reason turn\_limit). |
| `created_at` (required) | string (date-time) | When the conversation started. |
| `last_message_at` (required) | string or null (date-time) | When the last message was sent. |
| `closed_at` (required) | string or null (date-time) | When the conversation closed. |
| `close_reason` (required) | `"closed"`, `"inactive"`, `"turn_limit"`, `null` | closed: POST /conversations/{id}/close. inactive: no message for 30 minutes. turn\_limit: max\_turns reached. |
| `has_summary` (required) | boolean | Whether the summary is ready. Fetch it with GET /conversations/{id}. |
| `summary_ready_at` (required) | string or null (date-time) | When the summary was ready. |
| `test` (required) | boolean | true for a conversation in test mode (hm\_test\_): real replies, free, with a low daily limit. |
| `messages` (required) | ChatMessage\[\] | All messages, oldest first, starting with the greeting. |
| `summary` (required) | one of | The summary, after the conversation closed. Same shape as the summary of a call. |

JSON

```
{
  "id": "2c9d8e7f-6a5b-4c3d-9e2f-1a0b9c8d7e6f",
  "channel": "chat",
  "status": "closed",
  "reference": "session-8841",
  "metadata": {
    "page": "/pricing",
    "plan": "pro"
  },
  "customer": {
    "name": "Sam Jones",
    "phone": null,
    "email": "sam@example.com"
  },
  "language": "en",
  "turns": 2,
  "max_turns": 30,
  "created_at": "2026-10-01T09:00:00.000Z",
  "last_message_at": "2026-10-01T09:01:05.000Z",
  "closed_at": "2026-10-01T09:31:05.000Z",
  "close_reason": "inactive",
  "has_summary": true,
  "summary_ready_at": "2026-10-01T09:31:09.000Z",
  "test": false,
  "messages": [
    {
      "id": "4e5f6a7b-8c9d-4e0f-a1b2-c3d4e5f6a7b8",
      "role": "assistant",
      "text": "You are chatting with the digital assistant of Acme Plumbing. How can I help you?",
      "created_at": "2026-10-01T09:00:00.000Z"
    },
    {
      "id": "5f6a7b8c-9d0e-4f1a-b2c3-d4e5f6a7b8c9",
      "role": "customer",
      "text": "My kitchen tap is leaking. Can someone come today?",
      "created_at": "2026-10-01T09:00:20.000Z"
    },
    {
      "id": "6a7b8c9d-0e1f-4a2b-83c4-e5f6a7b8c9d0",
      "role": "assistant",
      "text": "I'm sorry about the leak. I can't plan a visit myself, but I'll pass it on: on which number can our team call you back within the hour?",
      "created_at": "2026-10-01T09:00:22.000Z"
    }
  ],
  "summary": {
    "text": "Sam Jones has a leaking kitchen tap and wants someone to come today. Sam left the number +447700900321 for a call back.",
    "topics": [
      "leak",
      "visit"
    ],
    "sentiment": "neutral",
    "action_items": [
      "Call Sam Jones back on +447700900321 within the hour to plan a visit."
    ],
    "next_step": "Call back within the hour."
  }
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### POST /conversations/{id}/messages

**Send a customer message and get the reply.**

Sends what the customer typed and returns the assistant's reply in the same response. With `Accept: text/event-stream` the reply streams as Server-Sent Events: `delta` events with pieces of text, then one `done` event with the same body as the JSON response (or an `error` event with a problem+json). The text in `done.reply` is the reply as stored; display that text. The customer's text is never treated as an instruction to the assistant, and the assistant never shares its instructions or keys. In a chat the assistant cannot book, transfer or send anything: it takes a message, which ends up in the summary. At most 2000 characters per message, 30 turns per conversation (then it closes) and 12 messages per minute per conversation. In live mode, every assistant reply is billed per use, usually about one cent a reply: first from the AI credit in your plan, then from your prepaid balance (the greeting is free; a reply that fails costs nothing). The summary of a conversation is charged the same way when it closes. In test mode the first replies of the day are free, after that they are deducted from the balance of your live project. Send an Idempotency-Key (one per customer message) so a retry returns the same reply instead of a second turn.

Scope: `chat:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the conversation. |
| `Idempotency-Key` | header | string | Optional but recommended: 1 to 255 visible ASCII characters without spaces, a new one per customer message. A retry with the same key within 24 hours returns the same reply. |
| `Accept` | header | `"application/json"`, `"text/event-stream"` | text/event-stream streams the reply as Server-Sent Events; anything else returns a single JSON response. |

#### Request body

One message from the customer.

| Field | Type |  |
| --- | --- | --- |
| `text` (required) | string | What the customer typed, at most 2000 characters. Send it as is; it is never treated as an instruction to the assistant. |

JSON

```
{
  "text": "My kitchen tap is leaking. Can someone come today?"
}
```

#### 200 The customer's message and the assistant's reply.

| Header |  |
| --- | --- |
| `Idempotent-Replayed` | Present when this is the stored response to an earlier request with the same Idempotency-Key. |

| Field | Type |  |
| --- | --- | --- |
| `message` (required) | object | The customer's message as stored. |
| `reply` (required) | object | The assistant's reply. Show this text to the customer. |
| `conversation` (required) | object | The conversation after this turn. status closed means the turn limit was reached. |

JSON

```
{
  "message": {
    "id": "5f6a7b8c-9d0e-4f1a-b2c3-d4e5f6a7b8c9",
    "role": "customer",
    "text": "My kitchen tap is leaking. Can someone come today?",
    "created_at": "2026-10-01T09:00:20.000Z"
  },
  "reply": {
    "id": "6a7b8c9d-0e1f-4a2b-83c4-e5f6a7b8c9d0",
    "role": "assistant",
    "text": "I'm sorry about the leak. I can't plan a visit myself, but I'll pass it on: on which number can our team call you back within the hour?",
    "created_at": "2026-10-01T09:00:22.000Z"
  },
  "conversation": {
    "id": "2c9d8e7f-6a5b-4c3d-9e2f-1a0b9c8d7e6f",
    "channel": "chat",
    "status": "open",
    "reference": "session-8841",
    "metadata": {
      "page": "/pricing",
      "plan": "pro"
    },
    "customer": {
      "name": "Sam Jones",
      "phone": null,
      "email": "sam@example.com"
    },
    "language": "en",
    "turns": 1,
    "max_turns": 30,
    "created_at": "2026-10-01T09:00:00.000Z",
    "last_message_at": "2026-10-01T09:00:20.000Z",
    "closed_at": null,
    "close_reason": null,
    "has_summary": false,
    "summary_ready_at": null,
    "test": false
  }
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`idempotency_key_invalid`](https://hypamoon.com/docs/errors/idempotency_key_invalid) |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 402 | [`payment_mandate_missing`](https://hypamoon.com/docs/errors/payment_mandate_missing) |
| 402 | [`billing_blocked`](https://hypamoon.com/docs/errors/billing_blocked) |
| 402 | [`insufficient_balance`](https://hypamoon.com/docs/errors/insufficient_balance) |
| 402 | [`test_free_replies_used`](https://hypamoon.com/docs/errors/test_free_replies_used) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conversation_closed`](https://hypamoon.com/docs/errors/conversation_closed) |
| 409 | [`conversation_turn_limit_reached`](https://hypamoon.com/docs/errors/conversation_turn_limit_reached) |
| 409 | [`conversation_busy`](https://hypamoon.com/docs/errors/conversation_busy) |
| 409 | [`idempotency_key_reused`](https://hypamoon.com/docs/errors/idempotency_key_reused) |
| 409 | [`idempotency_request_in_progress`](https://hypamoon.com/docs/errors/idempotency_request_in_progress) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`company_details_missing`](https://hypamoon.com/docs/errors/company_details_missing) |
| 422 | [`spend_cap_missing`](https://hypamoon.com/docs/errors/spend_cap_missing) |
| 502 | [`upstream_error`](https://hypamoon.com/docs/errors/upstream_error) |

### POST /conversations/{id}/close

**Close a conversation.**

Closes the conversation: it accepts no more messages, and the summary follows as conversation.summary.ready and in GET /conversations/{id}. Without a customer message there is no summary. Closing an already closed conversation returns it unchanged. A conversation closes automatically after 30 minutes without messages.

Scope: `chat:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the conversation. |

#### 200 The conversation, closed.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the conversation. |
| `channel` (required) | `"chat"`, `"widget"` | The channel: chat when your app started it with an API key, widget when a visitor started it in the chat widget on a website (public chat token). |
| `status` (required) | `"open"`, `"closed"` | open: takes messages. closed: takes no more messages; the summary follows. |
| `reference` (required) | string or null | Your own id for this conversation, as you sent it. |
| `metadata` (required) | object | Your metadata, as you sent it. The assistant never sees it. |
| `customer` (required) | object | What your app told us about the customer when the conversation started. |
| `language` (required) | string | The language the assistant opened in (nl, en, de, fr or es). It replies in the customer's language when that is one of its languages. |
| `turns` (required) | integer | Customer messages answered so far. |
| `max_turns` (required) | integer | After this many turns the conversation closes (close\_reason turn\_limit). |
| `created_at` (required) | string (date-time) | When the conversation started. |
| `last_message_at` (required) | string or null (date-time) | When the last message was sent. |
| `closed_at` (required) | string or null (date-time) | When the conversation closed. |
| `close_reason` (required) | `"closed"`, `"inactive"`, `"turn_limit"`, `null` | closed: POST /conversations/{id}/close. inactive: no message for 30 minutes. turn\_limit: max\_turns reached. |
| `has_summary` (required) | boolean | Whether the summary is ready. Fetch it with GET /conversations/{id}. |
| `summary_ready_at` (required) | string or null (date-time) | When the summary was ready. |
| `test` (required) | boolean | true for a conversation in test mode (hm\_test\_): real replies, free, with a low daily limit. |

JSON

```
{
  "id": "2c9d8e7f-6a5b-4c3d-9e2f-1a0b9c8d7e6f",
  "channel": "chat",
  "status": "closed",
  "reference": "session-8841",
  "metadata": {
    "page": "/pricing",
    "plan": "pro"
  },
  "customer": {
    "name": "Sam Jones",
    "phone": null,
    "email": "sam@example.com"
  },
  "language": "en",
  "turns": 2,
  "max_turns": 30,
  "created_at": "2026-10-01T09:00:00.000Z",
  "last_message_at": "2026-10-01T09:01:05.000Z",
  "closed_at": "2026-10-01T09:31:05.000Z",
  "close_reason": "closed",
  "has_summary": false,
  "summary_ready_at": null,
  "test": false
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

## Chat widget

A chat window on your website without your own backend: one script tag with a public chat token. Manage tokens with your API key (/chat-tokens); the widget itself calls the /public routes from the visitor's browser.

### GET /chat-tokens

**List the public chat tokens.**

The project's public chat tokens for the chat widget, newest first, including revoked ones, each with its embed\_code. daily\_spend\_limit\_eur is the most the project's public chat may spend on replies per day (default 5 euro, up to 1000); change it in the portal.

Scope: `chat:read`

#### 200 The tokens and the daily spending limit.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | ChatToken\[\] | The public chat tokens of the project, newest first, also the revoked ones. |
| `daily_spend_limit_eur` (required) | number | What the public chat of this project may spend per day in replies, in euro. Default 5; change it in the portal. 0 turns the live widget off. |

JSON

```
{
  "data": [
    {
      "id": "1b2c3d4e-5f60-4718-8a9b-0c1d2e3f4a5b",
      "name": "acme-plumbing.example",
      "display_name": "Acme Plumbing",
      "token": "hm_pub_4mXq9TbR2kLw7NcV1sHd8YzE",
      "mode": "live",
      "allowed_origins": [
        "https://www.acme-plumbing.example",
        "https://acme-plumbing.example"
      ],
      "turnstile": true,
      "max_conversations_per_day": 200,
      "revoked": false,
      "revoked_at": null,
      "last_used_at": null,
      "created_at": "2026-10-01T09:00:00.000Z",
      "embed_code": "<script src=\"https://api.hypamoon.com/widget.js\" data-token=\"hm_pub_4mXq9TbR2kLw7NcV1sHd8YzE\" async></script>",
      "kind": "chat"
    }
  ],
  "daily_spend_limit_eur": 5
}
```

### POST /chat-tokens

**Create a public chat token for the chat widget.**

Creates a public chat token and returns it with embed\_code, the script tag to paste on the website. The widget then chats with the project's assistant (set with PUT /assistant) directly from the visitor's browser, with no backend of your own. The token is not a secret: it is in the page source. It can only chat, only from allowed\_origins (exact origins like [https://www.example.com](https://www.example.com), no path and no wildcard), with a bot check and its own limits, and you can revoke it. Your API key stays on the server. A live token needs at least one https origin; a test key creates a test token (hm\_pubtest\_) that also works from localhost. At most 10 origins per token, and at most 1000 new conversations per day per token (default 200).

Scope: `chat:write`

#### Request body

A new public chat token for the website widget.

| Field | Type |  |
| --- | --- | --- |
| `name` (required) | string | A name for your own overview, like the website it is for. |
| `display_name` | string or null | The name the assistant uses for the business in the chat window, like "Knip": in the greeting ("You are chatting with the digital assistant of Knip.") and in its answers. Leave it out or null to use the name of the site the widget is on, and otherwise the project name. |
| `allowed_origins` (required) | string\[\] | The exact origins that may use this token, like [https://www.example.com](https://www.example.com) (scheme and host, no path, no wildcard), at most 10. A live token needs at least one https origin. A test token may always be used from localhost. |
| `turnstile` | boolean | Ask for a bot check before a conversation starts. Default true. |
| `max_conversations_per_day` | integer | New conversations per day through this token. Default 200, at most 1000. |

JSON

```
{
  "name": "acme-plumbing.example",
  "allowed_origins": [
    "https://www.acme-plumbing.example",
    "https://acme-plumbing.example"
  ]
}
```

#### 201 The token, with embed\_code.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the public chat token. Use it to change or revoke the token. |
| `name` (required) | string | Your name for the token, like the website it is for. |
| `display_name` (required) | string or null | The name the assistant uses for the business in the chat window and its greeting, or null: then the name of the site the widget is on, and otherwise the project name. |
| `token` (required) | string | The public chat token: hm\_pub\_ (live) or hm\_pubtest\_ (test project) plus 24 characters. Not a secret: it goes in the page source of your website. |
| `mode` (required) | `"live"`, `"test"` | live or test, from the project the key belongs to. |
| `allowed_origins` (required) | string\[\] | The exact origins that may use the token, like [https://www.example.com](https://www.example.com). A test token also works from localhost. |
| `turnstile` (required) | boolean | Whether a visitor passes a bot check before a conversation starts. |
| `max_conversations_per_day` (required) | integer | New conversations per day through this token, counted until midnight, Europe/Amsterdam. |
| `revoked` (required) | boolean | true once the token is revoked: the widget stops working right away, also in open conversations. |
| `revoked_at` (required) | string or null (date-time) | When the token was revoked. |
| `last_used_at` (required) | string or null (date-time) | When a browser last used the token, to the minute. |
| `created_at` (required) | string (date-time) | When the token was created. |
| `embed_code` (required) | string | The script tag for your website, with this token in it. Paste it before </body>. |
| `kind` (required) | `"chat"`, `"form"`, `"shop"` | chat: the chat widget, the cart, the checkout and forms. form: only forms that post to a collection with public\_write (made by Hypamoon for a form on a site); it cannot chat. shop: the buy button, the cart and forms of one site (made by Hypamoon for a buy button on a site); it cannot chat. |
| `warnings` | object\[\] | Only in the answer of POST /chat-tokens, and only when there is something to tell. The token is created either way. |

JSON

```
{
  "id": "1b2c3d4e-5f60-4718-8a9b-0c1d2e3f4a5b",
  "name": "acme-plumbing.example",
  "display_name": "Acme Plumbing",
  "token": "hm_pub_4mXq9TbR2kLw7NcV1sHd8YzE",
  "mode": "live",
  "allowed_origins": [
    "https://www.acme-plumbing.example",
    "https://acme-plumbing.example"
  ],
  "turnstile": true,
  "max_conversations_per_day": 200,
  "revoked": false,
  "revoked_at": null,
  "last_used_at": null,
  "created_at": "2026-10-01T09:00:00.000Z",
  "embed_code": "<script src=\"https://api.hypamoon.com/widget.js\" data-token=\"hm_pub_4mXq9TbR2kLw7NcV1sHd8YzE\" async></script>",
  "kind": "chat"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /chat-tokens/{id}

**Get a public chat token.**

One public chat token with its embed\_code.

Scope: `chat:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the public chat token. |

#### 200 The token.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the public chat token. Use it to change or revoke the token. |
| `name` (required) | string | Your name for the token, like the website it is for. |
| `display_name` (required) | string or null | The name the assistant uses for the business in the chat window and its greeting, or null: then the name of the site the widget is on, and otherwise the project name. |
| `token` (required) | string | The public chat token: hm\_pub\_ (live) or hm\_pubtest\_ (test project) plus 24 characters. Not a secret: it goes in the page source of your website. |
| `mode` (required) | `"live"`, `"test"` | live or test, from the project the key belongs to. |
| `allowed_origins` (required) | string\[\] | The exact origins that may use the token, like [https://www.example.com](https://www.example.com). A test token also works from localhost. |
| `turnstile` (required) | boolean | Whether a visitor passes a bot check before a conversation starts. |
| `max_conversations_per_day` (required) | integer | New conversations per day through this token, counted until midnight, Europe/Amsterdam. |
| `revoked` (required) | boolean | true once the token is revoked: the widget stops working right away, also in open conversations. |
| `revoked_at` (required) | string or null (date-time) | When the token was revoked. |
| `last_used_at` (required) | string or null (date-time) | When a browser last used the token, to the minute. |
| `created_at` (required) | string (date-time) | When the token was created. |
| `embed_code` (required) | string | The script tag for your website, with this token in it. Paste it before </body>. |
| `kind` (required) | `"chat"`, `"form"`, `"shop"` | chat: the chat widget, the cart, the checkout and forms. form: only forms that post to a collection with public\_write (made by Hypamoon for a form on a site); it cannot chat. shop: the buy button, the cart and forms of one site (made by Hypamoon for a buy button on a site); it cannot chat. |
| `warnings` | object\[\] | Only in the answer of POST /chat-tokens, and only when there is something to tell. The token is created either way. |

JSON

```
{
  "id": "1b2c3d4e-5f60-4718-8a9b-0c1d2e3f4a5b",
  "name": "acme-plumbing.example",
  "display_name": "Acme Plumbing",
  "token": "hm_pub_4mXq9TbR2kLw7NcV1sHd8YzE",
  "mode": "live",
  "allowed_origins": [
    "https://www.acme-plumbing.example",
    "https://acme-plumbing.example"
  ],
  "turnstile": true,
  "max_conversations_per_day": 200,
  "revoked": false,
  "revoked_at": null,
  "last_used_at": null,
  "created_at": "2026-10-01T09:00:00.000Z",
  "embed_code": "<script src=\"https://api.hypamoon.com/widget.js\" data-token=\"hm_pub_4mXq9TbR2kLw7NcV1sHd8YzE\" async></script>",
  "kind": "chat"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### PATCH /chat-tokens/{id}

**Change a public chat token.**

Changes the name, the display name (the business name in the chat window and its greeting), the allowed origins, the bot check or the daily limit of a token. Fields you leave out stay as they are; allowed\_origins replaces the whole list. The token itself stays the same, so the snippet on the website keeps working. A revoked token cannot be changed (409 chat\_token\_revoked): create a new one.

Scope: `chat:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the public chat token. |

#### Request body

Change a public chat token. Fields you leave out stay as they are.

| Field | Type |  |
| --- | --- | --- |
| `name` | string |  |
| `display_name` | string or null | The name the assistant uses for the business in the chat window, like "Knip": in the greeting ("You are chatting with the digital assistant of Knip.") and in its answers. null or an empty string goes back to the name of the site the widget is on, and otherwise the project name. |
| `allowed_origins` | string\[\] |  |
| `turnstile` | boolean |  |
| `max_conversations_per_day` | integer |  |

JSON

```
{
  "allowed_origins": [
    "https://www.acme-plumbing.example",
    "https://acme-plumbing.example",
    "https://shop.acme-plumbing.example"
  ]
}
```

#### 200 The token as changed.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the public chat token. Use it to change or revoke the token. |
| `name` (required) | string | Your name for the token, like the website it is for. |
| `display_name` (required) | string or null | The name the assistant uses for the business in the chat window and its greeting, or null: then the name of the site the widget is on, and otherwise the project name. |
| `token` (required) | string | The public chat token: hm\_pub\_ (live) or hm\_pubtest\_ (test project) plus 24 characters. Not a secret: it goes in the page source of your website. |
| `mode` (required) | `"live"`, `"test"` | live or test, from the project the key belongs to. |
| `allowed_origins` (required) | string\[\] | The exact origins that may use the token, like [https://www.example.com](https://www.example.com). A test token also works from localhost. |
| `turnstile` (required) | boolean | Whether a visitor passes a bot check before a conversation starts. |
| `max_conversations_per_day` (required) | integer | New conversations per day through this token, counted until midnight, Europe/Amsterdam. |
| `revoked` (required) | boolean | true once the token is revoked: the widget stops working right away, also in open conversations. |
| `revoked_at` (required) | string or null (date-time) | When the token was revoked. |
| `last_used_at` (required) | string or null (date-time) | When a browser last used the token, to the minute. |
| `created_at` (required) | string (date-time) | When the token was created. |
| `embed_code` (required) | string | The script tag for your website, with this token in it. Paste it before </body>. |
| `kind` (required) | `"chat"`, `"form"`, `"shop"` | chat: the chat widget, the cart, the checkout and forms. form: only forms that post to a collection with public\_write (made by Hypamoon for a form on a site); it cannot chat. shop: the buy button, the cart and forms of one site (made by Hypamoon for a buy button on a site); it cannot chat. |
| `warnings` | object\[\] | Only in the answer of POST /chat-tokens, and only when there is something to tell. The token is created either way. |

JSON

```
{
  "id": "1b2c3d4e-5f60-4718-8a9b-0c1d2e3f4a5b",
  "name": "acme-plumbing.example",
  "display_name": "Acme Plumbing",
  "token": "hm_pub_4mXq9TbR2kLw7NcV1sHd8YzE",
  "mode": "live",
  "allowed_origins": [
    "https://www.acme-plumbing.example",
    "https://acme-plumbing.example",
    "https://shop.acme-plumbing.example"
  ],
  "turnstile": true,
  "max_conversations_per_day": 200,
  "revoked": false,
  "revoked_at": null,
  "last_used_at": null,
  "created_at": "2026-10-01T09:00:00.000Z",
  "embed_code": "<script src=\"https://api.hypamoon.com/widget.js\" data-token=\"hm_pub_4mXq9TbR2kLw7NcV1sHd8YzE\" async></script>",
  "kind": "chat"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`chat_token_revoked`](https://hypamoon.com/docs/errors/chat_token_revoked) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### DELETE /chat-tokens/{id}

**Revoke a public chat token.**

Revokes the token immediately: the widget on the website starts no new conversations, and open conversations through this token accept no more messages. Cannot be undone. Returns the token with revoked: true; revoking it again returns the same.

Scope: `chat:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the public chat token. |

#### 200 The token, revoked.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the public chat token. Use it to change or revoke the token. |
| `name` (required) | string | Your name for the token, like the website it is for. |
| `display_name` (required) | string or null | The name the assistant uses for the business in the chat window and its greeting, or null: then the name of the site the widget is on, and otherwise the project name. |
| `token` (required) | string | The public chat token: hm\_pub\_ (live) or hm\_pubtest\_ (test project) plus 24 characters. Not a secret: it goes in the page source of your website. |
| `mode` (required) | `"live"`, `"test"` | live or test, from the project the key belongs to. |
| `allowed_origins` (required) | string\[\] | The exact origins that may use the token, like [https://www.example.com](https://www.example.com). A test token also works from localhost. |
| `turnstile` (required) | boolean | Whether a visitor passes a bot check before a conversation starts. |
| `max_conversations_per_day` (required) | integer | New conversations per day through this token, counted until midnight, Europe/Amsterdam. |
| `revoked` (required) | boolean | true once the token is revoked: the widget stops working right away, also in open conversations. |
| `revoked_at` (required) | string or null (date-time) | When the token was revoked. |
| `last_used_at` (required) | string or null (date-time) | When a browser last used the token, to the minute. |
| `created_at` (required) | string (date-time) | When the token was created. |
| `embed_code` (required) | string | The script tag for your website, with this token in it. Paste it before </body>. |
| `kind` (required) | `"chat"`, `"form"`, `"shop"` | chat: the chat widget, the cart, the checkout and forms. form: only forms that post to a collection with public\_write (made by Hypamoon for a form on a site); it cannot chat. shop: the buy button, the cart and forms of one site (made by Hypamoon for a buy button on a site); it cannot chat. |
| `warnings` | object\[\] | Only in the answer of POST /chat-tokens, and only when there is something to tell. The token is created either way. |

JSON

```
{
  "id": "1b2c3d4e-5f60-4718-8a9b-0c1d2e3f4a5b",
  "name": "acme-plumbing.example",
  "display_name": "Acme Plumbing",
  "token": "hm_pub_4mXq9TbR2kLw7NcV1sHd8YzE",
  "mode": "live",
  "allowed_origins": [
    "https://www.acme-plumbing.example",
    "https://acme-plumbing.example"
  ],
  "turnstile": true,
  "max_conversations_per_day": 200,
  "revoked": true,
  "revoked_at": "2026-10-02T08:00:00.000Z",
  "last_used_at": null,
  "created_at": "2026-10-01T09:00:00.000Z",
  "embed_code": "<script src=\"https://api.hypamoon.com/widget.js\" data-token=\"hm_pub_4mXq9TbR2kLw7NcV1sHd8YzE\" async></script>",
  "kind": "chat"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### GET /public/config

**Get the widget settings (public).**

Called by the chat widget in the visitor's browser, with the public chat token in ?token= and the Origin header of the page. No API key. Returns what the widget shows before a conversation starts: the project name, the greeting, the language and whether a bot check is needed. Every /public route allows CORS only for an allowed origin (with an OPTIONS preflight), and any reason that concerns you rather than the visitor (balance, verification, the daily spending limit) returns 503 chat\_unavailable, without details; the real reason is in the portal. All /public requests combined: at most 60 per minute per IP address.

#### 200 The settings of the widget.

| Field | Type |  |
| --- | --- | --- |
| `name` (required) | string | The name of the project, as the widget shows it. |
| `greeting` (required) | string | The greeting, in the language the assistant opens in: the default, or your own chat.greeting (configure\_texts), always with the AI disclosure. |
| `language` (required) | string | The language the assistant opens in (nl, en, de, fr or es). |
| `languages` (required) | string\[\] | The languages of the assistant. |
| `mode` (required) | `"live"`, `"test"` | live or test, from the token. |
| `turnstile` (required) | boolean | Whether POST /public/conversations needs a turnstile\_token. |
| `max_message_length` (required) | integer | The longest message a visitor can send, in characters. |
| `max_turns` (required) | integer | After this many turns the conversation closes. |
| `branding` (required) | boolean | Whether the widget shows "Powered by Hypamoon". True on Free, false from Maker. |
| `texts` | object | Only when the project chose its own widget texts (configure\_texts): per language, key (like send) to text. The widget uses them over its built-in texts. |

JSON

```
{
  "name": "Acme Plumbing",
  "greeting": "You are chatting with the digital assistant of Acme Plumbing. How can I help you?",
  "language": "en",
  "languages": [
    "en"
  ],
  "mode": "live",
  "turnstile": true,
  "max_message_length": 2000,
  "max_turns": 30,
  "branding": true
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 401 | [`invalid_chat_token`](https://hypamoon.com/docs/errors/invalid_chat_token) |
| 401 | [`chat_token_revoked`](https://hypamoon.com/docs/errors/chat_token_revoked) |
| 403 | [`origin_not_allowed`](https://hypamoon.com/docs/errors/origin_not_allowed) |
| 503 | [`chat_unavailable`](https://hypamoon.com/docs/errors/chat_unavailable) |

### POST /public/conversations

**Start a conversation from the widget (public).**

Called by the chat widget in the visitor's browser, with the public chat token in ?token= and the Origin header of the page. No API key. Starts a conversation (channel widget) with the assistant and returns the greeting and conversation\_token: the secret of this conversation for this visitor, valid for 6 hours. Every later request for it needs that secret as X-Conversation-Token. With turnstile on (the default) send turnstile\_token from the bot check; the widget shows that check in a frame on our host and does all of this for you. Limits: 3 new conversations per minute and 20 per hour per IP address, 30 per minute and 300 per hour per token, the token's daily limit (public\_chat\_limit\_reached) and, in live mode, the project's daily spending limit. Your backend can read the conversation with GET /conversations/{id} and receives conversation.summary.ready like any other chat.

#### Request body

An empty body is fine when turnstile is off for the token.

| Field | Type |  |
| --- | --- | --- |
| `turnstile_token` | string | The bot-check token from the challenge frame. Required when the public token has turnstile on (the default); the widget does this for you. |

JSON

```
{
  "turnstile_token": "0.zXnA8v1rT3...from-the-bot-check"
}
```

#### 201 The conversation with the greeting and its secret.

| Field | Type |  |
| --- | --- | --- |
| `conversation` (required) | PublicConversation | A conversation as the widget sees it: only what concerns the visitor. No metadata, customer details or summary; your backend reads those with GET /conversations/{id}. |
| `messages` (required) | ChatMessage\[\] | The greeting, as the first message. |
| `conversation_token` (required) | string | The secret of this conversation, for this visitor only. Send it as X-Conversation-Token on every next request about this conversation. Keep it in the page (or sessionStorage), never in a URL. |
| `expires_at` (required) | string (date-time) | When conversation\_token stops working (6 hours after the start). |

JSON

```
{
  "conversation": {
    "id": "2c9d8e7f-6a5b-4c3d-9e2f-1a0b9c8d7e6f",
    "channel": "widget",
    "status": "open",
    "language": "en",
    "turns": 0,
    "max_turns": 30,
    "created_at": "2026-10-01T09:00:00.000Z",
    "last_message_at": "2026-10-01T09:00:00.000Z",
    "closed_at": null,
    "close_reason": null,
    "test": false
  },
  "messages": [
    {
      "id": "4e5f6a7b-8c9d-4e0f-a1b2-c3d4e5f6a7b8",
      "role": "assistant",
      "text": "You are chatting with the digital assistant of Acme Plumbing. How can I help you?",
      "created_at": "2026-10-01T09:00:00.000Z"
    }
  ],
  "conversation_token": "v1.2c9d8e7f-6a5b-4c3d-9e2f-1a0b9c8d7e6f.1b2c3d4e-5f60-4718-8a9b-0c1d2e3f4a5b.1790866800.Qm9vZ3N0ZWVuLXZvb3JiZWVsZC1oYW5kdGVrZW5pbmc",
  "expires_at": "2026-10-01T15:00:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 401 | [`invalid_chat_token`](https://hypamoon.com/docs/errors/invalid_chat_token) |
| 401 | [`chat_token_revoked`](https://hypamoon.com/docs/errors/chat_token_revoked) |
| 402 | [`test_free_replies_used`](https://hypamoon.com/docs/errors/test_free_replies_used) |
| 403 | [`origin_not_allowed`](https://hypamoon.com/docs/errors/origin_not_allowed) |
| 403 | [`turnstile_failed`](https://hypamoon.com/docs/errors/turnstile_failed) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 429 | [`public_chat_limit_reached`](https://hypamoon.com/docs/errors/public_chat_limit_reached) |
| 503 | [`chat_unavailable`](https://hypamoon.com/docs/errors/chat_unavailable) |

### GET /public/conversations/{id}

**Get the visitor's conversation (public).**

Called by the chat widget to restore the conversation after a page load. Needs the public chat token in ?token=, the Origin header and X-Conversation-Token. Returns only the messages and the state: no metadata, customer details or summary. A conversation from another token, or one started with your API key, is never reachable here.

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the conversation. |
| `X-Conversation-Token` (required) | header | string | The conversation\_token from POST /public/conversations. Only the visitor who started the conversation has it. |

#### 200 The conversation with its messages.

| Field | Type |  |
| --- | --- | --- |
| `conversation` (required) | PublicConversation | A conversation as the widget sees it: only what concerns the visitor. No metadata, customer details or summary; your backend reads those with GET /conversations/{id}. |
| `messages` (required) | ChatMessage\[\] | All messages, oldest first, starting with the greeting. |

JSON

```
{
  "conversation": {
    "id": "2c9d8e7f-6a5b-4c3d-9e2f-1a0b9c8d7e6f",
    "channel": "widget",
    "status": "open",
    "language": "en",
    "turns": 1,
    "max_turns": 30,
    "created_at": "2026-10-01T09:00:00.000Z",
    "last_message_at": "2026-10-01T09:00:22.000Z",
    "closed_at": null,
    "close_reason": null,
    "test": false
  },
  "messages": [
    {
      "id": "4e5f6a7b-8c9d-4e0f-a1b2-c3d4e5f6a7b8",
      "role": "assistant",
      "text": "You are chatting with the digital assistant of Acme Plumbing. How can I help you?",
      "created_at": "2026-10-01T09:00:00.000Z"
    },
    {
      "id": "5f6a7b8c-9d0e-4f1a-b2c3-d4e5f6a7b8c9",
      "role": "customer",
      "text": "My kitchen tap is leaking. Can someone come today?",
      "created_at": "2026-10-01T09:00:20.000Z"
    },
    {
      "id": "6a7b8c9d-0e1f-4a2b-83c4-e5f6a7b8c9d0",
      "role": "assistant",
      "text": "I'm sorry about the leak. I can't plan a visit myself, but I'll pass it on: on which number can our team call you back within the hour?",
      "created_at": "2026-10-01T09:00:22.000Z"
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 401 | [`invalid_chat_token`](https://hypamoon.com/docs/errors/invalid_chat_token) |
| 401 | [`chat_token_revoked`](https://hypamoon.com/docs/errors/chat_token_revoked) |
| 401 | [`invalid_conversation_token`](https://hypamoon.com/docs/errors/invalid_conversation_token) |
| 403 | [`origin_not_allowed`](https://hypamoon.com/docs/errors/origin_not_allowed) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 503 | [`chat_unavailable`](https://hypamoon.com/docs/errors/chat_unavailable) |

### POST /public/conversations/{id}/messages

**Send a visitor message and get the reply (public).**

Called by the chat widget for every message the visitor types. Needs the public chat token in ?token=, the Origin header and X-Conversation-Token. Works like POST /conversations/{id}/messages: the same assistant, the same checks, and with `Accept: text/event-stream` the same Server-Sent Events (delta, then done or error). Limits: 2000 characters per message, 30 turns per conversation, 6 messages per minute per conversation and 20 per minute per IP address. In live mode, every reply is billed per use from your prepaid balance and counts toward the public chat's daily spending limit (counted at a safe 3 cents a reply); beyond that limit, the request returns public\_chat\_limit\_reached.

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the conversation. |
| `X-Conversation-Token` (required) | header | string | The conversation\_token from POST /public/conversations. Only the visitor who started the conversation has it. |
| `Accept` | header | `"application/json"`, `"text/event-stream"` | text/event-stream streams the reply as Server-Sent Events; anything else returns a single JSON response. |

#### Request body

One message from the customer.

| Field | Type |  |
| --- | --- | --- |
| `text` (required) | string | What the customer typed, at most 2000 characters. Send it as is; it is never treated as an instruction to the assistant. |

JSON

```
{
  "text": "My kitchen tap is leaking. Can someone come today?"
}
```

#### 200 The visitor's message and the assistant's reply.

| Field | Type |  |
| --- | --- | --- |
| `message` (required) | object | The visitor's message as stored. |
| `reply` (required) | object | The assistant's reply. Show this text. |
| `conversation` (required) | object | The conversation after this turn. status closed means the turn limit was reached. |

JSON

```
{
  "message": {
    "id": "5f6a7b8c-9d0e-4f1a-b2c3-d4e5f6a7b8c9",
    "role": "customer",
    "text": "My kitchen tap is leaking. Can someone come today?",
    "created_at": "2026-10-01T09:00:20.000Z"
  },
  "reply": {
    "id": "6a7b8c9d-0e1f-4a2b-83c4-e5f6a7b8c9d0",
    "role": "assistant",
    "text": "I'm sorry about the leak. I can't plan a visit myself, but I'll pass it on: on which number can our team call you back within the hour?",
    "created_at": "2026-10-01T09:00:22.000Z"
  },
  "conversation": {
    "id": "2c9d8e7f-6a5b-4c3d-9e2f-1a0b9c8d7e6f",
    "channel": "widget",
    "status": "open",
    "language": "en",
    "turns": 1,
    "max_turns": 30,
    "created_at": "2026-10-01T09:00:00.000Z",
    "last_message_at": "2026-10-01T09:00:20.000Z",
    "closed_at": null,
    "close_reason": null,
    "test": false
  }
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 401 | [`invalid_chat_token`](https://hypamoon.com/docs/errors/invalid_chat_token) |
| 401 | [`chat_token_revoked`](https://hypamoon.com/docs/errors/chat_token_revoked) |
| 401 | [`invalid_conversation_token`](https://hypamoon.com/docs/errors/invalid_conversation_token) |
| 402 | [`test_free_replies_used`](https://hypamoon.com/docs/errors/test_free_replies_used) |
| 403 | [`origin_not_allowed`](https://hypamoon.com/docs/errors/origin_not_allowed) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conversation_closed`](https://hypamoon.com/docs/errors/conversation_closed) |
| 409 | [`conversation_busy`](https://hypamoon.com/docs/errors/conversation_busy) |
| 409 | [`conversation_turn_limit_reached`](https://hypamoon.com/docs/errors/conversation_turn_limit_reached) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 429 | [`public_chat_limit_reached`](https://hypamoon.com/docs/errors/public_chat_limit_reached) |
| 502 | [`upstream_error`](https://hypamoon.com/docs/errors/upstream_error) |
| 503 | [`chat_unavailable`](https://hypamoon.com/docs/errors/chat_unavailable) |

### GET /public/challenge

**The bot check page for the widget (public).**

An HTML page with the bot check, which the chat widget shows in a frame; the widget handles this for you. It sends the bot-check token with postMessage only to `origin`, which must be an allowed origin of the token, and only that origin may frame it. Query: token (the public chat token), origin (the origin of the page with the widget) and lang (en, nl, de, fr or es). An unknown or revoked token returns a plain 404, and an origin that is not allowed returns a plain 403.

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `origin` (required) | query | string | The origin of the page with the widget, like [https://www.example.com](https://www.example.com). |
| `lang` | query | `"en"`, `"nl"`, `"de"`, `"fr"`, `"es"` | The language of the check. Without it, the browser language. |

#### 200 The page with the check.

### GET /public/texts

**Get the texts for checkout.js, cart.js and form.js (public).**

Called by checkout.js, cart.js and form.js in the visitor's browser, with the public token in ?token= and the Origin header of the page; the scripts handle this for you. Returns every visible text of the asked parts in one language: the default in that language with the project's own texts over it (configure\_texts). The language: lang with fixed=1 (data-lang on the script tag); otherwise the language the project chose; otherwise lang (the page's html lang); otherwise the site's language; otherwise English. Languages: en, nl, de, fr, es. A browser may cache the answer for five minutes.

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `parts` (required) | query | string | One or more of checkout, cart and form, comma separated. |
| `lang` | query | `"en"`, `"nl"`, `"de"`, `"fr"`, `"es"` | The language of the page (its html lang). |
| `fixed` | query | `"1"` | 1: lang is a fixed choice of the site and wins from the project's language. |

#### 200 The texts.

| Field | Type |  |
| --- | --- | --- |
| `language` (required) | `"en"`, `"nl"`, `"de"`, `"fr"`, `"es"` | The language of the texts. |
| `texts` (required) | object | Per part (checkout, cart, form): key to text, the default in this language with the project's own texts over it. {1} marks where the script puts a number, code or date. |

JSON

```
{
  "language": "de",
  "texts": {
    "checkout": {
      "title": "Kasse",
      "pay": "Weiter zur Zahlung"
    }
  }
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 401 | [`invalid_chat_token`](https://hypamoon.com/docs/errors/invalid_chat_token) |
| 401 | [`chat_token_revoked`](https://hypamoon.com/docs/errors/chat_token_revoked) |
| 403 | [`origin_not_allowed`](https://hypamoon.com/docs/errors/origin_not_allowed) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 503 | [`chat_unavailable`](https://hypamoon.com/docs/errors/chat_unavailable) |

## Sites

Static sites at `https://<slug>.hypamoon.app`: send the files, and the site is live. Free, including in test mode. Pair it with a number and the assistant, or the chat widget. A password or an unlisted address shares a site with a few people; for sign-in per user, add an app with auth to the site.

### GET /sites

**List the sites.**

The project's static sites, newest first, each with its url and its files (without their content). Deleted sites are not listed.

Scope: `sites:read`

#### 200 The sites.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | Site\[\] | The sites of the project, newest first. Deleted sites are not listed. |

JSON

```
{
  "data": [
    {
      "id": "6a7b8c9d-0e1f-4a2b-9c3d-4e5f6a7b8c9d",
      "slug": "acme-plumbing",
      "name": "Acme Plumbing",
      "url": "https://acme-plumbing.hypamoon.app",
      "files": [
        {
          "path": "/index.html",
          "content_type": "text/html",
          "bytes": 272,
          "updated_at": "2026-10-01T09:00:00.000Z"
        },
        {
          "path": "/style.css",
          "content_type": "text/css",
          "bytes": 98,
          "updated_at": "2026-10-01T09:00:00.000Z"
        }
      ],
      "created_at": "2026-10-01T09:00:00.000Z",
      "updated_at": "2026-10-01T09:00:00.000Z",
      "version": "k3Q9vXbT2mLc8Rw1",
      "password_protected": false,
      "test": false,
      "security_txt": "auto",
      "taken_offline": null
    }
  ]
}
```

### POST /sites

**Publish a static site.**

Creates a static site and publishes it immediately at `https://<slug>.hypamoon.app`. Free, including in test mode. Send every file the browser loads, in full: at least /index.html, plus css, js, images and fonts as separate files or inline. There is no build step, so send the built output, never React or Vite source. Text files (html, css, js, json, txt, xml, svg, webmanifest, md) as plain text. Images (png, jpg, gif, webp, ico), fonts (woff, woff2), PDFs (pdf), video (mp4, webm) and audio (mp3, m4a) preferably as source\_url, a public https URL that Hypamoon fetches, and base64-encoded in content only when there is no URL (never for video or audio). The type follows from the extension, and binary files must be that type in their first bytes. A PDF is served inline (Content-Disposition: inline); PDF, video and audio support Range requests (206), and count as one site request per started MB served. A PDF with JavaScript, a /Launch action, a form that submits to another host, or a brand name with a login or payment link is refused (site\_blocked). source\_url: Hypamoon fetches the file once from a public https URL on port 443 (no IP address or internal host, at most 3 redirects, each checked again; 10 s per file) within the plan's size limits. Its type must match the path: an image or font is recognized by its bytes, text must be UTF-8 and not a web page where a .css or .js was expected. The fetched file then goes through the same checks as one sent with content. A file that cannot be fetched returns 422 with the reason at files.<i>.source\_url, and nothing changes. At most 100 files with source\_url per request and 60 such requests per project per hour (429 rate\_limited). A path without an extension also resolves to <path>.html and <path>/index.html, so /about serves /about.html. Your own /404.html is the not-found page. At most 5 new sites a day (no limit on the number of sites). At most 50 files, 1 MB per file (also PDF, video and audio) and 5 MB together. Keep one request under 4 MB: send a larger file through an upload link (POST /sites/uploads) and name it here with sha256 and bytes instead of content. Without slug, one is derived from name. Retrying with the same slug returns 409 slug\_taken, never a second site. With site\_id (the id of an existing site, as deploy\_site takes it), this changes that site instead of creating one: exactly PUT /sites/{id} with the rest of the body (keep\_existing, if\_match\_version and the other fields of PUT), the response is 200 with the site, slug is ignored, and visibility is refused (use PUT /sites/{id}/address). With version history, send message: what the site is, in one short sentence; it is the first entry in its history. preview is only for an existing site (PUT /sites/{id}, or site\_id here): a new site goes live right away. A static site has no logins or server-side code of its own. To share it with a few people, set password (one shared password, entered once per browser) or make it unlisted; paid access gives each buyer a personal sign-in link. For server-side code and sign-in per user, add an app with auth to the site (POST /apps). Not yet: files over the limits. Every deploy is checked before it goes live: input fields for passwords, PIN codes, card numbers or IBANs, forms that send to another site, hidden iframes, redirects to another site, obfuscated scripts, and login fields next to the name of a bank, government service, parcel or payment service or large platform return 422 site\_blocked with the reasons. A new project has a lower limit on deploys per hour and on sites in its first week (deploy\_limit\_reached, site\_limit\_reached). With password, every visitor without the password sees a password form on every path (401, not indexed, ten wrong attempts per address per ten minutes), and nothing of the site is cached by the CDN.

Scope: `sites:write`

#### Request body

A new static site.

| Field | Type |  |
| --- | --- | --- |
| `slug` | string | The address: `https://<slug>.hypamoon.app`. 3 to 40 characters, lowercase letters, digits and hyphens. Leave it out to derive it from name (with a short suffix if that one is taken). |
| `name` (required) | string | A name for your own overview, like the business or the page. |
| `files` (required) | object\[\] | All files of the site: complete, ready for a browser, with at least /index.html. At most 50 files, 1 MB per file (also PDF, video and audio) and 5 MB together. |
| `password` | string or null | Optional. One shared password for the whole site (4 to 72 characters): visitors enter it once per browser, like password protection on a preview. Not a login system: no accounts, no per-visitor access. null or an empty string removes it. Never returned; the site shows password\_protected instead. |
| `for_app` | boolean | true: this site will carry a new app (POST /apps with its site\_id next). On the Free plan the site of an app does not count as the project's site. |
| `media` | string\[\] | Optional. Files from the project's media library (list\_media) to put on the site, without uploading them again: folders like "portfolio/" (with subfolders), file ids, or paths like /media/logo.webp. Each file lands at its library path with its 640 version next to it; private originals never go on a site. A file you also send in files wins. |
| `message` | string | Optional, but always send it: what changed and why, in one short sentence (up to 200 characters), like a commit message: "New opening hours for the summer" or "Spring menu, the user asked for it". It shows in the version history; without it Hypamoon writes a short summary like "Changed /index.html". |

JSON

```
{
  "slug": "acme-plumbing",
  "name": "Acme Plumbing",
  "files": [
    {
      "path": "/index.html",
      "content": "<!doctype html><html lang=\"en\"><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><title>Acme Plumbing</title><link rel=\"stylesheet\" href=\"style.css\"></head><body><h1>Acme Plumbing</h1><p>Leaking tap? Call us.</p></body></html>"
    },
    {
      "path": "/style.css",
      "content": "body { font-family: system-ui, sans-serif; max-width: 40rem; margin: 3rem auto; padding: 0 1rem; }"
    }
  ]
}
```

#### 200 With site\_id: the existing site as it is now, as PUT /sites/{id} returns it.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the site. Use it to update or delete the site. |
| `slug` (required) | string | The first part of the address: `https://<slug>.hypamoon.app`. |
| `name` (required) | string | Your name for the site. |
| `url` (required) | string | The public address of the site, live right away. |
| `files` (required) | SiteFile\[\] | The files of the site, sorted by path, without their content. |
| `created_at` (required) | string (date-time) | When the site was created. |
| `updated_at` (required) | string (date-time) | When the site or its files last changed. |
| `version` (required) | string | The version that is live now. Changes on every update; every file on the site carries it as its ETag, so you can check that a page shows this version. |
| `password_protected` (required) | boolean | true when visitors have to enter a password first: the site's shared password (set with password on POST /sites or PUT /sites/{id}) or a personal password per recipient. Passwords themselves are never returned. |
| `test` (required) | boolean | true for a site of a test project. It is public all the same. |
| `security_txt` | `"auto"`, `"off"` | auto: without a /.well-known/security.txt of its own, the site serves one with the project's contact address. off: none from Hypamoon. Set with security\_txt on PUT /sites/{id}. |
| `taken_offline` (required) | object or null | null while the site is live. Set when Hypamoon took the site offline because of abuse: visitors get a page that says it is unavailable, the files are kept, and PUT and DELETE return 403 site\_offline. To object, the owner replies to the email or writes to [hello@hypamoon.com](mailto:hello@hypamoon.com). |
| `warnings` | one of\[\] | Only in the answer of a deploy, and only when there is something to tell: files a deploy without keep\_existing removed, and build hints. Warnings never block a deploy. |

JSON

```
{
  "id": "6a7b8c9d-0e1f-4a2b-9c3d-4e5f6a7b8c9d",
  "slug": "acme-plumbing",
  "name": "Acme Plumbing",
  "url": "https://acme-plumbing.hypamoon.app",
  "files": [
    {
      "path": "/index.html",
      "content_type": "text/html",
      "bytes": 272,
      "updated_at": "2026-10-01T09:00:00.000Z"
    },
    {
      "path": "/style.css",
      "content_type": "text/css",
      "bytes": 98,
      "updated_at": "2026-10-01T09:00:00.000Z"
    }
  ],
  "created_at": "2026-10-01T09:00:00.000Z",
  "updated_at": "2026-10-01T09:00:00.000Z",
  "version": "k3Q9vXbT2mLc8Rw1",
  "password_protected": false,
  "test": false,
  "security_txt": "auto",
  "taken_offline": null
}
```

#### 201 The site, live at url.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the site. Use it to update or delete the site. |
| `slug` (required) | string | The first part of the address: `https://<slug>.hypamoon.app`. |
| `name` (required) | string | Your name for the site. |
| `url` (required) | string | The public address of the site, live right away. |
| `files` (required) | SiteFile\[\] | The files of the site, sorted by path, without their content. |
| `created_at` (required) | string (date-time) | When the site was created. |
| `updated_at` (required) | string (date-time) | When the site or its files last changed. |
| `version` (required) | string | The version that is live now. Changes on every update; every file on the site carries it as its ETag, so you can check that a page shows this version. |
| `password_protected` (required) | boolean | true when visitors have to enter a password first: the site's shared password (set with password on POST /sites or PUT /sites/{id}) or a personal password per recipient. Passwords themselves are never returned. |
| `test` (required) | boolean | true for a site of a test project. It is public all the same. |
| `security_txt` | `"auto"`, `"off"` | auto: without a /.well-known/security.txt of its own, the site serves one with the project's contact address. off: none from Hypamoon. Set with security\_txt on PUT /sites/{id}. |
| `taken_offline` (required) | object or null | null while the site is live. Set when Hypamoon took the site offline because of abuse: visitors get a page that says it is unavailable, the files are kept, and PUT and DELETE return 403 site\_offline. To object, the owner replies to the email or writes to [hello@hypamoon.com](mailto:hello@hypamoon.com). |
| `warnings` | one of\[\] | Only in the answer of a deploy, and only when there is something to tell: files a deploy without keep\_existing removed, and build hints. Warnings never block a deploy. |

JSON

```
{
  "id": "6a7b8c9d-0e1f-4a2b-9c3d-4e5f6a7b8c9d",
  "slug": "acme-plumbing",
  "name": "Acme Plumbing",
  "url": "https://acme-plumbing.hypamoon.app",
  "files": [
    {
      "path": "/index.html",
      "content_type": "text/html",
      "bytes": 272,
      "updated_at": "2026-10-01T09:00:00.000Z"
    },
    {
      "path": "/style.css",
      "content_type": "text/css",
      "bytes": 98,
      "updated_at": "2026-10-01T09:00:00.000Z"
    }
  ],
  "created_at": "2026-10-01T09:00:00.000Z",
  "updated_at": "2026-10-01T09:00:00.000Z",
  "version": "k3Q9vXbT2mLc8Rw1",
  "password_protected": false,
  "test": false,
  "security_txt": "auto",
  "taken_offline": null
}
```

#### 202 Four-eyes approval is on: the deploy waits for another owner or builder. Nothing has changed on the live site yet.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"deploy_approval"` |  |
| `id` (required) | string (uuid) | The id of the request; pass it as approval\_id to approve\_deploy or reject\_deploy. |
| `status` (required) | `"pending"`, `"processing"`, `"approved"`, `"rejected"`, `"failed"`, `"superseded"`, `"expired"` | pending until another owner or builder decides. superseded: a newer deploy of the same site replaced it. expired: after 7 days. |
| `kind` (required) | `"new_site"`, `"site_update"`, `"site_delete"`, `"app_deploy"`, `"app_rollback"` | app\_deploy and app\_rollback: server code of an app (deploy\_app, rollback\_app); files and bytes are its modules. |
| `site_id` (required) | string or null (uuid) |  |
| `name` (required) | string or null |  |
| `slug` (required) | string or null |  |
| `url` (required) | string or null | The address of the site. For an update or deletion it still shows the live version until approval. |
| `files` (required) | integer |  |
| `bytes` (required) | integer |  |
| `password_change` (required) | `"none"`, `"remove"`, `"set"` |  |
| `requested_by` (required) | object |  |
| `requested_at` (required) | string |  |
| `expires_at` (required) | string |  |
| `reviewed_by` (required) | string or null (uuid) |  |
| `reviewed_at` (required) | string or null |  |
| `reason` (required) | string or null |  |
| `result` (required) | object or null |  |

JSON

```
{
  "object": "deploy_approval",
  "id": "8f6c2a51-3d1e-4b7a-9c42-0e5d6f7a8b90",
  "status": "pending",
  "kind": "new_site",
  "site_id": null,
  "name": "Acme Plumbing",
  "slug": "acme-plumbing",
  "url": "https://acme-plumbing.hypamoon.app",
  "files": 2,
  "bytes": 1840,
  "password_change": "none",
  "requested_by": {
    "user_id": "5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a",
    "via": "api",
    "app": "Claude"
  },
  "requested_at": "2026-10-05T10:15:00Z",
  "expires_at": "2026-10-12T10:15:00Z",
  "reviewed_by": null,
  "reviewed_at": null,
  "reason": null,
  "result": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 402 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 403 | [`phone_verification_required`](https://hypamoon.com/docs/errors/phone_verification_required) |
| 409 | [`slug_taken`](https://hypamoon.com/docs/errors/slug_taken) |
| 409 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`site_too_large`](https://hypamoon.com/docs/errors/site_too_large) |
| 422 | [`upload_not_received`](https://hypamoon.com/docs/errors/upload_not_received) |
| 422 | [`slug_reserved`](https://hypamoon.com/docs/errors/slug_reserved) |
| 422 | [`site_limit_reached`](https://hypamoon.com/docs/errors/site_limit_reached) |
| 422 | [`site_blocked`](https://hypamoon.com/docs/errors/site_blocked) |
| 429 | [`site_limit_reached`](https://hypamoon.com/docs/errors/site_limit_reached) |
| 429 | [`deploy_limit_reached`](https://hypamoon.com/docs/errors/deploy_limit_reached) |

### POST /sites/uploads

**Get upload links for large files.**

For files too large to send inline (one request to the API stays under 4 MB). Send path, sha256 and bytes for each file; the response contains an upload\_url for each file. PUT the exact bytes to it within 15 minutes (curl -T file '<upload\_url>'); the upload checks size, SHA-256 and the type of the bytes (422 type\_mismatch) and stores the file. Video and audio above the inline limit (paid plans: up to the bytes\_per\_media limit) can only be uploaded this way. Then deploy with POST /sites or PUT /sites/{id}, naming the file with path, sha256 and bytes instead of content. A file another site of this project already has needs no new upload. The size is checked against the limits of the project's plan. At most 50 files, 1 MB per file (also PDF, video and audio) and 5 MB together.

Scope: `sites:write`

#### Request body

Ask for upload links for files that are too large to send inline.

| Field | Type |  |
| --- | --- | --- |
| `site_id` | string (uuid) | Optional. The site the files are for, when you change an existing one (from deploy\_site or list\_sites). Leave it out for a new site. |
| `files` (required) | object\[\] | The files to upload, at most 200 per request. |

JSON

```
{
  "files": [
    {
      "path": "/img/hero.jpg",
      "sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
      "bytes": 2483112
    }
  ]
}
```

#### 201 The upload links.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] | One upload link per file, in the order you sent them. |
| `hint` (required) | string | What to do when the PUT to upload\_url fails from your environment (a sandbox may block it). |
| `limits` (required) | object | The site limits of this project's plan. |

JSON

```
{
  "data": [
    {
      "path": "/img/hero.jpg",
      "sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
      "bytes": 2483112,
      "content_type": "image/jpeg",
      "upload_url": "https://hypamoon.app/_hypamoon/upload?t=eyJvIjoi...",
      "method": "PUT",
      "expires_at": "2026-10-06T10:15:00.000Z"
    }
  ],
  "hint": "If your environment cannot reach the upload_url (a sandbox may block it), send images under ~3 MB as base64 in deploy_site content instead, or create a drop link (create_drop_link) so the user uploads the files in a browser. Files that are already online go as source_url in deploy_site (up to 100 per call). For many local files, ask the user to add them at https://app.hypamoon.com/media, then deploy with the same path, sha256 and bytes.",
  "limits": {
    "files": 200,
    "bytes_per_file": 5242880,
    "bytes_per_site": 52428800,
    "bytes_per_pdf": 10485760,
    "bytes_per_media": 10485760
  }
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`site_offline`](https://hypamoon.com/docs/errors/site_offline) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`site_too_large`](https://hypamoon.com/docs/errors/site_too_large) |

### POST /sites/drops

**Create a drop link where the user uploads files in a browser.**

For when your environment cannot reach an upload\_url (a sandbox in a chat app may block it), or the user has the files and you do not. Returns an upload page, `https://app.hypamoon.com/drop/<token>`, open for 24 hours or until the user presses Done, for this project (and the site, with site\_id). The user opens it without signing in and drags files, a whole folder (folders stay folders under /media/<folder>/) or a zip, or chooses or takes photos on a phone; up to 100 files per link, within the plan's limits. Photos are made web-ready in the browser: a WebP of at most 2048 px plus a 640 px version, and the original is kept privately next to them (only an original larger than the plan allows per file is left out). An SVG (a logo or icon, at most 1 MB) goes on the site as it is, but only when it is plain drawing: an SVG with scripts, event handlers or links outside the file is refused. With site\_id, Done puts the files on the site as a new version (site\_version in GET /sites/drops/{id}); send only the HTML with keep\_existing. Without site\_id, GET /sites/drops/{id} lists the files with path, sha256 and bytes; deploy them with POST /sites or PUT /sites/{id} without content. The url is only in this response; the token is stored as a hash. user\_message is a sentence to give the user with the link.

Scope: `sites:write`

#### Request body

Create a drop link: a page where the user uploads files and whole folders in a browser.

| Field | Type |  |
| --- | --- | --- |
| `site_id` | string (uuid) | Optional. The site the files are for (from deploy\_site or list\_sites). Leave it out for a new site. |
| `strip` | `"location"`, `"all"`, `"none"` | Optional. What the upload page removes, in the user's browser before upload, from photos (JPEG, PNG, WebP) it keeps as they are: originals the user chooses to keep, and photos that would not get smaller as WebP. location (default) removes only the GPS location and keeps camera, date, orientation and copyright; all removes all metadata (the orientation stays so photos stay upright); none keeps the files as they are. Web versions are re-encoded and carry no metadata at all. Use all or none only when the user asks for it. |
| `folder` | string | Optional. The folder under /media/ where the files land, like portfolio or menu/2026. Folders the user drags keep their structure inside it: /media/portfolio/project-12/03.webp. Leave it out to use the user's own folder names. |
| `as_is` | boolean | Optional. For moving an existing site (like WordPress uploads): true keeps every file exactly as it is, with no web versions, the same name and extension, and the exact folder path the user drags, under /media/<folder>/. |
| `keep_zip` | boolean | Optional. true keeps a .zip the user adds as one file (a download, like a plugin or a pack of files) instead of unpacking it. On a site it is served as a download; the deploy check refuses a zip with a program, a password or another archive inside. |

JSON

```
{}
```

#### 201 The drop link.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the drop link; pass it to get\_drop (GET /sites/drops/{id}). |
| `status` (required) | `"open"`, `"done"`, `"expired"` | open: waiting for the user. done: the user uploaded the files. expired: 24 hours passed; create a new one. |
| `site_id` (required) | string or null (uuid) | The site the link is for, or null. |
| `created_at` (required) | string |  |
| `expires_at` (required) | string | When the link stops working (24 hours after it was made). |
| `completed_at` (required) | string or null | When the user finished uploading, or null. |
| `images_only` (required) | boolean | True when the link only takes images (an editor made it). |
| `as_is` | boolean | True when files are kept exactly as they are (for moving a site): no web versions, same names, and paths that follow the user's folders exactly. |
| `keep_zip` | boolean | True when a .zip stays one file (a download) instead of being unpacked. |
| `strip` (required) | `"location"`, `"all"`, `"none"` | What the upload page removes from photos before upload: location (the default, only the GPS location), all (all metadata) or none. Web versions are re-encoded and carry no metadata at all. |
| `folder` (required) | string or null | The folder under /media/ the files land in, or null for the user's own folder names. |
| `max_files` (required) | integer | How many files the user can add with this link (a photo with its versions counts once). |
| `files` (required) | object\[\] | The files that arrived, in order. Private originals are not listed. |
| `originals_kept` (required) | integer | How many originals were kept. They are private: never on a site, only downloadable in the portal. |
| `site_version` (required) | object or null | With site\_id, after the user pressed Done: the new version of the site with these files (waiting: it waits for four-eyes approval). The files are already on the site; send only HTML with keep\_existing. |
| `deploy_files` (required) | object\[\] | The same files in the form deploy\_site takes: add them to files, without content. |
| `url` | string | Only when the link is created: the page to give the user. It is not shown again. |
| `user_message` | string | A sentence to give the user. |
| `next_step` | string | What to do next. |

JSON

```
{
  "id": "3f1c2a9e-5b7d-4e8f-9a0b-1c2d3e4f5a6b",
  "status": "open",
  "site_id": null,
  "created_at": "2026-10-01T09:00:00.000Z",
  "expires_at": "2026-10-02T09:00:00.000Z",
  "completed_at": null,
  "images_only": false,
  "strip": "location",
  "folder": "portfolio",
  "max_files": 100,
  "files": [],
  "originals_kept": 0,
  "site_version": null,
  "deploy_files": [],
  "url": "https://app.hypamoon.com/drop/hmd_4fT0aQ8xK2mPq7RsV1wYz3Bc5De6Fg9H",
  "user_message": "Open this link in your browser and drag your files or a whole folder onto the page (on a phone: choose or take photos). Press Done when everything is in, then come back here and tell me. The link works for 24 hours.",
  "next_step": "Give the user the url and wait until they say they are done. Then call get_drop with drop_id 3f1c2a9e-5b7d-4e8f-9a0b-1c2d3e4f5a6b, and deploy_site with its deploy_files added to files (no content; you may change a path, keep sha256 and bytes). Never send the images through the chat."
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`site_offline`](https://hypamoon.com/docs/errors/site_offline) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /sites/drops/{id}

**Get a drop link and the files the user uploaded.**

status is open (waiting for the user), done (the user pressed Done) or expired (after 24 hours). files lists what arrived (photos with variant 2048 or 640, width and height; private originals are not listed); deploy\_files is the same list in the form POST /sites and PUT /sites/{id} take (path, sha256, bytes, no content). With site\_id and status done, site\_version is the new version of the site that already has these files: send only the HTML. You may give a file another path in the deploy; keep its sha256 and bytes.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the drop link. |

#### 200 The drop link and its files.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the drop link; pass it to get\_drop (GET /sites/drops/{id}). |
| `status` (required) | `"open"`, `"done"`, `"expired"` | open: waiting for the user. done: the user uploaded the files. expired: 24 hours passed; create a new one. |
| `site_id` (required) | string or null (uuid) | The site the link is for, or null. |
| `created_at` (required) | string |  |
| `expires_at` (required) | string | When the link stops working (24 hours after it was made). |
| `completed_at` (required) | string or null | When the user finished uploading, or null. |
| `images_only` (required) | boolean | True when the link only takes images (an editor made it). |
| `as_is` | boolean | True when files are kept exactly as they are (for moving a site): no web versions, same names, and paths that follow the user's folders exactly. |
| `keep_zip` | boolean | True when a .zip stays one file (a download) instead of being unpacked. |
| `strip` (required) | `"location"`, `"all"`, `"none"` | What the upload page removes from photos before upload: location (the default, only the GPS location), all (all metadata) or none. Web versions are re-encoded and carry no metadata at all. |
| `folder` (required) | string or null | The folder under /media/ the files land in, or null for the user's own folder names. |
| `max_files` (required) | integer | How many files the user can add with this link (a photo with its versions counts once). |
| `files` (required) | object\[\] | The files that arrived, in order. Private originals are not listed. |
| `originals_kept` (required) | integer | How many originals were kept. They are private: never on a site, only downloadable in the portal. |
| `site_version` (required) | object or null | With site\_id, after the user pressed Done: the new version of the site with these files (waiting: it waits for four-eyes approval). The files are already on the site; send only HTML with keep\_existing. |
| `deploy_files` (required) | object\[\] | The same files in the form deploy\_site takes: add them to files, without content. |
| `url` | string | Only when the link is created: the page to give the user. It is not shown again. |
| `user_message` | string | A sentence to give the user. |
| `next_step` | string | What to do next. |

JSON

```
{
  "id": "3f1c2a9e-5b7d-4e8f-9a0b-1c2d3e4f5a6b",
  "status": "done",
  "site_id": null,
  "created_at": "2026-10-01T09:00:00.000Z",
  "expires_at": "2026-10-02T09:00:00.000Z",
  "completed_at": "2026-10-01T09:04:00.000Z",
  "images_only": false,
  "strip": "location",
  "folder": "portfolio",
  "max_files": 100,
  "files": [
    {
      "path": "/media/portfolio/project-12/03.webp",
      "sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
      "bytes": 384112,
      "content_type": "image/webp",
      "name": "03.jpg",
      "variant": "2048",
      "width": 2048,
      "height": 1365
    },
    {
      "path": "/media/portfolio/project-12/03-640.webp",
      "sha256": "3a6eb0790f39ac87c94f3856b2dd2c5d110e6811602261a9a923d3bb23adc8b7",
      "bytes": 41240,
      "content_type": "image/webp",
      "name": "03.jpg",
      "variant": "640",
      "width": 640,
      "height": 427
    }
  ],
  "originals_kept": 0,
  "site_version": null,
  "deploy_files": [
    {
      "path": "/media/portfolio/project-12/03.webp",
      "sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
      "bytes": 384112
    },
    {
      "path": "/media/portfolio/project-12/03-640.webp",
      "sha256": "3a6eb0790f39ac87c94f3856b2dd2c5d110e6811602261a9a923d3bb23adc8b7",
      "bytes": 41240
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### GET /sites/{id}

**Get a site.**

One site with its url and its files, without their content.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the site. |

#### 200 The site.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the site. Use it to update or delete the site. |
| `slug` (required) | string | The first part of the address: `https://<slug>.hypamoon.app`. |
| `name` (required) | string | Your name for the site. |
| `url` (required) | string | The public address of the site, live right away. |
| `files` (required) | SiteFile\[\] | The files of the site, sorted by path, without their content. |
| `created_at` (required) | string (date-time) | When the site was created. |
| `updated_at` (required) | string (date-time) | When the site or its files last changed. |
| `version` (required) | string | The version that is live now. Changes on every update; every file on the site carries it as its ETag, so you can check that a page shows this version. |
| `password_protected` (required) | boolean | true when visitors have to enter a password first: the site's shared password (set with password on POST /sites or PUT /sites/{id}) or a personal password per recipient. Passwords themselves are never returned. |
| `test` (required) | boolean | true for a site of a test project. It is public all the same. |
| `security_txt` | `"auto"`, `"off"` | auto: without a /.well-known/security.txt of its own, the site serves one with the project's contact address. off: none from Hypamoon. Set with security\_txt on PUT /sites/{id}. |
| `taken_offline` (required) | object or null | null while the site is live. Set when Hypamoon took the site offline because of abuse: visitors get a page that says it is unavailable, the files are kept, and PUT and DELETE return 403 site\_offline. To object, the owner replies to the email or writes to [hello@hypamoon.com](mailto:hello@hypamoon.com). |
| `warnings` | one of\[\] | Only in the answer of a deploy, and only when there is something to tell: files a deploy without keep\_existing removed, and build hints. Warnings never block a deploy. |

JSON

```
{
  "id": "6a7b8c9d-0e1f-4a2b-9c3d-4e5f6a7b8c9d",
  "slug": "acme-plumbing",
  "name": "Acme Plumbing",
  "url": "https://acme-plumbing.hypamoon.app",
  "files": [
    {
      "path": "/index.html",
      "content_type": "text/html",
      "bytes": 272,
      "updated_at": "2026-10-01T09:00:00.000Z"
    },
    {
      "path": "/style.css",
      "content_type": "text/css",
      "bytes": 98,
      "updated_at": "2026-10-01T09:00:00.000Z"
    }
  ],
  "created_at": "2026-10-01T09:00:00.000Z",
  "updated_at": "2026-10-01T09:00:00.000Z",
  "version": "k3Q9vXbT2mLc8Rw1",
  "password_protected": false,
  "test": false,
  "security_txt": "auto",
  "taken_offline": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### PUT /sites/{id}

**Change the files, the name or the password of a site.**

Changes the name, the files, the password, or a combination. The slug and the url stay the same. The usual way is a partial update with keep\_existing: true: only the files in files are added or replaced, delete\_paths removes files, every other file stays, so images already on the site are never sent again. A partial update needs if\_match\_version, the version from GET; if the site has changed since, or if\_match\_version is missing, the request returns 409 version\_conflict with current\_version and nothing changes. Without keep\_existing, files is the complete new set of files: a file you leave out is removed, and the response lists those paths in warnings (code files\_removed). With version history, send message (what changed and why) so the history reads like a logbook; without it Hypamoon writes a short summary like "Replaced 6 files with 1, -88% size". Guardrail: an update without keep\_existing that removes more than half of the files, makes the site more than half smaller, or rewrites more than 70% of /index.html while other files disappear, does not go live. It becomes a preview (preview.url, version\_id) and the response has guardrail with what would disappear in plain words; the version that was live gets auto\_label "before big change". Ask the user, then publish the preview with POST /sites/{id}/versions/{versionId}/promote, or send the update again with confirm\_replace: true. preview: true makes a preview on purpose. Files can come as source\_url instead of content, as with POST /sites. source\_url: Hypamoon fetches the file once from a public https URL on port 443 (no IP address or internal host, at most 3 redirects, each checked again; 10 s per file) within the plan's size limits. Its type must match the path: an image or font is recognized by its bytes, text must be UTF-8 and not a web page where a .css or .js was expected. The fetched file then goes through the same checks as one sent with content. A file that cannot be fetched returns 422 with the reason at files.<i>.source\_url, and nothing changes. At most 100 files with source\_url per request and 60 such requests per project per hour (429 rate\_limited). The limits, the abuse checks and four-eyes approval always apply to the whole site as it will be after the update; a 202 requests approval for that whole site. The new version is live as soon as this request returns, for every visitor and as a whole: all files switch together, never a new page with old css. version in the response is the new one. A static site has no logins or server-side code of its own. To share it with a few people, set password (one shared password, entered once per browser) or make it unlisted; paid access gives each buyer a personal sign-in link. For server-side code and sign-in per user, add an app with auth to the site (POST /apps). Not yet: files over the limits. Every deploy is checked before it goes live: input fields for passwords, PIN codes, card numbers or IBANs, forms that send to another site, hidden iframes, redirects to another site, obfuscated scripts, and login fields next to the name of a bank, government service, parcel or payment service or large platform return 422 site\_blocked with the reasons. A new project has a lower limit on deploys per hour and on sites in its first week (deploy\_limit\_reached, site\_limit\_reached). Setting or changing password logs every visitor out (they enter the new one once); null or an empty string removes it and makes the site open to everyone. Sending the same password again changes nothing. A site that was open may still come from the CDN for up to a minute after its first password is set; after that nothing of it is cached.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the site. |

#### Request body

Change a site: a new name, new files, a password (or null to remove it), or a combination. The slug stays the same. The usual way: send only the changed files with keep\_existing: true and if\_match\_version, images preferably as source\_url.

| Field | Type |  |
| --- | --- | --- |
| `name` | string | A name for your own overview, like the business or the page. |
| `files` | object\[\] | Usually with keep\_existing: true: only the files you add or change; every other file stays as it is, so never send images that are already on the site again. Without keep\_existing, files is the complete new set of files: a file you leave out is removed, and the answer lists it in warnings. |
| `keep_existing` | boolean | true: a partial update. Only the files in files are added or replaced, delete\_paths removes files, and every other file stays. Needs if\_match\_version. The limits, the checks and four-eyes approval apply to the whole site as it will be after the update. |
| `delete_paths` | string\[\] | Only with keep\_existing: true. Paths of existing files to remove, like /old.html. A path that is not on the site is an error. |
| `media` | string\[\] | Optional. Files from the project's media library (list\_media) to put on the site, without uploading them again: folders like "portfolio/" (with subfolders), file ids, or paths like /media/logo.webp. Each file lands at its library path with its 640 version next to it; private originals never go on a site. A file you also send in files wins. |
| `if_match_version` | string | The version of the site you are changing, from list\_sites, get\_site or the last deploy (version). Required with keep\_existing. If the site changed since, you get 409 version\_conflict with current\_version and nothing changes: read the site again and redo your change. |
| `password` | string or null | Optional. One shared password for the whole site (4 to 72 characters): visitors enter it once per browser, like password protection on a preview. Not a login system: no accounts, no per-visitor access. null or an empty string removes it. Never returned; the site shows password\_protected instead. |
| `security_txt` | `"auto"`, `"off"` | auto (default): when the site has no /.well-known/security.txt of its own, Hypamoon serves one with the project's contact address (the shop contact\_email, else the billing email; none set means no file). off: no security.txt from Hypamoon. A file of your own at that path always wins. |
| `message` | string | Optional, but always send it: what changed and why, in one short sentence (up to 200 characters), like a commit message: "New opening hours for the summer" or "Spring menu, the user asked for it". It shows in the version history; without it Hypamoon writes a short summary like "Changed /index.html". |
| `preview` | boolean | true: do not put this change live. It becomes a preview version at a secret link (preview.url in the answer, not indexed), and the live site stays as it is. Put it live later with promote\_site\_version. Only files (with keep\_existing as usual), no name or password. Use it for large changes the user should see first. |
| `confirm_replace` | boolean | Only after the user agreed. A deploy without keep\_existing that removes more than half of the files, makes the site more than half smaller, or rewrites most of /index.html while other files disappear, is held as a preview instead of going live (guardrail in the answer). Send confirm\_replace: true only when the user has said yes to replacing the site like that; then it goes live right away. |

JSON

```
{
  "files": [
    {
      "path": "/index.html",
      "content": "<!doctype html><html lang=\"en\"><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><title>Acme Plumbing</title><link rel=\"stylesheet\" href=\"style.css\"></head><body><h1>Acme Plumbing</h1><p>Leaking tap? Call us.</p></body></html>"
    },
    {
      "path": "/style.css",
      "content": "body { font-family: system-ui, sans-serif; max-width: 40rem; margin: 3rem auto; padding: 0 1rem; }"
    }
  ],
  "password": "spring-tour-2027"
}
```

#### 200 The site as it is now.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the site. Use it to update or delete the site. |
| `slug` (required) | string | The first part of the address: `https://<slug>.hypamoon.app`. |
| `name` (required) | string | Your name for the site. |
| `url` (required) | string | The public address of the site, live right away. |
| `files` (required) | SiteFile\[\] | The files of the site, sorted by path, without their content. |
| `created_at` (required) | string (date-time) | When the site was created. |
| `updated_at` (required) | string (date-time) | When the site or its files last changed. |
| `version` (required) | string | The version that is live now. Changes on every update; every file on the site carries it as its ETag, so you can check that a page shows this version. |
| `password_protected` (required) | boolean | true when visitors have to enter a password first: the site's shared password (set with password on POST /sites or PUT /sites/{id}) or a personal password per recipient. Passwords themselves are never returned. |
| `test` (required) | boolean | true for a site of a test project. It is public all the same. |
| `security_txt` | `"auto"`, `"off"` | auto: without a /.well-known/security.txt of its own, the site serves one with the project's contact address. off: none from Hypamoon. Set with security\_txt on PUT /sites/{id}. |
| `taken_offline` (required) | object or null | null while the site is live. Set when Hypamoon took the site offline because of abuse: visitors get a page that says it is unavailable, the files are kept, and PUT and DELETE return 403 site\_offline. To object, the owner replies to the email or writes to [hello@hypamoon.com](mailto:hello@hypamoon.com). |
| `warnings` | one of\[\] | Only in the answer of a deploy, and only when there is something to tell: files a deploy without keep\_existing removed, and build hints. Warnings never block a deploy. |

JSON

```
{
  "id": "6a7b8c9d-0e1f-4a2b-9c3d-4e5f6a7b8c9d",
  "slug": "acme-plumbing",
  "name": "Acme Plumbing",
  "url": "https://acme-plumbing.hypamoon.app",
  "files": [
    {
      "path": "/index.html",
      "content_type": "text/html",
      "bytes": 272,
      "updated_at": "2026-10-01T09:00:00.000Z"
    },
    {
      "path": "/style.css",
      "content_type": "text/css",
      "bytes": 98,
      "updated_at": "2026-10-01T09:00:00.000Z"
    }
  ],
  "created_at": "2026-10-01T09:00:00.000Z",
  "updated_at": "2026-10-01T09:00:00.000Z",
  "version": "k3Q9vXbT2mLc8Rw1",
  "password_protected": true,
  "test": false,
  "security_txt": "auto",
  "taken_offline": null
}
```

#### 202 Four-eyes approval is on: the update waits for another owner or builder. Nothing has changed on the live site yet.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"deploy_approval"` |  |
| `id` (required) | string (uuid) | The id of the request; pass it as approval\_id to approve\_deploy or reject\_deploy. |
| `status` (required) | `"pending"`, `"processing"`, `"approved"`, `"rejected"`, `"failed"`, `"superseded"`, `"expired"` | pending until another owner or builder decides. superseded: a newer deploy of the same site replaced it. expired: after 7 days. |
| `kind` (required) | `"new_site"`, `"site_update"`, `"site_delete"`, `"app_deploy"`, `"app_rollback"` | app\_deploy and app\_rollback: server code of an app (deploy\_app, rollback\_app); files and bytes are its modules. |
| `site_id` (required) | string or null (uuid) |  |
| `name` (required) | string or null |  |
| `slug` (required) | string or null |  |
| `url` (required) | string or null | The address of the site. For an update or deletion it still shows the live version until approval. |
| `files` (required) | integer |  |
| `bytes` (required) | integer |  |
| `password_change` (required) | `"none"`, `"remove"`, `"set"` |  |
| `requested_by` (required) | object |  |
| `requested_at` (required) | string |  |
| `expires_at` (required) | string |  |
| `reviewed_by` (required) | string or null (uuid) |  |
| `reviewed_at` (required) | string or null |  |
| `reason` (required) | string or null |  |
| `result` (required) | object or null |  |

JSON

```
{
  "object": "deploy_approval",
  "id": "8f6c2a51-3d1e-4b7a-9c42-0e5d6f7a8b90",
  "status": "pending",
  "kind": "site_update",
  "site_id": "3b2f9c1e-7a4d-4e8b-b5c6-1d2e3f4a5b6c",
  "name": "Acme Plumbing",
  "slug": "acme-plumbing",
  "url": "https://acme-plumbing.hypamoon.app",
  "files": 2,
  "bytes": 1840,
  "password_change": "none",
  "requested_by": {
    "user_id": "5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a",
    "via": "api",
    "app": "Claude"
  },
  "requested_at": "2026-10-05T10:15:00Z",
  "expires_at": "2026-10-12T10:15:00Z",
  "reviewed_by": null,
  "reviewed_at": null,
  "reason": null,
  "result": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`site_offline`](https://hypamoon.com/docs/errors/site_offline) |
| 403 | [`phone_verification_required`](https://hypamoon.com/docs/errors/phone_verification_required) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`version_conflict`](https://hypamoon.com/docs/errors/version_conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`site_too_large`](https://hypamoon.com/docs/errors/site_too_large) |
| 422 | [`upload_not_received`](https://hypamoon.com/docs/errors/upload_not_received) |
| 422 | [`site_blocked`](https://hypamoon.com/docs/errors/site_blocked) |
| 429 | [`deploy_limit_reached`](https://hypamoon.com/docs/errors/deploy_limit_reached) |

### DELETE /sites/{id}

**Delete a site.**

Takes the site offline right away and removes it from the list. Its files and versions are kept for 30 days: POST /sites/{id}/restore puts it back, and GET /sites/deleted lists what can still be restored. After 30 days everything is erased for good. With permanent=true everything is erased right away and the site cannot be restored, also for a site that was already deleted; use it only when the owner explicitly asks for that. The slug stays taken, so an old link never shows someone else's site. Deleting it again returns 204 as well. A site Hypamoon took offline (taken\_offline) cannot be deleted: 403 site\_offline.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the site. |
| `permanent` | query | boolean | true erases the site and its files right away, without the 30 days to restore it. Only when the owner explicitly asks for it. |

#### 202 Four-eyes approval is on: the deletion waits for another owner or builder. Nothing has changed on the live site yet.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"deploy_approval"` |  |
| `id` (required) | string (uuid) | The id of the request; pass it as approval\_id to approve\_deploy or reject\_deploy. |
| `status` (required) | `"pending"`, `"processing"`, `"approved"`, `"rejected"`, `"failed"`, `"superseded"`, `"expired"` | pending until another owner or builder decides. superseded: a newer deploy of the same site replaced it. expired: after 7 days. |
| `kind` (required) | `"new_site"`, `"site_update"`, `"site_delete"`, `"app_deploy"`, `"app_rollback"` | app\_deploy and app\_rollback: server code of an app (deploy\_app, rollback\_app); files and bytes are its modules. |
| `site_id` (required) | string or null (uuid) |  |
| `name` (required) | string or null |  |
| `slug` (required) | string or null |  |
| `url` (required) | string or null | The address of the site. For an update or deletion it still shows the live version until approval. |
| `files` (required) | integer |  |
| `bytes` (required) | integer |  |
| `password_change` (required) | `"none"`, `"remove"`, `"set"` |  |
| `requested_by` (required) | object |  |
| `requested_at` (required) | string |  |
| `expires_at` (required) | string |  |
| `reviewed_by` (required) | string or null (uuid) |  |
| `reviewed_at` (required) | string or null |  |
| `reason` (required) | string or null |  |
| `result` (required) | object or null |  |

JSON

```
{
  "object": "deploy_approval",
  "id": "8f6c2a51-3d1e-4b7a-9c42-0e5d6f7a8b90",
  "status": "pending",
  "kind": "site_delete",
  "site_id": "3b2f9c1e-7a4d-4e8b-b5c6-1d2e3f4a5b6c",
  "name": "Acme Plumbing",
  "slug": "acme-plumbing",
  "url": "https://acme-plumbing.hypamoon.app",
  "files": 0,
  "bytes": 0,
  "password_change": "none",
  "requested_by": {
    "user_id": "5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a",
    "via": "api",
    "app": "Claude"
  },
  "requested_at": "2026-10-05T10:15:00Z",
  "expires_at": "2026-10-12T10:15:00Z",
  "reviewed_by": null,
  "reviewed_at": null,
  "reason": null,
  "result": null
}
```

#### 204 Deleted. Without permanent the site can be restored for 30 days.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`site_offline`](https://hypamoon.com/docs/errors/site_offline) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### GET /sites/deleted

**List the deleted sites that can be restored.**

The sites deleted in the last 30 days that can still be restored with POST /sites/{id}/restore, most recently deleted first, each with restore\_until. A site deleted with permanent=true is not listed.

Scope: `sites:read`

#### 200 The deleted sites.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | DeletedSite\[\] | The deleted sites that can still be restored, most recently deleted first. |

JSON

```
{
  "data": [
    {
      "id": "6a7b8c9d-0e1f-4a2b-9c3d-4e5f6a7b8c9d",
      "slug": "acme-plumbing",
      "name": "Acme Plumbing",
      "deleted_at": "2026-10-14T09:00:00.000Z",
      "restore_until": "2026-11-13T09:00:00.000Z",
      "test": true
    }
  ]
}
```

### POST /sites/{id}/restore

**Restore a deleted site.**

Puts a site that was deleted in the last 30 days back live at its old address, with its files, password, visibility and versions. Not restored: an app that ran on the site (deploy it again) and a custom domain (connect it again); restore\_notes says so. The plan's site limit applies, as for a new site. A site that was deleted permanently, or more than 30 days ago, cannot be restored (409).

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the site. |

#### 200 The site, live again.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the site. Use it to update or delete the site. |
| `slug` (required) | string | The first part of the address: `https://<slug>.hypamoon.app`. |
| `name` (required) | string | Your name for the site. |
| `url` (required) | string | The public address of the site, live right away. |
| `files` (required) | SiteFile\[\] | The files of the site, sorted by path, without their content. |
| `created_at` (required) | string (date-time) | When the site was created. |
| `updated_at` (required) | string (date-time) | When the site or its files last changed. |
| `version` (required) | string | The version that is live now. Changes on every update; every file on the site carries it as its ETag, so you can check that a page shows this version. |
| `password_protected` (required) | boolean | true when visitors have to enter a password first: the site's shared password (set with password on POST /sites or PUT /sites/{id}) or a personal password per recipient. Passwords themselves are never returned. |
| `test` (required) | boolean | true for a site of a test project. It is public all the same. |
| `security_txt` | `"auto"`, `"off"` | auto: without a /.well-known/security.txt of its own, the site serves one with the project's contact address. off: none from Hypamoon. Set with security\_txt on PUT /sites/{id}. |
| `taken_offline` (required) | object or null | null while the site is live. Set when Hypamoon took the site offline because of abuse: visitors get a page that says it is unavailable, the files are kept, and PUT and DELETE return 403 site\_offline. To object, the owner replies to the email or writes to [hello@hypamoon.com](mailto:hello@hypamoon.com). |
| `warnings` | one of\[\] | Only in the answer of a deploy, and only when there is something to tell: files a deploy without keep\_existing removed, and build hints. Warnings never block a deploy. |
| `visibility` | `"public"`, `"unlisted"` | public or unlisted, as before the site was deleted. |
| `restore_notes` (required) | string\[\] | What did not come back with the site (an app on it, a custom domain), and how to set it up again. |

JSON

```
{
  "id": "6a7b8c9d-0e1f-4a2b-9c3d-4e5f6a7b8c9d",
  "slug": "acme-plumbing",
  "name": "Acme Plumbing",
  "url": "https://acme-plumbing.hypamoon.app",
  "files": [
    {
      "path": "/index.html",
      "content_type": "text/html",
      "bytes": 272,
      "updated_at": "2026-10-01T09:00:00.000Z"
    },
    {
      "path": "/style.css",
      "content_type": "text/css",
      "bytes": 98,
      "updated_at": "2026-10-01T09:00:00.000Z"
    }
  ],
  "created_at": "2026-10-01T09:00:00.000Z",
  "updated_at": "2026-10-01T09:00:00.000Z",
  "version": "k3Q9vXbT2mLc8Rw1",
  "password_protected": false,
  "test": false,
  "security_txt": "auto",
  "taken_offline": null,
  "restore_notes": [
    "A custom domain was disconnected from the site; connect it again with connect_domain."
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 402 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 403 | [`site_offline`](https://hypamoon.com/docs/errors/site_offline) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`site_limit_reached`](https://hypamoon.com/docs/errors/site_limit_reached) |
| 429 | [`site_limit_reached`](https://hypamoon.com/docs/errors/site_limit_reached) |

### GET /sites/address-suggestions

**Suggest an address for a site.**

Checks the address the user wants (slug) and suggests up to three available ones based on name. Use it before POST /sites to show the user a suggestion and let them pick or change it. Nothing is reserved. Names that look like a bank, login, payment or support page, a brand, or anything with hypamoon in it are refused.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `name` | query | string | The name of the site or business, like Acme Plumbing. |
| `slug` | query | string | The address the user would like, like acme-plumbing. |

#### 200 The requested address, checked, and available suggestions.

| Field | Type |  |
| --- | --- | --- |
| `requested` (required) | object or null | The slug you sent, checked. null without slug. |
| `suggestions` (required) | object\[\] | Up to three free addresses derived from name. Nothing is reserved: whoever uses one first gets it. |

JSON

```
{
  "requested": {
    "slug": "acme",
    "available": false,
    "reason": "Taken by another site.",
    "url": "https://acme.hypamoon.app"
  },
  "suggestions": [
    {
      "slug": "acme-plumbing",
      "url": "https://acme-plumbing.hypamoon.app"
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### PUT /sites/{id}/address

**Change the address or visibility of a site.**

Renames a site (slug) and/or switches it between public and unlisted. After a rename the old address redirects (301) to the new one for 90 days, then stays reserved for this project for 30 more days without redirecting, so nobody can grab it right away; after that it is free again. At most 2 old addresses redirect at a time (a new rename stops the oldest), every redirect goes straight to the current address, and a site that is offline, unlisted or deleted has no redirects. A site's address can change at most 3 times per 30 days, and at most 10 times per project per 30 days: past that the answer is 429 rate\_limited with retry\_at and a user\_message that says when it can change again. A connected domain stays on the site, and public tokens keep working on every redirecting address of the same site. unlisted puts the site on a secret link (url in the response, 26 random characters, no name in it): the readable address and old addresses give 404, pages are sent with noindex and no-referrer. A secret link is not a login: anyone who has it can open the site. For real protection set a password as well (PUT /sites/{id}). A site on a domain cannot be unlisted. Four-eyes approval applies, just as for a deploy.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the site. |

#### Request body

Change the address of a site, its visibility, or both.

| Field | Type |  |
| --- | --- | --- |
| `slug` | string | The new address: `https://<slug>.hypamoon.app`, 3 to 40 characters, lowercase letters, digits and hyphens. The old address keeps redirecting (301) to the new one and stays reserved for this project, so nobody else can take it. A connected domain stays on the site. |
| `visibility` | `"public"`, `"unlisted"` | public: the site lives at `https://<slug>.hypamoon.app`. unlisted: the site only lives at a secret link (`https://<random>.hypamoon.app`, 26 random characters, no name in it), the readable address gives 404, and search engines are told not to index it. A secret link is not a login: anyone who has the link can open the site. For real protection set a password as well. |

JSON

```
{
  "slug": "acme-plumbing-rotterdam"
}
```

#### 200 The site with its new address.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the site. Use it to update or delete the site. |
| `slug` (required) | string | The first part of the address: `https://<slug>.hypamoon.app`. |
| `name` (required) | string | Your name for the site. |
| `url` (required) | string | Where the site lives: `https://<slug>.hypamoon.app`, or the secret link when visibility is unlisted. |
| `files` (required) | SiteFile\[\] | The files of the site, sorted by path, without their content. |
| `created_at` (required) | string (date-time) | When the site was created. |
| `updated_at` (required) | string (date-time) | When the site or its files last changed. |
| `version` (required) | string | The version that is live now. Changes on every update; every file on the site carries it as its ETag, so you can check that a page shows this version. |
| `password_protected` (required) | boolean | true when visitors have to enter a password first: the site's shared password (set with password on POST /sites or PUT /sites/{id}) or a personal password per recipient. Passwords themselves are never returned. |
| `test` (required) | boolean | true for a site of a test project. It is public all the same. |
| `security_txt` | `"auto"`, `"off"` | auto: without a /.well-known/security.txt of its own, the site serves one with the project's contact address. off: none from Hypamoon. Set with security\_txt on PUT /sites/{id}. |
| `taken_offline` (required) | object or null | null while the site is live. Set when Hypamoon took the site offline because of abuse: visitors get a page that says it is unavailable, the files are kept, and PUT and DELETE return 403 site\_offline. To object, the owner replies to the email or writes to [hello@hypamoon.com](mailto:hello@hypamoon.com). |
| `warnings` | one of\[\] | Only in the answer of a deploy, and only when there is something to tell: files a deploy without keep\_existing removed, and build hints. Warnings never block a deploy. |
| `visibility` (required) | `"public"`, `"unlisted"` | public: the site lives at `https://<slug>.hypamoon.app`. unlisted: url is the secret link (`https://<random>.hypamoon.app`) and the readable address gives 404. |

JSON

```
{
  "id": "6a7b8c9d-0e1f-4a2b-9c3d-4e5f6a7b8c9d",
  "slug": "acme-plumbing-rotterdam",
  "name": "Acme Plumbing",
  "url": "https://acme-plumbing-rotterdam.hypamoon.app",
  "files": [
    {
      "path": "/index.html",
      "content_type": "text/html",
      "bytes": 272,
      "updated_at": "2026-10-01T09:00:00.000Z"
    },
    {
      "path": "/style.css",
      "content_type": "text/css",
      "bytes": 98,
      "updated_at": "2026-10-01T09:00:00.000Z"
    }
  ],
  "created_at": "2026-10-01T09:00:00.000Z",
  "updated_at": "2026-10-01T09:00:00.000Z",
  "version": "k3Q9vXbT2mLc8Rw1",
  "password_protected": false,
  "test": false,
  "security_txt": "auto",
  "taken_offline": null,
  "visibility": "public"
}
```

#### 202 Four-eyes approval is on: the change waits for another owner or builder. Nothing has changed yet.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"deploy_approval"` |  |
| `id` (required) | string (uuid) | The id of the request; pass it as approval\_id to approve\_deploy or reject\_deploy. |
| `status` (required) | `"pending"`, `"processing"`, `"approved"`, `"rejected"`, `"failed"`, `"superseded"`, `"expired"` | pending until another owner or builder decides. superseded: a newer deploy of the same site replaced it. expired: after 7 days. |
| `kind` (required) | `"new_site"`, `"site_update"`, `"site_delete"`, `"app_deploy"`, `"app_rollback"` | app\_deploy and app\_rollback: server code of an app (deploy\_app, rollback\_app); files and bytes are its modules. |
| `site_id` (required) | string or null (uuid) |  |
| `name` (required) | string or null |  |
| `slug` (required) | string or null |  |
| `url` (required) | string or null | The address of the site. For an update or deletion it still shows the live version until approval. |
| `files` (required) | integer |  |
| `bytes` (required) | integer |  |
| `password_change` (required) | `"none"`, `"remove"`, `"set"` |  |
| `requested_by` (required) | object |  |
| `requested_at` (required) | string |  |
| `expires_at` (required) | string |  |
| `reviewed_by` (required) | string or null (uuid) |  |
| `reviewed_at` (required) | string or null |  |
| `reason` (required) | string or null |  |
| `result` (required) | object or null |  |

JSON

```
{
  "object": "deploy_approval",
  "id": "8f6c2a51-3d1e-4b7a-9c42-0e5d6f7a8b90",
  "status": "pending",
  "kind": "site_update",
  "site_id": "3b2f9c1e-7a4d-4e8b-b5c6-1d2e3f4a5b6c",
  "name": "Acme Plumbing",
  "slug": "acme-plumbing",
  "url": "https://acme-plumbing.hypamoon.app",
  "files": 2,
  "bytes": 1840,
  "password_change": "none",
  "requested_by": {
    "user_id": "5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a",
    "via": "api",
    "app": "Claude"
  },
  "requested_at": "2026-10-05T10:15:00Z",
  "expires_at": "2026-10-12T10:15:00Z",
  "reviewed_by": null,
  "reviewed_at": null,
  "reason": null,
  "result": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`site_offline`](https://hypamoon.com/docs/errors/site_offline) |
| 403 | [`phone_verification_required`](https://hypamoon.com/docs/errors/phone_verification_required) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`slug_taken`](https://hypamoon.com/docs/errors/slug_taken) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`slug_reserved`](https://hypamoon.com/docs/errors/slug_reserved) |
| 422 | [`site_blocked`](https://hypamoon.com/docs/errors/site_blocked) |
| 429 | [`deploy_limit_reached`](https://hypamoon.com/docs/errors/deploy_limit_reached) |

### POST /sites/{id}/rotate-secret-url

**Make a new secret link for an unlisted site.**

Gives an unlisted site a new secret link; the old one stops working within seconds, everywhere. Use it when the link reached the wrong people. Takes effect immediately, even when four-eyes approval is on.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the site. |

#### 200 The site with its new secret link in url.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the site. Use it to update or delete the site. |
| `slug` (required) | string | The first part of the address: `https://<slug>.hypamoon.app`. |
| `name` (required) | string | Your name for the site. |
| `url` (required) | string | Where the site lives: `https://<slug>.hypamoon.app`, or the secret link when visibility is unlisted. |
| `files` (required) | SiteFile\[\] | The files of the site, sorted by path, without their content. |
| `created_at` (required) | string (date-time) | When the site was created. |
| `updated_at` (required) | string (date-time) | When the site or its files last changed. |
| `version` (required) | string | The version that is live now. Changes on every update; every file on the site carries it as its ETag, so you can check that a page shows this version. |
| `password_protected` (required) | boolean | true when visitors have to enter a password first: the site's shared password (set with password on POST /sites or PUT /sites/{id}) or a personal password per recipient. Passwords themselves are never returned. |
| `test` (required) | boolean | true for a site of a test project. It is public all the same. |
| `security_txt` | `"auto"`, `"off"` | auto: without a /.well-known/security.txt of its own, the site serves one with the project's contact address. off: none from Hypamoon. Set with security\_txt on PUT /sites/{id}. |
| `taken_offline` (required) | object or null | null while the site is live. Set when Hypamoon took the site offline because of abuse: visitors get a page that says it is unavailable, the files are kept, and PUT and DELETE return 403 site\_offline. To object, the owner replies to the email or writes to [hello@hypamoon.com](mailto:hello@hypamoon.com). |
| `warnings` | one of\[\] | Only in the answer of a deploy, and only when there is something to tell: files a deploy without keep\_existing removed, and build hints. Warnings never block a deploy. |
| `visibility` (required) | `"public"`, `"unlisted"` | public: the site lives at `https://<slug>.hypamoon.app`. unlisted: url is the secret link (`https://<random>.hypamoon.app`) and the readable address gives 404. |

JSON

```
{
  "id": "6a7b8c9d-0e1f-4a2b-9c3d-4e5f6a7b8c9d",
  "slug": "acme-plumbing",
  "name": "Acme Plumbing",
  "url": "https://k7q2m4x9r3t6w8y2b5c7d9f3gh.hypamoon.app",
  "files": [
    {
      "path": "/index.html",
      "content_type": "text/html",
      "bytes": 272,
      "updated_at": "2026-10-01T09:00:00.000Z"
    },
    {
      "path": "/style.css",
      "content_type": "text/css",
      "bytes": 98,
      "updated_at": "2026-10-01T09:00:00.000Z"
    }
  ],
  "created_at": "2026-10-01T09:00:00.000Z",
  "updated_at": "2026-10-01T09:00:00.000Z",
  "version": "k3Q9vXbT2mLc8Rw1",
  "password_protected": false,
  "test": false,
  "security_txt": "auto",
  "taken_offline": null,
  "visibility": "unlisted"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`site_offline`](https://hypamoon.com/docs/errors/site_offline) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 429 | [`deploy_limit_reached`](https://hypamoon.com/docs/errors/deploy_limit_reached) |

### GET /sites/{id}/versions

**List the versions of a site.**

The history of a site, newest first: every deploy that changed its files (including partial deploys, imports, approved deploys, rollbacks and promoted previews) is a version with who made it, through which client, its message and the changed paths. Previews are in the list too (preview: true, with preview\_url). Versions older than the plan's retention period are removed, unless they have a label or are a checkpoint (auto\_label "before big change"). auto\_label also marks versions that stayed live for at least 24 hours and were not rolled back ("stable"). Included on every plan; the plan sets the retention period and the number of labels.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the site. |
| `limit` | query | integer | How many versions per page (default 20). |
| `cursor` | query | integer | The next\_cursor of the previous page. |

#### 200 The versions, newest first.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"list"` |  |
| `data` (required) | object\[\] |  |
| `has_more` (required) | boolean |  |
| `next_cursor` (required) | integer or null | Send as cursor for the next page. |
| `retention_days` (required) | integer | How long the plan keeps versions. |
| `labels_max` (required) | integer | How many labeled versions a site can have on this plan. |

JSON

```
{
  "object": "list",
  "data": [
    {
      "object": "site_version",
      "id": "8d0f5c1e-2b7a-4c55-9a51-3f1f2f6c9e10",
      "number": 4,
      "site_id": "6a7b8c9d-0e1f-4a2b-9c3d-4e5f6a7b8c9d",
      "created_at": "2026-10-06T09:12:00Z",
      "cause": "partial_deploy",
      "message": "New opening hours",
      "author": {
        "user_id": "5b1d6f3e-9a0c-4f2e-8d7b-2c4a1e9f0b33",
        "via": "connected_app",
        "client": "claude",
        "client_name": "Claude"
      },
      "changes": {
        "added": [],
        "modified": [
          "/index.html"
        ],
        "removed": [],
        "counts": {
          "added": 0,
          "modified": 1,
          "removed": 0
        },
        "truncated": false
      },
      "files": 3,
      "bytes": 18240,
      "current": true,
      "preview": false,
      "preview_url": null,
      "label": null,
      "labeled_at": null,
      "restored_from": null,
      "expires_at": null,
      "auto_label": null
    }
  ],
  "has_more": false,
  "next_cursor": null,
  "retention_days": 30,
  "labels_max": 5
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 402 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /sites/{id}/diff

**Show what changed between two versions.**

For each path, whether it was added, modified, removed or replaced between two versions of a site. Text files (html, css, js, json, txt, svg) get a unified diff; binary files (images, fonts) only their old and new size. Without to: the current version. Without from: the version before to (for a preview: the live version). Large diffs are left out (diff\_omitted) to keep the response small.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the site. |
| `from` | query | string | The id or number of the older version. |
| `to` | query | string | The id or number of the newer version. |

#### 200 What changed.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"site_diff"` |  |
| `site_id` (required) | string (uuid) |  |
| `from` (required) | object or null |  |
| `to` (required) | object |  |
| `summary` (required) | object |  |
| `files` (required) | object\[\] |  |
| `truncated` (required) | boolean | true: some diffs were left out to keep the answer small (diff\_omitted per file). |

JSON

```
{
  "object": "site_diff",
  "site_id": "6a7b8c9d-0e1f-4a2b-9c3d-4e5f6a7b8c9d",
  "from": {
    "id": "0b6c7e2a-1f3d-4e5a-9c8b-7d6e5f4a3b21",
    "number": 3
  },
  "to": {
    "id": "8d0f5c1e-2b7a-4c55-9a51-3f1f2f6c9e10",
    "number": 4
  },
  "summary": {
    "added": 0,
    "modified": 1,
    "removed": 0,
    "replaced": 0
  },
  "files": [
    {
      "path": "/index.html",
      "status": "modified",
      "kind": "text",
      "old_bytes": 2310,
      "new_bytes": 2342,
      "diff": "--- a/index.html\n+++ b/index.html\n@@ -12,1 +12,1 @@\n-<p>Open 9 to 5</p>\n+<p>Open 8 to 6</p>\n"
    }
  ],
  "truncated": false
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 402 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### POST /sites/{id}/rollback

**Roll a site back to an earlier version.**

Puts the files of an earlier version back live immediately. The rollback is itself a new version (cause rollback), so the history never loses anything and you can roll forward again. The same checks as for a deploy apply (abuse scan, plan limits, four-eyes approval). If the site already has exactly these files, nothing changes and unchanged is true: safe to retry. Send if\_match\_version to make sure nobody deployed in between. To restore only a few files, use POST /sites/{id}/restore-files.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the site. |

#### Request body

Which version to put back live: version\_id or number.

| Field | Type |  |
| --- | --- | --- |
| `version_id` | string (uuid) | The id of the version to go back to, from list\_site\_versions. |
| `number` | integer | Instead of version\_id: the number of the version. |
| `if_match_version` | string | Optional. The version of the site you are changing (version from get\_site); if the site changed since, you get 409 version\_conflict and nothing changes. |
| `message` | string | Optional. A short description for the version history, like "Back to the old menu". |

JSON

```
{
  "version_id": "0b6c7e2a-1f3d-4e5a-9c8b-7d6e5f4a3b21",
  "message": "Back to the old opening hours"
}
```

#### 200 The site as it is now live, with the new version.

| Field | Type |  |
| --- | --- | --- |
| `site` (required) | Site | A static site on hypamoon.app. |
| `version` (required) | object or null | One version of a site: a snapshot of its files. |
| `unchanged` (required) | boolean | true: the site already had exactly these files, so nothing changed (safe to retry). |

JSON

```
{
  "site": {
    "id": "6a7b8c9d-0e1f-4a2b-9c3d-4e5f6a7b8c9d",
    "slug": "acme-plumbing",
    "name": "Acme Plumbing",
    "url": "https://acme-plumbing.hypamoon.app",
    "files": [
      {
        "path": "/index.html",
        "content_type": "text/html",
        "bytes": 272,
        "updated_at": "2026-10-01T09:00:00.000Z"
      },
      {
        "path": "/style.css",
        "content_type": "text/css",
        "bytes": 98,
        "updated_at": "2026-10-01T09:00:00.000Z"
      }
    ],
    "created_at": "2026-10-01T09:00:00.000Z",
    "updated_at": "2026-10-01T09:00:00.000Z",
    "version": "k3Q9vXbT2mLc8Rw1",
    "password_protected": false,
    "test": false,
    "security_txt": "auto",
    "taken_offline": null
  },
  "version": {
    "object": "site_version",
    "id": "8d0f5c1e-2b7a-4c55-9a51-3f1f2f6c9e10",
    "number": 5,
    "site_id": "6a7b8c9d-0e1f-4a2b-9c3d-4e5f6a7b8c9d",
    "created_at": "2026-10-06T09:12:00Z",
    "cause": "rollback",
    "message": "New opening hours",
    "author": {
      "user_id": "5b1d6f3e-9a0c-4f2e-8d7b-2c4a1e9f0b33",
      "via": "connected_app",
      "client": "claude",
      "client_name": "Claude"
    },
    "changes": {
      "added": [],
      "modified": [
        "/index.html"
      ],
      "removed": [],
      "counts": {
        "added": 0,
        "modified": 1,
        "removed": 0
      },
      "truncated": false
    },
    "files": 3,
    "bytes": 18240,
    "current": true,
    "preview": false,
    "preview_url": null,
    "label": null,
    "labeled_at": null,
    "restored_from": "0b6c7e2a-1f3d-4e5a-9c8b-7d6e5f4a3b21",
    "expires_at": null,
    "auto_label": null
  },
  "unchanged": false
}
```

#### 202 Four-eyes approval is on: the rollback waits for another owner or builder. Nothing has changed yet.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"deploy_approval"` |  |
| `id` (required) | string (uuid) | The id of the request; pass it as approval\_id to approve\_deploy or reject\_deploy. |
| `status` (required) | `"pending"`, `"processing"`, `"approved"`, `"rejected"`, `"failed"`, `"superseded"`, `"expired"` | pending until another owner or builder decides. superseded: a newer deploy of the same site replaced it. expired: after 7 days. |
| `kind` (required) | `"new_site"`, `"site_update"`, `"site_delete"`, `"app_deploy"`, `"app_rollback"` | app\_deploy and app\_rollback: server code of an app (deploy\_app, rollback\_app); files and bytes are its modules. |
| `site_id` (required) | string or null (uuid) |  |
| `name` (required) | string or null |  |
| `slug` (required) | string or null |  |
| `url` (required) | string or null | The address of the site. For an update or deletion it still shows the live version until approval. |
| `files` (required) | integer |  |
| `bytes` (required) | integer |  |
| `password_change` (required) | `"none"`, `"remove"`, `"set"` |  |
| `requested_by` (required) | object |  |
| `requested_at` (required) | string |  |
| `expires_at` (required) | string |  |
| `reviewed_by` (required) | string or null (uuid) |  |
| `reviewed_at` (required) | string or null |  |
| `reason` (required) | string or null |  |
| `result` (required) | object or null |  |

JSON

```
{
  "object": "deploy_approval",
  "id": "8f6c2a51-3d1e-4b7a-9c42-0e5d6f7a8b90",
  "status": "pending",
  "kind": "site_update",
  "site_id": "3b2f9c1e-7a4d-4e8b-b5c6-1d2e3f4a5b6c",
  "name": "Acme Plumbing",
  "slug": "acme-plumbing",
  "url": "https://acme-plumbing.hypamoon.app",
  "files": 2,
  "bytes": 1840,
  "password_change": "none",
  "requested_by": {
    "user_id": "5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a",
    "via": "api",
    "app": "Claude"
  },
  "requested_at": "2026-10-05T10:15:00Z",
  "expires_at": "2026-10-12T10:15:00Z",
  "reviewed_by": null,
  "reviewed_at": null,
  "reason": null,
  "result": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 402 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 403 | [`site_offline`](https://hypamoon.com/docs/errors/site_offline) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 409 | [`version_conflict`](https://hypamoon.com/docs/errors/version_conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`site_blocked`](https://hypamoon.com/docs/errors/site_blocked) |
| 429 | [`deploy_limit_reached`](https://hypamoon.com/docs/errors/deploy_limit_reached) |

### POST /sites/{id}/restore-files

**Restore a few files from an earlier version.**

Puts only the files in paths back as they were in an earlier version, live immediately; every other file stays as it is now. Use it when one page, script or stylesheet broke and the rest of the site is fine. The result is a new version (cause file\_restore) with a message, so it can be undone too. A path that was not in that version is a 422. The same checks as for a deploy apply (abuse scan, plan limits, four-eyes approval). If the files are already like that, nothing changes and unchanged is true.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the site. |

#### Request body

Which files to restore, and from which version.

| Field | Type |  |
| --- | --- | --- |
| `version_id` | string (uuid) | The id of the version to take the files from, from list\_site\_versions. |
| `number` | integer | Instead of version\_id: the number of the version. |
| `paths` (required) | string\[\] | The paths to restore, like \["/app.js", "/style.css"\]. Every other file stays as it is now. |
| `if_match_version` | string | Optional. The version of the site you are changing (version from get\_site); if the site changed since, you get 409 version\_conflict and nothing changes. |
| `message` | string | Optional. A short description for the version history, like "Back to the old menu". |

JSON

```
{
  "number": 4,
  "paths": [
    "/app.js",
    "/style.css"
  ],
  "message": "Back to the working app.js and style.css"
}
```

#### 200 The site as it is now live, with the new version.

| Field | Type |  |
| --- | --- | --- |
| `site` (required) | Site | A static site on hypamoon.app. |
| `version` (required) | object or null | One version of a site: a snapshot of its files. |
| `unchanged` (required) | boolean | true: the site already had exactly these files, so nothing changed (safe to retry). |

JSON

```
{
  "site": {
    "id": "6a7b8c9d-0e1f-4a2b-9c3d-4e5f6a7b8c9d",
    "slug": "acme-plumbing",
    "name": "Acme Plumbing",
    "url": "https://acme-plumbing.hypamoon.app",
    "files": [
      {
        "path": "/index.html",
        "content_type": "text/html",
        "bytes": 272,
        "updated_at": "2026-10-01T09:00:00.000Z"
      },
      {
        "path": "/style.css",
        "content_type": "text/css",
        "bytes": 98,
        "updated_at": "2026-10-01T09:00:00.000Z"
      }
    ],
    "created_at": "2026-10-01T09:00:00.000Z",
    "updated_at": "2026-10-01T09:00:00.000Z",
    "version": "k3Q9vXbT2mLc8Rw1",
    "password_protected": false,
    "test": false,
    "security_txt": "auto",
    "taken_offline": null
  },
  "version": {
    "object": "site_version",
    "id": "8d0f5c1e-2b7a-4c55-9a51-3f1f2f6c9e10",
    "number": 7,
    "site_id": "6a7b8c9d-0e1f-4a2b-9c3d-4e5f6a7b8c9d",
    "created_at": "2026-10-06T09:12:00Z",
    "cause": "file_restore",
    "message": "Back to the working app.js and style.css",
    "author": {
      "user_id": "5b1d6f3e-9a0c-4f2e-8d7b-2c4a1e9f0b33",
      "via": "connected_app",
      "client": "claude",
      "client_name": "Claude"
    },
    "changes": {
      "added": [],
      "modified": [
        "/index.html"
      ],
      "removed": [],
      "counts": {
        "added": 0,
        "modified": 1,
        "removed": 0
      },
      "truncated": false
    },
    "files": 3,
    "bytes": 18240,
    "current": true,
    "preview": false,
    "preview_url": null,
    "label": null,
    "labeled_at": null,
    "restored_from": "0b6c7e2a-1f3d-4e5a-9c8b-7d6e5f4a3b21",
    "expires_at": null,
    "auto_label": null
  },
  "unchanged": false
}
```

#### 202 Four-eyes approval is on: the restore waits for another owner or builder. Nothing has changed yet.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"deploy_approval"` |  |
| `id` (required) | string (uuid) | The id of the request; pass it as approval\_id to approve\_deploy or reject\_deploy. |
| `status` (required) | `"pending"`, `"processing"`, `"approved"`, `"rejected"`, `"failed"`, `"superseded"`, `"expired"` | pending until another owner or builder decides. superseded: a newer deploy of the same site replaced it. expired: after 7 days. |
| `kind` (required) | `"new_site"`, `"site_update"`, `"site_delete"`, `"app_deploy"`, `"app_rollback"` | app\_deploy and app\_rollback: server code of an app (deploy\_app, rollback\_app); files and bytes are its modules. |
| `site_id` (required) | string or null (uuid) |  |
| `name` (required) | string or null |  |
| `slug` (required) | string or null |  |
| `url` (required) | string or null | The address of the site. For an update or deletion it still shows the live version until approval. |
| `files` (required) | integer |  |
| `bytes` (required) | integer |  |
| `password_change` (required) | `"none"`, `"remove"`, `"set"` |  |
| `requested_by` (required) | object |  |
| `requested_at` (required) | string |  |
| `expires_at` (required) | string |  |
| `reviewed_by` (required) | string or null (uuid) |  |
| `reviewed_at` (required) | string or null |  |
| `reason` (required) | string or null |  |
| `result` (required) | object or null |  |

JSON

```
{
  "object": "deploy_approval",
  "id": "8f6c2a51-3d1e-4b7a-9c42-0e5d6f7a8b90",
  "status": "pending",
  "kind": "site_update",
  "site_id": "3b2f9c1e-7a4d-4e8b-b5c6-1d2e3f4a5b6c",
  "name": "Acme Plumbing",
  "slug": "acme-plumbing",
  "url": "https://acme-plumbing.hypamoon.app",
  "files": 2,
  "bytes": 1840,
  "password_change": "none",
  "requested_by": {
    "user_id": "5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a",
    "via": "api",
    "app": "Claude"
  },
  "requested_at": "2026-10-05T10:15:00Z",
  "expires_at": "2026-10-12T10:15:00Z",
  "reviewed_by": null,
  "reviewed_at": null,
  "reason": null,
  "result": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 402 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 403 | [`site_offline`](https://hypamoon.com/docs/errors/site_offline) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 409 | [`version_conflict`](https://hypamoon.com/docs/errors/version_conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`site_blocked`](https://hypamoon.com/docs/errors/site_blocked) |
| 429 | [`deploy_limit_reached`](https://hypamoon.com/docs/errors/deploy_limit_reached) |

### POST /sites/{id}/versions/{versionId}/promote

**Publish a preview.**

Publishes a preview (deploy\_site with preview: true) as a new version (cause promote). The same checks as for a deploy apply, including four-eyes approval. Promoting twice changes nothing the second time.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the site. |
| `versionId` (required) | path | string (uuid) | The id of the version, from list\_site\_versions. |

#### Request body

Optional settings for putting the preview live.

| Field | Type |  |
| --- | --- | --- |
| `if_match_version` | string | Optional. The version of the site you are changing (version from get\_site); if the site changed since, you get 409 version\_conflict and nothing changes. |
| `message` | string | Optional. A short description for the version history, like "Back to the old menu". |

JSON

```
{
  "message": "Spring menu"
}
```

#### 200 The site as it is now live, with the new version.

| Field | Type |  |
| --- | --- | --- |
| `site` (required) | Site | A static site on hypamoon.app. |
| `version` (required) | object or null | One version of a site: a snapshot of its files. |
| `unchanged` (required) | boolean | true: the site already had exactly these files, so nothing changed (safe to retry). |

JSON

```
{
  "site": {
    "id": "6a7b8c9d-0e1f-4a2b-9c3d-4e5f6a7b8c9d",
    "slug": "acme-plumbing",
    "name": "Acme Plumbing",
    "url": "https://acme-plumbing.hypamoon.app",
    "files": [
      {
        "path": "/index.html",
        "content_type": "text/html",
        "bytes": 272,
        "updated_at": "2026-10-01T09:00:00.000Z"
      },
      {
        "path": "/style.css",
        "content_type": "text/css",
        "bytes": 98,
        "updated_at": "2026-10-01T09:00:00.000Z"
      }
    ],
    "created_at": "2026-10-01T09:00:00.000Z",
    "updated_at": "2026-10-01T09:00:00.000Z",
    "version": "k3Q9vXbT2mLc8Rw1",
    "password_protected": false,
    "test": false,
    "security_txt": "auto",
    "taken_offline": null
  },
  "version": {
    "object": "site_version",
    "id": "8d0f5c1e-2b7a-4c55-9a51-3f1f2f6c9e10",
    "number": 6,
    "site_id": "6a7b8c9d-0e1f-4a2b-9c3d-4e5f6a7b8c9d",
    "created_at": "2026-10-06T09:12:00Z",
    "cause": "promote",
    "message": "New opening hours",
    "author": {
      "user_id": "5b1d6f3e-9a0c-4f2e-8d7b-2c4a1e9f0b33",
      "via": "connected_app",
      "client": "claude",
      "client_name": "Claude"
    },
    "changes": {
      "added": [],
      "modified": [
        "/index.html"
      ],
      "removed": [],
      "counts": {
        "added": 0,
        "modified": 1,
        "removed": 0
      },
      "truncated": false
    },
    "files": 3,
    "bytes": 18240,
    "current": true,
    "preview": false,
    "preview_url": null,
    "label": null,
    "labeled_at": null,
    "restored_from": null,
    "expires_at": null,
    "auto_label": null
  },
  "unchanged": false
}
```

#### 202 Four-eyes approval is on: publishing the preview waits for another owner or builder.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"deploy_approval"` |  |
| `id` (required) | string (uuid) | The id of the request; pass it as approval\_id to approve\_deploy or reject\_deploy. |
| `status` (required) | `"pending"`, `"processing"`, `"approved"`, `"rejected"`, `"failed"`, `"superseded"`, `"expired"` | pending until another owner or builder decides. superseded: a newer deploy of the same site replaced it. expired: after 7 days. |
| `kind` (required) | `"new_site"`, `"site_update"`, `"site_delete"`, `"app_deploy"`, `"app_rollback"` | app\_deploy and app\_rollback: server code of an app (deploy\_app, rollback\_app); files and bytes are its modules. |
| `site_id` (required) | string or null (uuid) |  |
| `name` (required) | string or null |  |
| `slug` (required) | string or null |  |
| `url` (required) | string or null | The address of the site. For an update or deletion it still shows the live version until approval. |
| `files` (required) | integer |  |
| `bytes` (required) | integer |  |
| `password_change` (required) | `"none"`, `"remove"`, `"set"` |  |
| `requested_by` (required) | object |  |
| `requested_at` (required) | string |  |
| `expires_at` (required) | string |  |
| `reviewed_by` (required) | string or null (uuid) |  |
| `reviewed_at` (required) | string or null |  |
| `reason` (required) | string or null |  |
| `result` (required) | object or null |  |

JSON

```
{
  "object": "deploy_approval",
  "id": "8f6c2a51-3d1e-4b7a-9c42-0e5d6f7a8b90",
  "status": "pending",
  "kind": "site_update",
  "site_id": "3b2f9c1e-7a4d-4e8b-b5c6-1d2e3f4a5b6c",
  "name": "Acme Plumbing",
  "slug": "acme-plumbing",
  "url": "https://acme-plumbing.hypamoon.app",
  "files": 2,
  "bytes": 1840,
  "password_change": "none",
  "requested_by": {
    "user_id": "5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a",
    "via": "api",
    "app": "Claude"
  },
  "requested_at": "2026-10-05T10:15:00Z",
  "expires_at": "2026-10-12T10:15:00Z",
  "reviewed_by": null,
  "reviewed_at": null,
  "reason": null,
  "result": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 402 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 403 | [`site_offline`](https://hypamoon.com/docs/errors/site_offline) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 409 | [`version_conflict`](https://hypamoon.com/docs/errors/version_conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`site_blocked`](https://hypamoon.com/docs/errors/site_blocked) |
| 429 | [`deploy_limit_reached`](https://hypamoon.com/docs/errors/deploy_limit_reached) |

### PUT /sites/{id}/versions/{versionId}/label

**Label a version.**

Gives a version a name, like "before launch", unique per site. A labeled version is kept beyond the plan's retention period; the plan sets how many labels a site can have. label null removes it.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the site. |
| `versionId` (required) | path | string (uuid) | The id of the version, from list\_site\_versions. |

#### Request body

The label of a version.

| Field | Type |  |
| --- | --- | --- |
| `label` (required) | string or null | A name for this version, like "before launch" (1 to 60 characters, unique per site). null or an empty string removes it. |

JSON

```
{
  "label": "before launch"
}
```

#### 200 The version with its label.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"site_version"` |  |
| `id` (required) | string (uuid) | The id of the version: use it for get\_site\_diff, rollback\_site, promote\_site\_version and label\_site\_version. |
| `number` (required) | integer | The number of the version within the site: 1, 2, 3 and so on. |
| `site_id` (required) | string (uuid) |  |
| `created_at` (required) | string | When this version was made (ISO 8601). |
| `cause` (required) | `"baseline"`, `"deploy"`, `"partial_deploy"`, `"import"`, `"approved_deploy"`, `"rollback"`, `"promote"`, `"preview"`, `"file_restore"` | What made it: a deploy, a partial deploy (keep\_existing), an import, a deploy after four-eyes approval, a rollback, a promoted preview, a preview, a few files restored from an older version (file\_restore), or baseline (how the site was when its history started). |
| `message` (required) | string or null | The message sent with the deploy, if any. |
| `author` (required) | object | Who made it, and through which client. |
| `changes` (required) | object | The paths that changed compared to the version before. |
| `files` (required) | integer |  |
| `bytes` (required) | integer |  |
| `current` (required) | boolean | true for the version that is live now. |
| `preview` (required) | boolean | true for a preview that never went live. |
| `preview_url` (required) | string or null | The secret address of a preview (not indexed). Share it only with people who should see it. |
| `label` (required) | string or null |  |
| `labeled_at` (required) | string or null |  |
| `restored_from` (required) | string or null (uuid) | For a rollback or promote: the version it came from. |
| `expires_at` (required) | string or null | When the retention of the plan removes it; null for the current version, labeled versions and checkpoints. |
| `auto_label` (required) | `"before big change"`, `"stable"`, `"held by guardrail"`, `null` | A marker Hypamoon sets itself, apart from label: "before big change" is the version that was live when a deploy hit the guardrail (kept like a labeled version), "stable" a version that stayed live for at least 24 hours and was not rolled back (both good versions to go back to), and "held by guardrail" a preview the guardrail made instead of putting a deploy live. |

JSON

```
{
  "object": "site_version",
  "id": "8d0f5c1e-2b7a-4c55-9a51-3f1f2f6c9e10",
  "number": 4,
  "site_id": "6a7b8c9d-0e1f-4a2b-9c3d-4e5f6a7b8c9d",
  "created_at": "2026-10-06T09:12:00Z",
  "cause": "partial_deploy",
  "message": "New opening hours",
  "author": {
    "user_id": "5b1d6f3e-9a0c-4f2e-8d7b-2c4a1e9f0b33",
    "via": "connected_app",
    "client": "claude",
    "client_name": "Claude"
  },
  "changes": {
    "added": [],
    "modified": [
      "/index.html"
    ],
    "removed": [],
    "counts": {
      "added": 0,
      "modified": 1,
      "removed": 0
    },
    "truncated": false
  },
  "files": 3,
  "bytes": 18240,
  "current": true,
  "preview": false,
  "preview_url": null,
  "label": "before launch",
  "labeled_at": "2026-10-06T10:00:00Z",
  "restored_from": null,
  "expires_at": null,
  "auto_label": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 402 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /sites/{id}/store-readiness

**Check whether a site is ready for the App Store and Google Play.**

Checks a site against what Apple (guideline 4.2: more than a website in a shell; 2.1: complete; 3.1.1: digital goods through in-app purchase) and Google Play expect: native value, a privacy policy URL, a support contact, an icon of the right size, complete content without placeholder pages, no external payment pages for digital goods, and no tracking without permission. Returns ready or not ready for each store, with concrete next steps, and what the user must arrange with Apple and Google themselves (their own developer account, a D-U-N-S number for a company, the 14-day closed test for a new personal Play account). Read-only; changes nothing.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the site. |

#### 200 The verdict per store, every check and the next steps.

| Field | Type |  |
| --- | --- | --- |
| `site` (required) | object |  |
| `stores` (required) | object |  |
| `checks` (required) | object\[\] |  |
| `native_value` (required) | object |  |
| `accounts` (required) | object |  |
| `unknown` (required) | string\[\] | Parts of the project that could not be read; treat them carefully. |
| `next_steps` (required) | string\[\] |  |

JSON

```
{
  "site": {
    "id": "8d2c4b1e-3f5a-4c6d-9e7f-1a2b3c4d5e6f",
    "name": "Acme Plumbing",
    "app_url": "https://acme-plumbing.hypamoon.app",
    "test": false
  },
  "stores": {
    "apple": {
      "ready": true,
      "blocking": [],
      "warnings": [
        "native_value"
      ],
      "next_steps": [
        "Strengthen it with: push notifications: the exported app registers each device with Hypamoon; sending notifications from the rails comes in phase 2; offline: the exported app shows its own offline screen; a service worker on the site makes pages work without a connection; sharing: a share button that calls navigator.share opens the phone's share sheet."
      ]
    },
    "google_play": {
      "ready": true,
      "blocking": [],
      "warnings": [],
      "next_steps": []
    }
  },
  "checks": [
    {
      "id": "site_online",
      "title": "The site is online",
      "status": "pass",
      "stores": [
        "apple",
        "google_play"
      ],
      "detail": "The app loads https://acme-plumbing.hypamoon.app."
    },
    {
      "id": "content_complete",
      "title": "Content is complete",
      "status": "pass",
      "stores": [
        "apple",
        "google_play"
      ],
      "detail": "3 pages with real content."
    },
    {
      "id": "privacy_policy",
      "title": "Privacy policy URL",
      "status": "pass",
      "stores": [
        "apple",
        "google_play"
      ],
      "detail": "Found: /privacy.html. Make sure it also covers the app (push tokens, what the forms send)."
    },
    {
      "id": "support_contact",
      "title": "Support contact",
      "status": "pass",
      "stores": [
        "apple",
        "google_play"
      ],
      "detail": "Found contact page /contact.html, an email address, a phone number. Apple needs a support URL; Google Play needs a contact email."
    },
    {
      "id": "app_icon",
      "title": "App icon",
      "status": "pass",
      "stores": [
        "apple",
        "google_play"
      ],
      "detail": "/icon-1024.png is 1024x1024: good for every size."
    },
    {
      "id": "native_value",
      "title": "More than a website in a shell",
      "status": "warn",
      "stores": [
        "apple"
      ],
      "detail": "Present: forms that send data (contact, booking or sign-up); live chat with the assistant. This helps with guideline 4.2, but Apple decides per review; push notifications and an offline screen make the case stronger.",
      "fix": "Strengthen it with: push notifications: the exported app registers each device with Hypamoon; sending notifications from the rails comes in phase 2; offline: the exported app shows its own offline screen; a service worker on the site makes pages work without a connection; sharing: a share button that calls navigator.share opens the phone's share sheet."
    },
    {
      "id": "native_value_play",
      "title": "Useful beyond a website",
      "status": "pass",
      "stores": [
        "google_play"
      ],
      "detail": "Present: forms that send data (contact, booking or sign-up); live chat with the assistant."
    },
    {
      "id": "digital_payments",
      "title": "Digital goods use the store's billing",
      "status": "pass",
      "stores": [
        "apple",
        "google_play"
      ],
      "detail": "No payment links or checkout found."
    },
    {
      "id": "tracking",
      "title": "No tracking without permission",
      "status": "pass",
      "stores": [
        "apple",
        "google_play"
      ],
      "detail": "No third-party trackers found."
    }
  ],
  "native_value": {
    "present": [
      "forms that send data (contact, booking or sign-up)",
      "live chat with the assistant"
    ],
    "can_add": [
      "push notifications: the exported app registers each device with Hypamoon; sending notifications from the rails comes in phase 2",
      "offline: the exported app shows its own offline screen; a service worker on the site makes pages work without a connection",
      "sharing: a share button that calls navigator.share opens the phone's share sheet"
    ],
    "summary": "2 interactive parts. Apple judges guideline 4.2 per app; the more the app does that a browser does not, the better."
  },
  "accounts": {
    "apple": {
      "steps": [
        "The app is published under the user's own Apple Developer account, never under Hypamoon's (guideline 4.2.6: apps from an app generator must be submitted by the owner of the content).",
        "A company (Acme Plumbing B.V.) enrolls as an organization: it needs a D-U-N-S number (requested from Dun & Bradstreet, can take a few days), a legal entity name and a website on the company's domain. The company name is shown as the seller.",
        "In App Store Connect the user accepts the agreements and, for paid apps, fills in tax and banking. Only the account holder can do this.",
        "Later phases connect through an App Store Connect API key that the user adds in the Hypamoon portal (secret vault), never in this chat."
      ],
      "fee": "99 USD per year (Apple Developer Program)",
      "enroll_url": "https://developer.apple.com/programs/enroll/"
    },
    "google_play": {
      "steps": [
        "The app is published under the user's own Google Play developer account. Google verifies the identity of the account holder.",
        "An organization account (Acme Plumbing B.V.) needs a D-U-N-S number and an organization website; it can publish to production without the closed test.",
        "Data safety and the content rating questionnaire are filled in by the user in the Play Console.",
        "Later phases connect through a Google Play service account that the user adds in the Hypamoon portal (secret vault), never in this chat."
      ],
      "fee": "25 USD once (Google Play Console registration)",
      "enroll_url": "https://play.google.com/console/signup"
    }
  },
  "unknown": [],
  "next_steps": [
    "Strengthen it with: push notifications: the exported app registers each device with Hypamoon; sending notifications from the rails comes in phase 2; offline: the exported app shows its own offline screen; a service worker on the site makes pages work without a connection; sharing: a share button that calls navigator.share opens the phone's share sheet.",
    "Ask the user to set up the developer accounts (see accounts); nobody can do that for them.",
    "get_privacy_answers for App Privacy and Data safety.",
    "generate_store_listing for the texts and the list of screenshots.",
    "export_app_project for the app project."
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### GET /sites/{id}/store-listing

**Draft the store listing for a site's app.**

A first draft of the App Store and Google Play listing from the site's own text, within each store's limits: name, subtitle, promotional text, description and keywords (Apple), title, short and full description (Google), a category, review notes, and which screenshots and graphics to make per store. In English; source\_language says when the site is in another language and the texts need translating. No prices and no purchase links.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the site. |
| `app_name` | query | string | The name of the app, if the user chose one. Leave it out to use the site's name. |

#### 200 The draft listing.

| Field | Type |  |
| --- | --- | --- |
| `site` (required) | object |  |
| `source_language` (required) | string |  |
| `note` (required) | string |  |
| `apple` (required) | object |  |
| `google_play` (required) | object |  |
| `category_reason` (required) | string |  |
| `review_notes` (required) | string |  |
| `screenshots` (required) | object |  |
| `limits` (required) | object |  |

JSON

```
{
  "site": {
    "id": "8d2c4b1e-3f5a-4c6d-9e7f-1a2b3c4d5e6f",
    "app_url": "https://acme-plumbing.hypamoon.app"
  },
  "source_language": "en",
  "note": "Drafts from the site's own text. Read them with the user and make them sound like the business; never promise features the app does not have.",
  "apple": {
    "name": "Acme Plumbing",
    "subtitle": "Book a visit",
    "promotional_text": "Fast, friendly plumbing in Rotterdam. Book a visit online or call us, day and night.",
    "description": "Fast, friendly plumbing in Rotterdam. Book a visit online or call us, day and night. Leaking tap, blocked drain or a new boiler: our plumbers are on the road every day across Rotterdam and nearby towns. Send the form and we confirm a time within the hour, or call us for an emergency and we come the same day. Questions? Read our privacy policy, visit the contact page, mail hello@acme-plumbing.example or call +44 7700 900123. What you can do in the app: • Send a request or booking in a few taps • Chat with us and get an answer right away, day and night • Call us with one tap • Get notified when there is news (you choose whether you want notifications) • Clear message when you are offline, and back in one tap Acme Plumbing is the official app of Acme Plumbing B.V..",
    "keywords": "call,day,visit,book,rotterdam,across,blocked,boiler,come,confirm,contact,drain,emergency,every",
    "primary_category": "Business",
    "secondary_category": "Productivity",
    "support_url": "https://acme-plumbing.hypamoon.app/contact.html",
    "privacy_policy_url": "https://acme-plumbing.hypamoon.app/privacy.html"
  },
  "google_play": {
    "title": "Acme Plumbing",
    "short_description": "Fast, friendly plumbing in Rotterdam. Book a visit online or call us, day and…",
    "full_description": "Fast, friendly plumbing in Rotterdam. Book a visit online or call us, day and night. Leaking tap, blocked drain or a new boiler: our plumbers are on the road every day across Rotterdam and nearby towns. Send the form and we confirm a time within the hour, or call us for an emergency and we come the same day. Questions? Read our privacy policy, visit the contact page, mail hello@acme-plumbing.example or call +44 7700 900123. What you can do in the app: • Send a request or booking in a few taps • Chat with us and get an answer right away, day and night • Call us with one tap • Get notified when there is news (you choose whether you want notifications) • Clear message when you are offline, and back in one tap Acme Plumbing is the official app of Acme Plumbing B.V..",
    "category": "Business",
    "contact_email": "hello@acme-plumbing.example",
    "privacy_policy_url": "https://acme-plumbing.hypamoon.app/privacy.html"
  },
  "category_reason": "Nothing specific found; Business fits most company apps. Change it if another category describes the app better.",
  "review_notes": "Acme Plumbing is the app of the website https://acme-plumbing.hypamoon.app, published by its owner, Acme Plumbing B.V.. The content is the owner's own.\nNative features: the app asks permission for push notifications and registers the device for updates from the owner; it shows an offline screen with a retry button when there is no connection; forms that send data (contact, booking or sign-up); live chat with the assistant.\nNo account is needed; every feature is available without signing in.\nPhone links open the phone's own dialer; calls go to the owner's business number.\nThe chat is answered by the owner's assistant; it says it is a digital assistant.\nQuestions about the review: use the contact details in App Review Information.",
  "screenshots": {
    "required": [
      {
        "store": "apple",
        "device": "iPhone 6.9-inch display",
        "size": "1320 x 2868 or 1290 x 2796 pixels (portrait)",
        "count": "3 to 10",
        "required": true
      },
      {
        "store": "apple",
        "device": "iPad 13-inch display",
        "size": "2064 x 2752 pixels (portrait)",
        "count": "3 to 10",
        "required": false
      },
      {
        "store": "google_play",
        "device": "Phone",
        "size": "1080 x 1920 pixels or larger, 9:16 (each side 320 to 3840 pixels)",
        "count": "2 to 8 (4 or more recommended)",
        "required": true
      },
      {
        "store": "google_play",
        "device": "7-inch and 10-inch tablet",
        "size": "1200 x 1920 and 1600 x 2560 pixels",
        "count": "up to 8 each",
        "required": false
      }
    ],
    "graphics": [
      {
        "store": "apple",
        "what": "App icon",
        "size": "1024 x 1024 PNG without transparency (comes from the app project)",
        "required": true
      },
      {
        "store": "google_play",
        "what": "App icon",
        "size": "512 x 512 PNG, 32-bit",
        "required": true
      },
      {
        "store": "google_play",
        "what": "Feature graphic",
        "size": "1024 x 500 PNG or JPG",
        "required": true
      }
    ],
    "screens_to_capture": [
      "The home screen (first page of the app)",
      "Privacy (/privacy.html)",
      "Contact (/contact.html)",
      "A form filled in, just before sending",
      "The chat open with a question and its answer",
      "The notification permission prompt or a notification on the lock screen"
    ],
    "ipad_note": "iPad screenshots are only required when the app runs on iPad. The exported project explains how to build it for iPhone only (Xcode: Targets > App > General > Supported Destinations, remove iPad)."
  },
  "limits": {
    "apple": {
      "name": 30,
      "subtitle": 30,
      "promotional_text": 170,
      "description": 4000,
      "keywords": 100
    },
    "google_play": {
      "title": 30,
      "short_description": 80,
      "full_description": 4000
    }
  }
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /sites/{id}/privacy-answers

**Answers for Apple App Privacy and Google Play Data safety.**

Derives the answers for App Privacy (Apple) and Data safety (Google) from what the site and the project actually use on Hypamoon: forms and their fields, the chat widget, the bot check, payments and paid access, push registration, sign-in forms, location and third-party scripts on the site. Each answer has its reason and source. Cautious by design: when in doubt, a data type is declared as collected. Includes a click-by-click list for each console, because only the user can fill in both forms there.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the site. |

#### 200 The answers per store, with reasons and console steps.

| Field | Type |  |
| --- | --- | --- |
| `site` (required) | object |  |
| `sources` (required) | string\[\] | The rails and scripts the answers come from: forms, chat\_widget, bot\_check, payments, paid\_access, push, sign\_in, location, ai\_processing (the app sends data to AI processors, see notes), third\_party:<name>. |
| `apple` (required) | object |  |
| `google_play` (required) | object |  |
| `not_collected` (required) | object\[\] |  |
| `notes` (required) | string\[\] |  |

JSON

```
{
  "site": {
    "id": "8d2c4b1e-3f5a-4c6d-9e7f-1a2b3c4d5e6f",
    "name": "Acme Plumbing",
    "app_url": "https://acme-plumbing.hypamoon.app"
  },
  "sources": [
    "forms",
    "chat_widget",
    "bot_check",
    "push"
  ],
  "apple": {
    "data_collected": true,
    "used_for_tracking": false,
    "data_types": [
      {
        "category": "Contact Info",
        "type": "Name",
        "linked_to_user": true,
        "used_for_tracking": false,
        "purposes": [
          "App Functionality"
        ],
        "reason": "A form on the site sends this to the owner's data collection on Hypamoon (and by email to the owner); it is stored with the entry, so it is linked to the person who sent it.",
        "source": "forms"
      },
      {
        "category": "Contact Info",
        "type": "Email Address",
        "linked_to_user": true,
        "used_for_tracking": false,
        "purposes": [
          "App Functionality"
        ],
        "reason": "A form on the site sends this to the owner's data collection on Hypamoon (and by email to the owner); it is stored with the entry, so it is linked to the person who sent it.",
        "source": "forms"
      },
      {
        "category": "Contact Info",
        "type": "Phone Number",
        "linked_to_user": true,
        "used_for_tracking": false,
        "purposes": [
          "App Functionality"
        ],
        "reason": "A form on the site sends this to the owner's data collection on Hypamoon (and by email to the owner); it is stored with the entry, so it is linked to the person who sent it.",
        "source": "forms"
      },
      {
        "category": "User Content",
        "type": "Other User Content",
        "linked_to_user": true,
        "used_for_tracking": false,
        "purposes": [
          "App Functionality"
        ],
        "reason": "A form on the site sends this to the owner's data collection on Hypamoon (and by email to the owner); it is stored with the entry, so it is linked to the person who sent it. The text of chat messages.",
        "source": "forms, chat_widget"
      },
      {
        "category": "User Content",
        "type": "Customer Support",
        "linked_to_user": true,
        "used_for_tracking": false,
        "purposes": [
          "App Functionality"
        ],
        "reason": "Chat messages go to the owner's assistant on Hypamoon and are stored as a conversation the owner can read. People can type their name or contact details in a message, so we treat it as linked.",
        "source": "chat_widget"
      },
      {
        "category": "Diagnostics",
        "type": "Other Diagnostic Data",
        "linked_to_user": false,
        "used_for_tracking": false,
        "purposes": [
          "App Functionality"
        ],
        "reason": "Forms and the chat use a bot check against abuse; it reads signals from the browser for a moment and does not identify the person.",
        "source": "bot_check"
      },
      {
        "category": "Identifiers",
        "type": "Device ID",
        "linked_to_user": false,
        "used_for_tracking": false,
        "purposes": [
          "App Functionality"
        ],
        "reason": "The app registers a push token with Hypamoon so the owner can send notifications. It is stored per site, without a name or account. Apple does not always call a push token a device id; we declare it to be safe.",
        "source": "push"
      }
    ],
    "console_steps": [
      "Open App Store Connect, choose the app, then App Privacy in the sidebar.",
      "Next to Privacy Policy, click Edit and paste the privacy policy URL of the site. Save.",
      "Under Data Types, click Get Started (or Edit).",
      "\"Do you or your third-party partners collect data from this app?\" Answer Yes, we collect data from this app.",
      "Tick every data type below, then Save. App Store Connect then asks about each one in turn.",
      "Contact Info > Name: tick it, choose the purposes App Functionality, answer \"Is this data linked to the user's identity?\" with Yes, and \"Is this data used for tracking?\" with No.",
      "Contact Info > Email Address: tick it, choose the purposes App Functionality, answer \"Is this data linked to the user's identity?\" with Yes, and \"Is this data used for tracking?\" with No.",
      "Contact Info > Phone Number: tick it, choose the purposes App Functionality, answer \"Is this data linked to the user's identity?\" with Yes, and \"Is this data used for tracking?\" with No.",
      "User Content > Other User Content: tick it, choose the purposes App Functionality, answer \"Is this data linked to the user's identity?\" with Yes, and \"Is this data used for tracking?\" with No.",
      "User Content > Customer Support: tick it, choose the purposes App Functionality, answer \"Is this data linked to the user's identity?\" with Yes, and \"Is this data used for tracking?\" with No.",
      "Diagnostics > Other Diagnostic Data: tick it, choose the purposes App Functionality, answer \"Is this data linked to the user's identity?\" with No, and \"Is this data used for tracking?\" with No.",
      "Identifiers > Device ID: tick it, choose the purposes App Functionality, answer \"Is this data linked to the user's identity?\" with No, and \"Is this data used for tracking?\" with No.",
      "Click Publish at the top right. The labels go live with the next version you submit."
    ]
  },
  "google_play": {
    "collects_or_shares": true,
    "encrypted_in_transit": true,
    "deletion": "People can ask the owner to delete their data by email to hello@acme-plumbing.example. Google asks for a web link where people can request deletion; point it at the privacy policy or contact page.",
    "data_types": [
      {
        "category": "Personal info",
        "type": "Name",
        "collected": true,
        "shared": false,
        "processed_ephemerally": false,
        "required": false,
        "purposes": [
          "App functionality"
        ],
        "reason": "A form on the site sends this to the owner's data collection on Hypamoon (and by email to the owner); it is stored with the entry, so it is linked to the person who sent it.",
        "source": "forms"
      },
      {
        "category": "Personal info",
        "type": "Email address",
        "collected": true,
        "shared": false,
        "processed_ephemerally": false,
        "required": false,
        "purposes": [
          "App functionality"
        ],
        "reason": "A form on the site sends this to the owner's data collection on Hypamoon (and by email to the owner); it is stored with the entry, so it is linked to the person who sent it.",
        "source": "forms"
      },
      {
        "category": "Personal info",
        "type": "Phone number",
        "collected": true,
        "shared": false,
        "processed_ephemerally": false,
        "required": false,
        "purposes": [
          "App functionality"
        ],
        "reason": "A form on the site sends this to the owner's data collection on Hypamoon (and by email to the owner); it is stored with the entry, so it is linked to the person who sent it.",
        "source": "forms"
      },
      {
        "category": "App activity",
        "type": "Other user-generated content",
        "collected": true,
        "shared": false,
        "processed_ephemerally": false,
        "required": false,
        "purposes": [
          "App functionality"
        ],
        "reason": "A form on the site sends this to the owner's data collection on Hypamoon (and by email to the owner); it is stored with the entry, so it is linked to the person who sent it.",
        "source": "forms"
      },
      {
        "category": "Messages",
        "type": "Other in-app messages",
        "collected": true,
        "shared": false,
        "processed_ephemerally": false,
        "required": false,
        "purposes": [
          "App functionality"
        ],
        "reason": "Chat messages are stored as a conversation the owner can read. An AI model answers them as a service provider for the owner, which Google does not count as sharing.",
        "source": "chat_widget"
      },
      {
        "category": "Device or other IDs",
        "type": "Device or other IDs",
        "collected": true,
        "shared": false,
        "processed_ephemerally": false,
        "required": true,
        "purposes": [
          "Fraud prevention, security, and compliance",
          "App functionality"
        ],
        "reason": "A bot check looks at the browser against abuse when someone sends a form or starts a chat; processed only for that check. The app registers a push token so the owner can send notifications; people can refuse notifications.",
        "source": "bot_check, push"
      }
    ],
    "console_steps": [
      "Open the Play Console, choose the app, then Policy and programs > App content > Data safety, and click Start.",
      "\"Does your app collect or share any of the required user data types?\" Answer Yes.",
      "\"Is all of the user data collected by your app encrypted in transit?\" Answer Yes (every page and API call uses HTTPS).",
      "\"Which of the following methods of account creation does your app support?\" Pick what the site really offers; if people cannot create an account, choose \"My app does not allow users to create an account\".",
      "\"Do you provide a way for users to request that their data is deleted?\" Answer Yes, and give the URL of the privacy policy or contact page (people ask by email to hello@acme-plumbing.example).",
      "Next. Tick each data type below, then Next again and answer the questions per type.",
      "Personal info > Name: tick Collected; \"Is this data processed ephemerally?\" No; \"Is this data required?\" Users can choose; purposes: App functionality.",
      "Personal info > Email address: tick Collected; \"Is this data processed ephemerally?\" No; \"Is this data required?\" Users can choose; purposes: App functionality.",
      "Personal info > Phone number: tick Collected; \"Is this data processed ephemerally?\" No; \"Is this data required?\" Users can choose; purposes: App functionality.",
      "App activity > Other user-generated content: tick Collected; \"Is this data processed ephemerally?\" No; \"Is this data required?\" Users can choose; purposes: App functionality.",
      "Messages > Other in-app messages: tick Collected; \"Is this data processed ephemerally?\" No; \"Is this data required?\" Users can choose; purposes: App functionality.",
      "Device or other IDs > Device or other IDs: tick Collected; \"Is this data processed ephemerally?\" No; \"Is this data required?\" Required; purposes: Fraud prevention, security, and compliance, App functionality.",
      "Check the preview, then Save and submit for review."
    ]
  },
  "not_collected": [
    {
      "what": "Audio and call recordings",
      "reason": "Calls start in the phone's own dialer through a tel: link, outside the app. If the app ever records audio itself, this changes."
    },
    {
      "what": "Usage analytics by Hypamoon",
      "reason": "The site host counts requests per site for capacity, without IP addresses, cookies or any identifier of the visitor."
    },
    {
      "what": "Location",
      "reason": "The site does not ask for the location."
    },
    {
      "what": "Financial info",
      "reason": "No checkout, payment links or paid access found."
    }
  ],
  "notes": [
    "Run this again after every change to the site: new forms, scripts or payments change the answers.",
    "These answers are a careful starting point. The user is responsible for them and submits them in the console."
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### POST /sites/{id}/app-export

**Export a Capacitor app project for a site.**

Builds a Capacitor project that opens the site at its connected domain or hypamoon.app address, with the icon and splash from the site, a proposed app id in reverse domain form, an offline screen and push registration through Hypamoon, plus a README for building in Android Studio and Xcode. Returns a signed download link to a zip, valid for 15 minutes; a new export replaces the previous one. The zip contains no keys, tokens or passwords. Building and submitting in the cloud will come in a later phase.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the site. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `app_id` | string | Reverse domain form, like com.example.app. Leave it out for a proposal from the domain or the site's address. Cannot change after the first upload to a store. |
| `app_name` | string | The name under the icon. Leave it out to use the site's name. |
| `icon_path` | string | Path of an image on the site to use as the icon, like /icon-1024.png (square PNG, 1024x1024). Leave it out to pick the best icon the site has. |
| `background_color` | string | Background of the icon and splash screen as a hex color, like #ffffff. Leave it out to use the site's theme color. |

JSON

```
{
  "app_id": "com.acmeplumbing.app",
  "icon_path": "/icon-1024.png"
}
```

#### 201 The project is ready to download.

| Field | Type |  |
| --- | --- | --- |
| `download_url` (required) | string | A signed link to the zip, valid for 15 minutes. Give it to the user; never store it. |
| `expires_at` (required) | string |  |
| `app_id` (required) | string |  |
| `app_id_reason` (required) | string |  |
| `app_name` (required) | string |  |
| `app_url` (required) | string | The address the app opens: the connected domain, or the site's hypamoon.app address. |
| `icon` (required) | string or null | Where the icon is in the zip, or null when the user must add one. |
| `background_color` (required) | string |  |
| `files` (required) | string\[\] |  |
| `bytes` (required) | integer |  |
| `warnings` (required) | string\[\] |  |
| `test` (required) | boolean |  |

JSON

```
{
  "download_url": "https://api.hypamoon.com/api/v1/public/app-exports/k7q2m4x9r3t6w8y2b5c7d9f3gh?o=5f0c9a2e-1b3d-4e5f-8a9b-0c1d2e3f4a5b&n=acme-plumbing-app&e=1791282000&s=3q2-7wEXAMPLEsignature",
  "expires_at": "2026-10-06T12:20:00.000Z",
  "app_id": "com.acmeplumbing.app",
  "app_id_reason": "Chosen by the user.",
  "app_name": "Acme Plumbing",
  "app_url": "https://acme-plumbing.hypamoon.app",
  "icon": "assets/icon-only.png",
  "background_color": "#0b5cff",
  "files": [
    "assets/icon-only.png",
    "package.json",
    "capacitor.config.json",
    "www/index.html",
    "www/offline.html",
    "www/app.js",
    ".gitignore",
    "hypamoon.json",
    "README.md"
  ],
  "bytes": 9214,
  "warnings": [],
  "test": false
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /sites/{id}/readiness

**Check what works on a site and what is missing before going live.**

Reads the live files of a site, detects its kind (or takes type) and checks what can be checked automatically: terms, privacy, returns and contact pages with company details; forms that post to a real collection (not nowhere, not only mailto, not localStorage); buy buttons and a cart that lead to a real checkout; prices with currency; no placeholder text; no test wording on a live project; internal links that work; a 404 page; no password checked in JavaScript. It also checks findability: a title (10 to 60 characters) and a meta description (50 to 160) per page, exactly one h1, the page language, a share preview (og:title, og:description and an absolute og:image), alt text on images, images over 500 KB, a viewport meta tag and a favicon; and structured data (JSON-LD): existing blocks are checked for valid JSON, their required fields and leftover placeholders, and when there is none and the kind is known it offers a ready snippet to fill with the user's real details. Returns what works, what is missing (each with a plain explanation and the next tool), and what only the owner can confirm (check\_with\_owner). Advice only: it never blocks a deploy.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the site. |
| `type` | query | `"webshop"`, `"bookings"`, `"restaurant"`, `"course_membership"`, `"wordpress_portal"` | The kind of application; leave it out to detect it from the site. |

#### 200 What works, what is missing, and what to check with the owner.

| Field | Type |  |
| --- | --- | --- |
| `site` (required) | object |  |
| `type` (required) | `"webshop"`, `"bookings"`, `"restaurant"`, `"course_membership"`, `"wordpress_portal"`, `null` |  |
| `type_source` (required) | `"given"`, `"detected"`, `"none"` |  |
| `region` (required) | `"eu"`, `"uk"`, `"us"`, `"other"` |  |
| `country` (required) | string or null |  |
| `works` (required) | object\[\] |  |
| `missing` (required) | object\[\] |  |
| `check_with_owner` (required) | object\[\] | What cannot be checked on the site; ask the owner, never require an answer. |
| `pages_checked` (required) | integer |  |
| `note` (required) | string |  |
| `summary_markdown` (required) | string |  |

JSON

```
{
  "site": {
    "id": "7a1c2e0f-3b4d-4e5f-8a9b-0c1d2e3f4a5b",
    "url": "https://bakkerij-jansen.hypamoon.app",
    "live": true
  },
  "type": "webshop",
  "type_source": "given",
  "region": "eu",
  "country": "NL",
  "works": [
    {
      "id": "contact_details",
      "title": "Contact and company details",
      "detail": "Found an email address, an address, the KvK number."
    },
    {
      "id": "forms_saved",
      "title": "Forms save what visitors send",
      "detail": "1 form found, each sent to collection contact."
    },
    {
      "id": "no_fake_login",
      "title": "No password checked in JavaScript",
      "detail": "No password is checked in JavaScript."
    },
    {
      "id": "no_local_storage_db",
      "title": "No visitor data kept in localStorage",
      "detail": "localStorage is not used for visitor data."
    },
    {
      "id": "no_test_wording",
      "title": "No test wording on the live site",
      "detail": "No test wording found on the live site."
    },
    {
      "id": "prices_currency",
      "title": "Prices with currency",
      "detail": "Prices are shown with their currency."
    },
    {
      "id": "no_placeholders",
      "title": "No placeholder text",
      "detail": "No placeholder text found."
    },
    {
      "id": "seo_h1",
      "title": "One main heading per page",
      "detail": "Every page has exactly one h1 heading (all 4 pages checked)."
    },
    {
      "id": "seo_image_alt",
      "title": "Alt text on images",
      "detail": "The pages have no <img> elements."
    },
    {
      "id": "seo_image_size",
      "title": "Image file sizes",
      "detail": "The site has no image files of its own."
    }
  ],
  "missing": [
    {
      "id": "terms_page",
      "title": "Terms or policy page",
      "explanation": "No terms and conditions page was found. Before you go live, you might want to add one and link it in the footer.",
      "next_step": {
        "tool": "deploy_site",
        "how": "Add /terms with keep_existing: true and link it from the footer of every page. Write it with the user; never invent their policies."
      }
    },
    {
      "id": "returns_page",
      "title": "Returns and withdrawal page",
      "explanation": "No returns or withdrawal page was found. Before you go live, you might want to add one and link it in the footer.",
      "next_step": {
        "tool": "deploy_site",
        "how": "Add /returns with the 14-day withdrawal information and the model withdrawal form with keep_existing: true and link it from the footer of every page. Write it with the user; never invent their policies."
      }
    },
    {
      "id": "privacy_page",
      "title": "Privacy statement",
      "explanation": "A form asks for personal data (name, email or phone) on /contact.html, but that page has no privacy text or link. Visitors should be able to read what happens with their data before they send it (GDPR).",
      "next_step": {
        "tool": "deploy_site",
        "how": "Add a short line under the form, like \"We only use your details to answer your message. Read our privacy statement.\", linked to a /privacy page written with the user (never invent their policies). Then deploy_site with keep_existing: true."
      },
      "paths": [
        "/contact.html"
      ]
    },
    {
      "id": "checkout_real",
      "title": "Buttons and cart lead somewhere real",
      "explanation": "The button \"In winkelwagen\" on /index.html does nothing: it is outside a form and no script handles it. The link \"Bestel nu\" on /producten.html goes nowhere (href #). The site has a cart, but nothing leads to a real checkout or an order request; a visitor can fill the cart and never order.",
      "next_step": {
        "tool": "get_checkout_snippet",
        "how": "Use the real checkout (get_checkout_snippet) or a form that saves (get_form_snippet); if that is not available, change the text so it does not promise it."
      },
      "paths": [
        "/index.html",
        "/producten.html"
      ]
    },
    {
      "id": "internal_links",
      "title": "Internal links work",
      "explanation": "1 internal link lead to a page that does not exist: /voorwaarden (on /producten).",
      "next_step": {
        "tool": "deploy_site",
        "how": "Add the missing pages or fix the links, with keep_existing: true."
      },
      "paths": [
        "/producten.html"
      ]
    },
    {
      "id": "not_found_page",
      "title": "Not-found page",
      "explanation": "The site has no own not-found page; visitors who follow an old link see a plain error.",
      "next_step": {
        "tool": "deploy_site",
        "how": "Add /404.html with a link back home and the contact details, with keep_existing: true."
      }
    },
    {
      "id": "seo_title",
      "title": "Page titles for search",
      "explanation": "3 pages without a good title: /producten (no title), /contact (no title), /privacy (no title). Search engines show the title as the headline of the result. Before you go live, you might want to give every page its own title of 10 to 60 characters.",
      "next_step": {
        "tool": "deploy_site",
        "how": "Add a <title> of 10 to 60 characters to the head of each page, saying what that page is about (like \"Fresh sourdough bread | Bakery name\"), and deploy with keep_existing: true."
      },
      "paths": [
        "/producten.html",
        "/contact.html",
        "/privacy.html"
      ]
    },
    {
      "id": "seo_description",
      "title": "Meta descriptions for search",
      "explanation": "4 pages without a good meta description: / (no description), /producten (no description), /contact (no description), /privacy (no description). Search engines often show it as the text under the headline. Before you go live, you might want to give every page a short description of 50 to 160 characters.",
      "next_step": {
        "tool": "deploy_site",
        "how": "Add <meta name=\"description\" content=\"...\"> of 50 to 160 characters to the head of each page, in the user's own words about that page, and deploy with keep_existing: true."
      },
      "paths": [
        "/index.html",
        "/producten.html",
        "/contact.html",
        "/privacy.html"
      ]
    },
    {
      "id": "seo_lang",
      "title": "Page language set",
      "explanation": "3 pages without a language: /producten (no lang), /contact (no lang), /privacy (no lang). The lang attribute helps search engines show the page to the right audience and lets screen readers pronounce it correctly. Before you go live, you might want to add it.",
      "next_step": {
        "tool": "deploy_site",
        "how": "Set <html lang=\"nl\"> (or the language the site is written in, like en or de) on each page and deploy with keep_existing: true."
      },
      "paths": [
        "/producten.html",
        "/contact.html",
        "/privacy.html"
      ]
    },
    {
      "id": "seo_open_graph",
      "title": "Share preview (Open Graph)",
      "explanation": "4 pages without a complete share preview: / (no og:title, og:description, og:image), /producten (no og:title, og:description, og:image), /contact (no og:title, og:description, og:image), /privacy (no og:title, og:description, og:image). When someone shares the link in WhatsApp, LinkedIn or Facebook, these tags decide the title, text and image of the preview. Before you go live, you might want to add og:title, og:description and og:image.",
      "next_step": {
        "tool": "deploy_site",
        "how": "Add <meta property=\"og:title\">, <meta property=\"og:description\"> and <meta property=\"og:image\" content=\"https://...\"> (a full https address to an image of about 1200 by 630 pixels) to the head of each page, and deploy with keep_existing: true."
      },
      "paths": [
        "/index.html",
        "/producten.html",
        "/contact.html",
        "/privacy.html"
      ]
    },
    {
      "id": "seo_viewport",
      "title": "Mobile viewport",
      "explanation": "4 pages without a viewport meta tag: / (no viewport), /producten (no viewport), /contact (no viewport), /privacy (no viewport). Without it phones show the page zoomed out and tiny, and search engines treat it as not mobile friendly. Before you go live, you might want to add it.",
      "next_step": {
        "tool": "deploy_site",
        "how": "Add <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"> to the head of each page and deploy with keep_existing: true."
      },
      "paths": [
        "/index.html",
        "/producten.html",
        "/contact.html",
        "/privacy.html"
      ]
    },
    {
      "id": "seo_favicon",
      "title": "Favicon",
      "explanation": "The site has no favicon, the small icon in the browser tab and next to the site in search results. Sites on hypamoon.app get no default icon, so browsers show an empty one. Before you go live, you might want to add one.",
      "next_step": {
        "tool": "deploy_site",
        "how": "Add /favicon.ico or /favicon.svg (the user's logo, or a simple icon from their initial) and <link rel=\"icon\" href=\"/favicon.svg\"> in the head of each page, with keep_existing: true."
      }
    },
    {
      "id": "structured_data",
      "title": "Structured data for search",
      "explanation": "The site has no structured data (JSON-LD). Before you go live, you might want to add a Product block so search engines can show more than a plain link: Search engines can show the product with its price and whether it is in stock. Use one block per product page, with that product's own details.",
      "next_step": {
        "tool": "deploy_site",
        "how": "Add this block to the head of each product page (one block per product, with that product's details), replace every YOUR ... placeholder with the user's real details (ask them; never invent an address, phone number, price or hours, and leave out optional fields you do not know), then deploy with keep_existing: true: <script type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"Product\",\"name\":\"YOUR PRODUCT NAME\",\"description\":\"YOUR PRODUCT DESCRIPTION\",\"image\":\"YOUR PRODUCT IMAGE URL (absolute, https)\",\"offers\":{\"@type\":\"Offer\",\"price\":\"YOUR PRICE (like 19.95)\",\"priceCurrency\":\"YOUR CURRENCY CODE (like EUR)\",\"availability\":\"https://schema.org/InStock\",\"url\":\"YOUR PRODUCT PAGE URL\"}}</script>"
      }
    }
  ],
  "check_with_owner": [
    {
      "id": "vat_number",
      "level": "usually_required",
      "description": "The VAT number on the site, if the business has one (not every small business or private seller does).",
      "why": "Businesses with a VAT number are usually expected to show it on their site.",
      "how_on_hypamoon": "Ask the user for these details (never invent them), put them on /contact and in the footer of every page with deploy_site."
    },
    {
      "id": "cookie_notice",
      "level": "recommended",
      "description": "A cookie notice with a real choice, but only if the site uses non-essential cookies or trackers (analytics with personal data, advertising pixels, embedded videos that set cookies). A site with only functional storage needs no banner.",
      "why": "The ePrivacy rules (EU) and PECR (UK) require consent before non-essential cookies are set. A banner that is not needed only gets in the way.",
      "how_on_hypamoon": "Hypamoon sites, forms, checkout and the chat widget need no cookie banner by themselves. If the user adds a tracker, add a consent banner that loads it only after a yes."
    },
    {
      "id": "accessibility",
      "level": "recommended",
      "description": "Basic accessibility: readable contrast, alt text on images, labels on form fields, keyboard navigation, and an accessibility statement for online shops and services.",
      "why": "The European Accessibility Act applies to e-commerce and many consumer services since 28 June 2025; micro-enterprises (fewer than 10 staff and at most 2 million euro turnover) are usually exempt for services. Accessible sites also sell better.",
      "how_on_hypamoon": "Build the pages with labels, alt text and enough contrast; add /accessibility if the business is not a micro-enterprise."
    },
    {
      "id": "withdrawal_function",
      "level": "usually_required",
      "description": "An easy way to withdraw online: a clearly labelled withdrawal function (like \"withdraw from contract here\") where the customer confirms their withdrawal, followed by a confirmation.",
      "why": "An EU amendment to the Consumer Rights Directive (Directive 2023/2673) asks for an online withdrawal function for contracts made online, applying from 19 June 2026.",
      "how_on_hypamoon": "A form on /returns that saves the withdrawal in a collection (create_collection with public_write and email_on_insert, get_form_snippet) and shows a confirmation."
    },
    {
      "id": "shipping_costs_upfront",
      "level": "usually_required",
      "description": "Shipping costs, delivery restrictions (countries) and the expected delivery time shown before the customer starts ordering.",
      "why": "In the EU and UK this information must be clear at the start of the ordering process; everywhere, hidden costs at the end are the main reason people abandon a purchase.",
      "how_on_hypamoon": "Show shipping costs on the product pages and next to the order button (deploy_site)."
    },
    {
      "id": "payment_methods_upfront",
      "level": "usually_required",
      "description": "The accepted payment methods shown at the latest at the start of the ordering process.",
      "why": "The Consumer Rights Directive asks for this at the start of the order.",
      "how_on_hypamoon": "List the methods of the user's payment account on the product page or in the footer."
    },
    {
      "id": "order_button_text",
      "level": "usually_required",
      "description": "The final order button says clearly that ordering means paying, like \"Order with obligation to pay\" or in Dutch \"Bestellen en betalen\"; not just \"Next\" or \"Continue\".",
      "why": "The EU Consumer Rights Directive and the UK rules require this; without it the customer may not be bound by the order.",
      "how_on_hypamoon": "Set the button text on the checkout button (get_checkout_snippet html) or the order request button."
    },
    {
      "id": "order_confirmation",
      "level": "usually_required",
      "description": "An order confirmation by email (a durable medium) with what was ordered, the price, the company details and the withdrawal information.",
      "why": "EU and UK consumer law ask for a confirmation on a durable medium at the latest at delivery; customers everywhere expect one right away.",
      "how_on_hypamoon": "Check what the checkout or the payment provider already sends; add one with send_email (Mail module) if needed, or tell the user to send it."
    },
    {
      "id": "legal_guarantee",
      "level": "recommended",
      "description": "A line about the legal guarantee: products must be as promised, and consumers keep their legal rights when something is wrong.",
      "why": "The legal guarantee applies anyway (at least two years in most EU countries; in the Netherlands what the buyer may reasonably expect); saying so avoids disputes.",
      "how_on_hypamoon": "Add it to /terms or /returns with deploy_site."
    },
    {
      "id": "complaints",
      "level": "recommended",
      "description": "How to complain, with an email address and a reasonable answer time, and the dispute body if the business is a member of one (in the Netherlands for example the Geschillencommissie or a trade association).",
      "why": "The EU ODR platform closed on 20 July 2025 and the link is no longer needed, but a clear complaint route is still expected, and members of a dispute body must mention it.",
      "how_on_hypamoon": "Add it to /terms or /contact with deploy_site."
    },
    {
      "id": "age_check",
      "level": "usually_required",
      "description": "An age check when selling age-restricted products (alcohol, tobacco and vapes, knives, some games): ask for confirmation online and check the ID at delivery.",
      "why": "Selling these to minors is forbidden; in the Netherlands the Alcoholwet requires an age check at the door for alcohol delivered to the home.",
      "how_on_hypamoon": "Only if relevant: add an age statement to the order form and tell the user to arrange the check at delivery."
    },
    {
      "id": "vat_registration",
      "level": "recommended",
      "description": "VAT set up correctly: the right rate in the prices, and the EU One Stop Shop (OSS) when sales to consumers in other EU countries pass 10,000 euro a year.",
      "why": "Above that threshold the VAT of the buyer's country applies.",
      "how_on_hypamoon": "Nothing to build; mention it to the user so they check it with their accountant."
    }
  ],
  "pages_checked": 4,
  "note": "Advice only: nothing here blocks a deploy or requires the user to answer anything. Share what is missing in plain words and offer to fix it. This is guidance to help the user prepare, not legal or tax advice. Rules differ per country and change over time; for anything that matters, the user checks with an advisor or the official sources (in the Netherlands for example ACM ConsuWijzer for consumer law, the Belastingdienst for VAT and the Autoriteit Persoonsgegevens for privacy).",
  "summary_markdown": "## Readiness of https://bakkerij-jansen.hypamoon.app (webshop)\n**Works (10):** Contact and company details; Forms save what visitors send; No password checked in JavaScript; No visitor data kept in localStorage; No test wording on the live site; Prices with currency; No placeholder text; One main heading per page; Alt text on images; Image file sizes.\n**Before you go live, you might want to look at (13):**\n- Terms or policy page: No terms and conditions page was found. Before you go live, you might want to add one and link it in the footer. Next: deploy_site.\n- Returns and withdrawal page: No returns or withdrawal page was found. Before you go live, you might want to add one and link it in the footer. Next: deploy_site.\n- Privacy statement: A form asks for personal data (name, email or phone) on /contact.html, but that page has no privacy text or link. Visitors should be able to read what happens with their data before they send it (GDPR). Next: deploy_site.\n- Buttons and cart lead somewhere real: The button \"In winkelwagen\" on /index.html does nothing: it is outside a form and no script handles it. The link \"Bestel nu\" on /producten.html goes nowhere (href #). The site has a cart, but nothing leads to a real checkout or an order request; a visitor can fill the cart and never order. Next: get_checkout_snippet.\n- Internal links work: 1 internal link lead to a page that does not exist: /voorwaarden (on /producten). Next: deploy_site.\n- Not-found page: The site has no own not-found page; visitors who follow an old link see a plain error. Next: deploy_site.\n- Page titles for search: 3 pages without a good title: /producten (no title), /contact (no title), /privacy (no title). Search engines show the title as the headline of the result. Before you go live, you might want to give every page its own title of 10 to 60 characters. Next: deploy_site.\n- Meta descriptions for search: 4 pages without a good meta description: / (no description), /producten (no description), /contact (no description), /privacy (no description). Search engines often show it as the text under the headline. Before you go live, you might want to give every page a short description of 50 to 160 characters. Next: deploy_site.\n- Page language set: 3 pages without a language: /producten (no lang), /contact (no lang), /privacy (no lang). The lang attribute helps search engines show the page to the right audience and lets screen readers pronounce it correctly. Before you go live, you might want to add it. Next: deploy_site.\n- Share preview (Open Graph): 4 pages without a complete share preview: / (no og:title, og:description, og:image), /producten (no og:title, og:description, og:image), /contact (no og:title, og:description, og:image), /privacy (no og:title, og:description, og:image). When someone shares the link in WhatsApp, LinkedIn or Facebook, these tags decide the title, text and image of the preview. Before you go live, you might want to add og:title, og:description and og:image. Next: deploy_site.\n- Mobile viewport: 4 pages without a viewport meta tag: / (no viewport), /producten (no viewport), /contact (no viewport), /privacy (no viewport). Without it phones show the page zoomed out and tiny, and search engines treat it as not mobile friendly. Before you go live, you might want to add it. Next: deploy_site.\n- Favicon: The site has no favicon, the small icon in the browser tab and next to the site in search results. Sites on hypamoon.app get no default icon, so browsers show an empty one. Before you go live, you might want to add one. Next: deploy_site.\n- Structured data for search: The site has no structured data (JSON-LD). Before you go live, you might want to add a Product block so search engines can show more than a plain link: Search engines can show the product with its price and whether it is in stock. Use one block per product page, with that product's own details. Next: deploy_site.\n**Check with the owner (12):** vat_number, cookie_notice, accessibility, withdrawal_function, shipping_costs_upfront, payment_methods_upfront, order_button_text, order_confirmation, legal_guarantee, complaints, age_check, vat_registration.\n\n_This is advice, not a gate: it never blocks a deploy. This is guidance to help the user prepare, not legal or tax advice. Rules differ per country and change over time; for anything that matters, the user checks with an advisor or the official sources (in the Netherlands for example ACM ConsuWijzer for consumer law, the Belastingdienst for VAT and the Autoriteit Persoonsgegevens for privacy)._"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### POST /search-console/verify

**Verify a site or domain in Google Search Console.**

Proves to Google Search Console that a site or domain belongs to the user, with the token from Search Console (the value alone, google-site-verification=..., or the whole meta tag). method dns adds the TXT record google-site-verification=<token> to a domain connected in this project with nameservers (Search Console property type Domain). method meta adds the meta tag to /index.html as a new site version labelled "search console verification" (property type URL prefix; also on <slug>.hypamoon.app). A site that is unlisted, behind a password or paid access, or offline is refused: Google cannot read it. Give site\_id or domain. Calling it again with the same token changes nothing. Returns the property, the next steps for the user in Search Console and the sitemap to submit.

Scope: `sites:write`

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `site_id` | string (uuid) | The site to verify. For method meta this is the site that gets the tag; for dns the domain connected to this site is used. |
| `domain` | string | A domain connected in this project (connect\_domain), like example.com. For method dns; for meta, the site on this domain. |
| `method` (required) | `"dns"`, `"meta"` | dns: a TXT record on the connected domain (a domain property in Search Console). meta: a meta tag on the home page (property type URL prefix). |
| `token` (required) | string | The verification token from Search Console: the value alone, google-site-verification=..., or the whole meta tag. |

JSON

```
{
  "domain": "bakkerijjansen.nl",
  "method": "dns",
  "token": "Abc123dEf456gHi789jKl012mNo345pQr678sTu901v"
}
```

#### 200 What was added and what the user does next.

| Field | Type |  |
| --- | --- | --- |
| `method` (required) | `"dns"`, `"meta"` |  |
| `status` (required) | `"added"`, `"already_present"`, `"waiting_for_approval"` | added: done now. already\_present: it was there already. waiting\_for\_approval: the project needs a second person to approve the new version first. |
| `site_id` (required) | string or null |  |
| `domain` (required) | string or null |  |
| `property` (required) | string | What to enter in Search Console: sc-domain:<domain> for a domain property, or the address for a URL prefix property. |
| `record` | object |  |
| `version` | integer or null | The new site version with the tag (meta), when versions are on. |
| `sitemap` (required) | string | The sitemap to submit in Search Console under Sitemaps; the site serves it automatically. |
| `next_steps` (required) | string\[\] |  |

JSON

```
{
  "method": "dns",
  "status": "added",
  "site_id": "5b1f3c2a-8d4e-4f6a-9b7c-1d2e3f4a5b6c",
  "domain": "bakkerijjansen.nl",
  "property": "sc-domain:bakkerijjansen.nl",
  "record": {
    "type": "TXT",
    "name": "bakkerijjansen.nl",
    "content": "google-site-verification=Abc123dEf456gHi789jKl012mNo345pQr678sTu901v"
  },
  "sitemap": "https://bakkerijjansen.nl/sitemap.xml",
  "next_steps": [
    "In Search Console (https://search.google.com/search-console), add a property of the type Domain for bakkerijjansen.nl (the one you got this token for) and click Verify.",
    "Keep the TXT record: removing it ends the verification.",
    "After verifying, go to Sitemaps and submit https://bakkerijjansen.nl/sitemap.xml."
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /sites/{id}/stats

**Get the visits of a site.**

Page views of a site of this project per day, the top pages and where visitors came from (direct, internal, search, social, email, shortener, external). Counted at the edge without cookies; crawlers and scripts are left out. Page views, not unique visitors. Data is kept for 90 days; paths and the bot filter exist since 9 October 2026. A site behind a password also gets password\_logins: successful logins with the site password per day and the last 20 times, without anything about who logged in.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the site. |
| `days` | query | integer | How many days back, today included (default 30). |

#### 200 Page views per day, top pages and origins.

| Field | Type |  |
| --- | --- | --- |
| `site_id` (required) | string |  |
| `slug` (required) | string |  |
| `days` (required) | integer |  |
| `from` (required) | string | The first day (UTC) in the range. |
| `to` (required) | string | The last day (UTC), today. |
| `totals` (required) | object |  |
| `per_day` (required) | object\[\] |  |
| `top_pages` (required) | object\[\] | Up to 10 paths with the most page views. Paths are recorded since 9 October 2026. |
| `origins` (required) | object\[\] | Where page views came from: direct (no referrer), internal (from the site itself), search, social, email, shortener or external (another site). |
| `note` (required) | string |  |
| `password_logins` | object | Only for a site behind a password: successful logins with the site password per day in the range, and the times of the last 20. Who logged in is not recorded (no IP address, no device); kept for 90 days. |
| `recipients` | object\[\] | Only for a site with recipient passwords (POST /sites/{id}/recipients): per recipient whether they opened it, page views and opens in the range, correct password entries, first and last time and the pages viewed. Counted from the session the password gave; no other cookie and no IP address. |

JSON

```
{
  "site_id": "5b1f3c2a-8d4e-4f6a-9b7c-1d2e3f4a5b6c",
  "slug": "bakkerij-jansen",
  "days": 7,
  "from": "2026-10-03",
  "to": "2026-10-09",
  "totals": {
    "page_views": 60,
    "bot_page_views_excluded": 41
  },
  "per_day": [
    {
      "date": "2026-10-03",
      "page_views": 0
    },
    {
      "date": "2026-10-04",
      "page_views": 0
    },
    {
      "date": "2026-10-05",
      "page_views": 12
    },
    {
      "date": "2026-10-06",
      "page_views": 0
    },
    {
      "date": "2026-10-07",
      "page_views": 30
    },
    {
      "date": "2026-10-08",
      "page_views": 0
    },
    {
      "date": "2026-10-09",
      "page_views": 18
    }
  ],
  "top_pages": [
    {
      "path": "/",
      "page_views": 34
    },
    {
      "path": "/menu",
      "page_views": 19
    },
    {
      "path": "/contact",
      "page_views": 7
    }
  ],
  "origins": [
    {
      "origin": "search",
      "page_views": 28
    },
    {
      "origin": "direct",
      "page_views": 20
    },
    {
      "origin": "social",
      "page_views": 12
    }
  ],
  "note": "Page views by people, counted at the edge without cookies; not unique visitors. Numbers can be estimates on busy days (sampling). Paths and the bot filter exist since 9 October 2026; older data is kept for 90 days.",
  "password_logins": {
    "total": 3,
    "per_day": [
      {
        "date": "2026-10-03",
        "logins": 0
      },
      {
        "date": "2026-10-04",
        "logins": 0
      },
      {
        "date": "2026-10-05",
        "logins": 0
      },
      {
        "date": "2026-10-06",
        "logins": 0
      },
      {
        "date": "2026-10-07",
        "logins": 2
      },
      {
        "date": "2026-10-08",
        "logins": 0
      },
      {
        "date": "2026-10-09",
        "logins": 1
      }
    ],
    "last": [
      "2026-10-09T08:12:40.000Z",
      "2026-10-07T16:03:11.000Z",
      "2026-10-07T09:45:02.000Z"
    ]
  }
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /sites/{id}/fetch

**Fetch a page of a site or app, live.**

Fetches one path of a site or app of this project from the public internet, through Hypamoon's server, and returns the status, the main headers (never set-cookie), the final URL after redirects and the start of the body as text. The way to prove that a deployed site or app endpoint works live, for a client that cannot open the address itself. Only addresses of this project: the site's own address (also the secret link of an unlisted site) and its connected domains; give path (on the site's address) or a full url on one of them. Redirects are followed up to 3 times, and only to addresses of this project; otherwise redirect\_blocked says why and the redirect itself is returned. GET or HEAD only, without cookies or keys, a 10 second timeout per hop, the body cut at 20 KB (truncated), private addresses refused. At most 30 requests per minute per project (429 rate\_limited). A site that does not answer gives 502 upstream\_error.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the site. |
| `path` | query | string | The path on the site's address, like / or /contact or /api/health, with a query if needed. Give this or url. |
| `url` | query | string (uri) | A full https URL on an address of this site, like a connected domain. Give this or path. |
| `method` | query | `"GET"`, `"HEAD"` | GET (default) or HEAD. |

#### 200 What the site answered.

| Field | Type |  |
| --- | --- | --- |
| `url` (required) | string | The address that was asked for. |
| `final_url` (required) | string | The address that answered, after the redirects that were followed. |
| `method` (required) | `"GET"`, `"HEAD"` |  |
| `status` (required) | integer | The HTTP status of the final answer. |
| `ok` (required) | boolean | true for a 2xx status. |
| `headers` (required) | object | content-type, cache-control, location, etag, x-\* and a few more. Never set-cookie. |
| `redirects` (required) | object\[\] | The redirects that were followed, in order. |
| `redirect_blocked` | string | Set when a redirect was not followed (another host, not https, or too many); status and headers are then of that redirect. |
| `content_type` (required) | string or null |  |
| `body` (required) | string or null | The body as text, at most 20 KB; null for HEAD, an empty body or a body that is not text. |
| `body_bytes` (required) | integer | Bytes received (reading stops after 256 KB). |
| `truncated` (required) | boolean | true when the body is longer than what is returned. |
| `body_note` | string | Why the body is not shown, when it is not. |
| `elapsed_ms` (required) | integer |  |

JSON

```
{
  "url": "https://bakkerij-jansen.hypamoon.app/contact",
  "final_url": "https://bakkerij-jansen.hypamoon.app/contact",
  "method": "GET",
  "status": 200,
  "ok": true,
  "headers": {
    "content-type": "text/html; charset=utf-8",
    "cache-control": "public, max-age=60"
  },
  "redirects": [],
  "content_type": "text/html",
  "body": "<!doctype html><html lang=\"nl\"><head><title>Contact | Bakkerij Jansen</title>",
  "body_bytes": 4210,
  "truncated": false,
  "elapsed_ms": 182
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 502 | [`upstream_error`](https://hypamoon.com/docs/errors/upstream_error) |

### GET /sites/{id}/file

**Read one text file of a site.**

Returns the current content of one text file of a site of this project (html, css, js, json, md, txt, svg and other text types), complete, with the site's current version and the file's sha256. Use it before a small change: read the file, change it, and send only that file with PUT /sites/{id} (keep\_existing: true, if\_match\_version set to version from this response). If someone else changed the site in between, that PUT returns 409 version\_conflict and nothing changes. Images, fonts, PDFs, video and audio are not returned (422 validation\_failed), nor files above 256 KB. GET /sites/{id} lists the paths.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the site. |
| `path` (required) | query | string | The exact path of the file, like /index.html or /css/style.css. |

#### 200 The file and its content.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"site_file"` |  |
| `site_id` (required) | string (uuid) |  |
| `path` (required) | string | The path of the file, like /index.html. |
| `content_type` (required) | string |  |
| `bytes` (required) | integer |  |
| `sha256` (required) | string or null | The SHA-256 of the file's bytes as hex. |
| `version` (required) | string | The site's current version: send it as if\_match\_version when you change the site (deploy\_site or edit\_site\_file). |
| `encoding` (required) | `"utf8"` |  |
| `content` (required) | string | The file's current text, complete (at most 256 KB). |

JSON

```
{
  "object": "site_file",
  "site_id": "6a7b8c9d-0e1f-4a2b-9c3d-4e5f6a7b8c9d",
  "path": "/index.html",
  "content_type": "text/html",
  "bytes": 2310,
  "sha256": "9f2c4a7e1b3d5f6a8c0e2b4d6f8a0c2e4b6d8f0a2c4e6b8d0f2a4c6e8b0d2f4a",
  "version": "rACKg6LIN7-X5i7J",
  "encoding": "utf8",
  "content": "<!doctype html><html lang=\"nl\"><head><title>Bakkerij Jansen</title></head><body><h1>Open 9 to 5</h1></body></html>"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /sites/{id}/recipients

**List the recipient passwords of a site.**

The personal passwords of a site, oldest first, each with its label, status (active, expired or revoked), end date and how often it was entered correctly. The passwords themselves are never returned: Hypamoon keeps only a hash. Who opened what: GET /sites/{id}/stats (recipients).

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the site. |

#### 200 The recipient passwords.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] |  |

JSON

```
{
  "data": [
    {
      "object": "site_recipient",
      "id": "3e7c1a52-9b4d-4f0e-8a21-6d5c4b3a2f10",
      "site_id": "6a7b8c9d-0e1f-4a2b-9c3d-4e5f6a7b8c9d",
      "label": "Jan de Vries",
      "status": "active",
      "created_at": "2026-11-10T09:00:00.000Z",
      "expires_at": "2026-12-31T23:59:59.000Z",
      "revoked_at": null,
      "password_logins": {
        "total": 2,
        "first": "2026-11-10T10:12:00.000Z",
        "last": "2026-11-11T08:40:00.000Z"
      }
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### POST /sites/{id}/recipients

**Create a personal password for one recipient.**

Gives a site a password for one person, with a label (usually their name), next to or instead of the shared site password. From the first recipient password on, the site is closed to everyone else, also without a shared password, and it stays closed when no recipient password is active any more (then nobody gets in). To make it public again: revoke all recipient passwords, then PUT /sites/{id} with password null. Hypamoon makes the password (four groups of four letters and digits, like k7m2-x9qp-4trv-h8wn) and returns it only in this response; store or send it right away. Capitals, spaces and dashes do not matter when typing it. Whoever signs in with it gets a session for that recipient, and their visits count per recipient in GET /sites/{id}/stats (opened or not, page views, opens, first and last time, pages). No extra cookie and no IP address are stored with the label. Tell recipients the link is personal and that the sender sees when it is opened. The same attempt limits and bot check as the shared password apply. At most 100 active recipient passwords per site. Revoke one with DELETE /sites/{id}/recipients/{recipientId}.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the site. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `label` (required) | string | Who the password is for, usually the name of the recipient. Shown to you, never to the visitor. |
| `expires_at` | string or null | Optional end date (ISO 8601 date or time, at most 730 days ahead). After it the password and its sessions stop working. |

JSON

```
{
  "label": "Jan de Vries",
  "expires_at": "2026-12-31"
}
```

#### 201 The new recipient password, with password shown this once.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"site_recipient"` |  |
| `id` (required) | string |  |
| `site_id` (required) | string |  |
| `label` (required) | string | Who the password is for, usually the name of the recipient. |
| `status` (required) | `"active"`, `"expired"`, `"revoked"` |  |
| `created_at` (required) | string |  |
| `expires_at` (required) | string or null | After this moment the password and its sessions stop working. Null: no end date. |
| `revoked_at` (required) | string or null |  |
| `password_logins` (required) | object |  |
| `password` (required) | string | The password for this recipient. Shown only now: Hypamoon keeps only a hash. |

JSON

```
{
  "object": "site_recipient",
  "id": "3e7c1a52-9b4d-4f0e-8a21-6d5c4b3a2f10",
  "site_id": "6a7b8c9d-0e1f-4a2b-9c3d-4e5f6a7b8c9d",
  "label": "Jan de Vries",
  "status": "active",
  "created_at": "2026-11-10T09:00:00.000Z",
  "expires_at": "2026-12-31T23:59:59.000Z",
  "revoked_at": null,
  "password_logins": {
    "total": 0,
    "first": null,
    "last": null
  },
  "password": "k7m2-x9qp-4trv-h8wn"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### PATCH /sites/{id}/recipients/{recipientId}

**Change the end date of a recipient password.**

Sets a new end date for a recipient password, or none (null). A revoked password stays revoked. Live within seconds. A 503 means the new date is saved but not yet applied on the site: send the same request again.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the site. |
| `recipientId` (required) | path | string (uuid) | The id of the recipient password, from GET /sites/{id}/recipients. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `expires_at` (required) | string or null | The new end date (ISO 8601), or null for none. |

JSON

```
{
  "expires_at": "2027-01-31"
}
```

#### 200 The recipient password as it is now.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"site_recipient"` |  |
| `id` (required) | string |  |
| `site_id` (required) | string |  |
| `label` (required) | string | Who the password is for, usually the name of the recipient. |
| `status` (required) | `"active"`, `"expired"`, `"revoked"` |  |
| `created_at` (required) | string |  |
| `expires_at` (required) | string or null | After this moment the password and its sessions stop working. Null: no end date. |
| `revoked_at` (required) | string or null |  |
| `password_logins` (required) | object |  |

JSON

```
{
  "object": "site_recipient",
  "id": "3e7c1a52-9b4d-4f0e-8a21-6d5c4b3a2f10",
  "site_id": "6a7b8c9d-0e1f-4a2b-9c3d-4e5f6a7b8c9d",
  "label": "Jan de Vries",
  "status": "active",
  "created_at": "2026-11-10T09:00:00.000Z",
  "expires_at": "2027-01-31T23:59:59.000Z",
  "revoked_at": null,
  "password_logins": {
    "total": 2,
    "first": "2026-11-10T10:12:00.000Z",
    "last": "2026-11-11T08:40:00.000Z"
  }
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### DELETE /sites/{id}/recipients/{recipientId}

**Revoke a recipient password.**

The password stops working, and so does every session it gave, within seconds. The label and its numbers stay visible in GET /sites/{id}/stats. Revoking again changes nothing, but applies it on the site again. A 503 means the password is revoked but that is not yet applied on the site, so open sessions may still work: send the same request again. Revoking the last active recipient password does not open the site: without a shared password nobody gets in. To make it public, use PUT /sites/{id} with password null.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the site. |
| `recipientId` (required) | path | string (uuid) | The id of the recipient password, from GET /sites/{id}/recipients. |

#### 200 The revoked recipient password.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"site_recipient"` |  |
| `id` (required) | string |  |
| `site_id` (required) | string |  |
| `label` (required) | string | Who the password is for, usually the name of the recipient. |
| `status` (required) | `"active"`, `"expired"`, `"revoked"` |  |
| `created_at` (required) | string |  |
| `expires_at` (required) | string or null | After this moment the password and its sessions stop working. Null: no end date. |
| `revoked_at` (required) | string or null |  |
| `password_logins` (required) | object |  |

JSON

```
{
  "object": "site_recipient",
  "id": "3e7c1a52-9b4d-4f0e-8a21-6d5c4b3a2f10",
  "site_id": "6a7b8c9d-0e1f-4a2b-9c3d-4e5f6a7b8c9d",
  "label": "Jan de Vries",
  "status": "revoked",
  "created_at": "2026-11-10T09:00:00.000Z",
  "expires_at": "2026-12-31T23:59:59.000Z",
  "revoked_at": "2026-11-12T09:00:00.000Z",
  "password_logins": {
    "total": 2,
    "first": "2026-11-10T10:12:00.000Z",
    "last": "2026-11-11T08:40:00.000Z"
  }
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### POST /sites/import

**Import an existing site.**

Fetches an existing static site from a domain this project has proven it owns (active here, or proven with the TXT record) and publishes it as a site, through the same checks as POST /sites. Only the same host, respecting robots.txt, within the site limits; links become relative, and forms that need a server lose their action. The response is the same as for POST /sites (or PUT /sites/{id}), with an import report.

Scope: `sites:write`

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `url` (required) | string | The https address of the existing site, on a domain this project connected (like [https://www.example.com](https://www.example.com)). |
| `site_id` | string (uuid) | Optional. An existing site of this project to replace with the imported files. Without it, a new site is created. |
| `name` | string | Optional. A name for the new site; default the host name. |
| `slug` | string | Optional. The address of a new site, like deploy\_site's slug. |
| `max_pages` | integer | Optional. At most this many pages (default 25, at most 50). |

JSON

```
{
  "url": "https://www.example.com"
}
```

#### 200 The replaced site, with import.

#### 201 The new site, with import.

#### 202 Four-eyes approval is on: the imported site waits for another owner or builder, with import. Nothing has changed on the live site yet.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"deploy_approval"` |  |
| `id` (required) | string (uuid) | The id of the request; pass it as approval\_id to approve\_deploy or reject\_deploy. |
| `status` (required) | `"pending"`, `"processing"`, `"approved"`, `"rejected"`, `"failed"`, `"superseded"`, `"expired"` | pending until another owner or builder decides. superseded: a newer deploy of the same site replaced it. expired: after 7 days. |
| `kind` (required) | `"new_site"`, `"site_update"`, `"site_delete"`, `"app_deploy"`, `"app_rollback"` | app\_deploy and app\_rollback: server code of an app (deploy\_app, rollback\_app); files and bytes are its modules. |
| `site_id` (required) | string or null (uuid) |  |
| `name` (required) | string or null |  |
| `slug` (required) | string or null |  |
| `url` (required) | string or null | The address of the site. For an update or deletion it still shows the live version until approval. |
| `files` (required) | integer |  |
| `bytes` (required) | integer |  |
| `password_change` (required) | `"none"`, `"remove"`, `"set"` |  |
| `requested_by` (required) | object |  |
| `requested_at` (required) | string |  |
| `expires_at` (required) | string |  |
| `reviewed_by` (required) | string or null (uuid) |  |
| `reviewed_at` (required) | string or null |  |
| `reason` (required) | string or null |  |
| `result` (required) | object or null |  |

JSON

```
{
  "object": "deploy_approval",
  "id": "8f6c2a51-3d1e-4b7a-9c42-0e5d6f7a8b90",
  "status": "pending",
  "kind": "new_site",
  "site_id": null,
  "name": "Acme Plumbing",
  "slug": "acme-plumbing",
  "url": "https://acme-plumbing.hypamoon.app",
  "files": 2,
  "bytes": 1840,
  "password_change": "none",
  "requested_by": {
    "user_id": "5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a",
    "via": "api",
    "app": "Claude"
  },
  "requested_at": "2026-10-05T10:15:00Z",
  "expires_at": "2026-10-12T10:15:00Z",
  "reviewed_by": null,
  "reviewed_at": null,
  "reason": null,
  "result": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 402 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 403 | [`site_offline`](https://hypamoon.com/docs/errors/site_offline) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 409 | [`slug_taken`](https://hypamoon.com/docs/errors/slug_taken) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`site_limit_reached`](https://hypamoon.com/docs/errors/site_limit_reached) |
| 422 | [`slug_reserved`](https://hypamoon.com/docs/errors/slug_reserved) |
| 422 | [`site_too_large`](https://hypamoon.com/docs/errors/site_too_large) |
| 422 | [`site_blocked`](https://hypamoon.com/docs/errors/site_blocked) |
| 429 | [`site_limit_reached`](https://hypamoon.com/docs/errors/site_limit_reached) |
| 429 | [`deploy_limit_reached`](https://hypamoon.com/docs/errors/deploy_limit_reached) |

### POST /sites/inspect-wordpress

**Inspect a WordPress site.**

Reads what any visitor can see of a WordPress site (its public content API and home page) and reports pages, posts, media, forms, products, the permalink structure, and what cannot move because it is not public (drafts, form entries, users, orders). Read-only, for any public https address; no login is ever used or accepted. Limited per project and per site. With integrity, the clean-move check of what is visible from outside: Rank Math PRO 3.0.123 from the home page and whether wp-includes/class-wp-cache-util.php exists (at most two extra requests). Each finding has code, ernst (hoog or let\_op), wat (plain words) and bewijs (a version or an http status, never content). No findings means nothing from the list was found, not a full malware scan.

Scope: `sites:read`

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `url` (required) | string | The https address of the WordPress site, like [https://www.example.com](https://www.example.com). Any public site: nothing is changed and no login is used. |

JSON

```
{
  "url": "https://www.example.com"
}
```

#### 200 What was found, what can move (can\_move) and what cannot (cannot\_move), with next\_step.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### POST /sites/import-wordpress

**Import a WordPress site.**

Imports the published pages and posts of a WordPress site on a domain this project has proven it owns, as clean pages that keep their addresses, with images within the site limits, a /\_redirects file for addresses that change, a collection per form (the form on the new site posts to it), products to the product collection where payments are available, and puts posts that do not fit into a private collection. Publishes through the same checks as POST /sites (or PUT /sites/{id}). The response is the same as for POST /sites, with import (the report) and data (the collections).

Scope: `sites:write`

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `url` (required) | string | The https address of the WordPress site, on a domain this project has proven it owns (like [https://www.example.com](https://www.example.com)). |
| `site_id` | string (uuid) | Optional. An existing site of this project to put the import in. Without it, a new site is created. |
| `keep_existing` | boolean | Only with site\_id. true: a partial update. The imported files are added or replaced and every other file of the site stays; images already on the site are not fetched again. Needs if\_match\_version. |
| `if_match_version` | string | With keep\_existing: the version of the site from get\_site or list\_sites. If the site changed since, nothing changes (409). |
| `name` | string | Optional. A name for the new site; default the site's own name. |
| `slug` | string | Optional. The address of a new site, like deploy\_site's slug. |
| `max_posts` | integer | Optional. Read at most this many posts, newest first (default all, at most 500). |

JSON

```
{
  "url": "https://www.example.com"
}
```

#### 200 The updated site, with import and data.

#### 201 The new site, with import and data.

#### 202 Four-eyes approval is on: the imported site waits for another owner or builder. Nothing has changed on the live site yet.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"deploy_approval"` |  |
| `id` (required) | string (uuid) | The id of the request; pass it as approval\_id to approve\_deploy or reject\_deploy. |
| `status` (required) | `"pending"`, `"processing"`, `"approved"`, `"rejected"`, `"failed"`, `"superseded"`, `"expired"` | pending until another owner or builder decides. superseded: a newer deploy of the same site replaced it. expired: after 7 days. |
| `kind` (required) | `"new_site"`, `"site_update"`, `"site_delete"`, `"app_deploy"`, `"app_rollback"` | app\_deploy and app\_rollback: server code of an app (deploy\_app, rollback\_app); files and bytes are its modules. |
| `site_id` (required) | string or null (uuid) |  |
| `name` (required) | string or null |  |
| `slug` (required) | string or null |  |
| `url` (required) | string or null | The address of the site. For an update or deletion it still shows the live version until approval. |
| `files` (required) | integer |  |
| `bytes` (required) | integer |  |
| `password_change` (required) | `"none"`, `"remove"`, `"set"` |  |
| `requested_by` (required) | object |  |
| `requested_at` (required) | string |  |
| `expires_at` (required) | string |  |
| `reviewed_by` (required) | string or null (uuid) |  |
| `reviewed_at` (required) | string or null |  |
| `reason` (required) | string or null |  |
| `result` (required) | object or null |  |

JSON

```
{
  "object": "deploy_approval",
  "id": "8f6c2a51-3d1e-4b7a-9c42-0e5d6f7a8b90",
  "status": "pending",
  "kind": "new_site",
  "site_id": null,
  "name": "Acme Plumbing",
  "slug": "acme-plumbing",
  "url": "https://acme-plumbing.hypamoon.app",
  "files": 2,
  "bytes": 1840,
  "password_change": "none",
  "requested_by": {
    "user_id": "5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a",
    "via": "api",
    "app": "Claude"
  },
  "requested_at": "2026-10-05T10:15:00Z",
  "expires_at": "2026-10-12T10:15:00Z",
  "reviewed_by": null,
  "reviewed_at": null,
  "reason": null,
  "result": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 402 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 403 | [`site_offline`](https://hypamoon.com/docs/errors/site_offline) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`migration_paused`](https://hypamoon.com/docs/errors/migration_paused) |
| 409 | [`version_conflict`](https://hypamoon.com/docs/errors/version_conflict) |
| 409 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 409 | [`slug_taken`](https://hypamoon.com/docs/errors/slug_taken) |
| 412 | [`version_conflict`](https://hypamoon.com/docs/errors/version_conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`site_limit_reached`](https://hypamoon.com/docs/errors/site_limit_reached) |
| 422 | [`slug_reserved`](https://hypamoon.com/docs/errors/slug_reserved) |
| 422 | [`site_too_large`](https://hypamoon.com/docs/errors/site_too_large) |
| 422 | [`site_blocked`](https://hypamoon.com/docs/errors/site_blocked) |
| 429 | [`site_limit_reached`](https://hypamoon.com/docs/errors/site_limit_reached) |
| 429 | [`deploy_limit_reached`](https://hypamoon.com/docs/errors/deploy_limit_reached) |

### POST /sites/migrate-wordpress

**Move a WordPress site, step by step.**

Moves a WordPress site to Hypamoon server to server, without the user downloading or uploading anything. action plan (the default) shows what can move and what is missing and changes nothing; import publishes pages and posts like import\_wordpress (with an application password from the vault also drafts and private pages, kept in a private collection); media copies the media library to Media in rounds (cursor); woocommerce copies products with variations and stock, and customers and orders only with include\_personal\_data and the user's answer in confirm\_text; backup reads a .zip or .tar.gz backup link (uploads and posts, pages and attachments from the database dump; nothing is run); finish advises revoking the passwords and, with confirm, removes them from the vault. Every step except plan needs a domain this project connected or proved. Passwords and keys only come from the vault (request\_secret), never from the request. Clean-move check: plan also checks the site for signs of a known break-in (Rank Math PRO 3.0.123 in the window of the infected downloads, the file wp-includes/class-wp-cache-util.php, unknown administrators, settings with program code and scheduled tasks that stand out), as far as the available routes can see, and returns integrity. A serious finding pauses the move: import, media, woocommerce and backup then answer 409 migration\_paused (backup only checks again), until a later plan finds nothing serious. Only the user can choose to continue anyway, in the Hypamoon portal; there is no parameter for that.

Scope: `sites:write`

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `url` (required) | string | The https address of the WordPress site, like [https://www.example.com](https://www.example.com). |
| `action` | `"plan"`, `"import"`, `"media"`, `"woocommerce"`, `"backup"`, `"finish"` | plan (default): see what can move and what is missing, changes nothing. import: pages and posts to a site. media: the media library to Media, in rounds. woocommerce: products (and only with an explicit yes, customers and orders). backup: read a backup link from the hosting. finish: advice to revoke the passwords, and with confirm remove them from the vault. |
| `wordpress_secret` | string | Optional. The name of the vault secret with the WordPress application password (default wordpress\_app\_password). |
| `woocommerce_secret` | string | Optional. The name of the vault secret with the WooCommerce API key (default woocommerce\_api\_key). |
| `cursor` | string | Only for media, woocommerce and backup: the cursor from the previous answer, to continue where it stopped. |
| `site_id` | string (uuid) | Only for import: an existing site of this project to put the import in. Without it, a new site is created. |
| `keep_existing` | boolean | Only for import with site\_id: add or replace only the imported files. Needs if\_match\_version. |
| `if_match_version` | string | With keep\_existing: the version of the site from get\_site. |
| `name` | string | Only for import: a name for the new site. |
| `slug` | string | Only for import: the address of a new site. |
| `max_posts` | integer | Only for import: read at most this many posts, newest first. |
| `source` | `"site"`, `"backup"` | Only for import: site (default) reads the live site; backup uses the pages and posts from the database dump that action backup found. If the site's content API is closed, import uses the backup on its own when there is one. |
| `include_personal_data` | boolean | Only for woocommerce: true to also move customers and orders. Only after the user said yes in this conversation; send their answer in confirm\_text. |
| `confirm_text` | string | The user's own answer, word for word, when they agreed to move personal data or to remove the secrets. Kept in the audit log. |
| `backup_url` | string | Only for backup: an https link to a .zip or .tar.gz backup of the site, made at the hosting. |
| `confirm` | boolean | Only for finish: true removes the WordPress and WooCommerce secrets of this site from the vault, after the user agreed. |

JSON

```
{
  "url": "https://www.example.com",
  "action": "plan"
}
```

#### 200 The result of the step, with next\_step (and cursor when there is more).

#### 201 import: the new site, with import, data and migration.

#### 202 import with four-eyes approval on: the imported site waits for another owner or builder.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"deploy_approval"` |  |
| `id` (required) | string (uuid) | The id of the request; pass it as approval\_id to approve\_deploy or reject\_deploy. |
| `status` (required) | `"pending"`, `"processing"`, `"approved"`, `"rejected"`, `"failed"`, `"superseded"`, `"expired"` | pending until another owner or builder decides. superseded: a newer deploy of the same site replaced it. expired: after 7 days. |
| `kind` (required) | `"new_site"`, `"site_update"`, `"site_delete"`, `"app_deploy"`, `"app_rollback"` | app\_deploy and app\_rollback: server code of an app (deploy\_app, rollback\_app); files and bytes are its modules. |
| `site_id` (required) | string or null (uuid) |  |
| `name` (required) | string or null |  |
| `slug` (required) | string or null |  |
| `url` (required) | string or null | The address of the site. For an update or deletion it still shows the live version until approval. |
| `files` (required) | integer |  |
| `bytes` (required) | integer |  |
| `password_change` (required) | `"none"`, `"remove"`, `"set"` |  |
| `requested_by` (required) | object |  |
| `requested_at` (required) | string |  |
| `expires_at` (required) | string |  |
| `reviewed_by` (required) | string or null (uuid) |  |
| `reviewed_at` (required) | string or null |  |
| `reason` (required) | string or null |  |
| `result` (required) | object or null |  |

JSON

```
{
  "object": "deploy_approval",
  "id": "8f6c2a51-3d1e-4b7a-9c42-0e5d6f7a8b90",
  "status": "pending",
  "kind": "new_site",
  "site_id": null,
  "name": "Acme Plumbing",
  "slug": "acme-plumbing",
  "url": "https://acme-plumbing.hypamoon.app",
  "files": 2,
  "bytes": 1840,
  "password_change": "none",
  "requested_by": {
    "user_id": "5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a",
    "via": "api",
    "app": "Claude"
  },
  "requested_at": "2026-10-05T10:15:00Z",
  "expires_at": "2026-10-12T10:15:00Z",
  "reviewed_by": null,
  "reviewed_at": null,
  "reason": null,
  "result": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 402 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 403 | [`site_offline`](https://hypamoon.com/docs/errors/site_offline) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 409 | [`migration_paused`](https://hypamoon.com/docs/errors/migration_paused) |
| 409 | [`version_conflict`](https://hypamoon.com/docs/errors/version_conflict) |
| 409 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 409 | [`slug_taken`](https://hypamoon.com/docs/errors/slug_taken) |
| 412 | [`version_conflict`](https://hypamoon.com/docs/errors/version_conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`site_limit_reached`](https://hypamoon.com/docs/errors/site_limit_reached) |
| 422 | [`slug_reserved`](https://hypamoon.com/docs/errors/slug_reserved) |
| 422 | [`site_too_large`](https://hypamoon.com/docs/errors/site_too_large) |
| 422 | [`site_blocked`](https://hypamoon.com/docs/errors/site_blocked) |
| 429 | [`site_limit_reached`](https://hypamoon.com/docs/errors/site_limit_reached) |
| 429 | [`deploy_limit_reached`](https://hypamoon.com/docs/errors/deploy_limit_reached) |

## Media

The project's media library: photos and files the user uploads once (in the portal or with an upload page), private until you put them on a site with media in POST /sites or PUT /sites/{id}. No bytes go through a chat.

### GET /media

**List the media library.**

Every photo and file the user uploaded to the project's media library (in the portal under Media, or with an upload link from POST /media/links), newest first, with the folders. Per file: path under /media/, size, width and height, the 640 version for srcset, alt text, and the sites that use it. A file on no site has url null: it is private until you put it on a site with POST /sites or PUT /sites/{id} and media. Never contains the bytes. folder narrows to a folder (with its subfolders), path to one file, site\_id to the files on one site.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `folder` | query | string | Only this folder under /media/, with its subfolders, like portfolio. |
| `path` | query | string | Only the file with this path, like /media/logo.webp. |
| `site_id` | query | string (uuid) | Only the files this site uses. |
| `limit` | query | integer | At most this many files (default 100). |
| `cursor` | query | string | next\_cursor from the previous page. |
| `tag` | query | string | Only files with this tag. |
| `kind` | query | `"image"`, `"video"`, `"audio"`, `"pdf"`, `"font"`, `"archive"`, `"document"`, `"data"`, `"other"` | Only this kind of file. |
| `q` | query | string | A word in the name, path or title. |
| `include_deleted` | query | boolean | true: also the files in the trash (deleted\_at set). |

#### 200 The files and the folders.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | MediaFile\[\] |  |
| `folders` (required) | object\[\] | Every folder in the library with its number of files (empty is /media/ itself). |
| `next_cursor` (required) | string or null | Pass it as cursor for the next page; null when there is no more. |

JSON

```
{
  "data": [
    {
      "id": "6c0e3a5b-2f1d-4a8e-9b7c-1d2e3f4a5b6c",
      "path": "/media/portfolio/project-12/03.webp",
      "folder": "portfolio/project-12",
      "name": "03.webp",
      "original_name": "03.jpg",
      "content_type": "image/webp",
      "bytes": 384112,
      "width": 2048,
      "height": 1365,
      "alt": null,
      "url": null,
      "variants": {
        "640": {
          "path": "/media/portfolio/project-12/03-640.webp",
          "bytes": 41240,
          "width": 640,
          "height": 427,
          "url": null
        }
      },
      "srcset": null,
      "thumbnail_url": null,
      "original_kept": true,
      "sites": [],
      "source": "portaal",
      "access": "team",
      "title": null,
      "description": null,
      "tags": [],
      "kind": "image",
      "deleted_at": null,
      "purge_at": null,
      "deleted_from": null,
      "created_at": "2026-10-01T09:00:00.000Z",
      "updated_at": "2026-10-01T09:00:00.000Z"
    }
  ],
  "folders": [
    {
      "folder": "portfolio/project-12",
      "files": 1
    }
  ],
  "next_cursor": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### POST /media/links

**Create an upload page for the media library.**

Returns an upload page, `https://app.hypamoon.com/drop/<token>`, open for 24 hours or until the user presses Done. The user drags files or whole folders, or picks photos on a phone; photos are made web-ready in the browser (WebP at most 2048 px plus a 640 px version) and the original is kept privately. Everything lands in the media library under folder; with site\_id, Done also puts the files on that site as a new version. Then list them with GET /media and put them on a site with media in POST /sites or PUT /sites/{id}. The url is only in this response.

Scope: `sites:write`

#### Request body

Create an upload page for the media library.

| Field | Type |  |
| --- | --- | --- |
| `folder` | string | Optional. The folder under /media/ where the files land, like portfolio or menu/2026. Folders the user drags keep their structure inside it: /media/portfolio/project-12/03.webp. Leave it out to use the user's own folder names. |
| `site_id` | string (uuid) | Optional. With a site, Done also puts the files on that site as a new version. |
| `images_only` | boolean | Optional. true: the page only takes images. |
| `strip` | `"location"`, `"all"`, `"none"` | Optional. What the upload page removes, in the user's browser before upload, from photos (JPEG, PNG, WebP) it keeps as they are: originals the user chooses to keep, and photos that would not get smaller as WebP. location (default) removes only the GPS location and keeps camera, date, orientation and copyright; all removes all metadata (the orientation stays so photos stay upright); none keeps the files as they are. Web versions are re-encoded and carry no metadata at all. Use all or none only when the user asks for it. |
| `keep_zip` | boolean | Optional. true keeps a .zip the user adds as one file (a download, like a plugin or a pack of files) instead of unpacking it. On a site it is served as a download; the deploy check refuses a zip with a program, a password or another archive inside. |

JSON

```
{
  "folder": "portfolio"
}
```

#### 201 The upload page.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the drop link; pass it to get\_drop (GET /sites/drops/{id}). |
| `status` (required) | `"open"`, `"done"`, `"expired"` | open: waiting for the user. done: the user uploaded the files. expired: 24 hours passed; create a new one. |
| `site_id` (required) | string or null (uuid) | The site the link is for, or null. |
| `created_at` (required) | string |  |
| `expires_at` (required) | string | When the link stops working (24 hours after it was made). |
| `completed_at` (required) | string or null | When the user finished uploading, or null. |
| `images_only` (required) | boolean | True when the link only takes images (an editor made it). |
| `as_is` | boolean | True when files are kept exactly as they are (for moving a site): no web versions, same names, and paths that follow the user's folders exactly. |
| `keep_zip` | boolean | True when a .zip stays one file (a download) instead of being unpacked. |
| `strip` (required) | `"location"`, `"all"`, `"none"` | What the upload page removes from photos before upload: location (the default, only the GPS location), all (all metadata) or none. Web versions are re-encoded and carry no metadata at all. |
| `folder` (required) | string or null | The folder under /media/ the files land in, or null for the user's own folder names. |
| `max_files` (required) | integer | How many files the user can add with this link (a photo with its versions counts once). |
| `files` (required) | object\[\] | The files that arrived, in order. Private originals are not listed. |
| `originals_kept` (required) | integer | How many originals were kept. They are private: never on a site, only downloadable in the portal. |
| `site_version` (required) | object or null | With site\_id, after the user pressed Done: the new version of the site with these files (waiting: it waits for four-eyes approval). The files are already on the site; send only HTML with keep\_existing. |
| `deploy_files` (required) | object\[\] | The same files in the form deploy\_site takes: add them to files, without content. |
| `url` | string | Only when the link is created: the page to give the user. It is not shown again. |
| `user_message` | string | A sentence to give the user. |
| `next_step` | string | What to do next. |

JSON

```
{
  "id": "3f1c2a9e-5b7d-4e8f-9a0b-1c2d3e4f5a6b",
  "status": "open",
  "site_id": null,
  "created_at": "2026-10-01T09:00:00.000Z",
  "expires_at": "2026-10-02T09:00:00.000Z",
  "completed_at": null,
  "images_only": false,
  "strip": "location",
  "folder": "portfolio",
  "max_files": 100,
  "files": [],
  "originals_kept": 0,
  "site_version": null,
  "deploy_files": [],
  "url": "https://app.hypamoon.com/drop/hmd_4fT0aQ8xK2mPq7RsV1wYz3Bc5De6Fg9H",
  "user_message": "Open this link in your browser and drag your files or a whole folder onto the page (on a phone: choose or take photos). Press Done when everything is in, then come back here and tell me. The link works for 24 hours.",
  "next_step": "Give the user the url and wait until they say they are done. Then call list_media with folder portfolio and put the files on a site with deploy_site media: [\"portfolio/\"]. Never send the images through the chat."
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`site_offline`](https://hypamoon.com/docs/errors/site_offline) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /media/{id}

**Get a file from the media library.**

One file with its versions, alt text and the sites that use it.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the file. |

#### 200 The file.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the file in the library. |
| `path` (required) | string | Where the file goes on a site when you add it with deploy\_site media, like /media/portfolio/project-12/03.webp. |
| `folder` (required) | string | The folder under /media/, empty for /media/ itself. |
| `name` (required) | string | The file name in the library. |
| `original_name` (required) | string or null | The name on the user's computer, when it differs. |
| `content_type` (required) | string |  |
| `bytes` (required) | integer |  |
| `width` (required) | integer or null |  |
| `height` (required) | integer or null |  |
| `alt` (required) | string or null | The alt text, set with update\_media. |
| `url` (required) | string or null | Where the file is served, on the first site that has it at this path. null: it is on no site yet; it is private until you add it with deploy\_site media. |
| `variants` (required) | object | For photos: 640, the small version for srcset and thumbnails. |
| `srcset` (required) | string or null | A ready srcset for an img tag once the file is on a site: small webp versions at 160, 320, 640 and 1280 wide (from /\_hypamoon/img on that site) plus the file itself. Always add sizes with the width it is shown at, like sizes="52px" for a thumbnail. |
| `thumbnail_url` (required) | string or null | A small webp, 160 wide, for thumbnails up to about 80 px (search suggestions, lists, a cart). null while the file is on no site, or for a file that is not a photo. |
| `original_kept` (required) | boolean | The full-size original is kept privately. It never goes on a site; the user downloads it in the portal. |
| `sites` (required) | object\[\] | The sites that use this file right now, with the path and url there. |
| `source` (required) | `"upload"`, `"portaal"`, `"site"`, `"import"` | upload: an upload link; portaal: the portal; site: it was already on a site; import: an import. |
| `access` (required) | `"team"`, `"public"`, `"paid"` | Who can open the file. team: only the project's members and this chat (the default for every file). |
| `title` (required) | string or null | A display name, set with update\_media. |
| `description` (required) | string or null | A free description, set with update\_media. |
| `tags` (required) | string\[\] | Tags to filter on, set with update\_media. |
| `kind` (required) | `"image"`, `"video"`, `"audio"`, `"pdf"`, `"font"`, `"archive"`, `"document"`, `"data"`, `"other"` | image, video, audio, pdf, font, archive, document, data or other, from the file type. |
| `deleted_at` (required) | string or null | When it went to the trash; null when it is not in the trash. A file stays in the trash for 30 days. |
| `purge_at` (required) | string or null | When the trash deletes it for good. Restore it before then with update\_media restore: true. |
| `deleted_from` (required) | string or null | The path it had before it went to the trash; restore puts it back there. |
| `created_at` (required) | string |  |
| `updated_at` (required) | string |  |

JSON

```
{
  "id": "6c0e3a5b-2f1d-4a8e-9b7c-1d2e3f4a5b6c",
  "path": "/media/portfolio/project-12/03.webp",
  "folder": "portfolio/project-12",
  "name": "03.webp",
  "original_name": "03.jpg",
  "content_type": "image/webp",
  "bytes": 384112,
  "width": 2048,
  "height": 1365,
  "alt": null,
  "url": null,
  "variants": {
    "640": {
      "path": "/media/portfolio/project-12/03-640.webp",
      "bytes": 41240,
      "width": 640,
      "height": 427,
      "url": null
    }
  },
  "srcset": null,
  "thumbnail_url": null,
  "original_kept": true,
  "sites": [],
  "source": "portaal",
  "access": "team",
  "title": null,
  "description": null,
  "tags": [],
  "kind": "image",
  "deleted_at": null,
  "purge_at": null,
  "deleted_from": null,
  "created_at": "2026-10-01T09:00:00.000Z",
  "updated_at": "2026-10-01T09:00:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### PATCH /media/{id}

**Rename or move a file, set its alt text, title or tags, or restore it.**

name and folder change the path in the library (the extension stays); the 640 version moves with it. A site keeps the file under the path it has until you deploy again. alt sets the alt text; null removes it. title, description and tags (replacing the old ones) are yours to fill. restore: true puts a file from the trash back on its old path (or next to it when that is taken now); a file in the trash cannot change otherwise (409). 409 conflict when another file already has the new path.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the file. |

#### Request body

Rename or move a file in the library, set its alt text, title, description or tags, or restore it from the trash. Sites keep the file under the path they have until you deploy again.

| Field | Type |  |
| --- | --- | --- |
| `name` | string | A new file name. The extension always stays that of the file. |
| `folder` | string or null | Move the file to this folder under /media/; null or an empty string for /media/ itself. |
| `alt` | string or null | The alt text for the image; null removes it. |
| `title` | string or null | A display name; null removes it. |
| `description` | string or null | A free description; null removes it. |
| `tags` | string\[\] | The tags of the file, replacing the old ones; \[\] removes them. At most 20. |
| `restore` | `true` | Put a file from the trash back where it was (or next to it, when that name is taken now). |

JSON

```
{
  "alt": "Apple pie on a wooden board"
}
```

#### 200 The file after the change.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the file in the library. |
| `path` (required) | string | Where the file goes on a site when you add it with deploy\_site media, like /media/portfolio/project-12/03.webp. |
| `folder` (required) | string | The folder under /media/, empty for /media/ itself. |
| `name` (required) | string | The file name in the library. |
| `original_name` (required) | string or null | The name on the user's computer, when it differs. |
| `content_type` (required) | string |  |
| `bytes` (required) | integer |  |
| `width` (required) | integer or null |  |
| `height` (required) | integer or null |  |
| `alt` (required) | string or null | The alt text, set with update\_media. |
| `url` (required) | string or null | Where the file is served, on the first site that has it at this path. null: it is on no site yet; it is private until you add it with deploy\_site media. |
| `variants` (required) | object | For photos: 640, the small version for srcset and thumbnails. |
| `srcset` (required) | string or null | A ready srcset for an img tag once the file is on a site: small webp versions at 160, 320, 640 and 1280 wide (from /\_hypamoon/img on that site) plus the file itself. Always add sizes with the width it is shown at, like sizes="52px" for a thumbnail. |
| `thumbnail_url` (required) | string or null | A small webp, 160 wide, for thumbnails up to about 80 px (search suggestions, lists, a cart). null while the file is on no site, or for a file that is not a photo. |
| `original_kept` (required) | boolean | The full-size original is kept privately. It never goes on a site; the user downloads it in the portal. |
| `sites` (required) | object\[\] | The sites that use this file right now, with the path and url there. |
| `source` (required) | `"upload"`, `"portaal"`, `"site"`, `"import"` | upload: an upload link; portaal: the portal; site: it was already on a site; import: an import. |
| `access` (required) | `"team"`, `"public"`, `"paid"` | Who can open the file. team: only the project's members and this chat (the default for every file). |
| `title` (required) | string or null | A display name, set with update\_media. |
| `description` (required) | string or null | A free description, set with update\_media. |
| `tags` (required) | string\[\] | Tags to filter on, set with update\_media. |
| `kind` (required) | `"image"`, `"video"`, `"audio"`, `"pdf"`, `"font"`, `"archive"`, `"document"`, `"data"`, `"other"` | image, video, audio, pdf, font, archive, document, data or other, from the file type. |
| `deleted_at` (required) | string or null | When it went to the trash; null when it is not in the trash. A file stays in the trash for 30 days. |
| `purge_at` (required) | string or null | When the trash deletes it for good. Restore it before then with update\_media restore: true. |
| `deleted_from` (required) | string or null | The path it had before it went to the trash; restore puts it back there. |
| `created_at` (required) | string |  |
| `updated_at` (required) | string |  |

JSON

```
{
  "id": "6c0e3a5b-2f1d-4a8e-9b7c-1d2e3f4a5b6c",
  "path": "/media/portfolio/project-12/03.webp",
  "folder": "portfolio/project-12",
  "name": "03.webp",
  "original_name": "03.jpg",
  "content_type": "image/webp",
  "bytes": 384112,
  "width": 2048,
  "height": 1365,
  "alt": "Apple pie on a wooden board",
  "url": null,
  "variants": {
    "640": {
      "path": "/media/portfolio/project-12/03-640.webp",
      "bytes": 41240,
      "width": 640,
      "height": 427,
      "url": null
    }
  },
  "srcset": null,
  "thumbnail_url": null,
  "original_kept": true,
  "sites": [],
  "source": "portaal",
  "access": "team",
  "title": null,
  "description": null,
  "tags": [],
  "kind": "image",
  "deleted_at": null,
  "purge_at": null,
  "deleted_from": null,
  "created_at": "2026-10-01T09:00:00.000Z",
  "updated_at": "2026-10-01T09:00:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### DELETE /media/{id}

**Move a file from the media library to the trash.**

The file goes to the trash for 30 days: PATCH with restore: true puts it back, GET /media with include\_deleted shows it. After 30 days it is deleted for good, and the stored bytes are removed once nothing refers to them anymore. The trash counts toward the storage of the project; the owner can empty it in the portal. Refused with 409 conflict while a site uses the file (sites lists which, and under which path): remove it from the site first.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the file. |

#### 204 In the trash.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |

## Data

The data layer of a project: collections of JSON documents that your agent shapes itself. A contact form on your site, sign-ups, reservations, or facts for the assistant. Free, including in test mode. Forms post to /public/collections/{name}/documents with form.js and the public token.

### GET /collections

**List the collections.**

The project's collections, newest first, each with its access, triggers, schema and document\_count. Deleted collections are not listed. With the key of an app: only the collections of that app and the ones shared with it.

Scope: `data:read`

#### 200 The collections.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | Collection\[\] | The collections of the project, newest first. Deleted collections are not listed. |

JSON

```
{
  "data": [
    {
      "id": "3c4d5e6f-7a8b-4c9d-8e0f-1a2b3c4d5e6f",
      "name": "contact",
      "description": "The contact form on the website.",
      "access": {
        "public_write": true,
        "public_read": false,
        "assistant_read": false
      },
      "triggers": {
        "email_on_insert": true,
        "webhook_on_insert": false
      },
      "email_routing": null,
      "schema": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "message": {
            "type": "string",
            "minLength": 1,
            "maxLength": 5000
          }
        },
        "required": [
          "name",
          "email",
          "message"
        ]
      },
      "personal_data": true,
      "personal_data_fields": [
        "name",
        "email"
      ],
      "document_count": 1,
      "app_id": null,
      "app_access": [
        {
          "app_id": "8d0f4a1e-2b3c-4d5e-8f60-718293a4b5c6",
          "app_name": "Contact desk",
          "access": "read"
        }
      ],
      "created_at": "2026-10-01T09:00:00.000Z",
      "updated_at": "2026-10-01T09:00:00.000Z",
      "test": false
    }
  ]
}
```

### POST /collections

**Create a collection.**

A collection holds JSON documents: the entries of a contact form, sign-ups, reservations, or facts for the assistant. Free, including in test mode. access decides who may use it besides your API key: private (all false, the default); public\_write for a form on your website (with the public token, a bot check and limits); public\_read to show the newest documents on a page; assistant\_read to give the assistant the newest documents added through the API. triggers: email\_on\_insert emails every new document to the project's billing email address (live only, at most 50 emails per collection per day; beyond that, the document is still stored and the webhook is still sent), webhook\_on\_insert sends document.created. schema is an optional JSON Schema that every document must match. At most 20 collections per project on Free, 50 on Maker, 200 on Team, 1,000 on Business. app\_access shares it with apps of the project (see PATCH). Created with the key of an app (from the app's own code), the collection belongs to that app and only that app reaches it; the key of an app cannot set app\_access or role (403).

Scope: `data:write`

#### Request body

A new collection.

| Field | Type |  |
| --- | --- | --- |
| `name` (required) | string | The name of the collection, unique in the project: 2 to 40 characters, a lowercase letter first, then lowercase letters, digits and underscores (contact, signups, menu). A form posts to it by this name. |
| `description` | string | What the collection is for, for your own overview. |
| `access` | object | Who may use the collection besides your API key. Leave it out for private: all false. |
| `triggers` | object | What happens when a document is added, through the API or a form. |
| `email_routing` | object | Where the email of email\_on\_insert goes, instead of the billing email address: at most 5 different addresses in to and rules together. An address must be confirmed before it gets anything: the billing email, the email of a project member and an address on a domain connected to the project are confirmed right away; any other address gets one email with a link to confirm (live projects only). When none of the chosen addresses is confirmed, the email goes to the billing email address. Reply-To stays the email field of the entry. |
| `schema` | object | Optional JSON Schema (a subset of draft 2020-12, at most 16 kB) that every document must match, with type "object" at the root. Supported: type, properties, required, additionalProperties, items, minItems, maxItems, enum, const, minLength, maxLength, pattern, format (email, uri, date, date-time, time), minimum, maximum, exclusiveMinimum, exclusiveMaximum, title and description. |
| `app_access` | object | Share this collection with apps of the project: {"<app id or name>": "read" | "write" | "none"}. The code of an app (env.HYPAMOON) only reaches the collections it created itself and the ones shared with it here; everything else is closed to it by default. read: the app reads the collection and its documents; write: it may also add, change and delete documents; none: no longer shared. Only the apps you name change. A collection an app created itself cannot be shared. |

JSON

```
{
  "name": "contact",
  "description": "The contact form on the website.",
  "access": {
    "public_write": true
  },
  "triggers": {
    "email_on_insert": true
  },
  "schema": {
    "type": "object",
    "properties": {
      "name": {
        "type": "string",
        "minLength": 1,
        "maxLength": 100
      },
      "email": {
        "type": "string",
        "format": "email"
      },
      "message": {
        "type": "string",
        "minLength": 1,
        "maxLength": 5000
      }
    },
    "required": [
      "name",
      "email",
      "message"
    ]
  }
}
```

#### 201 The new collection.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the collection. Its name works in the path as well. |
| `name` (required) | string | The name, unique in the project. A form posts to it by this name. |
| `description` (required) | string or null | What the collection is for, or null. |
| `access` (required) | object | Who may use the collection besides your API key. All false is private. |
| `triggers` (required) | object |  |
| `email_routing` (required) | object or null | Where the email of email\_on\_insert goes. null: the billing email address. |
| `schema` (required) | object or null | The JSON Schema every document must match, or null. |
| `personal_data` | boolean | true when the collection holds personal data: its schema has fields about people (see personal\_data\_fields), or it was imported from WordPress (form entries, orders, customers, users, reviews; those always stay private). An editor reads such a collection only when the owner allowed personal data for them. |
| `personal_data_fields` | string\[\] | The fields of the schema that are about a person: names like name, email, phone, address or birth date (also naam, e-mail, telefoon, contact\_email), or format email. Empty without a schema. |
| `document_count` (required) | integer | How many documents the collection has now. |
| `app_id` | string or null | The app that created this collection from its own code; only that app (and its staging) reaches it. null: a collection of the project, closed to every app unless shared through app\_access. |
| `app_access` | object\[\] | The apps this collection of the project is shared with (set with app\_access on update\_collection). Not shown to the key of an app, and absent on a collection of an app. |
| `created_at` (required) | string (date-time) | When the collection was created. |
| `updated_at` (required) | string (date-time) | When the collection last changed. |
| `test` (required) | boolean | true for a collection of a test project. |

JSON

```
{
  "id": "3c4d5e6f-7a8b-4c9d-8e0f-1a2b3c4d5e6f",
  "name": "contact",
  "description": "The contact form on the website.",
  "access": {
    "public_write": true,
    "public_read": false,
    "assistant_read": false
  },
  "triggers": {
    "email_on_insert": true,
    "webhook_on_insert": false
  },
  "email_routing": null,
  "schema": {
    "type": "object",
    "properties": {
      "name": {
        "type": "string",
        "minLength": 1,
        "maxLength": 100
      },
      "email": {
        "type": "string",
        "format": "email"
      },
      "message": {
        "type": "string",
        "minLength": 1,
        "maxLength": 5000
      }
    },
    "required": [
      "name",
      "email",
      "message"
    ]
  },
  "personal_data": true,
  "personal_data_fields": [
    "name",
    "email"
  ],
  "document_count": 0,
  "app_id": null,
  "app_access": [
    {
      "app_id": "8d0f4a1e-2b3c-4d5e-8f60-718293a4b5c6",
      "app_name": "Contact desk",
      "access": "read"
    }
  ],
  "created_at": "2026-10-01T09:00:00.000Z",
  "updated_at": "2026-10-01T09:00:00.000Z",
  "test": false
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 409 | [`collection_name_taken`](https://hypamoon.com/docs/errors/collection_name_taken) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`collection_limit_reached`](https://hypamoon.com/docs/errors/collection_limit_reached) |

### GET /collections/{id}

**Get a collection.**

One collection with its access, triggers, schema and document\_count. The path takes the id or the name.

Scope: `data:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string | The id of the collection, or its name. |

#### 200 The collection.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the collection. Its name works in the path as well. |
| `name` (required) | string | The name, unique in the project. A form posts to it by this name. |
| `description` (required) | string or null | What the collection is for, or null. |
| `access` (required) | object | Who may use the collection besides your API key. All false is private. |
| `triggers` (required) | object |  |
| `email_routing` (required) | object or null | Where the email of email\_on\_insert goes. null: the billing email address. |
| `schema` (required) | object or null | The JSON Schema every document must match, or null. |
| `personal_data` | boolean | true when the collection holds personal data: its schema has fields about people (see personal\_data\_fields), or it was imported from WordPress (form entries, orders, customers, users, reviews; those always stay private). An editor reads such a collection only when the owner allowed personal data for them. |
| `personal_data_fields` | string\[\] | The fields of the schema that are about a person: names like name, email, phone, address or birth date (also naam, e-mail, telefoon, contact\_email), or format email. Empty without a schema. |
| `document_count` (required) | integer | How many documents the collection has now. |
| `app_id` | string or null | The app that created this collection from its own code; only that app (and its staging) reaches it. null: a collection of the project, closed to every app unless shared through app\_access. |
| `app_access` | object\[\] | The apps this collection of the project is shared with (set with app\_access on update\_collection). Not shown to the key of an app, and absent on a collection of an app. |
| `created_at` (required) | string (date-time) | When the collection was created. |
| `updated_at` (required) | string (date-time) | When the collection last changed. |
| `test` (required) | boolean | true for a collection of a test project. |

JSON

```
{
  "id": "3c4d5e6f-7a8b-4c9d-8e0f-1a2b3c4d5e6f",
  "name": "contact",
  "description": "The contact form on the website.",
  "access": {
    "public_write": true,
    "public_read": false,
    "assistant_read": false
  },
  "triggers": {
    "email_on_insert": true,
    "webhook_on_insert": false
  },
  "email_routing": null,
  "schema": {
    "type": "object",
    "properties": {
      "name": {
        "type": "string",
        "minLength": 1,
        "maxLength": 100
      },
      "email": {
        "type": "string",
        "format": "email"
      },
      "message": {
        "type": "string",
        "minLength": 1,
        "maxLength": 5000
      }
    },
    "required": [
      "name",
      "email",
      "message"
    ]
  },
  "personal_data": true,
  "personal_data_fields": [
    "name",
    "email"
  ],
  "document_count": 1,
  "app_id": null,
  "app_access": [
    {
      "app_id": "8d0f4a1e-2b3c-4d5e-8f60-718293a4b5c6",
      "app_name": "Contact desk",
      "access": "read"
    }
  ],
  "created_at": "2026-10-01T09:00:00.000Z",
  "updated_at": "2026-10-01T09:00:00.000Z",
  "test": false
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### PATCH /collections/{id}

**Change a collection.**

Changes the name, description, access, triggers or schema. Fields you leave out stay as they are, including inside access and triggers. A new schema applies to new and changed documents; existing documents are not checked again. A new name breaks a form that posts to the old one. app\_access shares a collection of the project with apps of the project ({"<app id or name>": "read" | "write" | "none"}): the key of an app only reaches the collections it created and the ones shared with it. The key of an app cannot set app\_access, and cannot change or delete a collection it did not create (403).

Scope: `data:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string | The id of the collection, or its name. |

#### Request body

Change a collection. Fields you leave out stay as they are.

| Field | Type |  |
| --- | --- | --- |
| `name` | string | The name of the collection, unique in the project: 2 to 40 characters, a lowercase letter first, then lowercase letters, digits and underscores (contact, signups, menu). A form posts to it by this name. |
| `description` | string or null | What the collection is for, for your own overview. |
| `access` | object | Who may use the collection besides your API key. Leave it out for private: all false. |
| `triggers` | object | What happens when a document is added, through the API or a form. |
| `email_routing` | object or null | Where the email of email\_on\_insert goes, instead of the billing email address: at most 5 different addresses in to and rules together. An address must be confirmed before it gets anything: the billing email, the email of a project member and an address on a domain connected to the project are confirmed right away; any other address gets one email with a link to confirm (live projects only). When none of the chosen addresses is confirmed, the email goes to the billing email address. Reply-To stays the email field of the entry. |
| `schema` | object or null | Optional JSON Schema (a subset of draft 2020-12, at most 16 kB) that every document must match, with type "object" at the root. Supported: type, properties, required, additionalProperties, items, minItems, maxItems, enum, const, minLength, maxLength, pattern, format (email, uri, date, date-time, time), minimum, maximum, exclusiveMinimum, exclusiveMaximum, title and description. |
| `app_access` | object | Share this collection with apps of the project: {"<app id or name>": "read" | "write" | "none"}. The code of an app (env.HYPAMOON) only reaches the collections it created itself and the ones shared with it here; everything else is closed to it by default. read: the app reads the collection and its documents; write: it may also add, change and delete documents; none: no longer shared. Only the apps you name change. A collection an app created itself cannot be shared. |

JSON

```
{
  "access": {
    "public_write": true
  },
  "triggers": {
    "webhook_on_insert": true
  }
}
```

#### 200 The collection as it is now.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the collection. Its name works in the path as well. |
| `name` (required) | string | The name, unique in the project. A form posts to it by this name. |
| `description` (required) | string or null | What the collection is for, or null. |
| `access` (required) | object | Who may use the collection besides your API key. All false is private. |
| `triggers` (required) | object |  |
| `email_routing` (required) | object or null | Where the email of email\_on\_insert goes. null: the billing email address. |
| `schema` (required) | object or null | The JSON Schema every document must match, or null. |
| `personal_data` | boolean | true when the collection holds personal data: its schema has fields about people (see personal\_data\_fields), or it was imported from WordPress (form entries, orders, customers, users, reviews; those always stay private). An editor reads such a collection only when the owner allowed personal data for them. |
| `personal_data_fields` | string\[\] | The fields of the schema that are about a person: names like name, email, phone, address or birth date (also naam, e-mail, telefoon, contact\_email), or format email. Empty without a schema. |
| `document_count` (required) | integer | How many documents the collection has now. |
| `app_id` | string or null | The app that created this collection from its own code; only that app (and its staging) reaches it. null: a collection of the project, closed to every app unless shared through app\_access. |
| `app_access` | object\[\] | The apps this collection of the project is shared with (set with app\_access on update\_collection). Not shown to the key of an app, and absent on a collection of an app. |
| `created_at` (required) | string (date-time) | When the collection was created. |
| `updated_at` (required) | string (date-time) | When the collection last changed. |
| `test` (required) | boolean | true for a collection of a test project. |

JSON

```
{
  "id": "3c4d5e6f-7a8b-4c9d-8e0f-1a2b3c4d5e6f",
  "name": "contact",
  "description": "The contact form on the website.",
  "access": {
    "public_write": true,
    "public_read": false,
    "assistant_read": false
  },
  "triggers": {
    "email_on_insert": true,
    "webhook_on_insert": false
  },
  "email_routing": null,
  "schema": {
    "type": "object",
    "properties": {
      "name": {
        "type": "string",
        "minLength": 1,
        "maxLength": 100
      },
      "email": {
        "type": "string",
        "format": "email"
      },
      "message": {
        "type": "string",
        "minLength": 1,
        "maxLength": 5000
      }
    },
    "required": [
      "name",
      "email",
      "message"
    ]
  },
  "personal_data": true,
  "personal_data_fields": [
    "name",
    "email"
  ],
  "document_count": 1,
  "app_id": null,
  "app_access": [
    {
      "app_id": "8d0f4a1e-2b3c-4d5e-8f60-718293a4b5c6",
      "app_name": "Contact desk",
      "access": "read"
    }
  ],
  "created_at": "2026-10-01T09:00:00.000Z",
  "updated_at": "2026-10-01T09:00:00.000Z",
  "test": false
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`collection_name_taken`](https://hypamoon.com/docs/errors/collection_name_taken) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### DELETE /collections/{id}

**Delete a collection.**

Deletes the collection: its documents can no longer be reached, a form that posts to it receives 404, and the name becomes available again. Deleting it again returns 204 as well.

Scope: `data:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string | The id of the collection, or its name. |

#### 204 Deleted.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### GET /collections/{id}/documents

**List the documents.**

The documents of a collection, newest first. Follow next\_cursor while has\_more is true, or pass before to start at a point in time. filter matches top-level fields exactly: filter={"status":"new"} returns only documents whose status is new.

Scope: `data:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string | The id of the collection, or its name. |
| `limit` | query | integer | Documents per page, default 25. A value above 100 is capped at 100. |
| `cursor` | query | string | The next\_cursor of the previous page. |
| `before` | query | string (date-time) | Only documents added before this moment, in ISO 8601. |
| `filter` | query | string | A JSON object of top-level fields and the exact value they must have (string, number, true, false or null), like {"status":"new"}. URL-encode it. |

#### 200 A page of documents.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | Document\[\] | The documents, newest first. |
| `has_more` (required) | boolean | Whether there is another page. |
| `next_cursor` (required) | string or null | Pass this as cursor to get the next page. |

JSON

```
{
  "data": [
    {
      "id": "7f6e5d4c-3b2a-4190-8f7e-6d5c4b3a2918",
      "collection_id": "3c4d5e6f-7a8b-4c9d-8e0f-1a2b3c4d5e6f",
      "data": {
        "name": "Anna de Vries",
        "email": "anna@example.com",
        "message": "Can you come and look at a leaking tap on Friday?"
      },
      "source": "public",
      "created_at": "2026-10-01T09:30:00.000Z",
      "updated_at": "2026-10-01T09:30:00.000Z",
      "test": false
    }
  ],
  "has_more": false,
  "next_cursor": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_parameter`](https://hypamoon.com/docs/errors/invalid_parameter) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### POST /collections/{id}/documents

**Add a document.**

Adds a JSON document of at most 64 kB to the collection; with a schema on the collection, it must match. At most 10000 documents per collection. The collection's triggers fire just as for a form: document.created if webhook\_on\_insert is on (including in test mode), and an email if email\_on\_insert is on (not in test mode).

Scope: `data:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string | The id of the collection, or its name. |

#### Request body

A new document.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object | The document: any JSON object, at most 64 kB. |

JSON

```
{
  "data": {
    "name": "Anna de Vries",
    "email": "anna@example.com",
    "message": "Can you come and look at a leaking tap on Friday?"
  }
}
```

#### 201 The new document.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the document. |
| `collection_id` (required) | string (uuid) | The id of its collection. |
| `data` (required) | object | The document itself: a JSON object. |
| `source` (required) | `"api"`, `"public"` | api: added with an API key. public: sent from a form on a website. |
| `created_at` (required) | string (date-time) | When the document was added. |
| `updated_at` (required) | string (date-time) | When the document last changed. |
| `test` (required) | boolean | true for a document of a test project. No email was sent for it. |

JSON

```
{
  "id": "7f6e5d4c-3b2a-4190-8f7e-6d5c4b3a2918",
  "collection_id": "3c4d5e6f-7a8b-4c9d-8e0f-1a2b3c4d5e6f",
  "data": {
    "name": "Anna de Vries",
    "email": "anna@example.com",
    "message": "Can you come and look at a leaking tap on Friday?"
  },
  "source": "api",
  "created_at": "2026-10-01T09:30:00.000Z",
  "updated_at": "2026-10-01T09:30:00.000Z",
  "test": false
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 402 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`schema_mismatch`](https://hypamoon.com/docs/errors/schema_mismatch) |
| 422 | [`document_too_large`](https://hypamoon.com/docs/errors/document_too_large) |
| 422 | [`document_limit_reached`](https://hypamoon.com/docs/errors/document_limit_reached) |

### GET /collections/{id}/documents/{docId}

**Get a document.**

One document from the collection.

Scope: `data:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string | The id of the collection, or its name. |
| `docId` (required) | path | string (uuid) | The id of the document. |

#### 200 The document.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the document. |
| `collection_id` (required) | string (uuid) | The id of its collection. |
| `data` (required) | object | The document itself: a JSON object. |
| `source` (required) | `"api"`, `"public"` | api: added with an API key. public: sent from a form on a website. |
| `created_at` (required) | string (date-time) | When the document was added. |
| `updated_at` (required) | string (date-time) | When the document last changed. |
| `test` (required) | boolean | true for a document of a test project. No email was sent for it. |

JSON

```
{
  "id": "7f6e5d4c-3b2a-4190-8f7e-6d5c4b3a2918",
  "collection_id": "3c4d5e6f-7a8b-4c9d-8e0f-1a2b3c4d5e6f",
  "data": {
    "name": "Anna de Vries",
    "email": "anna@example.com",
    "message": "Can you come and look at a leaking tap on Friday?"
  },
  "source": "public",
  "created_at": "2026-10-01T09:30:00.000Z",
  "updated_at": "2026-10-01T09:30:00.000Z",
  "test": false
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### PATCH /collections/{id}/documents/{docId}

**Change a document.**

Send data to replace the whole document, or merge to change some fields (JSON Merge Patch, RFC 7396: a field you send replaces that field, null removes it, an object is merged field by field). Not both. The result must match the schema of the collection. Triggers do not fire on a change.

Scope: `data:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string | The id of the collection, or its name. |
| `docId` (required) | path | string (uuid) | The id of the document. |

#### Request body

Change a document: send data to replace it, or merge to change some fields. Not both.

| Field | Type |  |
| --- | --- | --- |
| `data` | object | The document: any JSON object, at most 64 kB. |
| `merge` | object | Merged into the document as a JSON Merge Patch (RFC 7396): a field you send replaces that field, null removes it, an object is merged field by field. |

JSON

```
{
  "merge": {
    "status": "answered"
  }
}
```

#### 200 The document as it is now.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the document. |
| `collection_id` (required) | string (uuid) | The id of its collection. |
| `data` (required) | object | The document itself: a JSON object. |
| `source` (required) | `"api"`, `"public"` | api: added with an API key. public: sent from a form on a website. |
| `created_at` (required) | string (date-time) | When the document was added. |
| `updated_at` (required) | string (date-time) | When the document last changed. |
| `test` (required) | boolean | true for a document of a test project. No email was sent for it. |

JSON

```
{
  "id": "7f6e5d4c-3b2a-4190-8f7e-6d5c4b3a2918",
  "collection_id": "3c4d5e6f-7a8b-4c9d-8e0f-1a2b3c4d5e6f",
  "data": {
    "name": "Anna de Vries",
    "email": "anna@example.com",
    "message": "Can you come and look at a leaking tap on Friday?",
    "status": "answered"
  },
  "source": "public",
  "created_at": "2026-10-01T09:30:00.000Z",
  "updated_at": "2026-10-01T09:30:00.000Z",
  "test": false
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`schema_mismatch`](https://hypamoon.com/docs/errors/schema_mismatch) |
| 422 | [`document_too_large`](https://hypamoon.com/docs/errors/document_too_large) |

### DELETE /collections/{id}/documents/{docId}

**Delete a document.**

Deletes the document immediately and permanently. A second delete returns 404.

Scope: `data:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string | The id of the collection, or its name. |
| `docId` (required) | path | string (uuid) | The id of the document. |

#### 204 Deleted.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### GET /public/collections/{name}/documents

**Read the newest documents (public).**

The newest documents of a collection with access.public\_read, from a page on an allowed origin, with the public token in ?token=. Only data and created\_at, newest first, 100 at most. Useful for a list of events, a menu or reviews that you add with your API key.

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `name` (required) | path | string | The name of the collection. |
| `limit` | query | integer | How many, default 25, at most 100. |

#### 200 The newest documents.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] | The newest documents, newest first: only data and created\_at. |

JSON

```
{
  "data": [
    {
      "data": {
        "dish": "Soup of the day",
        "price_eur": 6.5
      },
      "created_at": "2026-10-01T09:00:00.000Z"
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_parameter`](https://hypamoon.com/docs/errors/invalid_parameter) |
| 401 | [`invalid_chat_token`](https://hypamoon.com/docs/errors/invalid_chat_token) |
| 401 | [`chat_token_revoked`](https://hypamoon.com/docs/errors/chat_token_revoked) |
| 403 | [`origin_not_allowed`](https://hypamoon.com/docs/errors/origin_not_allowed) |
| 403 | [`collection_not_public`](https://hypamoon.com/docs/errors/collection_not_public) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 503 | [`chat_unavailable`](https://hypamoon.com/docs/errors/chat_unavailable) |

### POST /public/collections/{name}/documents

**Send a form entry (public).**

Called from a form on a website by form.js (<script src="[https://api.hypamoon.com/form.js](https://api.hypamoon.com/form.js)" defer></script>); you rarely call it yourself. Needs the project's public token in ?token= (the same token as the chat widget, from POST /chat-tokens), an Origin header in its allowed\_origins, a collection with access.public\_write, and always a bot token from GET /public/challenge in turnstile\_token. Limits: 30 entries per hour per IP address and 500 per day per collection. The response contains the id and created\_at, never the data. If the honeypot is filled in, the response is the same but nothing is stored. The collection's triggers fire as they do for the API.

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `name` (required) | path | string | The name of the collection, like contact. |

#### Request body

A document from a form on a website.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object | The fields of the form as a JSON object, like { "name": "Anna", "email": "[anna@example.com](mailto:anna@example.com)", "message": "..." }. |
| `turnstile_token` | string | The bot-check token from the challenge frame (GET /public/challenge). Required; form.js does this for you. |
| `honeypot` | string | The value of a hidden field that people leave empty. When it is filled in, the answer is 201 but nothing is stored. |

JSON

```
{
  "data": {
    "name": "Anna de Vries",
    "email": "anna@example.com",
    "message": "Can you come and look at a leaking tap on Friday?"
  },
  "turnstile_token": "0.zXq3...from-the-challenge-frame"
}
```

#### 201 Stored.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the new document. |
| `created_at` (required) | string (date-time) | When it was stored. |
| `test` (required) | boolean | true when the public token is a test token: stored, but no email is sent. |

JSON

```
{
  "id": "7f6e5d4c-3b2a-4190-8f7e-6d5c4b3a2918",
  "created_at": "2026-10-01T09:30:00.000Z",
  "test": false
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 401 | [`invalid_chat_token`](https://hypamoon.com/docs/errors/invalid_chat_token) |
| 401 | [`chat_token_revoked`](https://hypamoon.com/docs/errors/chat_token_revoked) |
| 402 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 403 | [`origin_not_allowed`](https://hypamoon.com/docs/errors/origin_not_allowed) |
| 403 | [`collection_not_public`](https://hypamoon.com/docs/errors/collection_not_public) |
| 403 | [`turnstile_failed`](https://hypamoon.com/docs/errors/turnstile_failed) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`schema_mismatch`](https://hypamoon.com/docs/errors/schema_mismatch) |
| 422 | [`document_too_large`](https://hypamoon.com/docs/errors/document_too_large) |
| 422 | [`document_limit_reached`](https://hypamoon.com/docs/errors/document_limit_reached) |
| 503 | [`chat_unavailable`](https://hypamoon.com/docs/errors/chat_unavailable) |

## Test mode

Build and test without a real number or real costs: a test key (hm\_test\_) works on a test project with test numbers and simulated calls.

### POST /test/calls

**Simulate a call.**

Test mode only: runs a simulated call on one of your test numbers, with a transcript and a summary, and sends the real webhooks (call.completed, and call.summary.ready when there is a summary). A simulated caller talks to your own assistant, which answers with the same instructions, knowledge and tools as on a real call; tools are not executed. caller\_goal (optional, at most 300 characters) says what the caller wants; without it the caller asks something that fits the scenario (reservation, callback\_request, question). The scenario missed is a call nobody picked up: no transcript, no summary. Nothing reaches the carrier. The first 10 simulated calls per day are free; after that each one is deducted from the prepaid balance of your live project, billed per use (402 test\_free\_replies\_used without balance or saved card). Send it with your test key; a live key gets 403 test\_key\_required. At most 30 simulated calls per hour per test project.

Scope: `calls:read`

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `number_id` (required) | string (uuid) | The id of one of your test numbers, from GET /numbers. |
| `scenario` (required) | `"reservation"`, `"callback_request"`, `"question"`, `"missed"` | What happens in the call: reservation, callback\_request, question, missed. missed has no transcript and no summary, so only call.completed is sent. |
| `from` | string | Optional: the caller, a fictional number from +447700900000 to +447700900999. |
| `caller_goal` | string |  |

JSON

```
{
  "number_id": "0d1e2f3a-4b5c-4d6e-8f70-8192a3b4c5d6",
  "scenario": "question",
  "caller_goal": "Ask whether you are open on Sunday."
}
```

#### 201 The simulated call, as GET /calls/{id} returns it.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the call. |
| `direction` (required) | `"inbound"`, `"outbound"`, `null` | inbound, or outbound for a call your assistant made with POST /calls. |
| `from` (required) | string or null | The caller, in E.164. |
| `to` (required) | string or null | The number that was called, in E.164. |
| `status` (required) | string or null | The status as we track it: ringing, active, completed, missed, failed, voicemail, ai\_handled. New values may be added; treat an unknown value like completed. |
| `created_at` (required) | string or null (date-time) | When the call reached us. |
| `started_at` (required) | string or null (date-time) | When the call started. |
| `answered_at` (required) | string or null (date-time) | When the platform picked up. With a call plan the platform always picks up first, so this does not prove a person answered. |
| `ended_at` (required) | string or null (date-time) | When the call ended. |
| `duration_sec` (required) | integer or null | The length of the call in seconds. |
| `hangup_cause` (required) | string or null | Why the call ended, as reported by the carrier, like normal\_clearing. |
| `has_summary` (required) | boolean | Whether the call has a summary. Fetch it with GET /calls/{id}. |
| `summary_ready_at` (required) | string or null (date-time) | When the summary of a recorded call was ready. Empty for a call handled by the voice AI; look at has\_summary instead. |
| `test` (required) | boolean | true for a simulated call from POST /test/calls or POST /calls with a test key (test mode). Also in webhooks, so you can keep test traffic apart. |
| `outbound` (required) | object or null | The request behind an outbound call started with POST /calls. |
| `transcript` (required) | string or null | The transcript. Only here, never in a webhook. |
| `summary` (required) | one of | The summary of a call. |
| `warnings` | string\[\] | Only in the response of POST /calls, when something was adjusted: for example an opening without the AI disclosure got a short sentence in front of it. Tell the user. |

JSON

```
{
  "id": "6a7b8c9d-0e1f-4a2b-8c3d-4e5f6a7b8c9d",
  "direction": "inbound",
  "from": "+447700900456",
  "to": "+447700900042",
  "status": "ai_handled",
  "created_at": "2026-10-01T09:20:00.000Z",
  "started_at": "2026-10-01T09:18:52.000Z",
  "answered_at": "2026-10-01T09:18:56.000Z",
  "ended_at": "2026-10-01T09:20:00.000Z",
  "duration_sec": 64,
  "hangup_cause": "normal_clearing",
  "has_summary": true,
  "summary_ready_at": "2026-10-01T09:20:00.000Z",
  "test": true,
  "outbound": null,
  "transcript": "Assistant: You are speaking with the digital assistant of Acme Plumbing. How can I help you?\nCaller: Hello, I have a leak under my kitchen sink and I'd like someone to call me back.\nAssistant: I'm sorry to hear that. I'll make sure someone calls you back. What is your name and address?\nCaller: Tom Baker, 40 Main Street.\nAssistant: Thank you, Tom. Is the water still running, or have you been able to shut it off?\nCaller: I closed the tap under the sink, so it's under control for now.\nAssistant: Good. I've noted a leak under the kitchen sink at 40 Main Street. A colleague will call you back on this number within the hour.",
  "summary": {
    "text": "Tom Baker has a leak under his kitchen sink at 40 Main Street. He has shut off the water himself and asks to be called back.",
    "topics": [
      "leak",
      "callback request"
    ],
    "sentiment": "neutral",
    "action_items": [
      "Call Tom Baker back within the hour about the leak at 40 Main Street"
    ],
    "next_step": null
  }
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 402 | [`test_free_replies_used`](https://hypamoon.com/docs/errors/test_free_replies_used) |
| 403 | [`test_key_required`](https://hypamoon.com/docs/errors/test_key_required) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

## WordPress

Data behind the WordPress login, without passwords: the Hypamoon Connect plugin sends an inventory, the user chooses what moves (in the chat, the portal or the plugin), and the plugin sends only that into private collections of the project.

### POST /wordpress/connect-codes

**Create a code to connect a WordPress site.**

A one-time code of 8 characters (like ABCD-EF23), valid for 15 minutes and bound to this project. The user enters it in the Hypamoon Connect plugin in WordPress (Tools > Hypamoon). The plugin then sends an inventory of the site (counts, periods and field names, never content), and later only the data the user selected: drafts, private posts, custom post types with ACF fields, form entries, WooCommerce products, orders and customers, users. No WordPress password is ever needed.

Scope: `data:write`

#### Request body

An empty object.

JSON

```
{}
```

#### 201 The code, when it expires, and next\_step for the agent.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |

### GET /wordpress/connections

**List connected WordPress sites.**

The WordPress sites connected to this project with the Hypamoon Connect plugin, newest first, each with its status, selection, the collections the selection fills and the last export round.

Scope: `data:read`

#### 200 data: the connections.

### GET /wordpress/connections/{id}

**Get the inventory of a connected WordPress site.**

One connected WordPress site with its inventory: per kind of data (key) the count, the period (oldest and newest), the statuses, the field names, whether it holds personal data, the collection it goes to, and the current choice (selected). Personal data (form entries, orders, customers, users, reviews, subscriptions) is off until the user turns it on. next\_step says what to do now.

Scope: `data:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the WordPress connection. |

#### 200 The connection with inventory, selection and next\_step.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### DELETE /wordpress/connections/{id}

**Revoke a WordPress connection.**

The plugin's token stops working right away. The collections and their documents stay.

Scope: `data:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the WordPress connection. |

#### 204 Revoked.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### PUT /wordpress/connections/{id}/selection

**Choose what moves from a WordPress site.**

Per inventory key: on or off, a period (since, until), which statuses for content, and fields to leave out (like phone or ip). Keys you leave out keep their choice. Send version (from the inventory) so you never overwrite a choice the user made meanwhile in WordPress or the portal (409). The plugin shows the same selection and sends only that, in rounds; a later round adds or updates without connecting again.

Scope: `data:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the WordPress connection. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `items` | object | Per inventory key (like content:post, orders or form\_entries:wpforms:12) what moves. Keys you leave out keep their current choice. |
| `version` | integer or null | The selection version you showed the user (selection.version). If it changed meanwhile, nothing changes (409). Leave it out to change it anyway. |
| `from_suggestion` | boolean or null | true: apply the open suggestion of suggest\_wordpress\_selection (items, if given, go on top of it). |
| `include_personal_data` | boolean or null | Only after the user explicitly said yes to the question this route returns (409 with question): true turns on the kinds of data with personal data in this change; false leaves them off and saves the rest. |
| `confirm_text` | string or null | With include\_personal\_data true: the user's answer to the question, word for word. It is kept in the audit log. |
| `start_round` | boolean or null | true: Hypamoon wakes the plugin right away (plugin 1.4.2 and later, plugin\_woken in the answer) and it starts sending this selection; otherwise it starts the next time it checks in (when the admin opens Tools > Hypamoon, or within a few minutes by WP-cron). |

JSON

```
{
  "items": {
    "orders": {
      "enabled": true,
      "since": "2024-10-12",
      "omit_fields": [
        "phone"
      ]
    }
  },
  "version": 2
}
```

#### 200 The new selection, with its version.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /wordpress/connections/{id}/suggestion

**Read the compact inventory and the open suggestion.**

The inventory in its smallest form, structure only: per kind of data the group, count, period, a few field names, whether it holds personal data and why, the fields that point to other records (like opdrachtgever\_id) and what is selected now. Never values. Also the open suggestion, if there is one.

Scope: `data:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the WordPress connection. |

#### 200 inventory (compact), suggestion and selection\_version.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### PUT /wordpress/connections/{id}/suggestion

**Suggest a selection for a WordPress site.**

Stores a suggestion, per inventory key on or off with a short reason, based on what the user wants. It is never applied: the user reviews and applies it in WordPress (Tools > Hypamoon > Move data), or says yes in the chat, after which PUT /selection with from\_suggestion applies it. Personal data is marked and never ticked automatically. A new suggestion replaces the open one.

Scope: `data:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the WordPress connection. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `goal` (required) | string | What the user wants, in their words, like: move my hours portal, or only my pages and blog. |
| `items` (required) | object | Per inventory key what you suggest: enabled true or false, a reason, and optionally since, until, statuses, omit\_fields, include\_meta and names (options only by name). Keys you leave out stay as they are. |

JSON

```
{
  "goal": "Move my hours portal",
  "items": {
    "table:uren": {
      "enabled": true,
      "reason": "The hour history, linked to users via opdrachtgever_id."
    },
    "content:page": {
      "enabled": false,
      "reason": "The pages stay on the WordPress site."
    }
  }
}
```

#### 201 The suggestion with its differences from the current selection, a summary and next\_step.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /wordpress/connections/{id}/embeds

**Read the chat and forms on a WordPress site.**

What the Hypamoon Connect plugin puts on the connected WordPress site: the chat window (on or off, colour, position, title, welcome) and the forms that post to collections with public\_write, each with its fields and its shortcode. public\_token is the public token the site uses for both; problems lists what blocks it. Per site, not per connection: a new connection to the same site keeps these settings.

Scope: `data:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the WordPress connection. |

#### 200 The chat, the forms, the version and problems.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### PUT /wordpress/connections/{id}/embeds

**Put the chat and forms on a WordPress site.**

Turns the chat window on or off on the connected WordPress site and chooses the forms the plugin offers (a block and the shortcode \[hypamoon\_form id=...\]). Forms need a collection with public\_write; a field named email becomes the Reply-To of the notification email. Makes sure a public token allows the site's origin: the chosen one gets the origin added, or an existing one is used, or a new one is created. The plugin picks the settings up when the admin opens Tools > Hypamoon or presses Refresh. Send version to avoid overwriting a change made meanwhile (409).

Scope: `data:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the WordPress connection. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `chat` | object or null | The chat window on the site. Leave it out to keep it as it is. |
| `forms` | object\[\] | Forms to offer or change. Forms you leave out keep their settings. |
| `version` | integer or null | The version you showed the user. If it changed meanwhile, nothing changes (409). Leave it out to change it anyway. |

JSON

```
{
  "chat": {
    "enabled": true,
    "color": "#0f766e"
  },
  "forms": [
    {
      "collection": "contact",
      "title": "Contact us"
    }
  ],
  "version": 0
}
```

#### 200 The new settings, as GET returns them.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### POST /wordpress/connect

**Connect the plugin with a code (plugin).**

Called by the Hypamoon Connect plugin, not by you. Exchanges the one-time code for the plugin's own token (hm\_wp\_...), bound to this project and this WordPress site. Limited per IP address. The token is valid for 30 days and can be revoked. Answers with the token (shown once), the connection id, the project, and the limits: 200 records and 3 MB per batch, 50000 records and 200 MB per round.

No API key needed.

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `code` (required) | string | The one-time code of 8 characters, like ABCD-EF23 (dashes, spaces and case do not matter). |
| `site_url` (required) | string | The address of the WordPress site (home\_url), like [https://www.example.com](https://www.example.com). |
| `site_name` | string or null | The name of the WordPress site. |
| `wordpress_version` | string or null | The WordPress version, like 6.6.2. |
| `plugin_version` | string or null | The version of Hypamoon Connect, like 1.0.0. |

JSON

```
{
  "code": "ABCD-EF23",
  "site_url": "https://www.example.com",
  "site_name": "Example",
  "wordpress_version": "6.6.2",
  "plugin_version": "1.0.0"
}
```

#### 200 The token, the connection, the project and the limits.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /wordpress/connection

**Read the connection (plugin).**

Called by the plugin: the project, the site, when the token expires, the selection and the last export round.

#### 200 The connection.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |

### DELETE /wordpress/connection

**Disconnect (plugin).**

Called by the plugin when the admin disconnects: the token stops working. The collections stay.

#### 204 Disconnected.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |

### PUT /wordpress/connection/inventory

**Send the inventory (plugin).**

Called by the plugin right after connecting and on Refresh: per kind of data the count, period, statuses and field names (ACF field groups, form fields), never content. Form entries, orders, customers, users, reviews and subscriptions are always marked as personal data. Answers with the selection, with defaults for new keys (content on, personal data off).

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `items` (required) | object\[\] | One item per kind of data: counts, period and field names, never content. |

JSON

```
{
  "items": [
    {
      "key": "content:post",
      "type": "content",
      "label": "Posts",
      "count": 120,
      "oldest": "2019-03-01T10:00:00Z",
      "newest": "2026-10-01T09:00:00.000Z",
      "statuses": {
        "publish": 100,
        "draft": 20
      },
      "post_type": "post"
    },
    {
      "key": "orders",
      "type": "orders",
      "label": "Orders",
      "count": 830,
      "oldest": "2021-01-04T09:00:00Z",
      "newest": "2026-10-01T09:00:00.000Z"
    }
  ]
}
```

#### 200 inventory\_at and the selection.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### PUT /wordpress/connection/integrity

**Send the clean-move check (plugin).**

Called by the plugin (1.5.0 and later) after connecting, on Refresh and at most every few hours: a read-only check of the site for signs of a known break-in, used by migrate\_wordpress before anything moves. Only names, versions, dates, lengths and rule codes: Rank Math PRO with its version and file date, whether wp-includes/class-wp-cache-util.php exists, the administrators (login, the domain of their email address, created), options that match a rule and scheduled tasks that stand out. Never option values, passwords or email addresses.

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `version` (required) | `1` | The format of the report: 1. |
| `plugin_version` | string or null | The version of Hypamoon Connect, like 1.5.0. |
| `checked_at` | string or null | When the plugin ran the check (UTC). |
| `rank_math_pro` (required) | object | Rank Math PRO, if it is in the plugin folder. |
| `wp_cache_util` (required) | object | Whether wp-includes/class-wp-cache-util.php exists. |
| `admins` (required) | object\[\] | The administrators: login, the domain of their email address (never the address) and when they were created. |
| `options` (required) | object | Options that match a rule: only the name, the length and the rule. Never the value. |
| `cron` (required) | object | Scheduled tasks that stand out (no owner, or an address or code as argument). Never the arguments. |
| `site` | object or null |  |

JSON

```
{
  "version": 1,
  "plugin_version": "1.5.0",
  "checked_at": "2026-10-01T09:00:00.000Z",
  "rank_math_pro": {
    "found": false
  },
  "wp_cache_util": {
    "exists": false
  },
  "admins": [
    {
      "login": "anna",
      "email_domain": "example.com",
      "registered": "2019-03-01T10:00:00Z"
    }
  ],
  "options": {
    "scanned": 812,
    "complete": true,
    "findings": []
  },
  "cron": {
    "scanned": 24,
    "tasks": []
  },
  "site": {
    "siteurl_host": "www.example.com",
    "home_host": "www.example.com"
  }
}
```

#### 200 received\_at.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /wordpress/connection/selection

**Pull the selection (plugin).**

Called by the plugin: what the user chose (in a chat with their AI assistant, in the portal or in the plugin), with its version.

#### 200 The selection.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |

### PUT /wordpress/connection/selection

**Change the selection (plugin).**

Called by the plugin when the admin changes the checkboxes in WordPress. Send the version it showed; a newer one gives 409.

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `items` | object | Per inventory key (like content:post, orders or form\_entries:wpforms:12) what moves. Keys you leave out keep their current choice. |
| `version` | integer or null | The selection version you showed the user (selection.version). If it changed meanwhile, nothing changes (409). Leave it out to change it anyway. |
| `from_suggestion` | boolean or null | true: apply the open suggestion of suggest\_wordpress\_selection (items, if given, go on top of it). |
| `include_personal_data` | boolean or null | Only after the user explicitly said yes to the question this route returns (409 with question): true turns on the kinds of data with personal data in this change; false leaves them off and saves the rest. |
| `confirm_text` | string or null | With include\_personal\_data true: the user's answer to the question, word for word. It is kept in the audit log. |
| `start_round` | boolean or null | true: Hypamoon wakes the plugin right away (plugin 1.4.2 and later, plugin\_woken in the answer) and it starts sending this selection; otherwise it starts the next time it checks in (when the admin opens Tools > Hypamoon, or within a few minutes by WP-cron). |

JSON

```
{
  "items": {
    "users": {
      "enabled": true,
      "omit_fields": null
    }
  },
  "version": 2
}
```

#### 200 The new selection.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### DELETE /wordpress/connection/suggestion

**Close the suggestion of the chat (plugin).**

Called by the plugin when the admin applied and saved the suggestion (outcome=applied) or dismissed it (outcome=dismissed). The suggestion itself comes with GET /wordpress/connection.

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `outcome` | query | `"applied"`, `"dismissed"` | applied or dismissed. |

#### 200 The status of the suggestion.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |

### GET /wordpress/connection/embeds

**Pull the chat and forms for the site (plugin).**

Called by the plugin when the admin opens its screen or presses Refresh: the chat window and the forms for this site, with the public token. The plugin stores them; visitors talk to the public widget and form endpoints, never with the plugin's token.

#### 200 The chat, the forms, the version and problems.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |

### PUT /wordpress/connection/embeds

**Turn the chat on or off (plugin).**

Called by the plugin when the admin turns the chat window on or off, or sets up the forms. Makes sure a public token allows the site. Send the version it showed; a newer one gives 409.

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `chat` | object or null |  |
| `version` | integer or null |  |

JSON

```
{
  "chat": {
    "enabled": true
  },
  "version": 1
}
```

#### 200 The new settings.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### POST /wordpress/exports

**Start an export round (plugin).**

Called by the plugin: a round sends only what is selected. Send the selection version the plugin shows; a newer one gives 409. A running round of the same connection stops.

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `selection_version` (required) | integer | The selection version the plugin pulled and shows. A newer one gives 409: pull again. |

JSON

```
{
  "selection_version": 2
}
```

#### 201 The round: export\_id, status and the selection.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### POST /wordpress/exports/{id}/batches

**Send a batch (plugin).**

Called by the plugin: at most 200 records and 3 MB per batch, 50000 records and 200 MB per round, 120 requests per minute. Every record has wp\_id; the same record in a later round updates its document. A batch key that was already received changes nothing (duplicate: true). The selection is applied again here: what is not selected, outside the period or in omit\_fields is not stored. Passwords, hashes and tokens are always removed.

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the export round. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `batch` (required) | string | A key for this batch, unique and deterministic within the round, like content:post:after:0. The same key again changes nothing. |
| `key` (required) | string | The inventory key, like content:post, orders or form\_entries:wpforms:12. |
| `type` (required) | `"content"`, `"media"`, `"menus"`, `"terms"`, `"acf_field_groups"`, `"acf_options"`, `"form_entries"`, `"products"`, `"orders"`, `"customers"`, `"users"`, `"coupons"`, `"shipping"`, `"tax"`, `"reviews"`, `"subscriptions"`, `"table"`, `"options"` | The kind of data, the first part of key. |
| `form` | object or null | Only for form\_entries: the form. |
| `records` (required) | any\[\] | At most 200 records, each with wp\_id. |

JSON

```
{
  "batch": "content:post:after:0",
  "key": "content:post",
  "type": "content",
  "records": [
    {
      "wp_id": 12,
      "post_type": "post",
      "status": "draft",
      "title": "Spring menu",
      "content_html": "<p>...</p>"
    }
  ]
}
```

#### 200 What was stored: received, created, updated, skipped (with reasons), the collections and the totals of the round.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 402 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 409 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`collection_limit_reached`](https://hypamoon.com/docs/errors/collection_limit_reached) |
| 422 | [`document_limit_reached`](https://hypamoon.com/docs/errors/document_limit_reached) |

### POST /wordpress/exports/{id}/finish

**Finish an export round (plugin).**

Called by the plugin at the end of a round: the collections with their document counts and next\_step for the admin.

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the export round. |

#### 200 The round's result.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |

## MCP

The Model Context Protocol server, for agents and AI tools.

### POST /mcp

**Model Context Protocol endpoint.**

The MCP server for agents (Claude Code, Cursor, Lovable and other MCP hosts). Stateless Streamable HTTP: one JSON-RPC 2.0 message per POST, answered with JSON; notifications get 202. Authenticate with the same API key as the REST API, or with an OAuth access token (Claude.ai, ChatGPT and other hosts that connect by URL); the scopes of the key or the connection determine which tools are listed. Without valid credentials the response is 401 with a WWW-Authenticate header that points to the OAuth metadata. See [https://hypamoon.com/docs/mcp](https://hypamoon.com/docs/mcp).

Scope: `project:read`

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `jsonrpc` (required) | `"2.0"` |  |
| `id` | one of |  |
| `method` (required) | string |  |
| `params` | object |  |

JSON

```
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/list"
}
```

#### 200 The JSON-RPC response.

| Field | Type |  |
| --- | --- | --- |
| `jsonrpc` (required) | `"2.0"` |  |
| `id` (required) | one of |  |
| `result` | object |  |

JSON

```
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "tools": []
  }
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |

## Meta

About the API itself.

### GET /openapi.json

**This OpenAPI document.**

The OpenAPI 3.1 document of the API. Public: no key needed.

No API key needed.

#### 200 The OpenAPI document.

### GET /status

**Check whether Hypamoon is working.**

Whether Hypamoon is working, per component (sites, API, portal, phone, voice AI, email, payments), and any reported problem that is not resolved yet. From the public status page ([https://status.hypamoon.com](https://status.hypamoon.com)); when that page does not answer, a minimal check of our own. Use it when a step fails and you wonder whether Hypamoon is down: a blocked upload\_url or a network error from your own environment is not an outage. user\_message is a sentence for the user. Public: no key needed.

No API key needed.

#### 200 The status.

| Field | Type |  |
| --- | --- | --- |
| `status` (required) | `"operational"`, `"degraded"`, `"down"`, `"unknown"` | The overall status: the worst of the components (unknown does not count). |
| `source` (required) | `"status_page"`, `"self_check"` | status\_page: from status.hypamoon.com. self\_check: that page did not answer, so only a minimal check of our own. |
| `components` (required) | object\[\] | Per component: sites, api, portal, phone, ai, mail, payments. |
| `incidents` (required) | object\[\] | Reported problems that are not resolved yet. |
| `status_page` (required) | string | The public status page. |
| `checked_at` (required) | string | When the status was measured. |
| `user_message` (required) | string | One calm sentence for the user, like "Hypamoon is working normally. The problem is likely in your chat app." |
| `next_step` (required) | string | What the chat or agent should do next. |

JSON

```
{
  "status": "operational",
  "source": "status_page",
  "components": [
    {
      "id": "sites",
      "name": "Sites and apps",
      "status": "operational"
    },
    {
      "id": "api",
      "name": "API and chat connection",
      "status": "operational"
    },
    {
      "id": "portal",
      "name": "Portal",
      "status": "operational"
    },
    {
      "id": "phone",
      "name": "Phone",
      "status": "operational"
    },
    {
      "id": "ai",
      "name": "Voice AI",
      "status": "operational"
    },
    {
      "id": "mail",
      "name": "Email",
      "status": "operational"
    },
    {
      "id": "payments",
      "name": "Payments",
      "status": "operational"
    }
  ],
  "incidents": [],
  "status_page": "https://status.hypamoon.com",
  "checked_at": "2026-10-01T09:00:00.000Z",
  "user_message": "Hypamoon is working normally. The problem is likely in your chat app.",
  "next_step": "If a step failed, read its error and user_message."
}
```

### GET /recipes

**List the recipes.**

The recipes a chat builds in one go from one short sentence, like "Build the Hypamoon recipe coffee-quiz": slug, title, summary, the sentence to type, the page on hypamoon.com and a live example. GET /recipes/{slug} gives the full recipe. Public: no key needed.

No API key needed.

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `kind` | query | `"plan"`, `"track"`, `"request"`, `"check"`, `"calculate"`, `"share"`, `"sell"`, `"connect"`, `"business"` | Only the recipes that do this. |

#### 200 The recipes, without the full brief.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] |  |
| `next_step` (required) | string |  |

JSON

```
{
  "data": [
    {
      "slug": "coffee-quiz",
      "title": "Find your perfect coffee",
      "summary": "A Typeform-style product quiz: one question at a time, pictures to tap, a personal coffee at the end and a working Order button.",
      "say": "Build the Hypamoon recipe coffee-quiz",
      "page": "https://hypamoon.com/r/coffee-quiz",
      "demo": "https://coffee.hypamoon.app",
      "kind": "sell",
      "size": "medium",
      "start": true
    },
    {
      "slug": "build-an-adapter",
      "title": "Build an adapter for your system",
      "summary": "Your chat writes the link to any system with a REST API, and Hypamoon runs it: the key in a vault, only the hosts you allow, rights per action that you click, every call logged.",
      "say": "Build the Hypamoon recipe build-an-adapter for [system]. API docs: [link]. Read: [what]. Write: [what, or nothing].",
      "page": "https://hypamoon.com/r/build-an-adapter",
      "kind": "connect",
      "size": "medium"
    },
    {
      "slug": "marketplace",
      "title": "A marketplace with several sellers",
      "summary": "Sellers with their own products, one checkout over several sellers, your commission, and payouts per seller through your own Stripe account, tested end to end.",
      "say": "Build the Hypamoon recipe marketplace",
      "page": "https://hypamoon.com/r/marketplace",
      "kind": "sell",
      "size": "large"
    },
    {
      "slug": "car-dealer",
      "title": "A car dealer with its own workshop",
      "summary": "The cars in stock, a page per car, test drives and workshop bookings, and the live status of your car, readable by people, agents, AI search and classifieds sites from one source.",
      "say": "Build the Hypamoon recipe car-dealer",
      "page": "https://hypamoon.com/r/car-dealer",
      "demo": "https://car-dealer.hypamoon.app",
      "kind": "business",
      "size": "large"
    },
    {
      "slug": "inbox-agent",
      "title": "Give your agent an inbox",
      "summary": "support@ on your own domain (support@in.<domain> when the domain already has a mailbox), with an agent that reads every email, answers the easy questions with answers you approved, and asks you about the rest.",
      "say": "Build the Hypamoon recipe inbox-agent: set up support@ on my domain and let an agent answer the easy questions. Ask me before it promises anything.",
      "page": "https://hypamoon.com/r/inbox-agent",
      "kind": "request",
      "size": "large"
    },
    {
      "slug": "drop-store",
      "title": "A drop store for your label",
      "summary": "A limited drop with a countdown, products with sizes, a cart and a checkout, in a loud design that works on a phone.",
      "say": "Build the Hypamoon recipe drop-store",
      "page": "https://hypamoon.com/r/drop-store",
      "demo": "https://nullseason.hypamoon.app",
      "kind": "sell",
      "size": "medium"
    },
    {
      "slug": "link-in-bio",
      "title": "A link-in-bio page that sells",
      "summary": "A page for your bio link with a free prompt to copy, a PDF to sell and an application for a paid session, made for a phone.",
      "say": "Build the Hypamoon recipe link-in-bio",
      "page": "https://hypamoon.com/r/link-in-bio",
      "demo": "https://junoquill.hypamoon.app",
      "kind": "sell",
      "size": "medium"
    },
    {
      "slug": "digital-product",
      "title": "A product page for a digital download",
      "summary": "A product page that sells a PDF your chat writes for you, with a preview that fills in the visitor's own niche and a checkout.",
      "say": "Build the Hypamoon recipe digital-product",
      "page": "https://hypamoon.com/r/digital-product",
      "demo": "https://promptlark.hypamoon.app",
      "kind": "sell",
      "size": "medium"
    }
  ],
  "next_step": "Call get_recipe (GET /recipes/{slug}) with the slug the user named, then follow its instruction."
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_parameter`](https://hypamoon.com/docs/errors/invalid_parameter) |

### GET /recipes/{id}

**Get a recipe.**

One recipe in full: the build brief (prompt), the acceptance criteria, the Hypamoon parts and tools it uses, the cost, a live example (for recipes that build a site), and instruction: how to build it, normally in one go without asking questions, with sensible choices, one deploy at the end and the live link. A user asks for one with a short sentence like "Build the Hypamoon recipe coffee-quiz" or "Build hypamoon.com/r/coffee-quiz". Public: no key needed.

No API key needed.

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string | The slug of the recipe. |

#### 200 The recipe.

| Field | Type |  |
| --- | --- | --- |
| `slug` (required) | string |  |
| `title` (required) | string |  |
| `summary` (required) | string |  |
| `say` (required) | string | The short sentence a user types, like Build the Hypamoon recipe coffee-quiz. |
| `page` (required) | string | The recipe page on hypamoon.com. |
| `demo` | string | A live example of the result, for recipes that build a site. |
| `kind` (required) | `"plan"`, `"track"`, `"request"`, `"check"`, `"calculate"`, `"share"`, `"sell"`, `"connect"`, `"business"` | What the recipe does for the user: plan, track, request, check, calculate, share, sell, connect or business. |
| `size` (required) | `"small"`, `"medium"`, `"large"` | small is one screen, a list or a form with its own data, without sign-in, payments or a link to another system. |
| `start` | `true` | A starter idea for a first build. |
| `live_examples` | object\[\] | Examples of the result that are live. |
| `origin` | object | Where the prompt comes from, when that is known: real means the live example was built with this prompt, or a new try with it gave that example in one go. |
| `prompt_proven` (required) | boolean | True only when the prompt is real (origin.type real): then it is shown as the prompt to copy. |
| `instruction` (required) | string | How to build it: in one go, without questions, one deploy, then the live link. Follow it. |
| `prompt` (required) | string | The full build brief. |
| `acceptance` (required) | string\[\] | Check these yourself before you give the link. |
| `you_get` (required) | string\[\] |  |
| `parts` (required) | object\[\] |  |
| `tools` (required) | string\[\] |  |
| `cost` (required) | object |  |
| `needs` | object\[\] | What the user needs before starting. |
| `examples` | object\[\] | Worked examples. |

JSON

```
{
  "slug": "coffee-quiz",
  "title": "Find your perfect coffee",
  "summary": "A Typeform-style product quiz: one question at a time, pictures to tap, a personal coffee at the end and a working Order button.",
  "say": "Build the Hypamoon recipe coffee-quiz",
  "page": "https://hypamoon.com/r/coffee-quiz",
  "demo": "https://coffee.hypamoon.app",
  "kind": "sell",
  "size": "medium",
  "live_examples": [
    {
      "app": "https://coffee.hypamoon.app",
      "card": "https://hypamoon.com/examples#coffee-quiz"
    }
  ],
  "origin": {
    "type": "real",
    "date": "2026-10-21"
  },
  "prompt_proven": true,
  "start": true,
  "instruction": "Build this in one go without asking questions; make sensible choices; deploy once at the end; give the live link. The user already chose by asking for this recipe: do not ask about the name, the address, the style, the email or the payment provider, and do not call get_advice. Follow prompt and steps, check acceptance yourself (fetch_site_page on the live url), then reply with the live link and two or three short lines about what works and what is a test (the checkout is a test payment while payments are in test mode).",
  "prompt": "Build a coffee quiz with Hypamoon and put it live: \"Find your perfect coffee\" for a small roastery (no brand name). Don't ask me anything; make sensible choices.\n\nMake it feel like a finished Typeform: one question per screen, vertically centred, dark and calm, perfect on a phone.\n\nLook: background #0F1115, cards #181B22, text #F2F1EE, muted #A9ADB6, lines #2C313C, accent #F2B544 with dark text on it. System font, bold headings (title about 52px, questions 30px), 16px rounded cards, 12px rounded buttons. A thin accent progress bar on top, \"Question 2 of 5\" top right, a back arrow top left. Steps slide up going forward and down going back, no fades.\n\nKeyboard: Enter continues, A to D picks, 1 to 5 on the scale, arrow up goes back. Show the letter on every answer, and focus the question, never the first answer.\n\nSteps: intro with Start; first name (big underlined input, then use the name); how they drink it (4 picture cards, 2 by 2 on a phone, 4 in a row on desktop: espresso, cappuccino or latte, filter, iced); a follow-up for that answer (their machine, their brewer, or how they take it cold); flavour (4 picture cards: fruity, chocolate and nuts, caramel, dark and intense); strength 1 to 5; email; result.\n\nPictures: copy these to the site with source_url from https://hypamoon.com/kit/coffee/ : espresso, milk, filter, iced, fruity, chocolate, caramel, intense, bag-sunrise, bag-cocoa, bag-caramel, bag-nightshift (.svg).\n\nResult: \"Sam, meet Night Shift Espresso\", the bag in a square panel, tasting notes in accent, one sentence why it fits that mentions how they brew, the price and \"Order this\". Roasts: Sunrise Ethiopia 13.50, Cocoa Brazil 11.50, Caramel Colombia 12.50, Night Shift Espresso 12.50 euros, picked by flavour; strong espresso or milk drinkers get Night Shift.\n\nSave every response in a collection with the bot check and email me each one. The roasts are products; \"Order this\" checks out for real with Hypamoon in test mode, with a small line \"Demo checkout: a test payment, no money moves.\"\n\nCheck your code, deploy once, give me the link.",
  "acceptance": [
    "The site is live on its own link and opens without an account.",
    "One question per screen with a progress bar; Enter, A to D, 1 to 5 and arrow up work.",
    "The first name appears in the later questions.",
    "The follow-up question changes with the answer to question 2; only the chosen branch is sent.",
    "The end screen shows one of the 4 roasts with its bag, notes, a reason and the price, in the dark design of the recipe.",
    "Order this opens the checkout for the recommended roast.",
    "A response lands in coffee_quiz_responses and the owner gets an email.",
    "No horizontal scroll at 375 px; no console errors."
  ],
  "you_get": [
    "Five questions, one per screen, with your first name in the questions that follow, in a dark, calm design",
    "Picture choices, one question that depends on your answer, and a strength scale",
    "A personal recommendation with its picture, why it fits and the price",
    "An Order this button that goes through the real checkout (a test payment while payments are in test mode)",
    "Every response saved with a bot check, and an email to the owner for each new one",
    "Works with the keyboard and on a phone"
  ],
  "parts": [
    {
      "part": "Site",
      "why": "The quiz on its own link, live in seconds."
    },
    {
      "part": "Collection with a form",
      "why": "Every response saved with a bot check and limits."
    },
    {
      "part": "Email on each response",
      "why": "The owner hears about every new answer."
    },
    {
      "part": "Products and checkout",
      "why": "The Order button sells the recommended roast."
    }
  ],
  "tools": [
    "get_recipe",
    "list_collections",
    "create_collection",
    "insert_document",
    "deploy_site",
    "fetch_site_page"
  ],
  "cost": {
    "headline": "0 euros a month on Hypamoon Free",
    "details": [
      "Up to 10,000 responses per form and 50 email notifications a day.",
      "The checkout is a test payment until you turn on payments; real sales pay the usual payment fees.",
      "On Free the site shows a small Hypamoon badge."
    ]
  }
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

## Agents

Agents that keep working for your project: a trigger, instructions in plain language, a small set of actions on Hypamoon, and limits. Actions that involve money or have an outside effect wait for the owner's approval by default.

### GET /agents

**List the agents.**

The agents of the project, newest first, each with pending\_approvals: the actions waiting for the owner.

Scope: `project:read`

#### 200 The agents.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] |  |

JSON

```
{
  "data": [
    {
      "id": "6f1d2b3c-4a5e-4f60-8a71-92b3c4d5e6f7",
      "name": "Contact request follow-up",
      "instructions": "When a new contact request comes in, email me a short summary (who, what they ask, how to reach them). If they left a phone number, propose a call back: start a call to that number in which the assistant says we received their request and asks when we can help.",
      "trigger": {
        "type": "document.created",
        "collection": "contact_requests",
        "collection_id": "0c1d2e3f-4a5b-4c6d-8e7f-8091a2b3c4d5",
        "phone_field": "phone"
      },
      "actions": {
        "email_owner": {
          "mode": "auto"
        },
        "start_call": {
          "mode": "approve"
        }
      },
      "limits": {
        "runs_per_day": 20,
        "actions_per_run": 3
      },
      "status": "active",
      "mode": "test",
      "next_run_at": null,
      "pending_approvals": 1,
      "created_by": "key:c16a7b81-92a3-44b5-8fc6-f708192a3b4d",
      "created_at": "2026-10-05T09:00:00.000Z",
      "updated_at": "2026-10-05T09:00:00.000Z"
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### POST /agents

**Create an agent.**

An agent keeps working for your project after the chat: on a trigger (a new document in a collection, a finished call, a closed chat conversation, or a schedule of at least every 15 minutes) it follows your instructions with a small set of actions on Hypamoon: read or update a document, email the owner, send an SMS, start a call, send a webhook to one of your own endpoints. Default deny: an action that is not turned on is refused. SMS and calls go only to the phone number of the event (trigger.phone\_field of the document, the other side of the call, or the customer of the chat), at most once per number per day, never to the project's own numbers; they wait for the owner's approval, and always do so when the trigger can come from a stranger (a public form, a call, a chat). In test mode they are simulated; in live mode they need a verified project. Limits: runs per day (default 20) and actions per run (default 3). At most 10 agents per project. Every run is logged with its trigger, a short thought, each action and the model cost. The key needs the scope of every action it turns on (calls:write for start\_call, messages:write for send\_sms, data:write for update\_document, webhooks:write for send\_webhook) and of the trigger.

Scope: `project:write`

#### Request body

A new agent.

| Field | Type |  |
| --- | --- | --- |
| `name` (required) | string | A short name, like New contact request follow-up. |
| `instructions` (required) | string | What the agent should do, in plain language, like: Send the owner a short summary of every new contact request and propose a call back. |
| `trigger` (required) | one of | When the agent runs: a new document in a collection, a finished call, a closed chat conversation (once its summary is ready), a new email in a thread of the team inbox (inbox.message.received, where the team inbox is on), or a schedule (every\_minutes, at least 15). |
| `actions` (required) | object | The actions this agent may take. Anything not listed is denied. |
| `limits` | object | The limits of the agent. |
| `status` | `"active"`, `"paused"` | active (default) or paused. |

JSON

```
{
  "name": "Contact request follow-up",
  "instructions": "When a new contact request comes in, email me a short summary (who, what they ask, how to reach them). If they left a phone number, propose a call back: start a call to that number in which the assistant says we received their request and asks when we can help.",
  "trigger": {
    "type": "document.created",
    "collection": "contact_requests",
    "phone_field": "phone"
  },
  "actions": {
    "email_owner": {
      "mode": "auto"
    },
    "start_call": {
      "mode": "approve"
    }
  },
  "limits": {
    "runs_per_day": 20,
    "actions_per_run": 3
  }
}
```

#### 201 The new agent.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `name` (required) | string |  |
| `instructions` (required) | string |  |
| `trigger` (required) | object |  |
| `actions` (required) | object |  |
| `limits` (required) | object |  |
| `status` (required) | `"active"`, `"paused"` |  |
| `mode` (required) | `"live"`, `"test"` |  |
| `next_run_at` (required) | string or null |  |
| `pending_approvals` (required) | integer |  |
| `created_by` (required) | string or null | The key (key:<id>) or connected app (oauth:<id>) that created the agent. |
| `created_at` (required) | string |  |
| `updated_at` (required) | string |  |
| `adapter_access_url` | string | Only for an agent that reads or writes through adapters: the page where the owner allows the access rules proposed for this agent in one go. Opening it allows nothing. |

JSON

```
{
  "id": "6f1d2b3c-4a5e-4f60-8a71-92b3c4d5e6f7",
  "name": "Contact request follow-up",
  "instructions": "When a new contact request comes in, email me a short summary (who, what they ask, how to reach them). If they left a phone number, propose a call back: start a call to that number in which the assistant says we received their request and asks when we can help.",
  "trigger": {
    "type": "document.created",
    "collection": "contact_requests",
    "collection_id": "0c1d2e3f-4a5b-4c6d-8e7f-8091a2b3c4d5",
    "phone_field": "phone"
  },
  "actions": {
    "email_owner": {
      "mode": "auto"
    },
    "start_call": {
      "mode": "approve"
    }
  },
  "limits": {
    "runs_per_day": 20,
    "actions_per_run": 3
  },
  "status": "active",
  "mode": "test",
  "next_run_at": null,
  "pending_approvals": 0,
  "created_by": "key:c16a7b81-92a3-44b5-8fc6-f708192a3b4d",
  "created_at": "2026-10-05T09:00:00.000Z",
  "updated_at": "2026-10-05T09:00:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 402 | [`insufficient_balance`](https://hypamoon.com/docs/errors/insufficient_balance) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /agents/{id}

**Get an agent.**

One agent with its five newest runs, each with its actions (including those waiting for approval).

Scope: `project:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the agent. |

#### 200 The agent.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `name` (required) | string |  |
| `instructions` (required) | string |  |
| `trigger` (required) | object |  |
| `actions` (required) | object |  |
| `limits` (required) | object |  |
| `status` (required) | `"active"`, `"paused"` |  |
| `mode` (required) | `"live"`, `"test"` |  |
| `next_run_at` (required) | string or null |  |
| `pending_approvals` (required) | integer |  |
| `created_by` (required) | string or null | The key (key:<id>) or connected app (oauth:<id>) that created the agent. |
| `created_at` (required) | string |  |
| `updated_at` (required) | string |  |
| `adapter_access_url` | string | Only for an agent that reads or writes through adapters: the page where the owner allows the access rules proposed for this agent in one go. Opening it allows nothing. |
| `recent_runs` (required) | object\[\] |  |

JSON

```
{
  "id": "6f1d2b3c-4a5e-4f60-8a71-92b3c4d5e6f7",
  "name": "Contact request follow-up",
  "instructions": "When a new contact request comes in, email me a short summary (who, what they ask, how to reach them). If they left a phone number, propose a call back: start a call to that number in which the assistant says we received their request and asks when we can help.",
  "trigger": {
    "type": "document.created",
    "collection": "contact_requests",
    "collection_id": "0c1d2e3f-4a5b-4c6d-8e7f-8091a2b3c4d5",
    "phone_field": "phone"
  },
  "actions": {
    "email_owner": {
      "mode": "auto"
    },
    "start_call": {
      "mode": "approve"
    }
  },
  "limits": {
    "runs_per_day": 20,
    "actions_per_run": 3
  },
  "status": "active",
  "mode": "test",
  "next_run_at": null,
  "pending_approvals": 1,
  "created_by": "key:c16a7b81-92a3-44b5-8fc6-f708192a3b4d",
  "created_at": "2026-10-05T09:00:00.000Z",
  "updated_at": "2026-10-05T09:00:00.000Z",
  "recent_runs": [
    {
      "id": "7a2e3c4d-5b6f-4071-8b82-a3c4d5e6f708",
      "agent_id": "6f1d2b3c-4a5e-4f60-8a71-92b3c4d5e6f7",
      "status": "done",
      "trigger": {
        "type": "document.created",
        "id": "9c40e5f6-7d81-4293-ad04-c5e6f708192a",
        "scheduled_for": null
      },
      "thought": "A new contact request from Sam about a kitchen quote: I email the owner a summary and propose a call back.",
      "outcome": "email_owner simulated; start_call waiting for approval. The owner has the summary; the call waits for approval.",
      "error": null,
      "model_turns": 2,
      "input_tokens": 4210,
      "output_tokens": 312,
      "created_at": "2026-10-05T09:01:00.000Z",
      "started_at": "2026-10-05T09:01:02.000Z",
      "finished_at": "2026-10-05T09:01:06.000Z",
      "actions": [
        {
          "id": "a94f5e6f-7081-4293-8da4-d5e6f708192b",
          "run_id": "7a2e3c4d-5b6f-4071-8b82-a3c4d5e6f708",
          "agent_id": "6f1d2b3c-4a5e-4f60-8a71-92b3c4d5e6f7",
          "type": "email_owner",
          "input": {
            "subject": "New contact request: Sam, kitchen quote",
            "body": "Sam asks for a quote for a new kitchen. Phone +447700900123."
          },
          "status": "simulated",
          "reason": null,
          "result": {
            "to": "owner",
            "subject": "New contact request: Sam, kitchen quote"
          },
          "decided_by": null,
          "decided_at": null,
          "expires_at": null,
          "created_at": "2026-10-05T09:01:04.000Z",
          "executed_at": "2026-10-05T09:01:04.000Z"
        },
        {
          "id": "8b3f4d5e-6c70-4182-9c93-b4d5e6f70819",
          "run_id": "7a2e3c4d-5b6f-4071-8b82-a3c4d5e6f708",
          "agent_id": "6f1d2b3c-4a5e-4f60-8a71-92b3c4d5e6f7",
          "type": "start_call",
          "input": {
            "to": "+447700900123",
            "assistant_instructions": "Call Sam back: we received the contact request about a quote for a new kitchen and ask when we can help."
          },
          "status": "pending_approval",
          "reason": null,
          "result": null,
          "decided_by": null,
          "decided_at": null,
          "expires_at": "2026-10-08T09:01:05.000Z",
          "created_at": "2026-10-05T09:01:05.000Z",
          "executed_at": null
        }
      ]
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### PATCH /agents/{id}

**Change an agent.**

Changes the name, instructions, trigger, actions (the whole set: anything not listed is denied), limits or status. Fields you leave out stay as they are. status paused stops new runs; active starts them again.

Scope: `project:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the agent. |

#### Request body

Changes to an agent. Fields you leave out stay as they are.

| Field | Type |  |
| --- | --- | --- |
| `name` | string | A short name, like New contact request follow-up. |
| `instructions` | string | What the agent should do, in plain language, like: Send the owner a short summary of every new contact request and propose a call back. |
| `trigger` | one of | When the agent runs: a new document in a collection, a finished call, a closed chat conversation (once its summary is ready), a new email in a thread of the team inbox (inbox.message.received, where the team inbox is on), or a schedule (every\_minutes, at least 15). |
| `actions` | object | The actions this agent may take. Anything not listed is denied. |
| `limits` | object | The limits of the agent. |
| `status` | `"active"`, `"paused"` | paused stops new runs; active starts them again. |

JSON

```
{
  "actions": {
    "email_owner": {
      "mode": "auto"
    },
    "start_call": {
      "mode": "approve"
    },
    "send_sms": {
      "mode": "approve"
    }
  }
}
```

#### 200 The agent as it is now.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `name` (required) | string |  |
| `instructions` (required) | string |  |
| `trigger` (required) | object |  |
| `actions` (required) | object |  |
| `limits` (required) | object |  |
| `status` (required) | `"active"`, `"paused"` |  |
| `mode` (required) | `"live"`, `"test"` |  |
| `next_run_at` (required) | string or null |  |
| `pending_approvals` (required) | integer |  |
| `created_by` (required) | string or null | The key (key:<id>) or connected app (oauth:<id>) that created the agent. |
| `created_at` (required) | string |  |
| `updated_at` (required) | string |  |
| `adapter_access_url` | string | Only for an agent that reads or writes through adapters: the page where the owner allows the access rules proposed for this agent in one go. Opening it allows nothing. |

JSON

```
{
  "id": "6f1d2b3c-4a5e-4f60-8a71-92b3c4d5e6f7",
  "name": "Contact request follow-up",
  "instructions": "When a new contact request comes in, email me a short summary (who, what they ask, how to reach them). If they left a phone number, propose a call back: start a call to that number in which the assistant says we received their request and asks when we can help.",
  "trigger": {
    "type": "document.created",
    "collection": "contact_requests",
    "collection_id": "0c1d2e3f-4a5b-4c6d-8e7f-8091a2b3c4d5",
    "phone_field": "phone"
  },
  "actions": {
    "email_owner": {
      "mode": "auto"
    },
    "start_call": {
      "mode": "approve"
    }
  },
  "limits": {
    "runs_per_day": 20,
    "actions_per_run": 3
  },
  "status": "active",
  "mode": "test",
  "next_run_at": null,
  "pending_approvals": 1,
  "created_by": "key:c16a7b81-92a3-44b5-8fc6-f708192a3b4d",
  "created_at": "2026-10-05T09:00:00.000Z",
  "updated_at": "2026-10-05T09:00:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 402 | [`insufficient_balance`](https://hypamoon.com/docs/errors/insufficient_balance) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### DELETE /agents/{id}

**Delete an agent.**

Stops the agent permanently: no new runs, actions waiting for approval expire, and the agent's own key is revoked. Its log stays readable until the project is deleted. Deleting it again returns 204 as well.

Scope: `project:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the agent. |

#### 204 Deleted.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### GET /agents/{id}/runs

**List the runs of an agent.**

The log of an agent, newest first: for each run the trigger, what the agent thought, each action with its status (including refused and pending ones), the outcome and the tokens used. Thoughts, outcomes and action input are kept for 90 days. Paginate with before (the created\_at of the last run you have).

Scope: `project:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the agent. |
| `limit` | query | integer | Runs per page, 1 to 50. |
| `before` | query | string (date-time) | Only runs created before this moment. |

#### 200 The runs.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] |  |
| `has_more` (required) | boolean |  |

JSON

```
{
  "data": [
    {
      "id": "7a2e3c4d-5b6f-4071-8b82-a3c4d5e6f708",
      "agent_id": "6f1d2b3c-4a5e-4f60-8a71-92b3c4d5e6f7",
      "status": "done",
      "trigger": {
        "type": "document.created",
        "id": "9c40e5f6-7d81-4293-ad04-c5e6f708192a",
        "scheduled_for": null
      },
      "thought": "A new contact request from Sam about a kitchen quote: I email the owner a summary and propose a call back.",
      "outcome": "email_owner simulated; start_call waiting for approval. The owner has the summary; the call waits for approval.",
      "error": null,
      "model_turns": 2,
      "input_tokens": 4210,
      "output_tokens": 312,
      "created_at": "2026-10-05T09:01:00.000Z",
      "started_at": "2026-10-05T09:01:02.000Z",
      "finished_at": "2026-10-05T09:01:06.000Z",
      "actions": [
        {
          "id": "a94f5e6f-7081-4293-8da4-d5e6f708192b",
          "run_id": "7a2e3c4d-5b6f-4071-8b82-a3c4d5e6f708",
          "agent_id": "6f1d2b3c-4a5e-4f60-8a71-92b3c4d5e6f7",
          "type": "email_owner",
          "input": {
            "subject": "New contact request: Sam, kitchen quote",
            "body": "Sam asks for a quote for a new kitchen. Phone +447700900123."
          },
          "status": "simulated",
          "reason": null,
          "result": {
            "to": "owner",
            "subject": "New contact request: Sam, kitchen quote"
          },
          "decided_by": null,
          "decided_at": null,
          "expires_at": null,
          "created_at": "2026-10-05T09:01:04.000Z",
          "executed_at": "2026-10-05T09:01:04.000Z"
        },
        {
          "id": "8b3f4d5e-6c70-4182-9c93-b4d5e6f70819",
          "run_id": "7a2e3c4d-5b6f-4071-8b82-a3c4d5e6f708",
          "agent_id": "6f1d2b3c-4a5e-4f60-8a71-92b3c4d5e6f7",
          "type": "start_call",
          "input": {
            "to": "+447700900123",
            "assistant_instructions": "Call Sam back: we received the contact request about a quote for a new kitchen and ask when we can help."
          },
          "status": "pending_approval",
          "reason": null,
          "result": null,
          "decided_by": null,
          "decided_at": null,
          "expires_at": "2026-10-08T09:01:05.000Z",
          "created_at": "2026-10-05T09:01:05.000Z",
          "executed_at": null
        }
      ]
    }
  ],
  "has_more": false
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_parameter`](https://hypamoon.com/docs/errors/invalid_parameter) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### POST /agent-actions/{id}/decide

**Approve or reject an agent action.**

The owner's decision on an action awaiting approval (status pending\_approval). approve runs it now, through the same checks as any other request (verification, balance, test mode); reject drops it. An SMS or a call can only be approved in the portal (403 forbidden here); rejecting does work here. Approving also needs the action's scope. A paused agent's actions can only be rejected. Repeating the same decision returns the action unchanged; a different decision on an action that was already decided or expired returns 409. Every decision is recorded in the project's audit log.

Scope: `project:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the agent action. |

#### Request body

The owner's decision on an action that waits for approval.

| Field | Type |  |
| --- | --- | --- |
| `decision` (required) | `"approve"`, `"reject"` | approve runs the action now; reject drops it. |

JSON

```
{
  "decision": "approve"
}
```

#### 200 The action after the decision.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `run_id` (required) | string (uuid) |  |
| `agent_id` (required) | string (uuid) |  |
| `type` (required) | `"read_document"`, `"update_document"`, `"email_owner"`, `"email_contact"`, `"send_sms"`, `"start_call"`, `"send_webhook"` |  |
| `input` (required) | object | What the agent asked for, like {"to": "+447700900123", "assistant\_instructions": "..."}. |
| `status` (required) | `"running"`, `"done"`, `"simulated"`, `"pending_approval"`, `"rejected"`, `"refused"`, `"failed"`, `"expired"` | running, done, simulated (test mode), pending\_approval (waiting for the owner), rejected (by the owner), refused (by the limits or the rules, see reason), failed (see reason), expired (no decision within 72 hours). |
| `reason` (required) | string or null |  |
| `result` (required) | object or null |  |
| `decided_by` (required) | string or null |  |
| `decided_at` (required) | string or null |  |
| `expires_at` (required) | string or null | When a pending action expires. |
| `created_at` (required) | string |  |
| `executed_at` (required) | string or null |  |

JSON

```
{
  "id": "8b3f4d5e-6c70-4182-9c93-b4d5e6f70819",
  "run_id": "7a2e3c4d-5b6f-4071-8b82-a3c4d5e6f708",
  "agent_id": "6f1d2b3c-4a5e-4f60-8a71-92b3c4d5e6f7",
  "type": "start_call",
  "input": {
    "to": "+447700900123",
    "assistant_instructions": "Call Sam back: we received the contact request about a quote for a new kitchen and ask when we can help."
  },
  "status": "simulated",
  "reason": null,
  "result": {
    "call_id": "b05f6a70-8192-43a4-9eb5-e6f708192a3c",
    "status": "completed",
    "to": "+447700900123"
  },
  "decided_by": "user:d27b8c92-a3b4-45c6-90d7-08192a3b4c5e",
  "decided_at": "2026-10-05T09:10:00.000Z",
  "expires_at": null,
  "created_at": "2026-10-05T09:01:05.000Z",
  "executed_at": "2026-10-05T09:10:01.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

## Apps

Server code on your site: /api on the same address runs your code, isolated, with allowed hosts, secrets from the vault, the project's data and schedules.

### GET /apps

**List the apps.**

The project's apps, newest first.

Scope: `sites:read`

#### 200 The apps.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] |  |

JSON

```
{
  "data": [
    {
      "id": "9d2e4f6a-1b3c-4d5e-8f70-a1b2c3d4e5f6",
      "name": "Contact form",
      "site_id": "5b0c7c2e-8f1d-4a3b-9c6e-2d4f5a6b7c8d",
      "url": "https://contact-demo.hypamoon.app",
      "api_url": "https://contact-demo.hypamoon.app/api",
      "mode": "test",
      "status": "active",
      "version": 2,
      "allowed_hosts": [
        "api.weatherapi.com"
      ],
      "secrets": [
        "weather_key"
      ],
      "schedules": [
        {
          "cron": "0 7 * * *"
        }
      ],
      "limits": {
        "cpu_ms": 10,
        "subrequests": 10,
        "outbound_per_minute": 60,
        "outbound_per_day": 2000,
        "bundle_bytes": 1048576
      },
      "created_at": "2026-10-06T09:00:00.000Z",
      "updated_at": "2026-10-06T09:30:00.000Z"
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### POST /apps

**Deploy an app.**

An app is a site with server code: requests to /api and everything below it on the site go to your code, all other paths keep serving the site's static files. Same address, no CORS; the site's password, paid access and own domain apply to /api too. The code is one bundled ES module (plus optional extra modules) in the standard module worker format (export default { fetch, scheduled }); no build step runs here. fetch() only reaches allowed\_hosts and the Hypamoon API (the project's own data, with a key Hypamoon adds). To use a secret from the vault, send the header x-hypamoon-secret: <name>; the code never sees its value. Each app runs isolated, with limits per request (CPU time, fetch calls) and an outbound budget per minute and per day. The first deploy for a site creates the app (201); a deploy for a site that already has one publishes a new version (200). On a new version, every setting you leave out (allowed\_hosts, secrets, schedules, vars, auth, database, fetch\_pages) keeps its current value, and the answer lists them in kept. Clear one explicitly: \[\] or {} for a list or vars, null for auth, false for fetch\_pages. database: false on an app that has a database is refused (409): a deploy never disconnects a database. The code works the same way: leave main\_module and modules out to keep the running code (to change only settings, or to move a test app to live), or send only the changed modules with keep\_existing\_modules: true. A new app always needs main\_module and modules. The ten newest versions are kept for rollback. Before anything goes live the code is checked for mining, hidden or downloaded code and fake login pages; there is no option to skip that check. A live app needs a verified project. An app that runs in test mode moves to live when you deploy it with a live key once the project is verified: it keeps its database and its users. A live app cannot go back to test (key\_mode\_mismatch).

Scope: `sites:write`

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `site_id` (required) | string (uuid) | The site the app belongs to (from deploy\_site or list\_sites). Requests to /api and everything below it on that site go to the app; all other paths stay the site's static files. |
| `name` | string | A name for your own overview. Defaults to the site's name. |
| `main_module` | string | The module with export default { async fetch(request, env, ctx) { ... } } (and optionally scheduled). Usually index.js. |
| `modules` | object\[\] | The bundled server code: the main module plus at most 19 more (ES modules, JSON or text). No WebAssembly, no npm install: bundle dependencies into the module. |
| `allowed_hosts` | string\[\] | Hosts the app may call with fetch(): exact names like api.example.com, or \*.example.com for its subdomains. Everything else is blocked. At most 20. The Hypamoon API (for the project's data) is always allowed. |
| `secrets` | string\[\] | Names of secrets from the project's vault (request\_secret) the app may use. The code never sees a value: it sends the header x-hypamoon-secret: <name> and Hypamoon puts the secret in the request, only to the hosts of that secret. At most 10. |
| `schedules` | object\[\] | When the app's scheduled(event, env, ctx) handler runs. At most 3. |
| `vars` | object | Plain settings in env, like {"CITY": "Delft"}. Never a key or password: use secrets. At most 20, names in UPPER\_CASE. |
| `auth` | object or null | Sign-in for the people who use the app. They sign in on the site itself (/\_hypamoon/auth/login) with a link by email; Hypamoon keeps only their email address and name. Hypamoon checks the sign-in before a request reaches the code and hands the person over ready to use: env.HYPAMOON.user is { id, email, name, roles, entitlements, groups, is(role), has(entitlement) } or null, env.HYPAMOON.requireUser(request) gives the user or a ready 401 JSON Response, and env.HYPAMOON.requireRole(request, role) the user or a ready 401 or 403 (if (user instanceof Response) return user). Never verify the signature of the x-hypamoon-user headers yourself and never use HYPAMOON\_AUTH\_SECRET in the code; only forward those two headers unchanged to env.HYPAMOON\_API (/app-files, /app-users). The first role in roles is the admin role everywhere. |
| `database` | boolean | true gives the app its own SQL database (SQLite) as env.DB: env.DB.prepare(sql).bind(...).all(). Create and change tables with apply\_app\_migration. The database stays when you deploy a version without it; delete\_app removes it. |
| `fetch_pages` | boolean | true turns on env.HYPAMOON.fetchPage(url) for this app (off by default; needs auth). It fetches one public web page for the signed-in user, for example to import a recipe or read a product page from any site, without listing that site in allowed\_hosts: const page = await env.HYPAMOON.fetchPage(url) gives { url, status, contentType, body, truncated }, with url the final address after redirects. Only GET, http and https, text, HTML or JSON (also JSON-LD), at most 2 MB (truncated: true when cut off) and 10 seconds, at most 3 redirects. Private addresses and Hypamoon hosts are blocked. No cookies or x-hypamoon headers are sent. Each signed-in user can fetch 20 pages per hour, and the fetches count against the app's outbound budget. A refusal throws an Error with .status: 401 not signed in, 403 blocked address, 415 not text, 429 limit reached, 501 off for this app, 502 or 504 the page failed or was too slow. On an update, leave it out to keep the current setting; false turns it off. |
| `ai` | object or null | Whether the app may send its data to AI processors through env.HYPAMOON.ai: ai.generate is processed by Anthropic in the United States, ai.transcribe by the provider that already hosts the app. Off until you choose it: without ai: { enabled: true } every env.HYPAMOON.ai call is refused with ai\_not\_enabled. Turn it on only after the owner agrees, and name the processors (get\_app lists them) in the app's privacy text. Send site\_id and only ai to change just this, without a new version. null or enabled: false turns it off. On an update, leave it out to keep the current choice. |
| `subjects` | object or null | For data protection requests (GDPR) about people the app keeps data on who do not sign in to it, like candidates in an ATS or customers in a CRM. List the tables of the app's own database that identify a person (email\_column and/or id\_column) and the tables that hang from them (parent with the column that holds the parent's id). Then export\_app\_subject finds and exports everything about one email address or id, and delete\_app\_subject deletes it, files included, after the owner confirms. Example: { tables: \[ { table: "candidates", email\_column: "email", id\_column: "id", file\_columns: \["cv\_file\_id"\] }, { table: "notes", parent: { table: "candidates", column: "candidate\_id" } } \] }. Needs database: true. The tables and columns are checked when you export or delete, so you can deploy this before apply\_app\_migration creates them. On an update, leave it out to keep the current list; null removes it. |
| `email_recipients` | object or null | Optional. Who the app may email from its own database with env.HYPAMOON.sendEmail: tables of people the business already knows, with the column of their address and the legal basis. Such an email always carries an unsubscribe link and the business address (also with category transactional), goes to one recipient per email, and counts against the daily limit of new recipients; unsubscribes, bounces and complaints stop it. In test mode it always works (nothing is sent; it shows in list\_app\_mails). Real sending to these people is behind a switch that Hypamoon turns on. null removes the list. |
| `keep_existing_modules` | boolean | On an update: true keeps every running module you do not send, and replaces or adds only the modules you send (like keep\_existing on deploy\_site). |

JSON

```
{
  "site_id": "5b0c7c2e-8f1d-4a3b-9c6e-2d4f5a6b7c8d",
  "name": "Contact form",
  "main_module": "index.js",
  "modules": [
    {
      "name": "index.js",
      "content": "export default {\n  async fetch(request, env) {\n    const url = new URL(request.url);\n    if (url.pathname === \"/api/contact\" && request.method === \"POST\") {\n      const form = await request.formData();\n      const city = String(form.get(\"city\") || \"Delft\");\n      // The secret weather_key is added by Hypamoon; this code never sees it.\n      const weather = await fetch(\"https://api.weatherapi.com/v1/current.json?q=\" + encodeURIComponent(city), {\n        headers: { \"x-hypamoon-secret\": \"weather_key\" },\n      }).then((r) => r.json());\n      // The project's data: Hypamoon adds the app's own key. contact_requests is a\n      // collection of the project, shared with this app through app_access \"write\".\n      await fetch(env.HYPAMOON_API + \"/collections/contact_requests/documents\", {\n        method: \"POST\",\n        headers: { \"content-type\": \"application/json\" },\n        body: JSON.stringify({ data: { name: form.get(\"name\"), email: form.get(\"email\"), city } }),\n      });\n      return Response.json({ ok: true, temperature_c: weather.current?.temp_c ?? null });\n    }\n    return new Response(\"Not found\", { status: 404 });\n  },\n  async scheduled(event, env) {\n    // Runs on the schedule, for example a daily summary.\n  },\n};\n"
    }
  ],
  "allowed_hosts": [
    "api.weatherapi.com"
  ],
  "secrets": [
    "weather_key"
  ],
  "schedules": [
    {
      "cron": "0 7 * * *"
    }
  ],
  "vars": {
    "DEFAULT_CITY": "Delft"
  }
}
```

#### 200 A new version is live.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `name` (required) | string |  |
| `site_id` (required) | string (uuid) |  |
| `url` (required) | string | The site; the app answers on url + /api. |
| `api_url` (required) | string | Where the app's /api starts. |
| `mode` (required) | `"live"`, `"test"` |  |
| `status` (required) | `"active"`, `"offline"` | offline: Hypamoon took the site offline; the app does not run. |
| `version` (required) | integer | The version that runs now. |
| `allowed_hosts` (required) | string\[\] |  |
| `secrets` (required) | string\[\] |  |
| `schedules` (required) | object\[\] |  |
| `limits` (required) | object | Per request: CPU time and fetch calls. Per app: outbound requests per minute and per day. |
| `auth` | object or null | Sign-in for the app's users; null when it is off. login\_url is where people sign in. |
| `database` | object or null | The app's own database (env.DB); null when it has none. full: above the plan's data limit, so the app can only read and delete until there is room. |
| `ai` | object | AI processing: whether the app may send data to an AI processor through env.HYPAMOON.ai. Off without an explicit choice (deploy\_app ai). |
| `kept` | string\[\] | Only in the answer to a deploy of an existing app: the settings that were left out and kept from the running version, like "allowed\_hosts (20)", "vars (2)", "database", "auth". |
| `warnings` | string\[\] | Only in the answer to a deploy: advice about the app's data, never a block. For example that export and delete per user won't cover the data (no table marked with set\_table\_owner\_column), or tables that look like backups or copies. Tell the user in plain words and offer to fix it. |
| `created_at` (required) | string |  |
| `updated_at` (required) | string |  |

JSON

```
{
  "id": "9d2e4f6a-1b3c-4d5e-8f70-a1b2c3d4e5f6",
  "name": "Contact form",
  "site_id": "5b0c7c2e-8f1d-4a3b-9c6e-2d4f5a6b7c8d",
  "url": "https://contact-demo.hypamoon.app",
  "api_url": "https://contact-demo.hypamoon.app/api",
  "mode": "test",
  "status": "active",
  "version": 2,
  "allowed_hosts": [
    "api.weatherapi.com"
  ],
  "secrets": [
    "weather_key"
  ],
  "schedules": [
    {
      "cron": "0 7 * * *"
    }
  ],
  "limits": {
    "cpu_ms": 10,
    "subrequests": 10,
    "outbound_per_minute": 60,
    "outbound_per_day": 2000,
    "bundle_bytes": 1048576
  },
  "created_at": "2026-10-06T09:00:00.000Z",
  "updated_at": "2026-10-06T09:30:00.000Z"
}
```

#### 201 The app is live.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `name` (required) | string |  |
| `site_id` (required) | string (uuid) |  |
| `url` (required) | string | The site; the app answers on url + /api. |
| `api_url` (required) | string | Where the app's /api starts. |
| `mode` (required) | `"live"`, `"test"` |  |
| `status` (required) | `"active"`, `"offline"` | offline: Hypamoon took the site offline; the app does not run. |
| `version` (required) | integer | The version that runs now. |
| `allowed_hosts` (required) | string\[\] |  |
| `secrets` (required) | string\[\] |  |
| `schedules` (required) | object\[\] |  |
| `limits` (required) | object | Per request: CPU time and fetch calls. Per app: outbound requests per minute and per day. |
| `auth` | object or null | Sign-in for the app's users; null when it is off. login\_url is where people sign in. |
| `database` | object or null | The app's own database (env.DB); null when it has none. full: above the plan's data limit, so the app can only read and delete until there is room. |
| `ai` | object | AI processing: whether the app may send data to an AI processor through env.HYPAMOON.ai. Off without an explicit choice (deploy\_app ai). |
| `kept` | string\[\] | Only in the answer to a deploy of an existing app: the settings that were left out and kept from the running version, like "allowed\_hosts (20)", "vars (2)", "database", "auth". |
| `warnings` | string\[\] | Only in the answer to a deploy: advice about the app's data, never a block. For example that export and delete per user won't cover the data (no table marked with set\_table\_owner\_column), or tables that look like backups or copies. Tell the user in plain words and offer to fix it. |
| `created_at` (required) | string |  |
| `updated_at` (required) | string |  |

JSON

```
{
  "id": "9d2e4f6a-1b3c-4d5e-8f70-a1b2c3d4e5f6",
  "name": "Contact form",
  "site_id": "5b0c7c2e-8f1d-4a3b-9c6e-2d4f5a6b7c8d",
  "url": "https://contact-demo.hypamoon.app",
  "api_url": "https://contact-demo.hypamoon.app/api",
  "mode": "test",
  "status": "active",
  "version": 1,
  "allowed_hosts": [
    "api.weatherapi.com"
  ],
  "secrets": [
    "weather_key"
  ],
  "schedules": [
    {
      "cron": "0 7 * * *"
    }
  ],
  "limits": {
    "cpu_ms": 10,
    "subrequests": 10,
    "outbound_per_minute": 60,
    "outbound_per_day": 2000,
    "bundle_bytes": 1048576
  },
  "created_at": "2026-10-06T09:00:00.000Z",
  "updated_at": "2026-10-06T09:30:00.000Z"
}
```

#### 202 Four-eyes approval is on: the deploy waits for another owner or builder. The running code has not changed yet.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"deploy_approval"` |  |
| `id` (required) | string (uuid) | The id of the request; pass it as approval\_id to approve\_deploy or reject\_deploy. |
| `status` (required) | `"pending"`, `"processing"`, `"approved"`, `"rejected"`, `"failed"`, `"superseded"`, `"expired"` | pending until another owner or builder decides. superseded: a newer deploy of the same site replaced it. expired: after 7 days. |
| `kind` (required) | `"new_site"`, `"site_update"`, `"site_delete"`, `"app_deploy"`, `"app_rollback"` | app\_deploy and app\_rollback: server code of an app (deploy\_app, rollback\_app); files and bytes are its modules. |
| `site_id` (required) | string or null (uuid) |  |
| `name` (required) | string or null |  |
| `slug` (required) | string or null |  |
| `url` (required) | string or null | The address of the site. For an update or deletion it still shows the live version until approval. |
| `files` (required) | integer |  |
| `bytes` (required) | integer |  |
| `password_change` (required) | `"none"`, `"remove"`, `"set"` |  |
| `requested_by` (required) | object |  |
| `requested_at` (required) | string |  |
| `expires_at` (required) | string |  |
| `reviewed_by` (required) | string or null (uuid) |  |
| `reviewed_at` (required) | string or null |  |
| `reason` (required) | string or null |  |
| `result` (required) | object or null |  |

JSON

```
{
  "object": "deploy_approval",
  "id": "8f6c2a51-3d1e-4b7a-9c42-0e5d6f7a8b90",
  "status": "pending",
  "kind": "app_deploy",
  "site_id": "3b2f9c1e-7a4d-4e8b-b5c6-1d2e3f4a5b6c",
  "name": "Acme Plumbing",
  "slug": "acme-plumbing",
  "url": "https://acme-plumbing.hypamoon.app",
  "files": 1,
  "bytes": 1834,
  "password_change": "none",
  "requested_by": {
    "user_id": "5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a",
    "via": "api",
    "app": "Claude"
  },
  "requested_at": "2026-10-05T10:15:00Z",
  "expires_at": "2026-10-12T10:15:00Z",
  "reviewed_by": null,
  "reviewed_at": null,
  "reason": null,
  "result": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 402 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 403 | [`site_offline`](https://hypamoon.com/docs/errors/site_offline) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 413 | [`app_too_large`](https://hypamoon.com/docs/errors/app_too_large) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`app_blocked`](https://hypamoon.com/docs/errors/app_blocked) |
| 429 | [`deploy_limit_reached`](https://hypamoon.com/docs/errors/deploy_limit_reached) |

### GET /apps/{id}

**Get an app.**

One app with the settings of the running version (main\_module, allowed\_hosts, secrets by name only, schedules, vars with their values, auth, database, fetch\_pages), its stored versions and its most recent errors. A deploy that leaves a setting out keeps the value shown here.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app. |

#### 200 The app.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `name` (required) | string |  |
| `site_id` (required) | string (uuid) |  |
| `url` (required) | string | The site; the app answers on url + /api. |
| `api_url` (required) | string | Where the app's /api starts. |
| `mode` (required) | `"live"`, `"test"` |  |
| `status` (required) | `"active"`, `"offline"` | offline: Hypamoon took the site offline; the app does not run. |
| `version` (required) | integer | The version that runs now. |
| `allowed_hosts` (required) | string\[\] |  |
| `secrets` (required) | string\[\] |  |
| `schedules` (required) | object\[\] |  |
| `limits` (required) | object | Per request: CPU time and fetch calls. Per app: outbound requests per minute and per day. |
| `auth` | object or null | Sign-in for the app's users; null when it is off. login\_url is where people sign in. |
| `database` | object or null | The app's own database (env.DB); null when it has none. full: above the plan's data limit, so the app can only read and delete until there is room. |
| `ai` | object | AI processing: whether the app may send data to an AI processor through env.HYPAMOON.ai. Off without an explicit choice (deploy\_app ai). |
| `kept` | string\[\] | Only in the answer to a deploy of an existing app: the settings that were left out and kept from the running version, like "allowed\_hosts (20)", "vars (2)", "database", "auth". |
| `warnings` | string\[\] | Only in the answer to a deploy: advice about the app's data, never a block. For example that export and delete per user won't cover the data (no table marked with set\_table\_owner\_column), or tables that look like backups or copies. Tell the user in plain words and offer to fix it. |
| `created_at` (required) | string |  |
| `updated_at` (required) | string |  |
| `main_module` (required) | string | The main module of the running version. |
| `vars` (required) | object | The plain settings in env of the running version, with their values. Secrets are not here: secrets lists only their names. |
| `fetch_pages` (required) | boolean | Whether env.HYPAMOON.fetchPage is on in the running version. |
| `subjects` | object | For data protection requests (GDPR) about people the app keeps data on who do not sign in to it, like candidates in an ATS or customers in a CRM. List the tables of the app's own database that identify a person (email\_column and/or id\_column) and the tables that hang from them (parent with the column that holds the parent's id). Then export\_app\_subject finds and exports everything about one email address or id, and delete\_app\_subject deletes it, files included, after the owner confirms. Example: { tables: \[ { table: "candidates", email\_column: "email", id\_column: "id", file\_columns: \["cv\_file\_id"\] }, { table: "notes", parent: { table: "candidates", column: "candidate\_id" } } \] }. Needs database: true. The tables and columns are checked when you export or delete, so you can deploy this before apply\_app\_migration creates them. On an update, leave it out to keep the current list; null removes it. |
| `email_recipients` | object | Optional. Who the app may email from its own database with env.HYPAMOON.sendEmail: tables of people the business already knows, with the column of their address and the legal basis. Such an email always carries an unsubscribe link and the business address (also with category transactional), goes to one recipient per email, and counts against the daily limit of new recipients; unsubscribes, bounces and complaints stop it. In test mode it always works (nothing is sent; it shows in list\_app\_mails). Real sending to these people is behind a switch that Hypamoon turns on. null removes the list. |
| `project_warning` | object | Only when it applies: this app looks like it serves real users while it sits in an internal or demo project of Hypamoon. Advice, never a block. |
| `versions` (required) | object\[\] | The kept versions, newest first (at most 10). |
| `recent_errors` (required) | object\[\] | The newest errors (last 7 days), if the log could be read. |
| `performance_hints` | string\[\] | Only when a route is slow (last 24 hours): what it measured and what to change, like putting sequential database queries in one env.DB.batch. |

JSON

```
{
  "id": "9d2e4f6a-1b3c-4d5e-8f70-a1b2c3d4e5f6",
  "name": "Contact form",
  "site_id": "5b0c7c2e-8f1d-4a3b-9c6e-2d4f5a6b7c8d",
  "url": "https://contact-demo.hypamoon.app",
  "api_url": "https://contact-demo.hypamoon.app/api",
  "mode": "test",
  "status": "active",
  "version": 2,
  "allowed_hosts": [
    "api.weatherapi.com"
  ],
  "secrets": [
    "weather_key"
  ],
  "schedules": [
    {
      "cron": "0 7 * * *"
    }
  ],
  "limits": {
    "cpu_ms": 10,
    "subrequests": 10,
    "outbound_per_minute": 60,
    "outbound_per_day": 2000,
    "bundle_bytes": 1048576
  },
  "created_at": "2026-10-06T09:00:00.000Z",
  "updated_at": "2026-10-06T09:30:00.000Z",
  "main_module": "index.js",
  "vars": {
    "CITY": "Delft"
  },
  "fetch_pages": false,
  "versions": [
    {
      "version": 2,
      "bytes": 1834,
      "created_at": "2026-10-06T09:30:00.000Z"
    },
    {
      "version": 1,
      "bytes": 1620,
      "created_at": "2026-10-06T09:00:00.000Z"
    }
  ],
  "recent_errors": [
    {
      "at": "2026-10-06T09:41:12.000Z",
      "status": 500,
      "path": "/api/contact",
      "message": "TypeError: Cannot read properties of undefined (reading 'temp_c')"
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### DELETE /apps/{id}

**Delete an app.**

Removes the app right away with everything it holds: its users (accounts, sessions, passkeys, passwords and groups), the files they uploaded, its own database with all tables and migrations, its secrets, and the server code, its versions, its schedules and its key. None of it can be restored. Within seconds, /api is an ordinary path on the site again. The site itself remains (delete\_site removes it). Deleting it again returns 204 as well.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app. |

#### 204 Deleted.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### POST /apps/{id}/rollback

**Roll an app back.**

Makes a stored version live again, with the settings it had (allowed hosts, secrets, schedules, vars). Without version: the version before the current one.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `version` | integer | The version to go back to. Leave it out for the version before the current one. |

JSON

```
{
  "version": 1
}
```

#### 200 The app as it runs now.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `name` (required) | string |  |
| `site_id` (required) | string (uuid) |  |
| `url` (required) | string | The site; the app answers on url + /api. |
| `api_url` (required) | string | Where the app's /api starts. |
| `mode` (required) | `"live"`, `"test"` |  |
| `status` (required) | `"active"`, `"offline"` | offline: Hypamoon took the site offline; the app does not run. |
| `version` (required) | integer | The version that runs now. |
| `allowed_hosts` (required) | string\[\] |  |
| `secrets` (required) | string\[\] |  |
| `schedules` (required) | object\[\] |  |
| `limits` (required) | object | Per request: CPU time and fetch calls. Per app: outbound requests per minute and per day. |
| `auth` | object or null | Sign-in for the app's users; null when it is off. login\_url is where people sign in. |
| `database` | object or null | The app's own database (env.DB); null when it has none. full: above the plan's data limit, so the app can only read and delete until there is room. |
| `ai` | object | AI processing: whether the app may send data to an AI processor through env.HYPAMOON.ai. Off without an explicit choice (deploy\_app ai). |
| `kept` | string\[\] | Only in the answer to a deploy of an existing app: the settings that were left out and kept from the running version, like "allowed\_hosts (20)", "vars (2)", "database", "auth". |
| `warnings` | string\[\] | Only in the answer to a deploy: advice about the app's data, never a block. For example that export and delete per user won't cover the data (no table marked with set\_table\_owner\_column), or tables that look like backups or copies. Tell the user in plain words and offer to fix it. |
| `created_at` (required) | string |  |
| `updated_at` (required) | string |  |

JSON

```
{
  "id": "9d2e4f6a-1b3c-4d5e-8f70-a1b2c3d4e5f6",
  "name": "Contact form",
  "site_id": "5b0c7c2e-8f1d-4a3b-9c6e-2d4f5a6b7c8d",
  "url": "https://contact-demo.hypamoon.app",
  "api_url": "https://contact-demo.hypamoon.app/api",
  "mode": "test",
  "status": "active",
  "version": 1,
  "allowed_hosts": [
    "api.weatherapi.com"
  ],
  "secrets": [
    "weather_key"
  ],
  "schedules": [
    {
      "cron": "0 7 * * *"
    }
  ],
  "limits": {
    "cpu_ms": 10,
    "subrequests": 10,
    "outbound_per_minute": 60,
    "outbound_per_day": 2000,
    "bundle_bytes": 1048576
  },
  "created_at": "2026-10-06T09:00:00.000Z",
  "updated_at": "2026-10-06T09:30:00.000Z"
}
```

#### 202 Four-eyes approval is on: the rollback waits for another owner or builder. Nothing has changed yet.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"deploy_approval"` |  |
| `id` (required) | string (uuid) | The id of the request; pass it as approval\_id to approve\_deploy or reject\_deploy. |
| `status` (required) | `"pending"`, `"processing"`, `"approved"`, `"rejected"`, `"failed"`, `"superseded"`, `"expired"` | pending until another owner or builder decides. superseded: a newer deploy of the same site replaced it. expired: after 7 days. |
| `kind` (required) | `"new_site"`, `"site_update"`, `"site_delete"`, `"app_deploy"`, `"app_rollback"` | app\_deploy and app\_rollback: server code of an app (deploy\_app, rollback\_app); files and bytes are its modules. |
| `site_id` (required) | string or null (uuid) |  |
| `name` (required) | string or null |  |
| `slug` (required) | string or null |  |
| `url` (required) | string or null | The address of the site. For an update or deletion it still shows the live version until approval. |
| `files` (required) | integer |  |
| `bytes` (required) | integer |  |
| `password_change` (required) | `"none"`, `"remove"`, `"set"` |  |
| `requested_by` (required) | object |  |
| `requested_at` (required) | string |  |
| `expires_at` (required) | string |  |
| `reviewed_by` (required) | string or null (uuid) |  |
| `reviewed_at` (required) | string or null |  |
| `reason` (required) | string or null |  |
| `result` (required) | object or null |  |

JSON

```
{
  "object": "deploy_approval",
  "id": "8f6c2a51-3d1e-4b7a-9c42-0e5d6f7a8b90",
  "status": "pending",
  "kind": "app_rollback",
  "site_id": "3b2f9c1e-7a4d-4e8b-b5c6-1d2e3f4a5b6c",
  "name": "Acme Plumbing",
  "slug": "acme-plumbing",
  "url": "https://acme-plumbing.hypamoon.app",
  "files": 1,
  "bytes": 1620,
  "password_change": "none",
  "requested_by": {
    "user_id": "5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a",
    "via": "api",
    "app": "Claude"
  },
  "requested_at": "2026-10-05T10:15:00Z",
  "expires_at": "2026-10-12T10:15:00Z",
  "reviewed_by": null,
  "reviewed_at": null,
  "reason": null,
  "result": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`site_offline`](https://hypamoon.com/docs/errors/site_offline) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /apps/{id}/logs

**Read the log of an app.**

The newest requests, errors, scheduled runs, outbound calls and sign-in attempts of the last 7 days, newest first. Headers, cookies, query strings and bodies are never logged; in paths, parts that look like an email address, a long number or a token are replaced by :x. A sign-in attempt (kind sign\_in) says why it failed as a fixed reason, with the address masked; never the code or a token. New lines can take up to a minute to appear.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app. |
| `limit` | query | integer | Lines, 1 to 100. |
| `errors_only` | query | boolean | Only errors. |
| `kind` | query | `"request"`, `"error"`, `"scheduled"`, `"outbound"`, `"webhook"`, `"retry"`, `"dead_letter"`, `"sign_in"` | Only lines of this kind, like sign\_in for sign-in attempts. |

#### 200 The log.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] |  |
| `performance_hints` | string\[\] | Only when a route is slow (last 24 hours): what it measured and what to change. |

JSON

```
{
  "data": [
    {
      "at": "2026-10-06T09:41:12.000Z",
      "kind": "request",
      "method": "POST",
      "path": "/api/contact",
      "status": 200,
      "duration_ms": 182,
      "message": ""
    },
    {
      "at": "2026-10-06T09:41:12.000Z",
      "kind": "outbound",
      "method": "GET",
      "path": "api.weatherapi.com",
      "status": 200,
      "duration_ms": 95,
      "message": ""
    },
    {
      "at": "2026-10-06T09:42:03.000Z",
      "kind": "sign_in",
      "method": "POST",
      "path": "/_hypamoon/auth/code",
      "status": 400,
      "duration_ms": 0,
      "message": "The code does not match the code in the newest email for this address.",
      "sign_in": {
        "outcome": "rejected",
        "reason": "wrong_code",
        "method": "code",
        "email": "s***@example.com",
        "region": "NL",
        "ip_hash": "3f9a1c07be"
      }
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_parameter`](https://hypamoon.com/docs/errors/invalid_parameter) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### GET /apps/{id}/users

**List the users of an app.**

The people who may sign in to the app, with their role and when they last signed in. Hypamoon keeps only their email address and name. An app has no limit on its users, so the list comes in pages of up to 200, oldest first: while has\_more is true, call again with cursor set to next\_cursor.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app. |
| `limit` | query | integer | Users per page, 1 to 200. |
| `cursor` | query | string | next\_cursor from the previous page. |
| `email` | query | string (email) | Only the user with this whole email address (no partial match). |
| `role` | query | string | Only users with this role. |

#### 200 A page of users.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] |  |
| `has_more` (required) | boolean | Whether there is another page. |
| `next_cursor` (required) | string or null | Pass this as cursor to get the next page. Null on the last page. |

JSON

```
{
  "data": [
    {
      "id": "7c1d2e3f-4a5b-4c6d-8e7f-90a1b2c3d4e5",
      "email": "sam@example.com",
      "name": "Sam",
      "role": "member",
      "created_at": "2026-10-06T10:00:00.000Z",
      "last_sign_in_at": "2026-10-06T10:05:00.000Z"
    }
  ],
  "has_more": false,
  "next_cursor": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_parameter`](https://hypamoon.com/docs/errors/invalid_parameter) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |

### POST /apps/{id}/users

**Invite someone to an app.**

Lets this person sign in to the app with the given role, and emails them a sign-in link (unless send\_email is false). The app needs auth (deploy\_app with auth). With signup invite (the default) only invited people can sign in. Invitations with an email are limited per app to 20 per hour and 100 per day, and the same address once per 10 minutes (429 with Retry-After).

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `email` (required) | string (email) | Their email address. |
| `name` | string | Their name, shown to the app. |
| `role` | string | One of the app's roles. Defaults to default\_role. |
| `send_email` | boolean | Send them a sign-in link now (default true). |
| `language` | `"nl"`, `"en"`, `"de"`, `"fr"`, `"es"` | The language of the invitation email for this person (nl, en or de; fr and es get English). Leave it out for the site's language. |
| `test_user` | boolean | Marks this user as a test user, so create\_test\_login\_link can sign in as them on a live app. Needs an address that can never receive email (example.com, .test, .example, .invalid) and, on a live app, a role that is not the admin role. |

JSON

```
{
  "email": "sam@example.com",
  "name": "Sam",
  "role": "member"
}
```

#### 201 Invited.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The person's id: sub in x-hypamoon-user. |
| `email` (required) | string |  |
| `name` (required) | string or null |  |
| `role` (required) | string |  |
| `created_at` (required) | string |  |
| `last_sign_in_at` (required) | string or null |  |
| `test_user` | boolean | Only when true: a test user on an address that never receives email, not a real person (invite\_app\_user with test\_user). |

JSON

```
{
  "id": "7c1d2e3f-4a5b-4c6d-8e7f-90a1b2c3d4e5",
  "email": "sam@example.com",
  "name": "Sam",
  "role": "member",
  "created_at": "2026-10-06T10:00:00.000Z",
  "last_sign_in_at": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /apps/{id}/mails

**List the emails an app sent.**

The sign-in links, codes, invitations and account emails the app sent, newest first, with their delivery status: queued, sent (accepted by the mail provider), delivered (accepted by the recipient's mail server), bounced, complained or failed, and the reason. Recipients are masked (a\*\*\*@example.com); links and codes are never shown. Use it when someone saw "Check your email" and nothing arrived: delivered means it is in their spam, junk or quarantine.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app. |
| `limit` | query | integer | Emails, 1 to 50. |

#### 200 The emails.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] |  |

JSON

```
{
  "data": [
    {
      "sent_at": "2026-10-13T12:38:30.723Z",
      "kind": "sign_in_link",
      "to": "a***@example.com",
      "status": "delivered",
      "reason": null,
      "meaning": "Accepted by the recipient's mail server. If it is not in the inbox, it is in spam, junk or quarantine.",
      "status_at": "2026-10-13T12:40:02.000Z",
      "provider_ref": "01a13545"
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_parameter`](https://hypamoon.com/docs/errors/invalid_parameter) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### POST /apps/{id}/users/import

**Import users from a collection.**

Makes the people in a collection (default wp\_users, from the Hypamoon Connect plugin for WordPress) users of the app, with role\_map from WordPress roles to app roles. No passwords: people sign in with a link or code by email. send\_email false (the default) adds them silently; true emails each new person an invitation, within the invitation limits (20 per hour and 100 per day per app; the rest is reported as remaining with retry\_after). Idempotent on the WordPress id and the email address: people who can already sign in are left as they are. The app user id is written back into each document (hypamoon\_app\_users). dry\_run shows the plan without changing anything.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `collection` | string | The collection with the people, default wp\_users (from the Hypamoon Connect plugin). Each document needs email; name comes from display\_name, name or first\_name and last\_name; roles from roles (a list) or role. |
| `role_map` | object | WordPress role to app role, like { "administrator": "admin", "opdrachtgever": "opdrachtgever", "kandidaat": "kandidaat" }. A person gets the app role of the first of their roles that is in the map. Without role\_map, a WordPress role with the same name as an app role is used. |
| `default_role` | string or null | The app role for people whose roles are not in role\_map. Leave it out (or null) to skip them; without role\_map the app's default\_role is used. |
| `send_email` | boolean | false (the default): add them silently, no email; they sign in later with a link or code they request on the site. true: email each new person an invitation (counts toward the app's invitation limits and the email budget). |
| `invite_existing` | boolean | Only with send\_email true: also email people who were added earlier (for example silently) and never signed in. Default false, so running the import again sends nothing twice. |
| `dry_run` | boolean | true: change nothing, only show who would be added with which role. |

JSON

```
{
  "collection": "wp_users",
  "role_map": {
    "administrator": "admin",
    "opdrachtgever": "opdrachtgever",
    "kandidaat": "kandidaat"
  },
  "send_email": false
}
```

#### 200 What happened per person.

| Field | Type |  |
| --- | --- | --- |
| `app_id` (required) | string (uuid) |  |
| `collection` (required) | string |  |
| `dry_run` (required) | boolean |  |
| `send_email` (required) | boolean |  |
| `summary` (required) | object | created: added now (invited: of those, emailed). existing: could already sign in (matched on WordPress id or email; their role is not changed). remaining: not done yet because of a limit; call again. |
| `users` (required) | object\[\] | Per person what happened, in the order of the collection. |
| `retry_after` | integer | Seconds to wait before the remaining invitations can go out. |
| `next_step` (required) | string |  |

JSON

```
{
  "app_id": "8d0f4a1e-2b3c-4d5e-8f60-718293a4b5c6",
  "collection": "wp_users",
  "dry_run": false,
  "send_email": false,
  "summary": {
    "found": 2,
    "created": 1,
    "invited": 0,
    "existing": 1,
    "skipped": 0,
    "remaining": 0
  },
  "users": [
    {
      "wp_id": 12,
      "user_id": "3f1e2d3c-4b5a-4c6d-9e8f-0a1b2c3d4e5f",
      "email": "s***@example.com",
      "role": "opdrachtgever",
      "status": "created"
    },
    {
      "wp_id": 1,
      "user_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
      "email": "a***@example.com",
      "role": "admin",
      "status": "existing"
    }
  ],
  "next_step": "1 added silently, without email, 1 could already sign in, 0 skipped."
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### PATCH /apps/{id}/users/{userId}

**Change the role of a user.**

Sets one of the app's roles. The app sees the new role in x-hypamoon-user within seconds.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app. |
| `userId` (required) | path | string (uuid) | The id of the user (sub in x-hypamoon-user). |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `role` (required) | string | One of the app's roles. |

JSON

```
{
  "role": "admin"
}
```

#### 200 The user with the new role.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The person's id: sub in x-hypamoon-user. |
| `email` (required) | string |  |
| `name` (required) | string or null |  |
| `role` (required) | string |  |
| `created_at` (required) | string |  |
| `last_sign_in_at` (required) | string or null |  |
| `test_user` | boolean | Only when true: a test user on an address that never receives email, not a real person (invite\_app\_user with test\_user). |

JSON

```
{
  "id": "7c1d2e3f-4a5b-4c6d-8e7f-90a1b2c3d4e5",
  "email": "sam@example.com",
  "name": "Sam",
  "role": "admin",
  "created_at": "2026-10-06T10:00:00.000Z",
  "last_sign_in_at": "2026-10-06T10:05:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### DELETE /apps/{id}/users/{userId}

**Remove a user from an app.**

The person can no longer sign in; open sessions stop within seconds. Without another app in the project their email address and name are deleted too. With delete\_data=true everything of this person in the app goes as well (like DELETE /apps/{id}/users/{userId}/data); ask the owner of the app which they want.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app. |
| `userId` (required) | path | string (uuid) | The id of the user (sub in x-hypamoon-user). |
| `delete_data` | query | boolean | Also delete their rows in per-user tables, their files and their passkeys. Without it, their data stays. |

#### 200 Removed, with delete\_data=true: what was deleted.

| Field | Type |  |
| --- | --- | --- |
| `app_id` (required) | string (uuid) |  |
| `user_id` (required) | string (uuid) |  |
| `deleted` (required) | object |  |
| `app_tables` (required) | `"included"`, `"not_included"`, `"no_database"` | included: the per-user tables (set\_table\_owner\_column) were handled; unmarked\_tables may still hold data. not\_included: the app has no per-user tables, so no row of the app's own database was exported or deleted; check those tables yourself. no\_database: the app has no database. |
| `unmarked_tables` (required) | string\[\] | Tables that are not marked per-user: Hypamoon cannot tell which rows there belong to this user, so they may still hold data about them. |
| `note` (required) | string or null |  |

JSON

```
{
  "app_id": "9d2e4f6a-1b3c-4d5e-8f70-a1b2c3d4e5f6",
  "user_id": "7c1d2e3f-4a5b-4c6d-8e7f-90a1b2c3d4e5",
  "deleted": {
    "rows": {
      "items": 12
    },
    "files": 12,
    "sessions": 1,
    "passkeys": 1,
    "membership": true,
    "account": true
  },
  "app_tables": "included",
  "unmarked_tables": [],
  "note": null
}
```

#### 204 Removed; their data stays.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### POST /apps/{id}/users/{userId}/email

**Change the email address of a user.**

For a user who can no longer reach their old address. The account, its id and its data stay; only the address changes, for every app in the project. All their sessions end, a password of theirs is removed (they sign in again with a link or code to the new address), and both addresses get a short notice. The new address must be valid and not in use by another account in this project. At most 10 changes per app per hour.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app. |
| `userId` (required) | path | string (uuid) | The id of the user (sub in x-hypamoon-user). |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `email` (required) | string | The new email address of this user. It must not be in use by another account in this project. |

JSON

```
{
  "email": "sam@new.example.com"
}
```

#### 200 The user with the new address.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The person's id: sub in x-hypamoon-user. |
| `email` (required) | string |  |
| `name` (required) | string or null |  |
| `role` (required) | string |  |
| `created_at` (required) | string |  |
| `last_sign_in_at` (required) | string or null |  |
| `test_user` | boolean | Only when true: a test user on an address that never receives email, not a real person (invite\_app\_user with test\_user). |

JSON

```
{
  "id": "7c1d2e3f-4a5b-4c6d-8e7f-90a1b2c3d4e5",
  "email": "sam@new.example.com",
  "name": "Sam",
  "role": "member",
  "created_at": "2026-10-06T10:00:00.000Z",
  "last_sign_in_at": "2026-10-06T10:05:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### POST /apps/{id}/users/{userId}/test-login

**Sign in as a test user.**

A sign-in link for one test user of an app, for the owner or builder to see the app as that user (visual checks, roles). It works once, for 15 minutes, and signs in like a link from a sign-in email; no email is sent. For an app in test mode, and only for a user whose address can never receive email (example.com, .test, .example, .invalid): invite one first with invite\_app\_user, like [tester@example.com](mailto:tester@example.com) with the role to check. A real address gives 409. At most 30 links per app per hour. A live app gives 409, unless this is switched on for the platform and all of this holds: the user was invited with test\_user: true, has no admin role, and the owner or builder confirmed this request in the Hypamoon portal (create\_test\_login\_link in a chat sets that up). Then the link works for 5 minutes, at most 5 per app per hour, the session ends after an hour, and it is in the activity log.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app. |
| `userId` (required) | path | string (uuid) | The id of the user (sub in x-hypamoon-user). |

#### 201 The link.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"test_login_link"` |  |
| `app_id` (required) | string (uuid) |  |
| `user_id` (required) | string (uuid) |  |
| `email` (required) | string | The test user's address (example.com, .test, .example or .invalid). |
| `url` (required) | string | Open it in a browser and press the button: you are signed in as this user. Works once, until expires\_at: 15 minutes in test mode, 5 minutes on a live app. |
| `expires_at` (required) | string |  |
| `session_minutes` | integer | Only on a live app: the session ends after this many minutes and is not extended. |

JSON

```
{
  "object": "test_login_link",
  "app_id": "8f14e45f-ceea-467a-9575-4c4d8c1b2a01",
  "user_id": "7c1d2e3f-4a5b-4c6d-8e7f-90a1b2c3d4e5",
  "email": "tester@example.com",
  "url": "https://leads.hypamoon.app/_hypamoon/auth/callback?t=Q2x...",
  "expires_at": "2026-10-23T15:15:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |

### POST /apps/{id}/users/{userId}/export

**Export everything of one user (GDPR).**

Everything of one user of the app as JSON: what Hypamoon keeps (account, membership, passkeys without the keys), every row in the per-user tables (set with set\_table\_owner\_column) and every file of theirs with a download link for 15 minutes. unmarked\_tables lists the tables that are not per-user: Hypamoon cannot tell which rows there are theirs, so check those yourself. app\_tables not\_included: the app has no per-user tables at all, so no row of its database is in the export.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app. |
| `userId` (required) | path | string (uuid) | The id of the user (sub in x-hypamoon-user). |

#### 200 The export.

| Field | Type |  |
| --- | --- | --- |
| `app_id` (required) | string (uuid) |  |
| `user_id` (required) | string (uuid) |  |
| `exported_at` (required) | string |  |
| `account` (required) | object or null | What Hypamoon keeps about the person; null if the account is already gone. |
| `membership` (required) | object or null | Their place in this app; null if they were removed from it. |
| `passkeys` (required) | object\[\] | Their passkeys for this app, without the keys themselves. |
| `tables` (required) | object | Per per-user table, every row of this user. |
| `files` (required) | object\[\] | Every file of this user. |
| `app_tables` (required) | `"included"`, `"not_included"`, `"no_database"` | included: the per-user tables (set\_table\_owner\_column) were handled; unmarked\_tables may still hold data. not\_included: the app has no per-user tables, so no row of the app's own database was exported or deleted; check those tables yourself. no\_database: the app has no database. |
| `unmarked_tables` (required) | string\[\] | Tables that are not marked per-user: Hypamoon cannot tell which rows there belong to this user, so they may still hold data about them. |
| `note` (required) | string or null |  |

JSON

```
{
  "app_id": "9d2e4f6a-1b3c-4d5e-8f70-a1b2c3d4e5f6",
  "user_id": "7c1d2e3f-4a5b-4c6d-8e7f-90a1b2c3d4e5",
  "exported_at": "2026-10-07T12:00:00.000Z",
  "account": {
    "id": "7c1d2e3f-4a5b-4c6d-8e7f-90a1b2c3d4e5",
    "email": "sam@example.com",
    "name": "Sam",
    "created_at": "2026-10-06T10:00:00.000Z"
  },
  "membership": {
    "role": "member",
    "created_at": "2026-10-06T10:00:00.000Z",
    "last_sign_in_at": "2026-10-06T10:05:00.000Z",
    "active_sessions": 1
  },
  "passkeys": [
    {
      "name": "iPhone",
      "rp_id": "wardrobe-demo.hypamoon.app",
      "created_at": "2026-10-06T10:06:00.000Z",
      "last_used_at": "2026-10-07T08:00:00.000Z"
    }
  ],
  "tables": {
    "items": {
      "owner_column": "user_id",
      "rows": [
        {
          "id": "c1",
          "user_id": "7c1d2e3f-4a5b-4c6d-8e7f-90a1b2c3d4e5",
          "name": "Blue coat",
          "photo_file_id": "5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9",
          "created_at": "2026-10-06T10:10:00.000Z"
        }
      ],
      "truncated": false
    }
  },
  "files": [
    {
      "id": "5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9",
      "name": "coat.jpg",
      "content_type": "image/jpeg",
      "bytes": 48213,
      "status": "ready",
      "created_at": "2026-10-06T10:10:00.000Z",
      "download_url": "https://wardrobe-demo.hypamoon.app/_hypamoon/files/5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9?t=eyJvIjoi...",
      "expires_at": "2026-10-07T12:15:00.000Z"
    }
  ],
  "app_tables": "included",
  "unmarked_tables": [
    "outfits_shared"
  ],
  "note": "These tables are not marked as per-user, so Hypamoon cannot tell which rows belong to this user. They may still hold data about them: check them yourself (or mark them with set_table_owner_column)."
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### DELETE /apps/{id}/users/{userId}/data

**Delete everything of one user (GDPR).**

Permanently deletes everything of one user of the app: their rows in the per-user tables, their files, their sessions (signed out within seconds), their membership and passkeys, and without another app in the project their email address and name. unmarked\_tables lists the tables that are not per-user and may still hold data about them. app\_tables not\_included: the app has no per-user tables at all, so no row of its database was deleted. Safe to repeat.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app. |
| `userId` (required) | path | string (uuid) | The id of the user (sub in x-hypamoon-user). |

#### 200 What was deleted.

| Field | Type |  |
| --- | --- | --- |
| `app_id` (required) | string (uuid) |  |
| `user_id` (required) | string (uuid) |  |
| `deleted` (required) | object |  |
| `app_tables` (required) | `"included"`, `"not_included"`, `"no_database"` | included: the per-user tables (set\_table\_owner\_column) were handled; unmarked\_tables may still hold data. not\_included: the app has no per-user tables, so no row of the app's own database was exported or deleted; check those tables yourself. no\_database: the app has no database. |
| `unmarked_tables` (required) | string\[\] | Tables that are not marked per-user: Hypamoon cannot tell which rows there belong to this user, so they may still hold data about them. |
| `note` (required) | string or null |  |

JSON

```
{
  "app_id": "9d2e4f6a-1b3c-4d5e-8f70-a1b2c3d4e5f6",
  "user_id": "7c1d2e3f-4a5b-4c6d-8e7f-90a1b2c3d4e5",
  "deleted": {
    "rows": {
      "items": 12
    },
    "files": 12,
    "sessions": 1,
    "passkeys": 1,
    "membership": true,
    "account": true
  },
  "app_tables": "included",
  "unmarked_tables": [],
  "note": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### POST /apps/{id}/subjects/export

**Export everything about one person the app keeps data on (GDPR).**

For people the app keeps data on who do not sign in to it, like candidates or customers: everything about one email address or id in the tables the app lists in subjects (deploy\_app), and the app files in their file\_columns with a download link for 15 minutes. Rows match on email\_column (case-insensitive) or id\_column in a table without parent, and on the parent's id in a table with parent. Tables that are not in subjects are not searched. 409 when the app has no subjects or no database, or when subjects names a table or column that does not exist (nothing is read then).

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app. |

#### Request body

Who the request is about: an email address, an id, or both.

| Field | Type |  |
| --- | --- | --- |
| `email` | string | The person's email address, as the app stores it (case does not matter). |
| `subject_id` | one of | The person's id in the app: the id\_column of a table without parent. |

JSON

```
{
  "email": "jamie@example.com"
}
```

#### 200 The export.

| Field | Type |  |
| --- | --- | --- |
| `app_id` (required) | string (uuid) |  |
| `subject` (required) | object | Who the request was about. |
| `exported_at` (required) | string |  |
| `tables` (required) | object | Per table in subjects: the rows about this person. |
| `files` (required) | object\[\] | The app files named in file\_columns of the matched rows. |
| `note` (required) | string or null |  |

JSON

```
{
  "app_id": "3f2a1c4e-8b7d-4e6f-9a1b-2c3d4e5f6a7b",
  "subject": {
    "email": "jamie@example.com"
  },
  "exported_at": "2026-10-23T14:00:00.000Z",
  "tables": {
    "candidates": {
      "rows": [
        {
          "id": "c_81",
          "email": "jamie@example.com",
          "name": "Jamie Doe",
          "cv_file_id": "8d1c2b3a-4e5f-4a6b-9c7d-0e1f2a3b4c5d"
        }
      ],
      "truncated": false,
      "matched_by": [
        "email"
      ]
    },
    "notes": {
      "rows": [
        {
          "id": 4,
          "candidate_id": "c_81",
          "text": "Called back on Monday."
        }
      ],
      "truncated": false,
      "matched_by": [
        "parent:candidates"
      ]
    }
  },
  "files": [
    {
      "id": "8d1c2b3a-4e5f-4a6b-9c7d-0e1f2a3b4c5d",
      "name": "cv.pdf",
      "content_type": "application/pdf",
      "bytes": 182044,
      "status": "ready",
      "created_at": "2026-10-20T09:12:00.000Z",
      "download_url": "https://ats.hypamoon.app/_hypamoon/files/8d1c2b3a-4e5f-4a6b-9c7d-0e1f2a3b4c5d?t=...",
      "expires_at": "2026-10-23T14:15:00.000Z"
    }
  ],
  "note": "Tables that are not in subjects were not searched: if the app keeps data about this person elsewhere, add those tables to subjects."
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### POST /apps/{id}/subjects/delete

**Delete everything about one person the app keeps data on (GDPR).**

Permanently deletes everything about one email address or id in the tables the app lists in subjects: the matched rows (child tables first, in one transaction) and the app files in their file\_columns. Safe to repeat. From a chat this waits for the owner to confirm in the portal. Tables that are not in subjects are not touched. 409 as for the export.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app. |

#### Request body

Who the request is about: an email address, an id, or both.

| Field | Type |  |
| --- | --- | --- |
| `email` | string | The person's email address, as the app stores it (case does not matter). |
| `subject_id` | one of | The person's id in the app: the id\_column of a table without parent. |

JSON

```
{
  "email": "jamie@example.com"
}
```

#### 200 What was deleted.

| Field | Type |  |
| --- | --- | --- |
| `app_id` (required) | string (uuid) |  |
| `subject` (required) | object | Who the request was about. |
| `deleted` (required) | object |  |
| `note` (required) | string or null |  |

JSON

```
{
  "app_id": "3f2a1c4e-8b7d-4e6f-9a1b-2c3d4e5f6a7b",
  "subject": {
    "email": "jamie@example.com"
  },
  "deleted": {
    "rows": {
      "candidates": 1,
      "notes": 1
    },
    "files": 1
  },
  "note": "Tables that are not in subjects were not touched: if the app keeps data about this person elsewhere, delete it there and add those tables to subjects."
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### PUT /apps/{id}/tables/{table}/owner

**Make a table private per user.**

Marks a table of the app's database as per-user: column holds the owner (the user's id, sub in x-hypamoon-user). From then on the app reads and writes it only with env.DB.mine(table) (select, get, count, insert, update, delete), always for the signed-in user; plain SQL that names the table is refused, and so are migrations that would read it around that (views, copies). admin\_role lets users with that role use all rows with env.DB.mine(table, { all: true }). The app needs auth and database; the running version picks it up within seconds.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app. |
| `table` (required) | path | string | The name of a table in the app's database. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `column` | string | The column that holds the owner: the user's id (sub from x-hypamoon-user). Defaults to user\_id. It must exist; make it TEXT NOT NULL with an index. |
| `admin_role` | string or null | Optional. A role of the app (like admin) whose users may use all rows with env.DB.mine(table, { all: true }). Leave it out and nobody sees other users' rows, admins included. |

JSON

```
{
  "column": "user_id",
  "admin_role": "admin"
}
```

#### 200 The app, with database.per\_user\_tables.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `name` (required) | string |  |
| `site_id` (required) | string (uuid) |  |
| `url` (required) | string | The site; the app answers on url + /api. |
| `api_url` (required) | string | Where the app's /api starts. |
| `mode` (required) | `"live"`, `"test"` |  |
| `status` (required) | `"active"`, `"offline"` | offline: Hypamoon took the site offline; the app does not run. |
| `version` (required) | integer | The version that runs now. |
| `allowed_hosts` (required) | string\[\] |  |
| `secrets` (required) | string\[\] |  |
| `schedules` (required) | object\[\] |  |
| `limits` (required) | object | Per request: CPU time and fetch calls. Per app: outbound requests per minute and per day. |
| `auth` | object or null | Sign-in for the app's users; null when it is off. login\_url is where people sign in. |
| `database` | object or null | The app's own database (env.DB); null when it has none. full: above the plan's data limit, so the app can only read and delete until there is room. |
| `ai` | object | AI processing: whether the app may send data to an AI processor through env.HYPAMOON.ai. Off without an explicit choice (deploy\_app ai). |
| `kept` | string\[\] | Only in the answer to a deploy of an existing app: the settings that were left out and kept from the running version, like "allowed\_hosts (20)", "vars (2)", "database", "auth". |
| `warnings` | string\[\] | Only in the answer to a deploy: advice about the app's data, never a block. For example that export and delete per user won't cover the data (no table marked with set\_table\_owner\_column), or tables that look like backups or copies. Tell the user in plain words and offer to fix it. |
| `created_at` (required) | string |  |
| `updated_at` (required) | string |  |

JSON

```
{
  "id": "9d2e4f6a-1b3c-4d5e-8f70-a1b2c3d4e5f6",
  "name": "Wardrobe",
  "site_id": "5b0c7c2e-8f1d-4a3b-9c6e-2d4f5a6b7c8d",
  "url": "https://wardrobe-demo.hypamoon.app",
  "api_url": "https://wardrobe-demo.hypamoon.app/api",
  "mode": "test",
  "status": "active",
  "version": 2,
  "allowed_hosts": [],
  "secrets": [],
  "schedules": [],
  "limits": {
    "cpu_ms": 10,
    "subrequests": 10,
    "outbound_per_minute": 60,
    "outbound_per_day": 2000,
    "bundle_bytes": 1048576
  },
  "created_at": "2026-10-06T09:00:00.000Z",
  "updated_at": "2026-10-06T09:30:00.000Z",
  "auth": {
    "signup": "invite",
    "roles": [
      "admin",
      "member"
    ],
    "default_role": "member",
    "google": false,
    "login_url": "https://wardrobe-demo.hypamoon.app/_hypamoon/auth/login"
  },
  "database": {
    "bytes": 24576,
    "full": false,
    "per_user_tables": [
      {
        "table": "items",
        "column": "user_id",
        "admin_role": "admin"
      }
    ]
  }
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`site_offline`](https://hypamoon.com/docs/errors/site_offline) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### DELETE /apps/{id}/tables/{table}/owner

**Make a per-user table shared again.**

Removes the per-user marking: the app can use the table with plain SQL again, and nothing keeps users' rows apart any more. The rows stay.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app. |
| `table` (required) | path | string | The name of a table in the app's database. |

#### 200 The app.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `name` (required) | string |  |
| `site_id` (required) | string (uuid) |  |
| `url` (required) | string | The site; the app answers on url + /api. |
| `api_url` (required) | string | Where the app's /api starts. |
| `mode` (required) | `"live"`, `"test"` |  |
| `status` (required) | `"active"`, `"offline"` | offline: Hypamoon took the site offline; the app does not run. |
| `version` (required) | integer | The version that runs now. |
| `allowed_hosts` (required) | string\[\] |  |
| `secrets` (required) | string\[\] |  |
| `schedules` (required) | object\[\] |  |
| `limits` (required) | object | Per request: CPU time and fetch calls. Per app: outbound requests per minute and per day. |
| `auth` | object or null | Sign-in for the app's users; null when it is off. login\_url is where people sign in. |
| `database` | object or null | The app's own database (env.DB); null when it has none. full: above the plan's data limit, so the app can only read and delete until there is room. |
| `ai` | object | AI processing: whether the app may send data to an AI processor through env.HYPAMOON.ai. Off without an explicit choice (deploy\_app ai). |
| `kept` | string\[\] | Only in the answer to a deploy of an existing app: the settings that were left out and kept from the running version, like "allowed\_hosts (20)", "vars (2)", "database", "auth". |
| `warnings` | string\[\] | Only in the answer to a deploy: advice about the app's data, never a block. For example that export and delete per user won't cover the data (no table marked with set\_table\_owner\_column), or tables that look like backups or copies. Tell the user in plain words and offer to fix it. |
| `created_at` (required) | string |  |
| `updated_at` (required) | string |  |

JSON

```
{
  "id": "9d2e4f6a-1b3c-4d5e-8f70-a1b2c3d4e5f6",
  "name": "Wardrobe",
  "site_id": "5b0c7c2e-8f1d-4a3b-9c6e-2d4f5a6b7c8d",
  "url": "https://wardrobe-demo.hypamoon.app",
  "api_url": "https://wardrobe-demo.hypamoon.app/api",
  "mode": "test",
  "status": "active",
  "version": 2,
  "allowed_hosts": [],
  "secrets": [],
  "schedules": [],
  "limits": {
    "cpu_ms": 10,
    "subrequests": 10,
    "outbound_per_minute": 60,
    "outbound_per_day": 2000,
    "bundle_bytes": 1048576
  },
  "created_at": "2026-10-06T09:00:00.000Z",
  "updated_at": "2026-10-06T09:30:00.000Z",
  "auth": {
    "signup": "invite",
    "roles": [
      "admin",
      "member"
    ],
    "default_role": "member",
    "google": false,
    "login_url": "https://wardrobe-demo.hypamoon.app/_hypamoon/auth/login"
  },
  "database": {
    "bytes": 24576,
    "full": false,
    "per_user_tables": []
  }
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`site_offline`](https://hypamoon.com/docs/errors/site_offline) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /apps/{id}/files

**List the files of an app.**

Files the app's users uploaded through the app, newest first, with the total size. The app itself uploads and downloads through /app-files.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app. |
| `limit` | query | integer | Files, 1 to 500. |

#### 200 The files.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] |  |
| `bytes` (required) | integer | All files of this app together. |

JSON

```
{
  "data": [
    {
      "id": "5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9",
      "name": "receipt.pdf",
      "content_type": "application/pdf",
      "bytes": 48213,
      "status": "ready",
      "user_id": "7c1d2e3f-4a5b-4c6d-8e7f-90a1b2c3d4e5",
      "created_at": "2026-10-06T10:10:00.000Z"
    }
  ],
  "bytes": 48213
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### DELETE /apps/{id}/files/{fileId}

**Delete a file from an app.**

Deletes the file permanently, including from storage.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app. |
| `fileId` (required) | path | string (uuid) | The id of the file. |

#### 204 Deleted.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### GET /apps/{id}/migrations

**List the migrations of an app.**

The migrations applied to the app's database, oldest first, and its size.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app. |

#### 200 The migrations.

| Field | Type |  |
| --- | --- | --- |
| `applied` (required) | string\[\] | Applied now. |
| `skipped` (required) | string\[\] | Already applied before. |
| `data` (required) | object\[\] | Every migration of this app, oldest first. |
| `database_bytes` (required) | integer |  |

JSON

```
{
  "applied": [],
  "skipped": [],
  "data": [
    {
      "name": "0001_init.sql",
      "sha256": "9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f",
      "statements": 2,
      "applied_at": "2026-10-06T10:00:00.000Z"
    }
  ],
  "database_bytes": 24576
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### POST /apps/{id}/migrations

**Apply migrations to the database of an app.**

Runs new SQL migrations on the app's own database (env.DB), in order, each as one batch: all or nothing. A migration that was already applied with the same content is skipped; a new name must sort after the last applied one. Only DDL and DML on that database: CREATE TABLE, CREATE INDEX, CREATE VIEW, ALTER, DROP, INSERT, UPDATE, DELETE. No ATTACH, PRAGMA, VACUUM, triggers or transactions. The app needs database: true.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `migrations` (required) | object\[\] | New migrations in order. Ones already applied (same name and content) are skipped. |

JSON

```
{
  "migrations": [
    {
      "name": "0001_init.sql",
      "sql": "CREATE TABLE expenses (id TEXT PRIMARY KEY, user_id TEXT NOT NULL, amount_cents INTEGER NOT NULL, note TEXT, file_id TEXT, created_at TEXT NOT NULL);\nCREATE INDEX expenses_user ON expenses (user_id, created_at);"
    }
  ]
}
```

#### 200 Applied (or already applied).

| Field | Type |  |
| --- | --- | --- |
| `applied` (required) | string\[\] | Applied now. |
| `skipped` (required) | string\[\] | Already applied before. |
| `data` (required) | object\[\] | Every migration of this app, oldest first. |
| `database_bytes` (required) | integer |  |

JSON

```
{
  "applied": [
    "0001_init.sql"
  ],
  "skipped": [],
  "data": [
    {
      "name": "0001_init.sql",
      "sha256": "9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f9f",
      "statements": 2,
      "applied_at": "2026-10-06T10:00:00.000Z"
    }
  ],
  "database_bytes": 24576
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 402 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 403 | [`site_offline`](https://hypamoon.com/docs/errors/site_offline) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 409 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`migration_failed`](https://hypamoon.com/docs/errors/migration_failed) |

### GET /apps/{id}/schema

**Read the schema of an app's database.**

Read-only. The tables of the app's own database (env.DB) with their columns, indexes, number of rows and whether they are per-user (set\_table\_owner\_column), the views, the applied migrations and a name for the next one. Use it to see where a build stands before you change the tables.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app. |

#### 200 The schema.

| Field | Type |  |
| --- | --- | --- |
| `app_id` (required) | string |  |
| `database` (required) | `true` |  |
| `tables` (required) | object\[\] |  |
| `views` (required) | object\[\] |  |
| `migrations` (required) | object\[\] | Applied migrations, oldest first. |
| `next_migration_name` (required) | string | A name that sorts after the last applied migration, like 0003\_next.sql; replace next with what it does. |
| `database_bytes` (required) | integer |  |

JSON

```
{
  "app_id": "4a7ff9fa-1c2d-4e5f-8a9b-0c1d2e3f4a5b",
  "database": true,
  "tables": [
    {
      "name": "recipes",
      "columns": [
        {
          "name": "id",
          "type": "TEXT",
          "not_null": false,
          "primary_key": true,
          "default": null
        },
        {
          "name": "user_id",
          "type": "TEXT",
          "not_null": true,
          "primary_key": false,
          "default": null
        },
        {
          "name": "title",
          "type": "TEXT",
          "not_null": true,
          "primary_key": false,
          "default": null
        },
        {
          "name": "ingredients",
          "type": "TEXT",
          "not_null": false,
          "primary_key": false,
          "default": null
        }
      ],
      "indexes": [
        {
          "name": "recipes_user",
          "unique": false,
          "sql": "CREATE INDEX recipes_user ON recipes (user_id, created_at)"
        }
      ],
      "rows": 12,
      "per_user": {
        "column": "user_id",
        "admin_role": "admin"
      },
      "sql": "CREATE TABLE recipes (id TEXT PRIMARY KEY, user_id TEXT NOT NULL, title TEXT NOT NULL, ingredients TEXT)"
    }
  ],
  "views": [],
  "migrations": [
    {
      "name": "0001_init.sql",
      "applied_at": "2026-10-14T10:00:00.000Z",
      "statements": 4
    }
  ],
  "next_migration_name": "0002_next.sql",
  "database_bytes": 24576
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |

### GET /apps/{id}/code

**Read the server code of an app.**

Read-only. main\_module and the modules of the running version, or of a kept earlier version with version. Use it to continue building after a break or in a new chat: read the code, change what is needed, and deploy only the changed modules with keep\_existing\_modules: true. One answer holds at most about 200,000 characters of code; a module that does not fit comes without content (truncated: true) and can be read alone with module.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app. |
| `version` | query | integer | A kept version (get\_app lists them). Leave it out for the running version. |
| `module` | query | string | Only this module, like index.js. |

#### 200 The code.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"app_code"` |  |
| `app_id` (required) | string (uuid) |  |
| `version` (required) | integer | The version these modules belong to. |
| `running_version` (required) | integer | The version that runs now. |
| `main_module` (required) | string | The module with export default { fetch }. |
| `modules` (required) | object\[\] | The main module first, then the others by name. |

JSON

```
{
  "object": "app_code",
  "app_id": "9f2b6c1e-3d4a-4b5c-8d7e-1f2a3b4c5d6e",
  "version": 3,
  "running_version": 3,
  "main_module": "index.js",
  "modules": [
    {
      "name": "index.js",
      "type": "esm",
      "bytes": 74,
      "content": "export default { async fetch(request, env) { return new Response('hi'); } };",
      "truncated": false
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### POST /apps/{id}/query

**Run one read-only query on an app's database.**

Runs one SELECT on the app's own database and returns at most 50 rows, to see what is in it while building or debugging. It only reads: anything that writes or changes the schema is refused, and the query runs as a subquery with the row limit outside it. Email addresses and phone numbers in the result are masked, long text is cut and binary values show only their size. Per-user tables can be read here (the project owns the data); every query is logged in the project's activity, without its SQL. At most 120 queries per hour per project.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `sql` (required) | string | One SELECT (or WITH ... SELECT). Nothing that writes or changes the schema. |
| `limit` | integer | Rows to return, 1 to 50 (default 20). |

JSON

```
{
  "sql": "SELECT id, title, servings FROM recipes ORDER BY created_at DESC",
  "limit": 20
}
```

#### 200 The rows.

| Field | Type |  |
| --- | --- | --- |
| `columns` (required) | string\[\] |  |
| `rows` (required) | object\[\] |  |
| `row_count` (required) | integer |  |
| `limit` (required) | integer |  |
| `truncated` (required) | boolean | true when there were more rows than limit. |
| `per_user_tables` (required) | string\[\] | Per-user tables this query read. |
| `masked` (required) | string |  |

JSON

```
{
  "columns": [
    "id",
    "title",
    "servings"
  ],
  "rows": [
    {
      "id": "7f1c",
      "title": "Pasta pesto",
      "servings": 4
    }
  ],
  "row_count": 1,
  "limit": 20,
  "truncated": false,
  "per_user_tables": [
    "recipes"
  ],
  "masked": "Email addresses and phone numbers are masked, text longer than 300 characters is cut, and binary values show only their size."
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`query_failed`](https://hypamoon.com/docs/errors/query_failed) |

### GET /app-files

**List the files (from an app).**

For an app's own server code only: the uploaded files, newest first. With the signed user headers forwarded: only that user's files (a user with the admin role, the first of auth.roles, gets everyone's with all=true). Without them (the app itself, for example in a schedule): all files, optionally only those of one user.

Scope: `data:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `user_id` | query | string (uuid) | Only the files of this user (sub from x-hypamoon-user). |
| `limit` | query | integer | Files, 1 to 500. |
| `all` | query | boolean | With the signed headers of a user with the admin role (the first of auth.roles): the files of every user. |

#### 200 The files.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] |  |

JSON

```
{
  "data": [
    {
      "id": "5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9",
      "name": "receipt.pdf",
      "content_type": "application/pdf",
      "bytes": 48213,
      "status": "ready",
      "user_id": "7c1d2e3f-4a5b-4c6d-8e7f-90a1b2c3d4e5",
      "created_at": "2026-10-06T10:10:00.000Z"
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### POST /app-files

**Get an upload link (from an app).**

For an app's own server code only: fetch(env.HYPAMOON\_API + "/app-files", { method: "POST", ... }) without an Authorization header; Hypamoon adds the app's key, and any other key gets 403. Returns a path on the site's own address where the browser PUTs the exact bytes, once, within 15 minutes. The type is checked against the bytes, PDFs and text go through the abuse check, and the size counts toward the files in the plan. Forward the x-hypamoon-user and x-hypamoon-user-sig headers of the request to make the file the signed-in user's own: it is stored in their own folder, only they (and users with the admin role, the first of auth.roles) can download it, and it goes with them on export or deletion. Only forward the headers; never check their signature in the code.

Scope: `data:write`

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `name` (required) | string | The file name, like receipt.pdf. |
| `content_type` (required) | `"image/png"`, `"image/jpeg"`, `"image/gif"`, `"image/webp"`, `"application/pdf"`, `"video/mp4"`, `"video/webm"`, `"audio/mpeg"`, `"audio/mp4"`, `"audio/webm"`, `"image/heic"`, `"image/heif"`, `"video/quicktime"`, `"text/plain"`, `"text/csv"`, `"application/json"`, `"application/vnd.openxmlformats-officedocument.wordprocessingml.document"`, `"application/msword"` | The type: images (png, jpeg, gif, webp, heic, heif), pdf, Word (docx; doc for Word 97-2003), video (mp4, webm, mov), audio (mp3, m4a, webm), plain text, csv or json. The bytes are checked against it; a Word file with macros (docm, dotm), ActiveX, an embedded program or an external template is refused. |
| `size` (required) | integer | The exact size in bytes (File.size in the browser). |
| `user_id` | string (uuid) | Leave it out. To make the file the signed-in person's own, forward the x-hypamoon-user and x-hypamoon-user-sig headers of the request; if you send user\_id, it must be that same person. |

JSON

```
{
  "name": "receipt.pdf",
  "content_type": "application/pdf",
  "size": 48213
}
```

#### 201 The upload link.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `upload_url` (required) | string | PUT the bytes here from the browser, on the site's own address. Works once. |
| `method` (required) | `"PUT"` |  |
| `expires_at` (required) | string |  |

JSON

```
{
  "id": "5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9",
  "upload_url": "/_hypamoon/files/upload?t=eyJvIjoi...",
  "method": "PUT",
  "expires_at": "2026-10-06T10:25:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 402 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 403 | [`site_offline`](https://hypamoon.com/docs/errors/site_offline) |
| 409 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 413 | [`file_too_large`](https://hypamoon.com/docs/errors/file_too_large) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /app-files/{id}

**Get a download link (from an app).**

For an app's own server code only: a path on the site's own address that serves the file for 15 minutes. With the signed user headers forwarded, only for a file of that user (or any file for the admin role, the first of auth.roles). A file of a user only opens in a browser where that user, or a user with the admin role, is signed in. With public=true the link opens without signing in, for 15 minutes: use it only in a share route of the app, for a file the owner chose to share (like the photos of a shared recipe). With viewer=me (or the id of a user of the app) the link only opens in the browser where exactly that user is signed in, for 5 minutes: the way to show a private file of any size up to the upload limit (a CV) to the signed-in user; the file is streamed with Range, so PDF viewers and video work. In app code, return env.HYPAMOON.files.serve(request, id) does this and redirects. With as=pdf a Word document (.docx) is served as a PDF made from it (made once, then kept next to the original and deleted with it), with the same rules; a PDF stays itself. A .doc has no PDF view: serve it with disposition=attachment.

Scope: `data:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the file. |
| `public` | query | boolean | true: the link opens without signing in (for a share link of the app). Leave it out for a link that needs the owner's sign-in. |
| `viewer` | query | string | me (the signed user of the request) or the id of a user of the app: the link only opens in that user's signed-in browser, for 5 minutes. |
| `disposition` | query | `"inline"`, `"attachment"` | inline shows a PDF or image in the browser (the default); attachment downloads it. Text and Word files are always a download. |
| `as` | query | `"pdf"` | pdf: serve a Word document (.docx) as a PDF, to show it in the browser. |

#### 200 The download link.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `name` (required) | string |  |
| `content_type` (required) | string |  |
| `bytes` (required) | integer |  |
| `download_url` (required) | string | Valid for 15 minutes, on the site's own address. |
| `expires_at` (required) | string |  |

JSON

```
{
  "id": "5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9",
  "name": "receipt.pdf",
  "content_type": "application/pdf",
  "bytes": 48213,
  "download_url": "/_hypamoon/files/5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9?t=eyJvIjoi...",
  "expires_at": "2026-10-06T10:25:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`bad_request`](https://hypamoon.com/docs/errors/bad_request) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### DELETE /app-files/{id}

**Delete a file (from an app).**

For an app's own server code only: deletes the file permanently.

Scope: `data:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the file. |

#### 204 Deleted.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### GET /app-files/{id}/text

**Read a file's text (from an app).**

For an app's own server code only; in app code, await env.HYPAMOON.files.text(id) does this call (null when there is no such file). The text of a PDF, Word document (docx, doc), plain text, CSV or JSON file the app's users uploaded, of any size up to the upload limit: for example to let env.HYPAMOON.ai.generate read a CV. Up to 1,000,000 characters (truncated: true when cut off). A PDF that is a scan without text gives 422. With the signed user headers forwarded, only a file of that user (or any file for the admin role); without them (a schedule), any file of the app.

Scope: `data:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the file. |

#### 200 The text of the file.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `name` (required) | string |  |
| `content_type` (required) | string |  |
| `text` (required) | string | The plain text: paragraphs on their own lines, table cells separated by a tab. From a PDF it is Markdown-like text per page. |
| `truncated` (required) | boolean | true when the text was cut off at 1,000,000 characters. |

JSON

```
{
  "id": "5e6f7a8b-9c0d-4e1f-a2b3-c4d5e6f7a8b9",
  "name": "cv-jan-de-vries.docx",
  "content_type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
  "text": "Jan de Vries\nRecruiter\n\nExperience\n...",
  "truncated": false
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /app-files/{id}/content

**Read a file's content (from an app).**

For an app's own server code only; in app code, await env.HYPAMOON.files.read(id) or env.HYPAMOON.files.read(id, { as: "text" }) does this call (null when there is no such file). The bytes of a file the app's users uploaded, up to 4 MB, with its type as Content-Type and its name in X-File-Name (URL-encoded): for a CSV import on the server, without a round trip through the browser. With the signed user headers forwarded, only a file of that user (or any file for the admin role); without them (a schedule), any file of the app. A bigger file gives 413 file\_too\_large; to show or download it for the signed-in user, use GET /app-files/{id}?viewer=me (env.HYPAMOON.files.serve), which streams any size up to the upload limit.

Scope: `data:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the file. |

#### 200 The content of the file.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 413 | [`file_too_large`](https://hypamoon.com/docs/errors/file_too_large) |

### GET /app-users

**List the users (from an app, as admin).**

For an app's own server code only, on behalf of the signed-in user: fetch(env.HYPAMOON\_API + "/app-users", ...) without an Authorization header, forwarding the x-hypamoon-user and x-hypamoon-user-sig headers of the request unchanged. Only forward them: never check the signature in the app code yourself, Hypamoon does. Without them 401; a signed-in user without the app's first role in auth.roles (admin by default) 403. The people who may sign in to this app, with their role and when they last signed in. Use it for a people or family screen in the app, shown only to admins. In app code, env.HYPAMOON.users.list() does this call for you (all pages), and env.HYPAMOON.users.page({ cursor, limit, email, role }) gives one page; a small app is usually answered next to the app, without a round trip to this API. An app has no limit on its users, so the list comes in pages of up to 200, oldest first: while has\_more is true, call again with cursor set to next\_cursor.

Scope: `data:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `limit` | query | integer | Users per page, 1 to 200. |
| `cursor` | query | string | next\_cursor from the previous page. |
| `email` | query | string (email) | Only the user with this whole email address (no partial match). |
| `role` | query | string | Only users with this role. |

#### 200 A page of users.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] |  |
| `has_more` (required) | boolean | Whether there is another page. |
| `next_cursor` (required) | string or null | Pass this as cursor to get the next page. Null on the last page. |

JSON

```
{
  "data": [
    {
      "id": "7c1d2e3f-4a5b-4c6d-8e7f-90a1b2c3d4e5",
      "email": "sam@example.com",
      "name": "Sam",
      "role": "member",
      "created_at": "2026-10-06T10:00:00.000Z",
      "last_sign_in_at": "2026-10-06T10:05:00.000Z"
    }
  ],
  "has_more": false,
  "next_cursor": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_parameter`](https://hypamoon.com/docs/errors/invalid_parameter) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |

### POST /app-users

**Invite someone (from an app, as admin).**

For an app's own server code only, on behalf of the signed-in user: fetch(env.HYPAMOON\_API + "/app-users", ...) without an Authorization header, forwarding the x-hypamoon-user and x-hypamoon-user-sig headers of the request unchanged. Only forward them: never check the signature in the app code yourself, Hypamoon does. Without them 401; a signed-in user without the app's first role in auth.roles (admin by default) 403. Lets this person sign in with the given role and emails them a sign-in link that works once and stays valid for 7 days. The email comes in the app's own style and language and names the admin who invited them. Safe to call again: someone who is already a user comes back unchanged with 200 (invited: false), without an email and without counting against the limits. The answer comes right away; the email goes out after it. An address that can never receive email (example.com, .test, .example, .invalid, localhost) becomes a user without an email (invite\_email: not\_deliverable); the owner signs in as that test user with create\_test\_login\_link. Limits per app for new invitations: 20 per hour and 100 per day, and the same address once per 10 minutes (429 with Retry-After).

Scope: `data:write`

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `email` (required) | string (email) | Their email address. Ask the admin for it; never guess one. |
| `name` | string | Their name, shown in the app and in the list. |
| `role` | string | One of the app's roles. Defaults to default\_role. |
| `language` | `"nl"`, `"en"`, `"de"`, `"fr"`, `"es"` | The language of the invitation email for this person (nl, en or de; fr and es get English). Leave it out for the site's language. |

JSON

```
{
  "email": "sam@example.com",
  "name": "Sam",
  "role": "member"
}
```

#### 200 Already a user: unchanged, no email.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The person's id: sub in x-hypamoon-user. |
| `email` (required) | string |  |
| `name` (required) | string or null |  |
| `role` (required) | string |  |
| `created_at` (required) | string |  |
| `last_sign_in_at` (required) | string or null |  |
| `test_user` | boolean | Only when true: a test user on an address that never receives email, not a real person (invite\_app\_user with test\_user). |
| `invited` (required) | boolean | true: new now (201). false: this person could already sign in; nothing changed and no email was sent (200). |
| `invite_email` (required) | `"queued"`, `"not_deliverable"`, `"none"` | queued: the sign-in email goes out right after this answer (env.HYPAMOON.listEmails does not show it; list\_app\_mails does). not\_deliverable: an address that can never receive email (example.com, .test, .example, .invalid, localhost), so no email is sent; sign in as this test user with create\_test\_login\_link. none: no email (already a user). |

JSON

```
{
  "id": "7c1d2e3f-4a5b-4c6d-8e7f-90a1b2c3d4e5",
  "email": "sam@example.com",
  "name": "Sam",
  "role": "member",
  "created_at": "2026-10-06T10:00:00.000Z",
  "last_sign_in_at": "2026-10-06T10:05:00.000Z",
  "invited": false,
  "invite_email": "none"
}
```

#### 201 Invited; the email goes out right after this answer.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The person's id: sub in x-hypamoon-user. |
| `email` (required) | string |  |
| `name` (required) | string or null |  |
| `role` (required) | string |  |
| `created_at` (required) | string |  |
| `last_sign_in_at` (required) | string or null |  |
| `test_user` | boolean | Only when true: a test user on an address that never receives email, not a real person (invite\_app\_user with test\_user). |
| `invited` (required) | boolean | true: new now (201). false: this person could already sign in; nothing changed and no email was sent (200). |
| `invite_email` (required) | `"queued"`, `"not_deliverable"`, `"none"` | queued: the sign-in email goes out right after this answer (env.HYPAMOON.listEmails does not show it; list\_app\_mails does). not\_deliverable: an address that can never receive email (example.com, .test, .example, .invalid, localhost), so no email is sent; sign in as this test user with create\_test\_login\_link. none: no email (already a user). |

JSON

```
{
  "id": "7c1d2e3f-4a5b-4c6d-8e7f-90a1b2c3d4e5",
  "email": "sam@example.com",
  "name": "Sam",
  "role": "member",
  "created_at": "2026-10-06T10:00:00.000Z",
  "last_sign_in_at": null,
  "invited": true,
  "invite_email": "queued"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /app-users/{id}

**Get one user (from an app, as admin).**

For an app's own server code only, on behalf of the signed-in user: fetch(env.HYPAMOON\_API + "/app-users", ...) without an Authorization header, forwarding the x-hypamoon-user and x-hypamoon-user-sig headers of the request unchanged. Only forward them: never check the signature in the app code yourself, Hypamoon does. Without them 401; a signed-in user without the app's first role in auth.roles (admin by default) 403. One person who may sign in to this app, with their role. In app code, env.HYPAMOON.users.get(id) does this call for you (null when there is no such user).

Scope: `data:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the user (their sub in x-hypamoon-user). |

#### 200 The user.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The person's id: sub in x-hypamoon-user. |
| `email` (required) | string |  |
| `name` (required) | string or null |  |
| `role` (required) | string |  |
| `created_at` (required) | string |  |
| `last_sign_in_at` (required) | string or null |  |
| `test_user` | boolean | Only when true: a test user on an address that never receives email, not a real person (invite\_app\_user with test\_user). |

JSON

```
{
  "id": "7c1d2e3f-4a5b-4c6d-8e7f-90a1b2c3d4e5",
  "email": "sam@example.com",
  "name": "Sam",
  "role": "member",
  "created_at": "2026-10-06T10:00:00.000Z",
  "last_sign_in_at": "2026-10-06T10:05:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |

### PATCH /app-users/{id}

**Change a user's role (from an app, as admin).**

For an app's own server code only, on behalf of the signed-in user: fetch(env.HYPAMOON\_API + "/app-users", ...) without an Authorization header, forwarding the x-hypamoon-user and x-hypamoon-user-sig headers of the request unchanged. Only forward them: never check the signature in the app code yourself, Hypamoon does. Without them 401; a signed-in user without the app's first role in auth.roles (admin by default) 403. Sets one of the app's roles; the user sees it within seconds. The last user with the first role cannot give it up (409): give someone else that role first.

Scope: `data:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the user (their sub in x-hypamoon-user). |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `role` (required) | string | One of the app's roles. |

JSON

```
{
  "role": "admin"
}
```

#### 200 The user with the new role.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The person's id: sub in x-hypamoon-user. |
| `email` (required) | string |  |
| `name` (required) | string or null |  |
| `role` (required) | string |  |
| `created_at` (required) | string |  |
| `last_sign_in_at` (required) | string or null |  |
| `test_user` | boolean | Only when true: a test user on an address that never receives email, not a real person (invite\_app\_user with test\_user). |

JSON

```
{
  "id": "7c1d2e3f-4a5b-4c6d-8e7f-90a1b2c3d4e5",
  "email": "sam@example.com",
  "name": "Sam",
  "role": "admin",
  "created_at": "2026-10-06T10:00:00.000Z",
  "last_sign_in_at": "2026-10-06T10:05:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### DELETE /app-users/{id}

**Remove a user (from an app, as admin).**

For an app's own server code only, on behalf of the signed-in user: fetch(env.HYPAMOON\_API + "/app-users", ...) without an Authorization header, forwarding the x-hypamoon-user and x-hypamoon-user-sig headers of the request unchanged. Only forward them: never check the signature in the app code yourself, Hypamoon does. Without them 401; a signed-in user without the app's first role in auth.roles (admin by default) 403. The person can no longer sign in; open sessions stop within seconds. Their data in the app stays. The last user with the first role cannot be removed (409).

Scope: `data:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the user (their sub in x-hypamoon-user). |

#### 204 Removed; their data stays.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |

### GET /apps/{id}/secrets

**List the secrets of an app.**

An app secret is a value the app's own code reads while it runs, as env.<NAME> (like an encryption key, or a client secret that a token request needs in its body). It belongs to the app, not to a version: deploy\_app and rollback\_app always give the current value, and it is never shown by get\_app, get\_app\_code, the kept versions or the log; only its name and when it changed. For a key that only goes in a request header to a fixed host, use the vault (request\_secret) instead: the app's code never sees that one. This lists the names and when they changed, never a value.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app. |

#### 200 The app's secrets.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"list"` |  |
| `data` (required) | object\[\] |  |

JSON

```
{
  "object": "list",
  "data": [
    {
      "object": "app_secret",
      "name": "SIGNING_KEY",
      "status": "active",
      "created_at": "2026-10-29T10:00:00.000Z",
      "updated_at": "2026-10-29T10:00:00.000Z"
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### PUT /apps/{id}/secrets/{name}

**Set a secret of an app.**

An app secret is a value the app's own code reads while it runs, as env.<NAME> (like an encryption key, or a client secret that a token request needs in its body). It belongs to the app, not to a version: deploy\_app and rollback\_app always give the current value, and it is never shown by get\_app, get\_app\_code, the kept versions or the log; only its name and when it changed. For a key that only goes in a request header to a fixed host, use the vault (request\_secret) instead: the app's code never sees that one. With value it is saved right away (only from a terminal or a server). Without value you get a link (202, status pending) where the user pastes it; call this again after they confirmed, and the value moves to the app. Either way the running version gets it within seconds, without a new version. A var with the same name is refused.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app. |
| `name` (required) | path | string | The name, like SIGNING\_KEY: uppercase letters, digits and \_. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `value` | string | The value, only from a terminal or a server (like `pbpaste | node scripts/app-geheim.mjs`), never typed into a chat. Leave it out to get a link where the user pastes it. |
| `purpose` | string | Without value: what the user sees on the link, in a few words. |

JSON

```
{
  "purpose": "The key the app encrypts its tokens with"
}
```

#### 200 Saved; applied says whether the running version has it already.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"app_secret"` |  |
| `name` (required) | string | The name; the code reads it as env.<name>. |
| `status` (required) | `"active"` |  |
| `created_at` (required) | string |  |
| `updated_at` (required) | string | When the value last changed. |
| `applied` (required) | boolean | true: the running version has it now. false: it is saved and arrives with the next deploy\_app. |
| `replaced` (required) | boolean | true: there was a value under this name, and it is replaced. |

JSON

```
{
  "object": "app_secret",
  "name": "SIGNING_KEY",
  "status": "active",
  "created_at": "2026-10-29T10:00:00.000Z",
  "updated_at": "2026-10-29T10:00:00.000Z",
  "applied": true,
  "replaced": false
}
```

#### 202 No value yet: the link for the user.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"app_secret"` |  |
| `name` (required) | string |  |
| `status` (required) | `"pending"` |  |
| `url` (required) | string | A one-time link of 30 minutes for the user, to paste the value after signing in. |
| `expires_at` (required) | string |  |
| `next_step` (required) | string |  |

JSON

```
{
  "object": "app_secret",
  "name": "SIGNING_KEY",
  "status": "pending",
  "url": "https://app.hypamoon.com/secrets/new?token=...",
  "expires_at": "2026-10-29T10:30:00.000Z",
  "next_step": "Give the user this link, then call set_app_secret again."
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 403 | [`site_offline`](https://hypamoon.com/docs/errors/site_offline) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### DELETE /apps/{id}/secrets/{name}

**Delete a secret of an app.**

Deletes the secret: the running version loses env.<name> within seconds, and no rollback brings it back. Deleting it twice is fine.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app. |
| `name` (required) | path | string | The name, like SIGNING\_KEY: uppercase letters, digits and \_. |

#### 200 Deleted (or there was none).

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"app_secret_deletion"` |  |
| `name` (required) | string |  |
| `deleted` (required) | boolean | false: there was no secret with this name. |
| `applied` (required) | boolean |  |

JSON

```
{
  "object": "app_secret_deletion",
  "name": "SIGNING_KEY",
  "deleted": true,
  "applied": true
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /apps/{id}/groups

**List the groups of an app.**

Groups (teams) in an app with auth.groups: true. A group has a key (like team-north), a name, and optionally a role and an entitlement that everyone in it gets on top of their own: the app's code sees env.HYPAMOON.user.groups and inGroup(key), and the extra role and entitlement in is() and has(). A group never gives the admin role (the first role). At most 100 groups per app and 20 groups per person. Admins of the app manage groups on /\_hypamoon/admin too. The list has every group with its members.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app. |

#### 200 The groups.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] |  |

JSON

```
{
  "data": [
    {
      "key": "team-north",
      "name": "Team North",
      "role": "editor",
      "entitlement": null,
      "member_count": 1,
      "created_at": "2026-10-12T10:00:00.000Z",
      "members": [
        {
          "id": "6f1c2d3e-4a5b-4c6d-8e7f-90a1b2c3d4e5",
          "email": "sam@example.com",
          "name": "Sam",
          "added_at": "2026-10-12T10:05:00.000Z"
        }
      ]
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |

### POST /apps/{id}/groups

**Create a group in an app.**

Groups (teams) in an app with auth.groups: true. A group has a key (like team-north), a name, and optionally a role and an entitlement that everyone in it gets on top of their own: the app's code sees env.HYPAMOON.user.groups and inGroup(key), and the extra role and entitlement in is() and has(). A group never gives the admin role (the first role). At most 100 groups per app and 20 groups per person. Admins of the app manage groups on /\_hypamoon/admin too.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `key` (required) | string | The key the code checks with inGroup(key): lowercase letters, digits, - and \_, starting with a letter, like team-north. It cannot change later. |
| `name` | string | A name for people, like Team North. Defaults to the key. |
| `role` | string | Optional: one of the app's roles that everyone in the group gets too. Never the admin role (the first role). |
| `entitlement` | string | Optional: an entitlement everyone in the group gets too, checked with env.HYPAMOON.user.has(entitlement). |

JSON

```
{
  "key": "team-north",
  "name": "Team North",
  "role": "editor"
}
```

#### 201 The new group.

| Field | Type |  |
| --- | --- | --- |
| `key` (required) | string |  |
| `name` (required) | string |  |
| `role` (required) | string or null |  |
| `entitlement` (required) | string or null |  |
| `member_count` (required) | integer |  |
| `created_at` (required) | string |  |
| `members` | object\[\] | Who is in the group (at most 200 shown; member\_count is always the full number). |

JSON

```
{
  "key": "team-north",
  "name": "Team North",
  "role": "editor",
  "entitlement": null,
  "member_count": 0,
  "created_at": "2026-10-12T10:00:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### POST /apps/{id}/groups/{key}/members

**Add a user to a group.**

Puts a user of the app in the group. The app sees the group (and its role and entitlement) within seconds. Adding someone who is already in it changes nothing (added false).

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app. |
| `key` (required) | path | string | The key of the group. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `user_id` (required) | string (uuid) | The id of a user of the app, from list\_app\_users. |

JSON

```
{
  "user_id": "6f1c2d3e-4a5b-4c6d-8e7f-90a1b2c3d4e5"
}
```

#### 200 In the group.

| Field | Type |  |
| --- | --- | --- |
| `key` (required) | string |  |
| `user_id` (required) | string (uuid) |  |
| `added` (required) | boolean | false: they were already in the group. |

JSON

```
{
  "key": "team-north",
  "user_id": "6f1c2d3e-4a5b-4c6d-8e7f-90a1b2c3d4e5",
  "added": true
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

## Email

Email from the project's own domain (an extra module the owner turns on in the portal): sending domains with their DNS records, emails with cc, bcc and attachments, and batches of separate emails, only to people the project already knows.

### GET /emails

**List sent emails.**

The project's emails, newest first, each with its status, a short reason when it bounced, was marked as spam, is delayed or was not sent, the status per recipient and a timeline. Plus the state of the Mail module: on or off, paused, the daily limit and what was sent in the last 24 hours. Filter on the app that sent them (app\_id), a recipient (to), a status and a start time (since). form\_notifications lists the notification emails of form entries (email\_on\_insert on a collection), with status and masked recipients; they are separate from data and do not count for the module.

Scope: `messages:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `limit` | query | integer | Emails per page, 1 to 100. |
| `cursor` | query | string | The next\_cursor of the previous page. |
| `app_id` | query | string (uuid) | Only emails this app sent with env.HYPAMOON.sendEmail (an id from list\_apps). |
| `to` | query | string | Only emails with this address in to, cc or bcc. |
| `status` | query | `"queued"`, `"sent"`, `"delivered"`, `"bounced"`, `"complained"`, `"failed"`, `"simulated"` | Only emails with this status. |
| `since` | query | string (date-time) | Only emails sent at or after this moment, like 2026-10-01 or 2026-10-15T09:00:00Z. |

#### 200 The emails and the state of the module.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] |  |
| `next_cursor` (required) | string or null |  |
| `mail` (required) | object |  |
| `form_notifications` | object\[\] | The notification emails of form entries (email\_on\_insert), newest first. They do not count for the Mail module and are not in data. Only on the first page and without app\_id, to or status; since applies. |

JSON

```
{
  "data": [
    {
      "id": "7c1e2d3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
      "app_id": null,
      "from": "Acme Plumbing <hello@acmeplumbing.com>",
      "to": "sam@example.org",
      "recipients": {
        "to": [
          "sam@example.org"
        ],
        "cc": [],
        "bcc": []
      },
      "recipient_count": 1,
      "attachments": [
        {
          "filename": "quote.pdf",
          "content_type": "application/pdf",
          "size": 48213
        }
      ],
      "reply_to": "office@acmeplumbing.com",
      "message_id": "<0100019a2b3c4d5e-6f7a8b9c-0d1e-4f2a-9b3c-4d5e6f7a8b9c-000000@mail.acmeplumbing.com>",
      "subject": "We received your request",
      "category": "transactional",
      "status": "sent",
      "recipient_source": "form",
      "test": false,
      "error": null,
      "reason": null,
      "recipient_status": [
        {
          "email": "sam@example.org",
          "field": "to",
          "status": "sent",
          "reason": null,
          "updated_at": "2026-10-06T10:15:01.000Z"
        }
      ],
      "timeline": [
        {
          "status": "queued",
          "at": "2026-10-06T10:15:00.000Z",
          "recipient": null,
          "reason": null
        },
        {
          "status": "sent",
          "at": "2026-10-06T10:15:01.000Z",
          "recipient": null,
          "reason": null
        }
      ],
      "created_at": "2026-10-06T10:15:00.000Z",
      "sent_at": "2026-10-06T10:15:01.000Z",
      "delivered_at": null,
      "bounced_at": null,
      "complained_at": null
    }
  ],
  "next_cursor": null,
  "mail": {
    "enabled": true,
    "paused": false,
    "pause_reason": null,
    "daily_limit": 100,
    "sent_last_24h": 12
  },
  "form_notifications": [
    {
      "id": "5f0c2a7e-1b3d-4c8e-9a6f-2d4b8e1c7a90",
      "collection": "contact",
      "collection_id": "0b1c2d3e-4f50-4a6b-8c7d-9e0f1a2b3c4d",
      "document_id": "7c6b5a49-3827-4615-9d4e-3f2a1b0c9d8e",
      "status": "sent",
      "to": [
        "o***@example.com"
      ],
      "subject": "New entry in contact (Acme Plumbing)",
      "error": null,
      "test": false,
      "created_at": "2026-10-20T09:30:01.000Z"
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_parameter`](https://hypamoon.com/docs/errors/invalid_parameter) |

### POST /emails

**Send one email.**

Sends one email from an address on a verified sending domain of this project, like Resend: to is one address or a list, with optional cc and bcc (at most 50 recipients together). Everyone in to and cc sees the others; use bcc or POST /emails/batch when people must not see each other. Every recipient must appear in the project (a form submission, an order, a chat conversation, a user of one of your apps who signed in; an address only in a document written through the API does not count) or be confirmed by the owner. category other (the default) adds an unsubscribe link and header plus the project's postal address (from PUT /project/company, required by the US CAN-SPAM Act; without it the email is refused with company\_details\_missing) and goes to exactly one recipient; several recipients need category transactional (a reply to something they all did). attachments: at most 10 files, 10 MB together, each with a filename and one of content (base64), media\_id (a file from Media) or path (an https address on one of this project's sites). Allowed: PDF, PNG, JPG, GIF, WebP, and ICS, TXT or CSV as UTF-8 text; the type is checked on the file's first bytes. Keep the request under about 4 MB; use media\_id or path for larger files. Every email passes a content check (no phishing, no scripts or forms, no links that hide where they go). Limits count every recipient: a daily limit per project, 200 recipients and 20 calls per minute, and a cap on new recipients a day that only appear in documents your app wrote (25 to start, growing to 100 and 500 as emails are delivered without bounces or complaints; see mail.new\_recipients in GET /emails). Each recipient also counts as one email for the bundle. Sending pauses automatically when bounces exceed 5% or spam complaints exceed 0.1% over the last 200 emails. With a test key nothing is sent: after all the same checks, the email gets status simulated. An Idempotency-Key (header or idempotency\_key) returns the same email instead of a second one. template\_id with data sends a template (POST /email-templates) instead of subject, html and text. send\_at sends it later (at most 30 days ahead): the answer is then a scheduled email (202), which POST /scheduled-emails/{id}/cancel stops.

Scope: `messages:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `Idempotency-Key` | header | string | Optional. The same key returns the same email instead of sending it again. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `from` (required) | string | The sender: an address on a verified sending domain of this project, optionally with a name, like "Acme Plumbing <[hello@acme.com](mailto:hello@acme.com)\>". |
| `to` (required) | one of | One address or a list (at most 50 recipients in to, cc and bcc together). Everyone in to and cc sees the others, as in any email; use bcc, or a batch with one email per person, when they must not. Every address must appear in this project (a form submission, an order, a chat conversation, a user of one of your apps who signed in) or be confirmed by the owner. |
| `cc` | string\[\] | Optional. Copy recipients; they see the to and cc addresses. The same rules as to. |
| `bcc` | string\[\] | Optional. Hidden recipients; nobody sees them. The same rules as to. |
| `subject` | string | The subject line. Required without template\_id; with template\_id it comes from the template. |
| `text` | string | The plain text body. Send text, html or both. |
| `html` | string | The HTML body. No scripts, no forms; links must show where they go. |
| `reply_to` | string | Optional. Where replies go, like the user's own mailbox. |
| `language` | `"en"`, `"nl"`, `"de"`, `"fr"`, `"es"` | Optional, only for email through Hypamoon's address (no verified sending domain of its own): the language of the lines Hypamoon adds around your text (the header and "Sent by Hypamoon on behalf of ...") and of html lang. Default: the language of the app's site (configure\_texts), otherwise the project's, otherwise en. From the project's own domain your html is sent as it is. |
| `attachments` | object\[\] | Optional. At most 10 files, 10 MB together: PDF, PNG, JPG, GIF, WebP, and ICS, TXT or CSV as UTF-8 text. Never executables, HTML, SVG or archives. |
| `category` | `"transactional"`, `"other"` | transactional: a reply to something the recipients did (an order, a booking, a form they sent). other (default): anything else; it gets an unsubscribe link with the project's postal address (needs a business address in the company details) and a List-Unsubscribe header, is not sent to people who unsubscribed, and goes to exactly one recipient (use a batch for more people). |
| `in_reply_to` | string (uuid) | The id of the form submission (a document from a public form) or the chat conversation this email answers. Required when the recipient appears in the project only through a form or a chat; the address must be in that submission or conversation. |
| `check_recipients` | boolean | Optional, default true: before the first email to an address, check that its domain exists and accepts email, and refuse likely typos (like gmial.com) and, for category other, throwaway addresses. false skips those checks; an address that bounced before is always refused. |
| `headers` | object | Optional. Only In-Reply-To and References, with Message-IDs like <[abc@example.com](mailto:abc@example.com)\>, so a reply lands in the same thread. Other headers are not allowed. |
| `idempotency_key` | string | Optional. The same key returns the same email instead of sending a second one (also as the Idempotency-Key header). |
| `template_id` | string (uuid) | Optional. A template (create\_email\_template): the subject, html and text come from it, filled with data. Leave out subject, html and text. |
| `data` | object | With template\_id: the values for its variables, like { "name": "Sam" }. |
| `send_at` | string | Optional. Send later, like 2026-11-02T09:00:00Z, at most 30 days ahead: the answer is a scheduled email (202) that cancel\_scheduled\_email can stop. All checks except the form run when it is sent. |

JSON

```
{
  "from": "Acme Plumbing <hello@acmeplumbing.com>",
  "to": "sam@example.org",
  "subject": "We received your request",
  "text": "Hi Sam, thanks for your request. We will call you back today.",
  "reply_to": "office@acmeplumbing.com",
  "category": "transactional",
  "attachments": [
    {
      "filename": "quote.pdf",
      "content": "JVBERi0xLjcKJcfsj6IK..."
    }
  ]
}
```

#### 200 The same Idempotency-Key as before: the original email, and nothing is sent again.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the email. sendEmail and sendEmailBatch in an app return it; getEmail(id) reads it back. |
| `app_id` (required) | string or null (uuid) | The app that sent it with env.HYPAMOON.sendEmail; null when it was sent with the API, by an agent or from the portal. |
| `from` (required) | string |  |
| `to` (required) | string | The first address in to. All recipients are in recipients. |
| `recipients` (required) | object | Everyone this email went to. After 90 days the addresses are masked, like s\*\*\*@example.org. |
| `recipient_count` (required) | integer | to, cc and bcc together; each counts toward the limits and the bundle. |
| `attachments` (required) | object\[\] | Name, type and size of each attachment. The content is never stored. |
| `reply_to` (required) | string or null |  |
| `message_id` (required) | string or null | The Message-ID header the recipient sees, once sent; null before that. Pass it in headers (In-Reply-To, References) to thread a follow-up. |
| `subject` (required) | string |  |
| `category` (required) | `"transactional"`, `"other"` |  |
| `status` (required) | `"queued"`, `"sent"`, `"delivered"`, `"bounced"`, `"complained"`, `"failed"`, `"simulated"` | queued, sent (accepted for delivery), delivered, bounced, complained (marked as spam), failed, or simulated (test mode). |
| `recipient_source` (required) | `"confirmed"`, `"member"`, `"form"`, `"document"`, `"conversation"`, `"app_user"`, `"buyer"`, `"pass_holder"`, `null` | Where the recipient appears in the project. |
| `test` (required) | boolean |  |
| `error` (required) | string or null |  |
| `reason` (required) | string or null | Why the email bounced, was marked as spam, is delayed or was not sent, in plain words. null otherwise. |
| `recipient_status` (required) | object\[\] | The status per recipient. With several recipients one can bounce while the others are delivered. |
| `timeline` (required) | object\[\] | Every step, oldest first: queued, then sent (or simulated, or failed), then what the recipient's mail server reported. |
| `created_at` (required) | string |  |
| `sent_at` (required) | string or null |  |
| `delivered_at` (required) | string or null |  |
| `bounced_at` (required) | string or null |  |
| `complained_at` (required) | string or null |  |
| `sender` | `"hypamoon_fallback"` | Only when the project has no verified sending domain of its own: the email went from Hypamoon's address ("<app or project> via Hypamoon"), in a neutral layout without the project's images or design. Tell the user so. |
| `next_step` | string | With sender hypamoon\_fallback: how to send from the project's own address with its own design. |

JSON

```
{
  "id": "7c1e2d3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
  "app_id": null,
  "from": "Acme Plumbing <hello@acmeplumbing.com>",
  "to": "sam@example.org",
  "recipients": {
    "to": [
      "sam@example.org"
    ],
    "cc": [],
    "bcc": []
  },
  "recipient_count": 1,
  "attachments": [
    {
      "filename": "quote.pdf",
      "content_type": "application/pdf",
      "size": 48213
    }
  ],
  "reply_to": "office@acmeplumbing.com",
  "message_id": "<0100019a2b3c4d5e-6f7a8b9c-0d1e-4f2a-9b3c-4d5e6f7a8b9c-000000@mail.acmeplumbing.com>",
  "subject": "We received your request",
  "category": "transactional",
  "status": "sent",
  "recipient_source": "form",
  "test": false,
  "error": null,
  "reason": null,
  "recipient_status": [
    {
      "email": "sam@example.org",
      "field": "to",
      "status": "sent",
      "reason": null,
      "updated_at": "2026-10-06T10:15:01.000Z"
    }
  ],
  "timeline": [
    {
      "status": "queued",
      "at": "2026-10-06T10:15:00.000Z",
      "recipient": null,
      "reason": null
    },
    {
      "status": "sent",
      "at": "2026-10-06T10:15:01.000Z",
      "recipient": null,
      "reason": null
    }
  ],
  "created_at": "2026-10-06T10:15:00.000Z",
  "sent_at": "2026-10-06T10:15:01.000Z",
  "delivered_at": null,
  "bounced_at": null,
  "complained_at": null
}
```

#### 201 Accepted for delivery (or simulated with a test key).

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the email. sendEmail and sendEmailBatch in an app return it; getEmail(id) reads it back. |
| `app_id` (required) | string or null (uuid) | The app that sent it with env.HYPAMOON.sendEmail; null when it was sent with the API, by an agent or from the portal. |
| `from` (required) | string |  |
| `to` (required) | string | The first address in to. All recipients are in recipients. |
| `recipients` (required) | object | Everyone this email went to. After 90 days the addresses are masked, like s\*\*\*@example.org. |
| `recipient_count` (required) | integer | to, cc and bcc together; each counts toward the limits and the bundle. |
| `attachments` (required) | object\[\] | Name, type and size of each attachment. The content is never stored. |
| `reply_to` (required) | string or null |  |
| `message_id` (required) | string or null | The Message-ID header the recipient sees, once sent; null before that. Pass it in headers (In-Reply-To, References) to thread a follow-up. |
| `subject` (required) | string |  |
| `category` (required) | `"transactional"`, `"other"` |  |
| `status` (required) | `"queued"`, `"sent"`, `"delivered"`, `"bounced"`, `"complained"`, `"failed"`, `"simulated"` | queued, sent (accepted for delivery), delivered, bounced, complained (marked as spam), failed, or simulated (test mode). |
| `recipient_source` (required) | `"confirmed"`, `"member"`, `"form"`, `"document"`, `"conversation"`, `"app_user"`, `"buyer"`, `"pass_holder"`, `null` | Where the recipient appears in the project. |
| `test` (required) | boolean |  |
| `error` (required) | string or null |  |
| `reason` (required) | string or null | Why the email bounced, was marked as spam, is delayed or was not sent, in plain words. null otherwise. |
| `recipient_status` (required) | object\[\] | The status per recipient. With several recipients one can bounce while the others are delivered. |
| `timeline` (required) | object\[\] | Every step, oldest first: queued, then sent (or simulated, or failed), then what the recipient's mail server reported. |
| `created_at` (required) | string |  |
| `sent_at` (required) | string or null |  |
| `delivered_at` (required) | string or null |  |
| `bounced_at` (required) | string or null |  |
| `complained_at` (required) | string or null |  |
| `sender` | `"hypamoon_fallback"` | Only when the project has no verified sending domain of its own: the email went from Hypamoon's address ("<app or project> via Hypamoon"), in a neutral layout without the project's images or design. Tell the user so. |
| `next_step` | string | With sender hypamoon\_fallback: how to send from the project's own address with its own design. |

JSON

```
{
  "id": "7c1e2d3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
  "app_id": null,
  "from": "Acme Plumbing <hello@acmeplumbing.com>",
  "to": "sam@example.org",
  "recipients": {
    "to": [
      "sam@example.org"
    ],
    "cc": [],
    "bcc": []
  },
  "recipient_count": 1,
  "attachments": [
    {
      "filename": "quote.pdf",
      "content_type": "application/pdf",
      "size": 48213
    }
  ],
  "reply_to": "office@acmeplumbing.com",
  "message_id": "<0100019a2b3c4d5e-6f7a8b9c-0d1e-4f2a-9b3c-4d5e6f7a8b9c-000000@mail.acmeplumbing.com>",
  "subject": "We received your request",
  "category": "transactional",
  "status": "sent",
  "recipient_source": "form",
  "test": false,
  "error": null,
  "reason": null,
  "recipient_status": [
    {
      "email": "sam@example.org",
      "field": "to",
      "status": "sent",
      "reason": null,
      "updated_at": "2026-10-06T10:15:01.000Z"
    }
  ],
  "timeline": [
    {
      "status": "queued",
      "at": "2026-10-06T10:15:00.000Z",
      "recipient": null,
      "reason": null
    },
    {
      "status": "sent",
      "at": "2026-10-06T10:15:01.000Z",
      "recipient": null,
      "reason": null
    }
  ],
  "created_at": "2026-10-06T10:15:00.000Z",
  "sent_at": "2026-10-06T10:15:01.000Z",
  "delivered_at": null,
  "bounced_at": null,
  "complained_at": null
}
```

#### 202 With send\_at: the scheduled email. get\_scheduled\_email shows it; once sent, email\_id is the email.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the scheduled email. cancel\_scheduled\_email takes it. |
| `source` (required) | `"api"`, `"automation"`, `"sequence"`, `"list"`, `"confirmation"` | api: send\_email with send\_at. automation, sequence, list: sent by those. confirmation: the confirmation email of a list. |
| `status` (required) | `"scheduled"`, `"sending"`, `"sent"`, `"canceled"`, `"skipped"`, `"failed"` | scheduled (waits for send\_at), sending, sent (email\_id is the email), canceled, skipped (the person unsubscribed or left the list or sequence), failed (reason says why). |
| `send_at` (required) | string (date-time) |  |
| `to` (required) | string or null |  |
| `subject` (required) | string or null |  |
| `template_id` (required) | string or null (uuid) |  |
| `email_id` (required) | string or null (uuid) | The email once it was sent; get\_email shows whether it was delivered. |
| `reason` (required) | string or null |  |
| `test` (required) | boolean |  |
| `created_at` (required) | string (date-time) |  |

JSON

```
{
  "id": "6c7d8e9f-0a1b-4c2d-9e3f-4a5b6c7d8e9f",
  "source": "api",
  "status": "scheduled",
  "send_at": "2026-10-16T08:00:00.000Z",
  "to": "sam@example.org",
  "subject": "Your appointment tomorrow",
  "template_id": null,
  "email_id": null,
  "reason": null,
  "test": false,
  "created_at": "2026-10-15T10:00:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 400 | [`idempotency_key_invalid`](https://hypamoon.com/docs/errors/idempotency_key_invalid) |
| 402 | [`insufficient_balance`](https://hypamoon.com/docs/errors/insufficient_balance) |
| 403 | [`mail_not_enabled`](https://hypamoon.com/docs/errors/mail_not_enabled) |
| 403 | [`email_paused`](https://hypamoon.com/docs/errors/email_paused) |
| 403 | [`recipient_not_allowed`](https://hypamoon.com/docs/errors/recipient_not_allowed) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`idempotency_key_reused`](https://hypamoon.com/docs/errors/idempotency_key_reused) |
| 409 | [`idempotency_request_in_progress`](https://hypamoon.com/docs/errors/idempotency_request_in_progress) |
| 409 | [`email_domain_not_verified`](https://hypamoon.com/docs/errors/email_domain_not_verified) |
| 413 | [`attachment_too_large`](https://hypamoon.com/docs/errors/attachment_too_large) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`email_address_invalid`](https://hypamoon.com/docs/errors/email_address_invalid) |
| 422 | [`company_details_missing`](https://hypamoon.com/docs/errors/company_details_missing) |
| 422 | [`email_blocked`](https://hypamoon.com/docs/errors/email_blocked) |
| 422 | [`attachment_not_allowed`](https://hypamoon.com/docs/errors/attachment_not_allowed) |
| 429 | [`email_limit_reached`](https://hypamoon.com/docs/errors/email_limit_reached) |
| 502 | [`upstream_error`](https://hypamoon.com/docs/errors/upstream_error) |

### GET /app-emails

**List the emails of an app (from the app).**

For an app's own server code only: await env.HYPAMOON.listEmails({ to, status, since, limit, cursor }) does this call without an Authorization header; Hypamoon adds the app's key, and any other key gets 403. Only the emails this app sent with sendEmail or sendEmailBatch, newest first, never those of another app or of the API. Each with its status, reason, status per recipient and timeline, as GET /emails/{id}.

Scope: `data:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `limit` | query | integer | Emails per page, 1 to 100. |
| `cursor` | query | string | The next\_cursor of the previous page. |
| `to` | query | string | Only emails with this address in to, cc or bcc. |
| `status` | query | `"queued"`, `"sent"`, `"delivered"`, `"bounced"`, `"complained"`, `"failed"`, `"simulated"` | Only emails with this status. |
| `since` | query | string (date-time) | Only emails sent at or after this moment, like 2026-10-01 or 2026-10-15T09:00:00Z. |

#### 200 The app's emails.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] |  |
| `next_cursor` (required) | string or null |  |

JSON

```
{
  "data": [
    {
      "id": "7c1e2d3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
      "app_id": "5a4b3c2d-1e0f-4a9b-8c7d-6e5f4a3b2c1d",
      "from": "noreply@acmeplumbing.com",
      "to": "sam@example.org",
      "recipients": {
        "to": [
          "sam@example.org"
        ],
        "cc": [],
        "bcc": []
      },
      "recipient_count": 1,
      "attachments": [],
      "reply_to": null,
      "message_id": "<0100019a2b3c4d5e-6f7a8b9c-0d1e-4f2a-9b3c-4d5e6f7a8b9c-000000@mail.acmeplumbing.com>",
      "subject": "Your hours for week 41 are approved",
      "category": "transactional",
      "status": "delivered",
      "recipient_source": "form",
      "test": false,
      "error": null,
      "reason": null,
      "recipient_status": [
        {
          "email": "sam@example.org",
          "field": "to",
          "status": "delivered",
          "reason": null,
          "updated_at": "2026-10-06T10:15:04.000Z"
        }
      ],
      "timeline": [
        {
          "status": "queued",
          "at": "2026-10-06T10:15:00.000Z",
          "recipient": null,
          "reason": null
        },
        {
          "status": "sent",
          "at": "2026-10-06T10:15:01.000Z",
          "recipient": null,
          "reason": null
        },
        {
          "status": "delivered",
          "at": "2026-10-06T10:15:04.000Z",
          "recipient": null,
          "reason": null
        }
      ],
      "created_at": "2026-10-06T10:15:00.000Z",
      "sent_at": "2026-10-06T10:15:01.000Z",
      "delivered_at": "2026-10-06T10:15:04.000Z",
      "bounced_at": null,
      "complained_at": null
    }
  ],
  "next_cursor": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_parameter`](https://hypamoon.com/docs/errors/invalid_parameter) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |

### POST /app-emails

**Send one email (from an app).**

For an app's own server code only: await env.HYPAMOON.sendEmail({ to, subject, text }) does this call, POST env.HYPAMOON\_API + "/app-emails" without an Authorization header; Hypamoon adds the app's key, and any other key gets 403 (other keys use POST /emails with messages:write). The same rules as POST /emails, for the app's project: the Mail module on, recipients (to, cc, bcc) that the project knows (a user of the app who signed in, a form submission, an order, a chat conversation) or that the owner confirmed, attachments, the daily and per-minute limits per recipient, and the content check. In the app, an attachment's content may be a Uint8Array (like the result of env.HYPAMOON.renderPdf); the wrapper sends it as base64. from is optional: without it the email comes from noreply@ on the project's verified sending domain (the oldest one). No signed-in user is needed, so a scheduled job can send too. With a test key nothing is sent (status simulated).

Scope: `data:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `Idempotency-Key` | header | string | Optional. The same key returns the same email instead of sending it again. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `from` | string | Optional. An address on a verified sending domain of this project, optionally with a name. Without it: the app's own sender (login\_email.from\_domain and from\_local of the app's site, set with deploy\_app or set\_site\_access), else noreply@ on the sending domain the app's site is on (or a subdomain of), else noreply@ on the project's only sending domain. Otherwise (no sending domain, or several and none matches) it goes from Hypamoon's address ("<app> via Hypamoon"), never from a random one of the project's domains: to its own team always, to others only category transactional with a payment method or paid plan, up to 50 a day. |
| `to` (required) | one of | One address or a list (at most 50 recipients in to, cc and bcc together). Everyone in to and cc sees the others, as in any email; use bcc, or a batch with one email per person, when they must not. Every address must appear in this project (a form submission, an order, a chat conversation, a user of one of your apps who signed in) or be confirmed by the owner. |
| `cc` | string\[\] | Optional. Copy recipients; they see the to and cc addresses. The same rules as to. |
| `bcc` | string\[\] | Optional. Hidden recipients; nobody sees them. The same rules as to. |
| `subject` (required) | string | The subject line. |
| `text` | string | The plain text body. Send text, html or both. |
| `html` | string | The HTML body. No scripts, no forms; links must show where they go. |
| `reply_to` | string | Optional. Where replies go, like the user's own mailbox. |
| `language` | `"en"`, `"nl"`, `"de"`, `"fr"`, `"es"` | Optional, only for email through Hypamoon's address (no verified sending domain of its own): the language of the lines Hypamoon adds around your text (the header and "Sent by Hypamoon on behalf of ...") and of html lang. Default: the language of the app's site (configure\_texts), otherwise the project's, otherwise en. From the project's own domain your html is sent as it is. |
| `attachments` | object\[\] | Optional. At most 10 files, 10 MB together: PDF, PNG, JPG, GIF, WebP, and ICS, TXT or CSV as UTF-8 text. Never executables, HTML, SVG or archives. |
| `category` | `"transactional"`, `"other"` | transactional: a reply to something the recipients did (an order, a booking, a form they sent). other (default): anything else; it gets an unsubscribe link with the project's postal address (needs a business address in the company details) and a List-Unsubscribe header, is not sent to people who unsubscribed, and goes to exactly one recipient (use a batch for more people). |
| `in_reply_to` | string (uuid) | The id of the form submission (a document from a public form) or the chat conversation this email answers. Required when the recipient appears in the project only through a form or a chat; the address must be in that submission or conversation. |
| `check_recipients` | boolean | Optional, default true: before the first email to an address, check that its domain exists and accepts email, and refuse likely typos (like gmial.com) and, for category other, throwaway addresses. false skips those checks; an address that bounced before is always refused. |
| `headers` | object | Optional. Only In-Reply-To and References, with Message-IDs like <[abc@example.com](mailto:abc@example.com)\>, so a reply lands in the same thread. Other headers are not allowed. |
| `idempotency_key` | string | Optional. The same key returns the same email instead of sending a second one (also as the Idempotency-Key header). |

JSON

```
{
  "to": "sam@example.org",
  "subject": "Your hours for week 41 are approved",
  "text": "Hi Sam, your hours for week 41 were approved.",
  "category": "transactional"
}
```

#### 200 The same Idempotency-Key as before: the original email, and nothing is sent again.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the email. sendEmail and sendEmailBatch in an app return it; getEmail(id) reads it back. |
| `app_id` (required) | string or null (uuid) | The app that sent it with env.HYPAMOON.sendEmail; null when it was sent with the API, by an agent or from the portal. |
| `from` (required) | string |  |
| `to` (required) | string | The first address in to. All recipients are in recipients. |
| `recipients` (required) | object | Everyone this email went to. After 90 days the addresses are masked, like s\*\*\*@example.org. |
| `recipient_count` (required) | integer | to, cc and bcc together; each counts toward the limits and the bundle. |
| `attachments` (required) | object\[\] | Name, type and size of each attachment. The content is never stored. |
| `reply_to` (required) | string or null |  |
| `message_id` (required) | string or null | The Message-ID header the recipient sees, once sent; null before that. Pass it in headers (In-Reply-To, References) to thread a follow-up. |
| `subject` (required) | string |  |
| `category` (required) | `"transactional"`, `"other"` |  |
| `status` (required) | `"queued"`, `"sent"`, `"delivered"`, `"bounced"`, `"complained"`, `"failed"`, `"simulated"` | queued, sent (accepted for delivery), delivered, bounced, complained (marked as spam), failed, or simulated (test mode). |
| `recipient_source` (required) | `"confirmed"`, `"member"`, `"form"`, `"document"`, `"conversation"`, `"app_user"`, `"buyer"`, `"pass_holder"`, `null` | Where the recipient appears in the project. |
| `test` (required) | boolean |  |
| `error` (required) | string or null |  |
| `reason` (required) | string or null | Why the email bounced, was marked as spam, is delayed or was not sent, in plain words. null otherwise. |
| `recipient_status` (required) | object\[\] | The status per recipient. With several recipients one can bounce while the others are delivered. |
| `timeline` (required) | object\[\] | Every step, oldest first: queued, then sent (or simulated, or failed), then what the recipient's mail server reported. |
| `created_at` (required) | string |  |
| `sent_at` (required) | string or null |  |
| `delivered_at` (required) | string or null |  |
| `bounced_at` (required) | string or null |  |
| `complained_at` (required) | string or null |  |
| `sender` | `"hypamoon_fallback"` | Only when the project has no verified sending domain of its own: the email went from Hypamoon's address ("<app or project> via Hypamoon"), in a neutral layout without the project's images or design. Tell the user so. |
| `next_step` | string | With sender hypamoon\_fallback: how to send from the project's own address with its own design. |

JSON

```
{
  "id": "7c1e2d3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
  "app_id": null,
  "from": "Acme Plumbing <hello@acmeplumbing.com>",
  "to": "sam@example.org",
  "recipients": {
    "to": [
      "sam@example.org"
    ],
    "cc": [],
    "bcc": []
  },
  "recipient_count": 1,
  "attachments": [
    {
      "filename": "quote.pdf",
      "content_type": "application/pdf",
      "size": 48213
    }
  ],
  "reply_to": "office@acmeplumbing.com",
  "message_id": "<0100019a2b3c4d5e-6f7a8b9c-0d1e-4f2a-9b3c-4d5e6f7a8b9c-000000@mail.acmeplumbing.com>",
  "subject": "We received your request",
  "category": "transactional",
  "status": "sent",
  "recipient_source": "form",
  "test": false,
  "error": null,
  "reason": null,
  "recipient_status": [
    {
      "email": "sam@example.org",
      "field": "to",
      "status": "sent",
      "reason": null,
      "updated_at": "2026-10-06T10:15:01.000Z"
    }
  ],
  "timeline": [
    {
      "status": "queued",
      "at": "2026-10-06T10:15:00.000Z",
      "recipient": null,
      "reason": null
    },
    {
      "status": "sent",
      "at": "2026-10-06T10:15:01.000Z",
      "recipient": null,
      "reason": null
    }
  ],
  "created_at": "2026-10-06T10:15:00.000Z",
  "sent_at": "2026-10-06T10:15:01.000Z",
  "delivered_at": null,
  "bounced_at": null,
  "complained_at": null
}
```

#### 201 Accepted for delivery (or simulated with a test key).

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the email. sendEmail and sendEmailBatch in an app return it; getEmail(id) reads it back. |
| `app_id` (required) | string or null (uuid) | The app that sent it with env.HYPAMOON.sendEmail; null when it was sent with the API, by an agent or from the portal. |
| `from` (required) | string |  |
| `to` (required) | string | The first address in to. All recipients are in recipients. |
| `recipients` (required) | object | Everyone this email went to. After 90 days the addresses are masked, like s\*\*\*@example.org. |
| `recipient_count` (required) | integer | to, cc and bcc together; each counts toward the limits and the bundle. |
| `attachments` (required) | object\[\] | Name, type and size of each attachment. The content is never stored. |
| `reply_to` (required) | string or null |  |
| `message_id` (required) | string or null | The Message-ID header the recipient sees, once sent; null before that. Pass it in headers (In-Reply-To, References) to thread a follow-up. |
| `subject` (required) | string |  |
| `category` (required) | `"transactional"`, `"other"` |  |
| `status` (required) | `"queued"`, `"sent"`, `"delivered"`, `"bounced"`, `"complained"`, `"failed"`, `"simulated"` | queued, sent (accepted for delivery), delivered, bounced, complained (marked as spam), failed, or simulated (test mode). |
| `recipient_source` (required) | `"confirmed"`, `"member"`, `"form"`, `"document"`, `"conversation"`, `"app_user"`, `"buyer"`, `"pass_holder"`, `null` | Where the recipient appears in the project. |
| `test` (required) | boolean |  |
| `error` (required) | string or null |  |
| `reason` (required) | string or null | Why the email bounced, was marked as spam, is delayed or was not sent, in plain words. null otherwise. |
| `recipient_status` (required) | object\[\] | The status per recipient. With several recipients one can bounce while the others are delivered. |
| `timeline` (required) | object\[\] | Every step, oldest first: queued, then sent (or simulated, or failed), then what the recipient's mail server reported. |
| `created_at` (required) | string |  |
| `sent_at` (required) | string or null |  |
| `delivered_at` (required) | string or null |  |
| `bounced_at` (required) | string or null |  |
| `complained_at` (required) | string or null |  |
| `sender` | `"hypamoon_fallback"` | Only when the project has no verified sending domain of its own: the email went from Hypamoon's address ("<app or project> via Hypamoon"), in a neutral layout without the project's images or design. Tell the user so. |
| `next_step` | string | With sender hypamoon\_fallback: how to send from the project's own address with its own design. |

JSON

```
{
  "id": "7c1e2d3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
  "app_id": null,
  "from": "Acme Plumbing <hello@acmeplumbing.com>",
  "to": "sam@example.org",
  "recipients": {
    "to": [
      "sam@example.org"
    ],
    "cc": [],
    "bcc": []
  },
  "recipient_count": 1,
  "attachments": [
    {
      "filename": "quote.pdf",
      "content_type": "application/pdf",
      "size": 48213
    }
  ],
  "reply_to": "office@acmeplumbing.com",
  "message_id": "<0100019a2b3c4d5e-6f7a8b9c-0d1e-4f2a-9b3c-4d5e6f7a8b9c-000000@mail.acmeplumbing.com>",
  "subject": "We received your request",
  "category": "transactional",
  "status": "sent",
  "recipient_source": "form",
  "test": false,
  "error": null,
  "reason": null,
  "recipient_status": [
    {
      "email": "sam@example.org",
      "field": "to",
      "status": "sent",
      "reason": null,
      "updated_at": "2026-10-06T10:15:01.000Z"
    }
  ],
  "timeline": [
    {
      "status": "queued",
      "at": "2026-10-06T10:15:00.000Z",
      "recipient": null,
      "reason": null
    },
    {
      "status": "sent",
      "at": "2026-10-06T10:15:01.000Z",
      "recipient": null,
      "reason": null
    }
  ],
  "created_at": "2026-10-06T10:15:00.000Z",
  "sent_at": "2026-10-06T10:15:01.000Z",
  "delivered_at": null,
  "bounced_at": null,
  "complained_at": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 400 | [`idempotency_key_invalid`](https://hypamoon.com/docs/errors/idempotency_key_invalid) |
| 402 | [`insufficient_balance`](https://hypamoon.com/docs/errors/insufficient_balance) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 403 | [`mail_not_enabled`](https://hypamoon.com/docs/errors/mail_not_enabled) |
| 403 | [`email_paused`](https://hypamoon.com/docs/errors/email_paused) |
| 403 | [`recipient_not_allowed`](https://hypamoon.com/docs/errors/recipient_not_allowed) |
| 409 | [`idempotency_key_reused`](https://hypamoon.com/docs/errors/idempotency_key_reused) |
| 409 | [`idempotency_request_in_progress`](https://hypamoon.com/docs/errors/idempotency_request_in_progress) |
| 409 | [`email_domain_not_verified`](https://hypamoon.com/docs/errors/email_domain_not_verified) |
| 413 | [`attachment_too_large`](https://hypamoon.com/docs/errors/attachment_too_large) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`email_address_invalid`](https://hypamoon.com/docs/errors/email_address_invalid) |
| 422 | [`company_details_missing`](https://hypamoon.com/docs/errors/company_details_missing) |
| 422 | [`email_blocked`](https://hypamoon.com/docs/errors/email_blocked) |
| 422 | [`attachment_not_allowed`](https://hypamoon.com/docs/errors/attachment_not_allowed) |
| 429 | [`email_limit_reached`](https://hypamoon.com/docs/errors/email_limit_reached) |
| 502 | [`upstream_error`](https://hypamoon.com/docs/errors/upstream_error) |

### POST /emails/batch

**Send a batch of emails.**

Sends 1 to 100 separate emails in one call, like Resend's batch: each email has its own to (and its own text), so everyone sees only their own email, for example a personal invitation per person. Each email follows the rules of POST /emails, except that a batch has no attachments (send those one by one). All or nothing: every email is checked first, and if one is refused, none is sent and the error says which (index). Every email and every recipient counts toward the limits and the bundle; the whole batch is one call for the per-minute limit. An Idempotency-Key (header or idempotency\_key) returns the same emails instead of sending them again. With a test key nothing is sent (status simulated).

Scope: `messages:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `Idempotency-Key` | header | string | Optional. The same key returns the same emails instead of sending them again. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `emails` (required) | object\[\] | 1 to 100 separate emails, each with its own to (and its own text, for personal invitations): everyone sees only their own email. No attachments in a batch; send those one by one. |
| `idempotency_key` | string | Optional. The same key returns the same emails instead of sending them again (also as the Idempotency-Key header). |

JSON

```
{
  "emails": [
    {
      "from": "Acme Plumbing <hello@acmeplumbing.com>",
      "to": "sam@example.org",
      "subject": "Your invitation",
      "text": "Hi Sam, you are invited to our open day on 1 November.",
      "category": "transactional"
    },
    {
      "from": "Acme Plumbing <hello@acmeplumbing.com>",
      "to": "kim@example.org",
      "subject": "Your invitation",
      "text": "Hi Kim, you are invited to our open day on 1 November.",
      "category": "transactional"
    }
  ]
}
```

#### 200 The same Idempotency-Key as before: the original emails, and nothing is sent again.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] | The emails in the order of the request. |

JSON

```
{
  "data": [
    {
      "id": "7c1e2d3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
      "app_id": null,
      "from": "Acme Plumbing <hello@acmeplumbing.com>",
      "to": "sam@example.org",
      "recipients": {
        "to": [
          "sam@example.org"
        ],
        "cc": [],
        "bcc": []
      },
      "recipient_count": 1,
      "attachments": [
        {
          "filename": "quote.pdf",
          "content_type": "application/pdf",
          "size": 48213
        }
      ],
      "reply_to": "office@acmeplumbing.com",
      "message_id": "<0100019a2b3c4d5e-6f7a8b9c-0d1e-4f2a-9b3c-4d5e6f7a8b9c-000000@mail.acmeplumbing.com>",
      "subject": "We received your request",
      "category": "transactional",
      "status": "sent",
      "recipient_source": "form",
      "test": false,
      "error": null,
      "reason": null,
      "recipient_status": [
        {
          "email": "sam@example.org",
          "field": "to",
          "status": "sent",
          "reason": null,
          "updated_at": "2026-10-06T10:15:01.000Z"
        }
      ],
      "timeline": [
        {
          "status": "queued",
          "at": "2026-10-06T10:15:00.000Z",
          "recipient": null,
          "reason": null
        },
        {
          "status": "sent",
          "at": "2026-10-06T10:15:01.000Z",
          "recipient": null,
          "reason": null
        }
      ],
      "created_at": "2026-10-06T10:15:00.000Z",
      "sent_at": "2026-10-06T10:15:01.000Z",
      "delivered_at": null,
      "bounced_at": null,
      "complained_at": null
    }
  ]
}
```

#### 201 Accepted for delivery (or simulated with a test key), in the order of the request.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] | The emails in the order of the request. |

JSON

```
{
  "data": [
    {
      "id": "7c1e2d3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
      "app_id": null,
      "from": "Acme Plumbing <hello@acmeplumbing.com>",
      "to": "sam@example.org",
      "recipients": {
        "to": [
          "sam@example.org"
        ],
        "cc": [],
        "bcc": []
      },
      "recipient_count": 1,
      "attachments": [
        {
          "filename": "quote.pdf",
          "content_type": "application/pdf",
          "size": 48213
        }
      ],
      "reply_to": "office@acmeplumbing.com",
      "message_id": "<0100019a2b3c4d5e-6f7a8b9c-0d1e-4f2a-9b3c-4d5e6f7a8b9c-000000@mail.acmeplumbing.com>",
      "subject": "We received your request",
      "category": "transactional",
      "status": "sent",
      "recipient_source": "form",
      "test": false,
      "error": null,
      "reason": null,
      "recipient_status": [
        {
          "email": "sam@example.org",
          "field": "to",
          "status": "sent",
          "reason": null,
          "updated_at": "2026-10-06T10:15:01.000Z"
        }
      ],
      "timeline": [
        {
          "status": "queued",
          "at": "2026-10-06T10:15:00.000Z",
          "recipient": null,
          "reason": null
        },
        {
          "status": "sent",
          "at": "2026-10-06T10:15:01.000Z",
          "recipient": null,
          "reason": null
        }
      ],
      "created_at": "2026-10-06T10:15:00.000Z",
      "sent_at": "2026-10-06T10:15:01.000Z",
      "delivered_at": null,
      "bounced_at": null,
      "complained_at": null
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 400 | [`idempotency_key_invalid`](https://hypamoon.com/docs/errors/idempotency_key_invalid) |
| 402 | [`insufficient_balance`](https://hypamoon.com/docs/errors/insufficient_balance) |
| 403 | [`mail_not_enabled`](https://hypamoon.com/docs/errors/mail_not_enabled) |
| 403 | [`email_paused`](https://hypamoon.com/docs/errors/email_paused) |
| 403 | [`recipient_not_allowed`](https://hypamoon.com/docs/errors/recipient_not_allowed) |
| 409 | [`idempotency_key_reused`](https://hypamoon.com/docs/errors/idempotency_key_reused) |
| 409 | [`idempotency_request_in_progress`](https://hypamoon.com/docs/errors/idempotency_request_in_progress) |
| 409 | [`email_domain_not_verified`](https://hypamoon.com/docs/errors/email_domain_not_verified) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`email_address_invalid`](https://hypamoon.com/docs/errors/email_address_invalid) |
| 422 | [`company_details_missing`](https://hypamoon.com/docs/errors/company_details_missing) |
| 422 | [`email_blocked`](https://hypamoon.com/docs/errors/email_blocked) |
| 422 | [`attachment_not_allowed`](https://hypamoon.com/docs/errors/attachment_not_allowed) |
| 429 | [`email_limit_reached`](https://hypamoon.com/docs/errors/email_limit_reached) |
| 502 | [`upstream_error`](https://hypamoon.com/docs/errors/upstream_error) |

### POST /app-emails/batch

**Send a batch of emails (from an app).**

For an app's own server code only: await env.HYPAMOON.sendEmailBatch(\[{ to, subject, text }, ...\]) does this call without an Authorization header; Hypamoon adds the app's key, and any other key gets 403. The rules of POST /emails/batch for the app's project; from is optional per email, as in sendEmail.

Scope: `data:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `Idempotency-Key` | header | string | Optional. The same key returns the same emails instead of sending them again. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `emails` (required) | object\[\] |  |
| `idempotency_key` | string |  |

JSON

```
{
  "emails": [
    {
      "to": "sam@example.org",
      "subject": "Your invitation",
      "text": "Hi Sam, see you on 1 November.",
      "category": "transactional"
    }
  ]
}
```

#### 200 The same Idempotency-Key as before: the original emails.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] | The emails in the order of the request. |

JSON

```
{
  "data": [
    {
      "id": "7c1e2d3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
      "app_id": null,
      "from": "Acme Plumbing <hello@acmeplumbing.com>",
      "to": "sam@example.org",
      "recipients": {
        "to": [
          "sam@example.org"
        ],
        "cc": [],
        "bcc": []
      },
      "recipient_count": 1,
      "attachments": [
        {
          "filename": "quote.pdf",
          "content_type": "application/pdf",
          "size": 48213
        }
      ],
      "reply_to": "office@acmeplumbing.com",
      "message_id": "<0100019a2b3c4d5e-6f7a8b9c-0d1e-4f2a-9b3c-4d5e6f7a8b9c-000000@mail.acmeplumbing.com>",
      "subject": "We received your request",
      "category": "transactional",
      "status": "sent",
      "recipient_source": "form",
      "test": false,
      "error": null,
      "reason": null,
      "recipient_status": [
        {
          "email": "sam@example.org",
          "field": "to",
          "status": "sent",
          "reason": null,
          "updated_at": "2026-10-06T10:15:01.000Z"
        }
      ],
      "timeline": [
        {
          "status": "queued",
          "at": "2026-10-06T10:15:00.000Z",
          "recipient": null,
          "reason": null
        },
        {
          "status": "sent",
          "at": "2026-10-06T10:15:01.000Z",
          "recipient": null,
          "reason": null
        }
      ],
      "created_at": "2026-10-06T10:15:00.000Z",
      "sent_at": "2026-10-06T10:15:01.000Z",
      "delivered_at": null,
      "bounced_at": null,
      "complained_at": null
    }
  ]
}
```

#### 201 Accepted for delivery (or simulated with a test key).

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] | The emails in the order of the request. |

JSON

```
{
  "data": [
    {
      "id": "7c1e2d3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
      "app_id": null,
      "from": "Acme Plumbing <hello@acmeplumbing.com>",
      "to": "sam@example.org",
      "recipients": {
        "to": [
          "sam@example.org"
        ],
        "cc": [],
        "bcc": []
      },
      "recipient_count": 1,
      "attachments": [
        {
          "filename": "quote.pdf",
          "content_type": "application/pdf",
          "size": 48213
        }
      ],
      "reply_to": "office@acmeplumbing.com",
      "message_id": "<0100019a2b3c4d5e-6f7a8b9c-0d1e-4f2a-9b3c-4d5e6f7a8b9c-000000@mail.acmeplumbing.com>",
      "subject": "We received your request",
      "category": "transactional",
      "status": "sent",
      "recipient_source": "form",
      "test": false,
      "error": null,
      "reason": null,
      "recipient_status": [
        {
          "email": "sam@example.org",
          "field": "to",
          "status": "sent",
          "reason": null,
          "updated_at": "2026-10-06T10:15:01.000Z"
        }
      ],
      "timeline": [
        {
          "status": "queued",
          "at": "2026-10-06T10:15:00.000Z",
          "recipient": null,
          "reason": null
        },
        {
          "status": "sent",
          "at": "2026-10-06T10:15:01.000Z",
          "recipient": null,
          "reason": null
        }
      ],
      "created_at": "2026-10-06T10:15:00.000Z",
      "sent_at": "2026-10-06T10:15:01.000Z",
      "delivered_at": null,
      "bounced_at": null,
      "complained_at": null
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 400 | [`idempotency_key_invalid`](https://hypamoon.com/docs/errors/idempotency_key_invalid) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 403 | [`mail_not_enabled`](https://hypamoon.com/docs/errors/mail_not_enabled) |
| 403 | [`email_paused`](https://hypamoon.com/docs/errors/email_paused) |
| 403 | [`recipient_not_allowed`](https://hypamoon.com/docs/errors/recipient_not_allowed) |
| 409 | [`idempotency_key_reused`](https://hypamoon.com/docs/errors/idempotency_key_reused) |
| 409 | [`email_domain_not_verified`](https://hypamoon.com/docs/errors/email_domain_not_verified) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`email_address_invalid`](https://hypamoon.com/docs/errors/email_address_invalid) |
| 422 | [`company_details_missing`](https://hypamoon.com/docs/errors/company_details_missing) |
| 422 | [`email_blocked`](https://hypamoon.com/docs/errors/email_blocked) |
| 422 | [`attachment_not_allowed`](https://hypamoon.com/docs/errors/attachment_not_allowed) |
| 429 | [`email_limit_reached`](https://hypamoon.com/docs/errors/email_limit_reached) |
| 502 | [`upstream_error`](https://hypamoon.com/docs/errors/upstream_error) |

### GET /emails/{id}

**Get one email.**

One email with its status (queued, sent, delivered, bounced, complained: marked as spam, failed or simulated), a short reason, the status per recipient (one can bounce while the others are delivered) and the timeline with times.

Scope: `messages:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the email. |

#### 200 The email.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the email. sendEmail and sendEmailBatch in an app return it; getEmail(id) reads it back. |
| `app_id` (required) | string or null (uuid) | The app that sent it with env.HYPAMOON.sendEmail; null when it was sent with the API, by an agent or from the portal. |
| `from` (required) | string |  |
| `to` (required) | string | The first address in to. All recipients are in recipients. |
| `recipients` (required) | object | Everyone this email went to. After 90 days the addresses are masked, like s\*\*\*@example.org. |
| `recipient_count` (required) | integer | to, cc and bcc together; each counts toward the limits and the bundle. |
| `attachments` (required) | object\[\] | Name, type and size of each attachment. The content is never stored. |
| `reply_to` (required) | string or null |  |
| `message_id` (required) | string or null | The Message-ID header the recipient sees, once sent; null before that. Pass it in headers (In-Reply-To, References) to thread a follow-up. |
| `subject` (required) | string |  |
| `category` (required) | `"transactional"`, `"other"` |  |
| `status` (required) | `"queued"`, `"sent"`, `"delivered"`, `"bounced"`, `"complained"`, `"failed"`, `"simulated"` | queued, sent (accepted for delivery), delivered, bounced, complained (marked as spam), failed, or simulated (test mode). |
| `recipient_source` (required) | `"confirmed"`, `"member"`, `"form"`, `"document"`, `"conversation"`, `"app_user"`, `"buyer"`, `"pass_holder"`, `null` | Where the recipient appears in the project. |
| `test` (required) | boolean |  |
| `error` (required) | string or null |  |
| `reason` (required) | string or null | Why the email bounced, was marked as spam, is delayed or was not sent, in plain words. null otherwise. |
| `recipient_status` (required) | object\[\] | The status per recipient. With several recipients one can bounce while the others are delivered. |
| `timeline` (required) | object\[\] | Every step, oldest first: queued, then sent (or simulated, or failed), then what the recipient's mail server reported. |
| `created_at` (required) | string |  |
| `sent_at` (required) | string or null |  |
| `delivered_at` (required) | string or null |  |
| `bounced_at` (required) | string or null |  |
| `complained_at` (required) | string or null |  |
| `sender` | `"hypamoon_fallback"` | Only when the project has no verified sending domain of its own: the email went from Hypamoon's address ("<app or project> via Hypamoon"), in a neutral layout without the project's images or design. Tell the user so. |
| `next_step` | string | With sender hypamoon\_fallback: how to send from the project's own address with its own design. |

JSON

```
{
  "id": "7c1e2d3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
  "app_id": null,
  "from": "Acme Plumbing <hello@acmeplumbing.com>",
  "to": "sam@example.org",
  "recipients": {
    "to": [
      "sam@example.org"
    ],
    "cc": [],
    "bcc": []
  },
  "recipient_count": 1,
  "attachments": [
    {
      "filename": "quote.pdf",
      "content_type": "application/pdf",
      "size": 48213
    }
  ],
  "reply_to": "office@acmeplumbing.com",
  "message_id": "<0100019a2b3c4d5e-6f7a8b9c-0d1e-4f2a-9b3c-4d5e6f7a8b9c-000000@mail.acmeplumbing.com>",
  "subject": "We received your request",
  "category": "transactional",
  "status": "delivered",
  "recipient_source": "form",
  "test": false,
  "error": null,
  "reason": null,
  "recipient_status": [
    {
      "email": "sam@example.org",
      "field": "to",
      "status": "delivered",
      "reason": null,
      "updated_at": "2026-10-06T10:15:04.000Z"
    }
  ],
  "timeline": [
    {
      "status": "queued",
      "at": "2026-10-06T10:15:00.000Z",
      "recipient": null,
      "reason": null
    },
    {
      "status": "sent",
      "at": "2026-10-06T10:15:01.000Z",
      "recipient": null,
      "reason": null
    },
    {
      "status": "delivered",
      "at": "2026-10-06T10:15:04.000Z",
      "recipient": null,
      "reason": null
    }
  ],
  "created_at": "2026-10-06T10:15:00.000Z",
  "sent_at": "2026-10-06T10:15:01.000Z",
  "delivered_at": "2026-10-06T10:15:04.000Z",
  "bounced_at": null,
  "complained_at": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### GET /app-emails/{id}

**Get one email of an app (from the app).**

For an app's own server code only: await env.HYPAMOON.getEmail(id), with the id that sendEmail or sendEmailBatch returned. The same fields as GET /emails/{id}. An email of another app or of the API is not found.

Scope: `data:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the email. |

#### 200 The email.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the email. sendEmail and sendEmailBatch in an app return it; getEmail(id) reads it back. |
| `app_id` (required) | string or null (uuid) | The app that sent it with env.HYPAMOON.sendEmail; null when it was sent with the API, by an agent or from the portal. |
| `from` (required) | string |  |
| `to` (required) | string | The first address in to. All recipients are in recipients. |
| `recipients` (required) | object | Everyone this email went to. After 90 days the addresses are masked, like s\*\*\*@example.org. |
| `recipient_count` (required) | integer | to, cc and bcc together; each counts toward the limits and the bundle. |
| `attachments` (required) | object\[\] | Name, type and size of each attachment. The content is never stored. |
| `reply_to` (required) | string or null |  |
| `message_id` (required) | string or null | The Message-ID header the recipient sees, once sent; null before that. Pass it in headers (In-Reply-To, References) to thread a follow-up. |
| `subject` (required) | string |  |
| `category` (required) | `"transactional"`, `"other"` |  |
| `status` (required) | `"queued"`, `"sent"`, `"delivered"`, `"bounced"`, `"complained"`, `"failed"`, `"simulated"` | queued, sent (accepted for delivery), delivered, bounced, complained (marked as spam), failed, or simulated (test mode). |
| `recipient_source` (required) | `"confirmed"`, `"member"`, `"form"`, `"document"`, `"conversation"`, `"app_user"`, `"buyer"`, `"pass_holder"`, `null` | Where the recipient appears in the project. |
| `test` (required) | boolean |  |
| `error` (required) | string or null |  |
| `reason` (required) | string or null | Why the email bounced, was marked as spam, is delayed or was not sent, in plain words. null otherwise. |
| `recipient_status` (required) | object\[\] | The status per recipient. With several recipients one can bounce while the others are delivered. |
| `timeline` (required) | object\[\] | Every step, oldest first: queued, then sent (or simulated, or failed), then what the recipient's mail server reported. |
| `created_at` (required) | string |  |
| `sent_at` (required) | string or null |  |
| `delivered_at` (required) | string or null |  |
| `bounced_at` (required) | string or null |  |
| `complained_at` (required) | string or null |  |
| `sender` | `"hypamoon_fallback"` | Only when the project has no verified sending domain of its own: the email went from Hypamoon's address ("<app or project> via Hypamoon"), in a neutral layout without the project's images or design. Tell the user so. |
| `next_step` | string | With sender hypamoon\_fallback: how to send from the project's own address with its own design. |

JSON

```
{
  "id": "7c1e2d3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
  "app_id": "5a4b3c2d-1e0f-4a9b-8c7d-6e5f4a3b2c1d",
  "from": "noreply@acmeplumbing.com",
  "to": "sam@example.org",
  "recipients": {
    "to": [
      "sam@example.org"
    ],
    "cc": [],
    "bcc": []
  },
  "recipient_count": 1,
  "attachments": [],
  "reply_to": null,
  "message_id": "<0100019a2b3c4d5e-6f7a8b9c-0d1e-4f2a-9b3c-4d5e6f7a8b9c-000000@mail.acmeplumbing.com>",
  "subject": "Your hours for week 41 are approved",
  "category": "transactional",
  "status": "delivered",
  "recipient_source": "form",
  "test": false,
  "error": null,
  "reason": null,
  "recipient_status": [
    {
      "email": "sam@example.org",
      "field": "to",
      "status": "delivered",
      "reason": null,
      "updated_at": "2026-10-06T10:15:04.000Z"
    }
  ],
  "timeline": [
    {
      "status": "queued",
      "at": "2026-10-06T10:15:00.000Z",
      "recipient": null,
      "reason": null
    },
    {
      "status": "sent",
      "at": "2026-10-06T10:15:01.000Z",
      "recipient": null,
      "reason": null
    },
    {
      "status": "delivered",
      "at": "2026-10-06T10:15:04.000Z",
      "recipient": null,
      "reason": null
    }
  ],
  "created_at": "2026-10-06T10:15:00.000Z",
  "sent_at": "2026-10-06T10:15:01.000Z",
  "delivered_at": "2026-10-06T10:15:04.000Z",
  "bounced_at": null,
  "complained_at": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### GET /email-domains

**List sending domains.**

The project's sending domains with their status and DNS records.

Scope: `sites:read`

#### 200 The sending domains.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] |  |

JSON

```
{
  "data": [
    {
      "id": "8d2f3e4a-5b6c-4d7e-8f9a-0b1c2d3e4f5a",
      "domain": "acmeplumbing.com",
      "status": "pending",
      "test": false,
      "dns": "managed",
      "records": [
        {
          "type": "MX",
          "name": "send.acmeplumbing.com",
          "value": "feedback-smtp.example.net",
          "priority": 10,
          "state": "set"
        },
        {
          "type": "TXT",
          "name": "send.acmeplumbing.com",
          "value": "v=spf1 include:spf.example.net ~all",
          "state": "set"
        },
        {
          "type": "TXT",
          "name": "mail._domainkey.acmeplumbing.com",
          "value": "p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC...",
          "state": "set"
        }
      ],
      "dmarc_suggestion": {
        "type": "TXT",
        "name": "_dmarc.acmeplumbing.com",
        "value": "v=DMARC1; p=none;"
      },
      "next_step": "The records are set. Call verify_email_domain in a few minutes; verification usually takes minutes, sometimes up to a few hours.",
      "checked_at": null,
      "verified_at": null,
      "created_at": "2026-10-06T10:00:00.000Z"
    }
  ]
}
```

### POST /email-domains

**Add a sending domain.**

Makes one of this project's domains (connected or purchased) a sending domain. When its DNS is hosted here, we add the records ourselves: an existing SPF record is merged (never a second one), an MX record of the user's mailbox is never touched, and nothing is deleted, so the user's mail keeps working. When the user manages DNS elsewhere, records lists what they need to add there (state add\_yourself). A DMARC record is only suggested when there is none. Then call verify\_email\_domain. Adding the same domain again returns the existing one.

Scope: `sites:write`

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `domain` (required) | string | A domain of this project (connected with connect\_domain or bought with register\_domain), like example.com. |

JSON

```
{
  "domain": "acmeplumbing.com"
}
```

#### 200 Already a sending domain of this project.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `domain` (required) | string |  |
| `status` (required) | `"pending"`, `"verified"`, `"failed"` |  |
| `test` (required) | boolean |  |
| `dns` (required) | `"managed"`, `"manual"` | managed: the domain's DNS is here and we set the records; manual: the user adds them at their own DNS provider. |
| `records` (required) | object\[\] |  |
| `dmarc_suggestion` (required) | object or null | Only when the domain has no DMARC record yet. A suggestion; we never set it ourselves. |
| `next_step` (required) | string |  |
| `checked_at` (required) | string or null |  |
| `verified_at` (required) | string or null |  |
| `created_at` (required) | string |  |

JSON

```
{
  "id": "8d2f3e4a-5b6c-4d7e-8f9a-0b1c2d3e4f5a",
  "domain": "acmeplumbing.com",
  "status": "pending",
  "test": false,
  "dns": "managed",
  "records": [
    {
      "type": "MX",
      "name": "send.acmeplumbing.com",
      "value": "feedback-smtp.example.net",
      "priority": 10,
      "state": "set"
    },
    {
      "type": "TXT",
      "name": "send.acmeplumbing.com",
      "value": "v=spf1 include:spf.example.net ~all",
      "state": "set"
    },
    {
      "type": "TXT",
      "name": "mail._domainkey.acmeplumbing.com",
      "value": "p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC...",
      "state": "set"
    }
  ],
  "dmarc_suggestion": {
    "type": "TXT",
    "name": "_dmarc.acmeplumbing.com",
    "value": "v=DMARC1; p=none;"
  },
  "next_step": "The records are set. Call verify_email_domain in a few minutes; verification usually takes minutes, sometimes up to a few hours.",
  "checked_at": null,
  "verified_at": null,
  "created_at": "2026-10-06T10:00:00.000Z"
}
```

#### 201 The sending domain, with its records.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `domain` (required) | string |  |
| `status` (required) | `"pending"`, `"verified"`, `"failed"` |  |
| `test` (required) | boolean |  |
| `dns` (required) | `"managed"`, `"manual"` | managed: the domain's DNS is here and we set the records; manual: the user adds them at their own DNS provider. |
| `records` (required) | object\[\] |  |
| `dmarc_suggestion` (required) | object or null | Only when the domain has no DMARC record yet. A suggestion; we never set it ourselves. |
| `next_step` (required) | string |  |
| `checked_at` (required) | string or null |  |
| `verified_at` (required) | string or null |  |
| `created_at` (required) | string |  |

JSON

```
{
  "id": "8d2f3e4a-5b6c-4d7e-8f9a-0b1c2d3e4f5a",
  "domain": "acmeplumbing.com",
  "status": "pending",
  "test": false,
  "dns": "managed",
  "records": [
    {
      "type": "MX",
      "name": "send.acmeplumbing.com",
      "value": "feedback-smtp.example.net",
      "priority": 10,
      "state": "set"
    },
    {
      "type": "TXT",
      "name": "send.acmeplumbing.com",
      "value": "v=spf1 include:spf.example.net ~all",
      "state": "set"
    },
    {
      "type": "TXT",
      "name": "mail._domainkey.acmeplumbing.com",
      "value": "p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC...",
      "state": "set"
    }
  ],
  "dmarc_suggestion": {
    "type": "TXT",
    "name": "_dmarc.acmeplumbing.com",
    "value": "v=DMARC1; p=none;"
  },
  "next_step": "The records are set. Call verify_email_domain in a few minutes; verification usually takes minutes, sometimes up to a few hours.",
  "checked_at": null,
  "verified_at": null,
  "created_at": "2026-10-06T10:00:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`mail_not_enabled`](https://hypamoon.com/docs/errors/mail_not_enabled) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 502 | [`upstream_error`](https://hypamoon.com/docs/errors/upstream_error) |

### GET /email-domains/{id}

**Get a sending domain.**

One sending domain with its records and the status of the last check. Read-only; verify\_email\_domain runs a new check.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the sending domain. |

#### 200 The sending domain.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `domain` (required) | string |  |
| `status` (required) | `"pending"`, `"verified"`, `"failed"` |  |
| `test` (required) | boolean |  |
| `dns` (required) | `"managed"`, `"manual"` | managed: the domain's DNS is here and we set the records; manual: the user adds them at their own DNS provider. |
| `records` (required) | object\[\] |  |
| `dmarc_suggestion` (required) | object or null | Only when the domain has no DMARC record yet. A suggestion; we never set it ourselves. |
| `next_step` (required) | string |  |
| `checked_at` (required) | string or null |  |
| `verified_at` (required) | string or null |  |
| `created_at` (required) | string |  |

JSON

```
{
  "id": "8d2f3e4a-5b6c-4d7e-8f9a-0b1c2d3e4f5a",
  "domain": "acmeplumbing.com",
  "status": "pending",
  "test": false,
  "dns": "managed",
  "records": [
    {
      "type": "MX",
      "name": "send.acmeplumbing.com",
      "value": "feedback-smtp.example.net",
      "priority": 10,
      "state": "set"
    },
    {
      "type": "TXT",
      "name": "send.acmeplumbing.com",
      "value": "v=spf1 include:spf.example.net ~all",
      "state": "set"
    },
    {
      "type": "TXT",
      "name": "mail._domainkey.acmeplumbing.com",
      "value": "p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC...",
      "state": "set"
    }
  ],
  "dmarc_suggestion": {
    "type": "TXT",
    "name": "_dmarc.acmeplumbing.com",
    "value": "v=DMARC1; p=none;"
  },
  "next_step": "The records are set. Call verify_email_domain in a few minutes; verification usually takes minutes, sometimes up to a few hours.",
  "checked_at": null,
  "verified_at": null,
  "created_at": "2026-10-06T10:00:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### DELETE /email-domains/{id}

**Remove a sending domain.**

Stops sending from this domain. The DNS records remain (they do no harm); the domain itself stays connected.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the sending domain. |

#### 200 Removed.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `deleted` (required) | `true` |  |

JSON

```
{
  "id": "8d2f3e4a-5b6c-4d7e-8f9a-0b1c2d3e4f5a",
  "deleted": true
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 502 | [`upstream_error`](https://hypamoon.com/docs/errors/upstream_error) |

### POST /email-domains/{id}/verify

**Check a sending domain now.**

Checks the DNS records of the sending domain now and returns the new status: pending, verified or failed. At most 10 checks per minute per domain.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the sending domain. |

#### 200 The sending domain after the check.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `domain` (required) | string |  |
| `status` (required) | `"pending"`, `"verified"`, `"failed"` |  |
| `test` (required) | boolean |  |
| `dns` (required) | `"managed"`, `"manual"` | managed: the domain's DNS is here and we set the records; manual: the user adds them at their own DNS provider. |
| `records` (required) | object\[\] |  |
| `dmarc_suggestion` (required) | object or null | Only when the domain has no DMARC record yet. A suggestion; we never set it ourselves. |
| `next_step` (required) | string |  |
| `checked_at` (required) | string or null |  |
| `verified_at` (required) | string or null |  |
| `created_at` (required) | string |  |

JSON

```
{
  "id": "8d2f3e4a-5b6c-4d7e-8f9a-0b1c2d3e4f5a",
  "domain": "acmeplumbing.com",
  "status": "verified",
  "test": false,
  "dns": "managed",
  "records": [
    {
      "type": "MX",
      "name": "send.acmeplumbing.com",
      "value": "feedback-smtp.example.net",
      "priority": 10,
      "state": "set"
    },
    {
      "type": "TXT",
      "name": "send.acmeplumbing.com",
      "value": "v=spf1 include:spf.example.net ~all",
      "state": "set"
    },
    {
      "type": "TXT",
      "name": "mail._domainkey.acmeplumbing.com",
      "value": "p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC...",
      "state": "set"
    }
  ],
  "dmarc_suggestion": {
    "type": "TXT",
    "name": "_dmarc.acmeplumbing.com",
    "value": "v=DMARC1; p=none;"
  },
  "next_step": "The records are set. Call verify_email_domain in a few minutes; verification usually takes minutes, sometimes up to a few hours.",
  "checked_at": "2026-10-06T10:05:00.000Z",
  "verified_at": "2026-10-06T10:05:00.000Z",
  "created_at": "2026-10-06T10:00:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 502 | [`upstream_error`](https://hypamoon.com/docs/errors/upstream_error) |

### POST /email-recipients

**Confirm a recipient (owner only).**

The owner confirms an address that does not appear in the project, so send\_email may use it. Only through a connection where the owner is signed in (a chat), or in the portal; an API key cannot. Ask the owner first and only pass an address they typed or confirmed. At most 20 a day.

Scope: `messages:write`

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `email` (required) | string | The address the owner confirmed they want to email. |

JSON

```
{
  "email": "sam@example.org"
}
```

#### 201 Confirmed.

| Field | Type |  |
| --- | --- | --- |
| `email` (required) | string |  |
| `allowed` (required) | `true` |  |

JSON

```
{
  "email": "sam@example.org",
  "allowed": true
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 429 | [`email_limit_reached`](https://hypamoon.com/docs/errors/email_limit_reached) |

### POST /email-recipients/check

**Check email addresses.**

Checks one address or up to 50 the way sending does before the first email to someone: the format, this project's suppression list (an earlier hard bounce or spam complaint, or an unsubscribe), likely typos of big mail domains (gmial.com), throwaway domains, and whether the domain exists and accepts email (MX, or an A record without MX). Sends nothing and stores nothing. Use it on addresses from a form or an import before sending. At most 30 calls per minute per project.

Scope: `messages:read`

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `email` | string | One address to check. |
| `emails` | string\[\] | Or a list of 1 to 50 addresses. |

JSON

```
{
  "emails": [
    "sam@example.org",
    "kim@gmial.com"
  ]
}
```

#### 200 One result per address, in the order sent.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] |  |

JSON

```
{
  "data": [
    {
      "email": "sam@example.org",
      "result": "valid",
      "code": "ok",
      "reason": "The address looks deliverable: its domain accepts email.",
      "suggestion": null,
      "would_send": {
        "transactional": true,
        "other": true
      }
    },
    {
      "email": "kim@gmial.com",
      "result": "invalid",
      "code": "likely_typo",
      "reason": "This looks like a typo in the domain. Did you mean kim@gmail.com?",
      "suggestion": "kim@gmail.com",
      "would_send": {
        "transactional": false,
        "other": false
      }
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /email-deliverability

**Get delivery per sending domain.**

Per sending domain over the last 7 and 30 days: emails sent, delivered, bounced and marked as spam, with the rates (counted per email). Mailboxes start filtering above 2% bounces or 0.1% spam complaints; health and advice say what to do in plain words. Opens are not measured. Also SPF and DKIM (pass once the domain is verified) and the DMARC record that is in the DNS now, and the state of a dedicated sending IP with its price. With a test key the numbers come from simulated test emails, so there is no delivery data. Read-only.

Scope: `messages:read`

#### 200 Delivery per sending domain.

| Field | Type |  |
| --- | --- | --- |
| `test` (required) | boolean | true with a test key: test emails are simulated, so there is no delivery data. |
| `thresholds` (required) | object |  |
| `opens_measured` (required) | `false` |  |
| `domains` (required) | object\[\] |  |
| `dedicated_ip` (required) | object or null |  |

JSON

```
{
  "test": false,
  "thresholds": {
    "bounce_rate": 0.02,
    "complaint_rate": 0.001
  },
  "opens_measured": false,
  "domains": [
    {
      "email_domain_id": "8d2f3e4a-5b6c-4d7e-8f9a-0b1c2d3e4f5a",
      "domain": "acmeplumbing.com",
      "status": "verified",
      "authentication": {
        "spf": "pass",
        "dkim": "pass",
        "dmarc": {
          "record": "v=DMARC1; p=none;",
          "policy": "none",
          "status": "monitoring"
        }
      },
      "last_7_days": {
        "sent": 120,
        "delivered": 119,
        "bounced": 1,
        "complained": 0,
        "opened": null,
        "bounce_rate": 0.0083,
        "complaint_rate": 0
      },
      "last_30_days": {
        "sent": 480,
        "delivered": 476,
        "bounced": 4,
        "complained": 0,
        "opened": null,
        "bounce_rate": 0.0083,
        "complaint_rate": 0
      },
      "health": "good",
      "advice": [
        "DMARC on acmeplumbing.com only monitors (p=none). Once your emails pass for a few weeks, move to p=quarantine; that is also needed for your logo in the inbox."
      ]
    }
  ],
  "dedicated_ip": {
    "status": "none",
    "requested_at": null,
    "emails_last_30_days": 480,
    "price": {
      "month_eur_per_ip": 49,
      "free": false,
      "text": "€49 a month per IP, excluding VAT, once we have set it up."
    },
    "advice": "A dedicated IP makes sense from about 100,000 emails a month with steady volume. Below that, an IP gets too little traffic to build its own reputation, and the shared pool usually delivers better.",
    "available": true,
    "reason": null
  }
}
```

### GET /email-domains/{id}/bimi

**Get the inbox logo (BIMI) of a sending domain.**

Whether the domain can show its logo next to emails in the inbox (BIMI): the DMARC policy (it must be quarantine or reject for all mail), the BIMI record at default.\_bimi, and the steps that are left. Gmail shows the logo only with a mark certificate (VMC or CMC) that the user gets from a certificate authority; Apple Mail only with a VMC; Yahoo can show it without a certificate for domains with a good sending reputation, but that is not guaranteed. Read-only.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the sending domain. |

#### 200 The logo settings of the domain.

| Field | Type |  |
| --- | --- | --- |
| `email_domain_id` (required) | string |  |
| `domain` (required) | string |  |
| `dmarc` (required) | object |  |
| `bimi` (required) | object |  |
| `ready` (required) | boolean |  |
| `dns_managed` (required) | boolean | The DNS is hosted here, so set\_email\_bimi sets the record itself. |
| `steps` (required) | string\[\] |  |
| `note` (required) | string | Which mailboxes show the logo, and what they need. |

JSON

```
{
  "email_domain_id": "8d2f3e4a-5b6c-4d7e-8f9a-0b1c2d3e4f5a",
  "domain": "acmeplumbing.com",
  "dmarc": {
    "record": "v=DMARC1; p=quarantine; rua=mailto:dmarc@acmeplumbing.com",
    "policy": "quarantine",
    "percentage": 100,
    "ok": true
  },
  "bimi": {
    "name": "default._bimi.acmeplumbing.com",
    "record": "v=BIMI1; l=https://acmeplumbing.com/logo.svg;",
    "logo_url": "https://acmeplumbing.com/logo.svg",
    "certificate_url": null
  },
  "ready": true,
  "dns_managed": true,
  "steps": [
    "For Gmail and Apple Mail, get a mark certificate (VMC or CMC) for the logo and add its address as certificate_url."
  ],
  "note": "Gmail shows the logo only with a mark certificate (VMC or CMC) that you get from a certificate authority yourself; Apple Mail only with a VMC. Yahoo can show it without a certificate for domains with a good sending reputation, but that is not guaranteed."
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### POST /email-domains/{id}/bimi

**Set the inbox logo (BIMI) of a sending domain.**

Sets the BIMI record default.\_bimi.<domain> with the logo (and the mark certificate, if the user has one). First checks that DMARC is quarantine or reject for all mail (otherwise bimi\_not\_ready; we never change DMARC ourselves) and that the logo is an SVG Tiny PS file mailboxes accept: version 1.2 with baseProfile tiny-ps, a `<title>`, square, no scripts or external files, at most 32 KB, on an https address without a redirect. When the domain's DNS is hosted here we set or update the record; otherwise record\_to\_add is the record to add at the DNS provider.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the sending domain. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `logo_url` (required) | string | The https address of your logo as an SVG Tiny PS file (square, with a <title>, at most 32 KB), for example on your own site. |
| `certificate_url` | string | Optional: the https address of your mark certificate (VMC or CMC, a .pem file). Gmail needs one; Apple Mail needs a VMC. |

JSON

```
{
  "logo_url": "https://acmeplumbing.com/logo.svg"
}
```

#### 200 The record is set (or record\_to\_add says what to add).

| Field | Type |  |
| --- | --- | --- |
| `email_domain_id` (required) | string |  |
| `domain` (required) | string |  |
| `dmarc` (required) | object |  |
| `bimi` (required) | object |  |
| `ready` (required) | boolean |  |
| `dns_managed` (required) | boolean | The DNS is hosted here, so set\_email\_bimi sets the record itself. |
| `steps` (required) | string\[\] |  |
| `note` (required) | string | Which mailboxes show the logo, and what they need. |
| `record_to_add` (required) | object or null | When the DNS is hosted elsewhere: the record to add there. Null when we set it. |

JSON

```
{
  "email_domain_id": "8d2f3e4a-5b6c-4d7e-8f9a-0b1c2d3e4f5a",
  "domain": "acmeplumbing.com",
  "dmarc": {
    "record": "v=DMARC1; p=quarantine; rua=mailto:dmarc@acmeplumbing.com",
    "policy": "quarantine",
    "percentage": 100,
    "ok": true
  },
  "bimi": {
    "name": "default._bimi.acmeplumbing.com",
    "record": "v=BIMI1; l=https://acmeplumbing.com/logo.svg;",
    "logo_url": "https://acmeplumbing.com/logo.svg",
    "certificate_url": null
  },
  "ready": true,
  "dns_managed": true,
  "steps": [
    "For Gmail and Apple Mail, get a mark certificate (VMC or CMC) for the logo and add its address as certificate_url."
  ],
  "note": "Gmail shows the logo only with a mark certificate (VMC or CMC) that you get from a certificate authority yourself; Apple Mail only with a VMC. Yahoo can show it without a certificate for domains with a good sending reputation, but that is not guaranteed.",
  "record_to_add": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`bimi_not_ready`](https://hypamoon.com/docs/errors/bimi_not_ready) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 502 | [`upstream_error`](https://hypamoon.com/docs/errors/upstream_error) |

### POST /email-dedicated-ip

**Request a dedicated sending IP.**

Asks Hypamoon to set up a dedicated IP address for this project's email. Available on the Team plan and higher, and on Enterprise, for €49 a month per IP, excluding VAT (shown in price before anyone requests; GET /email-deliverability has it too); otherwise dedicated\_ip\_not\_available. We set it up ourselves and get back to the owner; nothing changes until then. It makes sense from about 100,000 emails a month with steady volume; below that the shared pool usually delivers better. A second request while one is open returns that one.

Scope: `messages:write`

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `note` | string | Optional: anything we should know, like expected volume. |

JSON

```
{
  "note": "We send about 150,000 order emails a month."
}
```

#### 200 Already requested: the open request.

| Field | Type |  |
| --- | --- | --- |
| `status` (required) | `"none"`, `"requested"`, `"active"`, `"declined"` |  |
| `requested_at` (required) | string or null |  |
| `emails_last_30_days` (required) | integer |  |
| `price` (required) | object | Per IP per month, excluding VAT; free for founder projects. |
| `advice` (required) | string |  |
| `available` (required) | boolean | Whether this project can request one (Business and Enterprise). |
| `reason` (required) | string or null |  |

JSON

```
{
  "status": "requested",
  "requested_at": "2026-10-15T12:00:00.000Z",
  "emails_last_30_days": 142300,
  "price": {
    "month_eur_per_ip": 49,
    "free": false,
    "text": "€49 a month per IP, excluding VAT, once we have set it up."
  },
  "advice": "A dedicated IP makes sense from about 100,000 emails a month with steady volume. Below that, an IP gets too little traffic to build its own reputation, and the shared pool usually delivers better.",
  "available": true,
  "reason": null
}
```

#### 201 Requested.

| Field | Type |  |
| --- | --- | --- |
| `status` (required) | `"none"`, `"requested"`, `"active"`, `"declined"` |  |
| `requested_at` (required) | string or null |  |
| `emails_last_30_days` (required) | integer |  |
| `price` (required) | object | Per IP per month, excluding VAT; free for founder projects. |
| `advice` (required) | string |  |
| `available` (required) | boolean | Whether this project can request one (Business and Enterprise). |
| `reason` (required) | string or null |  |

JSON

```
{
  "status": "requested",
  "requested_at": "2026-10-15T12:00:00.000Z",
  "emails_last_30_days": 142300,
  "price": {
    "month_eur_per_ip": 49,
    "free": false,
    "text": "€49 a month per IP, excluding VAT, once we have set it up."
  },
  "advice": "A dedicated IP makes sense from about 100,000 emails a month with steady volume. Below that, an IP gets too little traffic to build its own reputation, and the shared pool usually delivers better.",
  "available": true,
  "reason": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`dedicated_ip_not_available`](https://hypamoon.com/docs/errors/dedicated_ip_not_available) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /inbound-addresses

**List inbound addresses.**

The addresses where the project receives email, with their state (pending until the MX record is in place, then active), the MX record and the retention.

Scope: `messages:read`

#### 200 The addresses.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] |  |

JSON

```
{
  "data": [
    {
      "id": "3c4d5e6f-7081-4b92-a3b4-c5d6e7f8091a",
      "email": "support@in.acmeplumbing.com",
      "local_part": "support",
      "domain": "in.acmeplumbing.com",
      "receive_on": "subdomain",
      "app_id": null,
      "retention_days": 30,
      "status": "pending",
      "records": [
        {
          "type": "MX",
          "name": "in.acmeplumbing.com",
          "value": "inbound.example.net",
          "priority": 10,
          "state": "set"
        }
      ],
      "next_step": "The MX record is set. Email starts arriving within minutes; list_inbound_addresses shows when it is active.",
      "created_at": "2026-10-15T10:00:00.000Z"
    }
  ]
}
```

### POST /inbound-addresses

**Receive email on an address.**

Receive email on support@, requests@ or every address (\*) of one of the project's domains. The domain must use Hypamoon's nameservers; answering also needs it as a verified sending domain. By default the address is on in.<domain> ([support@in.acme.com](mailto:support@in.acme.com)), so a mailbox the user already has on the domain keeps working; subdomain picks your own ([receipts@ai.acme.com](mailto:receipts@ai.acme.com)), and is refused when that subdomain already has records of its own. receive\_on root uses the domain itself, and is refused when the domain already receives email elsewhere. When the domain's DNS is hosted here the MX record is set for you; otherwise records says what to add. Received email is kept for retention\_days (default 30), then deleted with its attachments. Programs, scripts, Office files with macros and archives that cannot be checked are never passed on; email marked as virus is dropped, spam is kept with spam: true.

Scope: `messages:write`

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `local_part` (required) | string | The part before the @, like support or requests, or \* for every address on the domain (catch-all). |
| `domain` (required) | string | A domain of this project on Hypamoon's nameservers, like acme.com. |
| `receive_on` | `"subdomain"`, `"root"`, `"auto"` | subdomain (default): receive on a subdomain (in.<domain>, or the one in subdomain), so a mailbox the user already has on the domain keeps working. root: receive on the domain itself; refused when the domain already receives email elsewhere. auto: root when the domain has no mail yet, otherwise in.<domain>. |
| `subdomain` | string | Optional. The subdomain to receive on, one label like ai or receipts (default in): [receipts@ai.acme.com](mailto:receipts@ai.acme.com) while the normal mailbox stays on acme.com. Letters, digits and dashes, 1 to 40 characters. Refused when that subdomain already has records of its own (a website, a CNAME, another mail service) or is reserved (www, mail, autodiscover and the like). One domain can have several subdomains. |
| `app_id` | string (uuid) | Optional. The app this address belongs to; its emails are then listed under that app. |
| `retention_days` | integer | How long received emails and their attachments are kept, 1 to 365 days (default 30). |

JSON

```
{
  "local_part": "support",
  "domain": "acmeplumbing.com"
}
```

#### 200 This address already existed.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `email` (required) | string | The address that receives, like [support@in.acme.com](mailto:support@in.acme.com) (or \*@in.acme.com). |
| `local_part` (required) | string |  |
| `domain` (required) | string | The domain that receives: in.<domain> or the domain itself. |
| `receive_on` (required) | `"subdomain"`, `"root"` |  |
| `app_id` (required) | string or null (uuid) |  |
| `retention_days` (required) | integer |  |
| `status` (required) | `"pending"`, `"active"` | pending: waiting for the MX record. active: email arrives. |
| `records` (required) | object\[\] |  |
| `next_step` (required) | string or null |  |
| `created_at` (required) | string |  |

JSON

```
{
  "id": "3c4d5e6f-7081-4b92-a3b4-c5d6e7f8091a",
  "email": "support@in.acmeplumbing.com",
  "local_part": "support",
  "domain": "in.acmeplumbing.com",
  "receive_on": "subdomain",
  "app_id": null,
  "retention_days": 30,
  "status": "pending",
  "records": [
    {
      "type": "MX",
      "name": "in.acmeplumbing.com",
      "value": "inbound.example.net",
      "priority": 10,
      "state": "set"
    }
  ],
  "next_step": "The MX record is set. Email starts arriving within minutes; list_inbound_addresses shows when it is active.",
  "created_at": "2026-10-15T10:00:00.000Z"
}
```

#### 201 The address, with the MX record.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `email` (required) | string | The address that receives, like [support@in.acme.com](mailto:support@in.acme.com) (or \*@in.acme.com). |
| `local_part` (required) | string |  |
| `domain` (required) | string | The domain that receives: in.<domain> or the domain itself. |
| `receive_on` (required) | `"subdomain"`, `"root"` |  |
| `app_id` (required) | string or null (uuid) |  |
| `retention_days` (required) | integer |  |
| `status` (required) | `"pending"`, `"active"` | pending: waiting for the MX record. active: email arrives. |
| `records` (required) | object\[\] |  |
| `next_step` (required) | string or null |  |
| `created_at` (required) | string |  |

JSON

```
{
  "id": "3c4d5e6f-7081-4b92-a3b4-c5d6e7f8091a",
  "email": "support@in.acmeplumbing.com",
  "local_part": "support",
  "domain": "in.acmeplumbing.com",
  "receive_on": "subdomain",
  "app_id": null,
  "retention_days": 30,
  "status": "pending",
  "records": [
    {
      "type": "MX",
      "name": "in.acmeplumbing.com",
      "value": "inbound.example.net",
      "priority": 10,
      "state": "set"
    }
  ],
  "next_step": "The MX record is set. Email starts arriving within minutes; list_inbound_addresses shows when it is active.",
  "created_at": "2026-10-15T10:00:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 409 | [`email_domain_not_verified`](https://hypamoon.com/docs/errors/email_domain_not_verified) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### DELETE /inbound-addresses/{id}

**Stop receiving on an address.**

The address stops receiving. Email that already arrived stays until its retention ends.

Scope: `messages:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the inbound address. |

#### 200 Removed.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `deleted` (required) | `true` |  |

JSON

```
{
  "id": "3c4d5e6f-7081-4b92-a3b4-c5d6e7f8091a",
  "deleted": true
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### GET /inbound-emails

**List received emails.**

Email the project received, newest first, without the body (GET /inbound-emails/{id} has it). Spam is left out unless include\_spam is true. Filter on app\_id, address\_id, from (also for a request to see someone's data) and since.

Scope: `messages:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `limit` | query | integer | Emails per page, 1 to 100. |
| `cursor` | query | string | The next\_cursor of the previous page. |
| `app_id` | query | string (uuid) | Only email for addresses of this app. |
| `address_id` | query | string (uuid) | Only email for this inbound address. |
| `from` | query | string | Only email from this sender. |
| `since` | query | string (date-time) | Only email received at or after this moment. |
| `include_spam` | query | boolean | Also list email marked as spam. |

#### 200 The emails.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] |  |
| `next_cursor` (required) | string or null |  |

JSON

```
{
  "data": [
    {
      "id": "4d5e6f70-8192-4ca3-b4c5-d6e7f8091a2b",
      "address_id": "3c4d5e6f-7081-4b92-a3b4-c5d6e7f8091a",
      "app_id": null,
      "to": "support@in.acmeplumbing.com",
      "from": {
        "email": "sam@example.org",
        "name": "Sam de Vries"
      },
      "cc": [],
      "subject": "Leaking tap in the kitchen",
      "text": null,
      "html": null,
      "attachments": [
        {
          "index": 0,
          "filename": "tap.jpg",
          "content_type": "image/jpeg",
          "size": 184220,
          "download_url": null
        }
      ],
      "blocked_attachments": [],
      "spam": false,
      "message_id": "<CAB123@mail.example.org>",
      "in_reply_to": null,
      "received_at": "2026-10-15T10:12:00.000Z",
      "expires_at": "2026-11-14T10:12:00.000Z",
      "replied_email_id": null
    }
  ],
  "next_cursor": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_parameter`](https://hypamoon.com/docs/errors/invalid_parameter) |

### DELETE /inbound-emails

**Delete all email from one sender.**

Deletes every received email from this sender, with its attachments: for a request to erase someone's data. Cannot be undone.

Scope: `messages:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `from` (required) | query | string | The sender's email address. |

#### 200 How many were deleted.

| Field | Type |  |
| --- | --- | --- |
| `from` (required) | string |  |
| `deleted` (required) | integer |  |

JSON

```
{
  "from": "sam@example.org",
  "deleted": 3
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_parameter`](https://hypamoon.com/docs/errors/invalid_parameter) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /inbound-emails/{id}

**Get a received email.**

One received email with its text, its HTML (as sent: sanitize before showing it) and a download link per attachment, valid for one hour.

Scope: `messages:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the inbound email. |

#### 200 The email.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `address_id` (required) | string or null (uuid) |  |
| `app_id` (required) | string or null (uuid) |  |
| `to` (required) | string | The address it was sent to. |
| `from` (required) | object |  |
| `cc` (required) | string\[\] |  |
| `subject` (required) | string |  |
| `text` (required) | string or null | The plain text body. Only on get\_inbound\_email. |
| `html` (required) | string or null | The HTML body as sent; never render it without sanitizing. Only on get\_inbound\_email. |
| `attachments` (required) | object\[\] |  |
| `blocked_attachments` (required) | object\[\] | Attachments that were not passed on (programs, scripts, macros, archives that cannot be checked). |
| `spam` (required) | boolean | Marked as spam on arrival. Spam is not sent to webhooks and cannot be answered. |
| `message_id` (required) | string or null |  |
| `in_reply_to` (required) | string or null |  |
| `received_at` (required) | string |  |
| `expires_at` (required) | string | When it is deleted, with its attachments (the retention of its address). |
| `replied_email_id` (required) | string or null (uuid) | The email sent with answer\_inbound\_email, if any. |

JSON

```
{
  "id": "4d5e6f70-8192-4ca3-b4c5-d6e7f8091a2b",
  "address_id": "3c4d5e6f-7081-4b92-a3b4-c5d6e7f8091a",
  "app_id": null,
  "to": "support@in.acmeplumbing.com",
  "from": {
    "email": "sam@example.org",
    "name": "Sam de Vries"
  },
  "cc": [],
  "subject": "Leaking tap in the kitchen",
  "text": "Hi, my kitchen tap is leaking. Can someone come by this week? Photo attached.",
  "html": null,
  "attachments": [
    {
      "index": 0,
      "filename": "tap.jpg",
      "content_type": "image/jpeg",
      "size": 184220,
      "download_url": "https://files.example.net/tap.jpg?token=..."
    }
  ],
  "blocked_attachments": [],
  "spam": false,
  "message_id": "<CAB123@mail.example.org>",
  "in_reply_to": null,
  "received_at": "2026-10-15T10:12:00.000Z",
  "expires_at": "2026-11-14T10:12:00.000Z",
  "replied_email_id": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### DELETE /inbound-emails/{id}

**Delete a received email.**

Deletes this email and its attachments now, before its retention ends. Cannot be undone.

Scope: `messages:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the inbound email. |

#### 200 Deleted.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `deleted` (required) | `true` |  |

JSON

```
{
  "id": "4d5e6f70-8192-4ca3-b4c5-d6e7f8091a2b",
  "deleted": true
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### POST /inbound-emails/{id}/reply

**Reply to a received email.**

Sends a reply to the sender, in the same thread (In-Reply-To and References), through the normal sending with the same rules, limits and bundle as POST /emails. From defaults to the address it was sent to, on the verified sending domain ([support@in.acme.com](mailto:support@in.acme.com) replies from [support@acme.com](mailto:support@acme.com)), with reply\_to on the inbound address so the answer comes back here. The subject gets Re:. Spam cannot be answered. An Idempotency-Key returns the same reply instead of a second one.

Scope: `messages:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the inbound email. |
| `Idempotency-Key` | header | string | Optional. The same key returns the same reply. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `from` | string | Optional. The sender; default the address it was sent to, on the verified sending domain ([support@in.acme.com](mailto:support@in.acme.com) answers from [support@acme.com](mailto:support@acme.com)). |
| `text` | string | The plain text reply. Send text, html or both. |
| `html` | string | The HTML reply. |
| `attachments` | object\[\] | Optional attachments, as in send\_email. |
| `idempotency_key` | string | Optional. The same key returns the same reply instead of a second one. |

JSON

```
{
  "text": "Hi Sam, we can come by on Thursday between 9 and 12. Does that work for you?"
}
```

#### 200 The same Idempotency-Key as before: the original reply.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the email. sendEmail and sendEmailBatch in an app return it; getEmail(id) reads it back. |
| `app_id` (required) | string or null (uuid) | The app that sent it with env.HYPAMOON.sendEmail; null when it was sent with the API, by an agent or from the portal. |
| `from` (required) | string |  |
| `to` (required) | string | The first address in to. All recipients are in recipients. |
| `recipients` (required) | object | Everyone this email went to. After 90 days the addresses are masked, like s\*\*\*@example.org. |
| `recipient_count` (required) | integer | to, cc and bcc together; each counts toward the limits and the bundle. |
| `attachments` (required) | object\[\] | Name, type and size of each attachment. The content is never stored. |
| `reply_to` (required) | string or null |  |
| `message_id` (required) | string or null | The Message-ID header the recipient sees, once sent; null before that. Pass it in headers (In-Reply-To, References) to thread a follow-up. |
| `subject` (required) | string |  |
| `category` (required) | `"transactional"`, `"other"` |  |
| `status` (required) | `"queued"`, `"sent"`, `"delivered"`, `"bounced"`, `"complained"`, `"failed"`, `"simulated"` | queued, sent (accepted for delivery), delivered, bounced, complained (marked as spam), failed, or simulated (test mode). |
| `recipient_source` (required) | `"confirmed"`, `"member"`, `"form"`, `"document"`, `"conversation"`, `"app_user"`, `"buyer"`, `"pass_holder"`, `null` | Where the recipient appears in the project. |
| `test` (required) | boolean |  |
| `error` (required) | string or null |  |
| `reason` (required) | string or null | Why the email bounced, was marked as spam, is delayed or was not sent, in plain words. null otherwise. |
| `recipient_status` (required) | object\[\] | The status per recipient. With several recipients one can bounce while the others are delivered. |
| `timeline` (required) | object\[\] | Every step, oldest first: queued, then sent (or simulated, or failed), then what the recipient's mail server reported. |
| `created_at` (required) | string |  |
| `sent_at` (required) | string or null |  |
| `delivered_at` (required) | string or null |  |
| `bounced_at` (required) | string or null |  |
| `complained_at` (required) | string or null |  |
| `sender` | `"hypamoon_fallback"` | Only when the project has no verified sending domain of its own: the email went from Hypamoon's address ("<app or project> via Hypamoon"), in a neutral layout without the project's images or design. Tell the user so. |
| `next_step` | string | With sender hypamoon\_fallback: how to send from the project's own address with its own design. |

JSON

```
{
  "id": "7c1e2d3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
  "app_id": null,
  "from": "Acme Plumbing <hello@acmeplumbing.com>",
  "to": "sam@example.org",
  "recipients": {
    "to": [
      "sam@example.org"
    ],
    "cc": [],
    "bcc": []
  },
  "recipient_count": 1,
  "attachments": [],
  "reply_to": "office@acmeplumbing.com",
  "message_id": "<0100019a2b3c4d5e-6f7a8b9c-0d1e-4f2a-9b3c-4d5e6f7a8b9c-000000@mail.acmeplumbing.com>",
  "subject": "Re: Leaking tap in the kitchen",
  "category": "transactional",
  "status": "sent",
  "recipient_source": "form",
  "test": false,
  "error": null,
  "reason": null,
  "recipient_status": [
    {
      "email": "sam@example.org",
      "field": "to",
      "status": "sent",
      "reason": null,
      "updated_at": "2026-10-06T10:15:01.000Z"
    }
  ],
  "timeline": [
    {
      "status": "queued",
      "at": "2026-10-06T10:15:00.000Z",
      "recipient": null,
      "reason": null
    },
    {
      "status": "sent",
      "at": "2026-10-06T10:15:01.000Z",
      "recipient": null,
      "reason": null
    }
  ],
  "created_at": "2026-10-06T10:15:00.000Z",
  "sent_at": "2026-10-06T10:15:01.000Z",
  "delivered_at": null,
  "bounced_at": null,
  "complained_at": null
}
```

#### 201 The reply, accepted for delivery (or simulated with a test key).

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the email. sendEmail and sendEmailBatch in an app return it; getEmail(id) reads it back. |
| `app_id` (required) | string or null (uuid) | The app that sent it with env.HYPAMOON.sendEmail; null when it was sent with the API, by an agent or from the portal. |
| `from` (required) | string |  |
| `to` (required) | string | The first address in to. All recipients are in recipients. |
| `recipients` (required) | object | Everyone this email went to. After 90 days the addresses are masked, like s\*\*\*@example.org. |
| `recipient_count` (required) | integer | to, cc and bcc together; each counts toward the limits and the bundle. |
| `attachments` (required) | object\[\] | Name, type and size of each attachment. The content is never stored. |
| `reply_to` (required) | string or null |  |
| `message_id` (required) | string or null | The Message-ID header the recipient sees, once sent; null before that. Pass it in headers (In-Reply-To, References) to thread a follow-up. |
| `subject` (required) | string |  |
| `category` (required) | `"transactional"`, `"other"` |  |
| `status` (required) | `"queued"`, `"sent"`, `"delivered"`, `"bounced"`, `"complained"`, `"failed"`, `"simulated"` | queued, sent (accepted for delivery), delivered, bounced, complained (marked as spam), failed, or simulated (test mode). |
| `recipient_source` (required) | `"confirmed"`, `"member"`, `"form"`, `"document"`, `"conversation"`, `"app_user"`, `"buyer"`, `"pass_holder"`, `null` | Where the recipient appears in the project. |
| `test` (required) | boolean |  |
| `error` (required) | string or null |  |
| `reason` (required) | string or null | Why the email bounced, was marked as spam, is delayed or was not sent, in plain words. null otherwise. |
| `recipient_status` (required) | object\[\] | The status per recipient. With several recipients one can bounce while the others are delivered. |
| `timeline` (required) | object\[\] | Every step, oldest first: queued, then sent (or simulated, or failed), then what the recipient's mail server reported. |
| `created_at` (required) | string |  |
| `sent_at` (required) | string or null |  |
| `delivered_at` (required) | string or null |  |
| `bounced_at` (required) | string or null |  |
| `complained_at` (required) | string or null |  |
| `sender` | `"hypamoon_fallback"` | Only when the project has no verified sending domain of its own: the email went from Hypamoon's address ("<app or project> via Hypamoon"), in a neutral layout without the project's images or design. Tell the user so. |
| `next_step` | string | With sender hypamoon\_fallback: how to send from the project's own address with its own design. |

JSON

```
{
  "id": "7c1e2d3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
  "app_id": null,
  "from": "Acme Plumbing <hello@acmeplumbing.com>",
  "to": "sam@example.org",
  "recipients": {
    "to": [
      "sam@example.org"
    ],
    "cc": [],
    "bcc": []
  },
  "recipient_count": 1,
  "attachments": [],
  "reply_to": "office@acmeplumbing.com",
  "message_id": "<0100019a2b3c4d5e-6f7a8b9c-0d1e-4f2a-9b3c-4d5e6f7a8b9c-000000@mail.acmeplumbing.com>",
  "subject": "Re: Leaking tap in the kitchen",
  "category": "transactional",
  "status": "sent",
  "recipient_source": "form",
  "test": false,
  "error": null,
  "reason": null,
  "recipient_status": [
    {
      "email": "sam@example.org",
      "field": "to",
      "status": "sent",
      "reason": null,
      "updated_at": "2026-10-06T10:15:01.000Z"
    }
  ],
  "timeline": [
    {
      "status": "queued",
      "at": "2026-10-06T10:15:00.000Z",
      "recipient": null,
      "reason": null
    },
    {
      "status": "sent",
      "at": "2026-10-06T10:15:01.000Z",
      "recipient": null,
      "reason": null
    }
  ],
  "created_at": "2026-10-06T10:15:00.000Z",
  "sent_at": "2026-10-06T10:15:01.000Z",
  "delivered_at": null,
  "bounced_at": null,
  "complained_at": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 400 | [`idempotency_key_invalid`](https://hypamoon.com/docs/errors/idempotency_key_invalid) |
| 402 | [`insufficient_balance`](https://hypamoon.com/docs/errors/insufficient_balance) |
| 403 | [`mail_not_enabled`](https://hypamoon.com/docs/errors/mail_not_enabled) |
| 403 | [`email_paused`](https://hypamoon.com/docs/errors/email_paused) |
| 403 | [`recipient_not_allowed`](https://hypamoon.com/docs/errors/recipient_not_allowed) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`email_domain_not_verified`](https://hypamoon.com/docs/errors/email_domain_not_verified) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`email_blocked`](https://hypamoon.com/docs/errors/email_blocked) |
| 429 | [`email_limit_reached`](https://hypamoon.com/docs/errors/email_limit_reached) |
| 502 | [`upstream_error`](https://hypamoon.com/docs/errors/upstream_error) |

### GET /email-templates

**List email templates.**

The project's email templates, newest first, with their variables.

Scope: `messages:read`

#### 200 The templates.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] |  |

JSON

```
{
  "data": [
    {
      "id": "3f1a2b3c-4d5e-4f60-8a7b-9c0d1e2f3a4b",
      "name": "Welcome",
      "subject": "Welcome, {{name|there}}",
      "html": "<p>Hi {{name|there}},</p><p>Thanks for signing up. Reply to this email if you have a question.</p>",
      "text": null,
      "style": "site",
      "site_id": null,
      "variables": [
        "name"
      ],
      "created_at": "2026-10-15T10:00:00.000Z",
      "updated_at": "2026-10-15T10:00:00.000Z"
    }
  ]
}
```

### POST /email-templates

**Create an email template.**

A template has a name, a subject and html or text with variables: {{name}}, or {{name|there}} with a fallback when the value is missing. Values in html are escaped. style site (default) puts the email in the style of the project's site: its name, logo and colors. Send it with POST /emails and template\_id plus data, use it in an automation or a sequence, or preview it first. At most 200 templates per project.

Scope: `messages:write`

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `name` (required) | string | A name for the template, unique in the project, like "Welcome" or "Order shipped". |
| `subject` (required) | string | The subject, with variables like {{name}}. |
| `html` | string | The HTML body with variables, like <p>Hi {{name|there}},</p>. Values are escaped. No scripts or forms. |
| `text` | string | The plain text body with variables. Without it, the text comes from the html. |
| `style` | `"site"`, `"none"` | site (default): the email gets the name, logo and colors of the project's site around it. none: the html is sent as it is. |
| `site_id` | string (uuid) | Optional. The site whose style to use; without it the project's first site. |

JSON

```
{
  "name": "Welcome",
  "subject": "Welcome, {{name|there}}",
  "html": "<p>Hi {{name|there}},</p><p>Thanks for signing up.</p>",
  "style": "site"
}
```

#### 201 The template.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `name` (required) | string |  |
| `subject` (required) | string |  |
| `html` (required) | string or null |  |
| `text` (required) | string or null |  |
| `style` (required) | `"site"`, `"none"` | site: the name, logo and colors of the project's site around the email. none: sent as it is. |
| `site_id` (required) | string or null (uuid) |  |
| `variables` (required) | string\[\] | The variables in the subject and content, like name or order\_number. |
| `created_at` (required) | string (date-time) |  |
| `updated_at` (required) | string (date-time) |  |

JSON

```
{
  "id": "3f1a2b3c-4d5e-4f60-8a7b-9c0d1e2f3a4b",
  "name": "Welcome",
  "subject": "Welcome, {{name|there}}",
  "html": "<p>Hi {{name|there}},</p><p>Thanks for signing up. Reply to this email if you have a question.</p>",
  "text": null,
  "style": "site",
  "site_id": null,
  "variables": [
    "name"
  ],
  "created_at": "2026-10-15T10:00:00.000Z",
  "updated_at": "2026-10-15T10:00:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /email-templates/{id}

**Get an email template.**

Scope: `messages:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the template. |

#### 200 The template.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `name` (required) | string |  |
| `subject` (required) | string |  |
| `html` (required) | string or null |  |
| `text` (required) | string or null |  |
| `style` (required) | `"site"`, `"none"` | site: the name, logo and colors of the project's site around the email. none: sent as it is. |
| `site_id` (required) | string or null (uuid) |  |
| `variables` (required) | string\[\] | The variables in the subject and content, like name or order\_number. |
| `created_at` (required) | string (date-time) |  |
| `updated_at` (required) | string (date-time) |  |

JSON

```
{
  "id": "3f1a2b3c-4d5e-4f60-8a7b-9c0d1e2f3a4b",
  "name": "Welcome",
  "subject": "Welcome, {{name|there}}",
  "html": "<p>Hi {{name|there}},</p><p>Thanks for signing up. Reply to this email if you have a question.</p>",
  "text": null,
  "style": "site",
  "site_id": null,
  "variables": [
    "name"
  ],
  "created_at": "2026-10-15T10:00:00.000Z",
  "updated_at": "2026-10-15T10:00:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### PATCH /email-templates/{id}

**Update an email template.**

Changes only the fields you send. Emails that are scheduled with this template use the new version when they go out.

Scope: `messages:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the template. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `name` | string |  |
| `subject` | string |  |
| `html` | string or null |  |
| `text` | string or null |  |
| `style` | `"site"`, `"none"` |  |
| `site_id` | string or null (uuid) |  |

JSON

```
{
  "subject": "Welcome to Acme, {{name|there}}"
}
```

#### 200 The updated template.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `name` (required) | string |  |
| `subject` (required) | string |  |
| `html` (required) | string or null |  |
| `text` (required) | string or null |  |
| `style` (required) | `"site"`, `"none"` | site: the name, logo and colors of the project's site around the email. none: sent as it is. |
| `site_id` (required) | string or null (uuid) |  |
| `variables` (required) | string\[\] | The variables in the subject and content, like name or order\_number. |
| `created_at` (required) | string (date-time) |  |
| `updated_at` (required) | string (date-time) |  |

JSON

```
{
  "id": "3f1a2b3c-4d5e-4f60-8a7b-9c0d1e2f3a4b",
  "name": "Welcome",
  "subject": "Welcome, {{name|there}}",
  "html": "<p>Hi {{name|there}},</p><p>Thanks for signing up. Reply to this email if you have a question.</p>",
  "text": null,
  "style": "site",
  "site_id": null,
  "variables": [
    "name"
  ],
  "created_at": "2026-10-15T10:00:00.000Z",
  "updated_at": "2026-10-15T10:00:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### DELETE /email-templates/{id}

**Delete an email template.**

Not possible while an automation, a sequence, a list or a scheduled email that has not gone out yet uses it (conflict); change those or cancel the scheduled emails first.

Scope: `messages:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the template. |

#### 200 Deleted.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `deleted` (required) | `true` |  |

JSON

```
{
  "id": "3f1a2b3c-4d5e-4f60-8a7b-9c0d1e2f3a4b",
  "deleted": true
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |

### POST /email-templates/{id}/preview

**Preview an email template.**

The template filled with data, in the style of the site, without sending anything. missing\_variables lists what has no value.

Scope: `messages:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the template. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `data` | object | The values for the variables, like { "name": "Sam", "order\_number": "1042" }. Text, numbers or true/false. |

JSON

```
{
  "data": {
    "name": "Sam"
  }
}
```

#### 200 The subject, html and text as they would be sent.

| Field | Type |  |
| --- | --- | --- |
| `subject` (required) | string |  |
| `html` (required) | string or null |  |
| `text` (required) | string or null |  |
| `missing_variables` (required) | string\[\] | Variables without a value in data and without a fallback ({{name|there}}); they come out empty. |

JSON

```
{
  "subject": "Welcome, Sam",
  "html": "<!doctype html>...",
  "text": "Hi Sam,\n\nThanks for signing up.",
  "missing_variables": []
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /email-automations

**List email automations.**

Scope: `messages:read`

#### 200 The automations.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] |  |

JSON

```
{
  "data": [
    {
      "id": "5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e",
      "event": "form.submitted",
      "template_id": "3f1a2b3c-4d5e-4f60-8a7b-9c0d1e2f3a4b",
      "sequence_id": null,
      "to": "contact",
      "from": "Acme Plumbing <hello@acmeplumbing.com>",
      "reply_to": "office@acmeplumbing.com",
      "category": "transactional",
      "delay_minutes": 0,
      "filter": {
        "collection": "contact"
      },
      "enabled": true,
      "created_at": "2026-10-15T10:00:00.000Z"
    }
  ]
}
```

### POST /email-automations

**Create an email automation.**

When something happens, send a template (or start a sequence) to the person it happened to, or to a fixed address that appears in the project. Events: form.submitted (a form on one of the project's sites was sent; filter.collection for one form), booking.created (a form submission in the collection bookings, or the one in filter.collection), order.paid, order.payment\_failed (the payment failed, expired or was canceled), app\_user.created (someone became a user of an app; filter.app\_id for one app), and for subscriptions on paid access subscription.payment\_failed, subscription.past\_due, subscription.chargeback, subscription.canceled, subscription.paused, subscription.resumed and subscription.recovered (to: contact is the buyer). The variables are the fields of the form, or order\_id, order\_number, total and currency, or for a subscription subscription\_id, product, amount, currency, interval, status, paid\_until, reason, pay\_url (the buyer's signed link to pay or cancel), manage\_url (the same link), order\_id where it applies, plus email and name, plus email and name. delay\_minutes waits, like 60 for an hour (at most 30 days). Every event sends at most once per automation, also when it is reported twice. The email follows all rules of POST /emails: category transactional (default) answers what the person did. A test project only simulates.

Scope: `messages:write`

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `event` (required) | `"form.submitted"`, `"booking.created"`, `"order.paid"`, `"order.payment_failed"`, `"app_user.created"`, `"list.subscribed"`, `"subscription.payment_failed"`, `"subscription.past_due"`, `"subscription.chargeback"`, `"subscription.canceled"`, `"subscription.paused"`, `"subscription.resumed"`, `"subscription.recovered"` | What happens. |
| `template_id` | string (uuid) | The template to send. Give template\_id or sequence\_id. |
| `sequence_id` | string (uuid) | Or: start this sequence for the person. |
| `to` | string | contact (default): the person of the event (who sent the form, the buyer, the new app user). Or one fixed address that appears in the project, like the owner's, for a notice. |
| `from` (required) | string | The sender: an address on a verified sending domain of this project, optionally with a name, like "Acme <[hello@acme.com](mailto:hello@acme.com)\>". |
| `reply_to` | string | Optional. Where replies go, like the owner's own mailbox. |
| `category` | `"transactional"`, `"other"` | transactional (default): it answers what the person did. other: gets an unsubscribe link. |
| `delay_minutes` | integer | Wait this long after the event, like 60 for one hour. 0 sends right away. |
| `filter` | object |  |
| `enabled` | boolean |  |

JSON

```
{
  "event": "form.submitted",
  "template_id": "3f1a2b3c-4d5e-4f60-8a7b-9c0d1e2f3a4b",
  "from": "Acme Plumbing <hello@acmeplumbing.com>",
  "reply_to": "office@acmeplumbing.com",
  "filter": {
    "collection": "contact"
  }
}
```

#### 201 The automation.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `event` (required) | `"form.submitted"`, `"booking.created"`, `"order.paid"`, `"order.payment_failed"`, `"app_user.created"`, `"list.subscribed"`, `"subscription.payment_failed"`, `"subscription.past_due"`, `"subscription.chargeback"`, `"subscription.canceled"`, `"subscription.paused"`, `"subscription.resumed"`, `"subscription.recovered"` |  |
| `template_id` (required) | string or null (uuid) |  |
| `sequence_id` (required) | string or null (uuid) |  |
| `to` (required) | string | contact (the person of the event) or a fixed address. |
| `from` (required) | string |  |
| `reply_to` (required) | string or null |  |
| `category` (required) | `"transactional"`, `"other"` |  |
| `delay_minutes` (required) | integer |  |
| `filter` (required) | object |  |
| `enabled` (required) | boolean |  |
| `created_at` (required) | string (date-time) |  |

JSON

```
{
  "id": "5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e",
  "event": "form.submitted",
  "template_id": "3f1a2b3c-4d5e-4f60-8a7b-9c0d1e2f3a4b",
  "sequence_id": null,
  "to": "contact",
  "from": "Acme Plumbing <hello@acmeplumbing.com>",
  "reply_to": "office@acmeplumbing.com",
  "category": "transactional",
  "delay_minutes": 0,
  "filter": {
    "collection": "contact"
  },
  "enabled": true,
  "created_at": "2026-10-15T10:00:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`recipient_not_allowed`](https://hypamoon.com/docs/errors/recipient_not_allowed) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`email_domain_not_verified`](https://hypamoon.com/docs/errors/email_domain_not_verified) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### PATCH /email-automations/{id}

**Update an email automation.**

Changes only the fields you send, like enabled: false to pause it.

Scope: `messages:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the automation. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `template_id` | string (uuid) |  |
| `to` | string |  |
| `from` | string | The sender: an address on a verified sending domain of this project, optionally with a name, like "Acme <[hello@acme.com](mailto:hello@acme.com)\>". |
| `reply_to` | string or null |  |
| `category` | `"transactional"`, `"other"` |  |
| `delay_minutes` | integer |  |
| `filter` | object |  |
| `enabled` | boolean |  |

JSON

```
{
  "enabled": false
}
```

#### 200 The updated automation.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `event` (required) | `"form.submitted"`, `"booking.created"`, `"order.paid"`, `"order.payment_failed"`, `"app_user.created"`, `"list.subscribed"`, `"subscription.payment_failed"`, `"subscription.past_due"`, `"subscription.chargeback"`, `"subscription.canceled"`, `"subscription.paused"`, `"subscription.resumed"`, `"subscription.recovered"` |  |
| `template_id` (required) | string or null (uuid) |  |
| `sequence_id` (required) | string or null (uuid) |  |
| `to` (required) | string | contact (the person of the event) or a fixed address. |
| `from` (required) | string |  |
| `reply_to` (required) | string or null |  |
| `category` (required) | `"transactional"`, `"other"` |  |
| `delay_minutes` (required) | integer |  |
| `filter` (required) | object |  |
| `enabled` (required) | boolean |  |
| `created_at` (required) | string (date-time) |  |

JSON

```
{
  "id": "5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e",
  "event": "form.submitted",
  "template_id": "3f1a2b3c-4d5e-4f60-8a7b-9c0d1e2f3a4b",
  "sequence_id": null,
  "to": "contact",
  "from": "Acme Plumbing <hello@acmeplumbing.com>",
  "reply_to": "office@acmeplumbing.com",
  "category": "transactional",
  "delay_minutes": 0,
  "filter": {
    "collection": "contact"
  },
  "enabled": false,
  "created_at": "2026-10-15T10:00:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`recipient_not_allowed`](https://hypamoon.com/docs/errors/recipient_not_allowed) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`email_domain_not_verified`](https://hypamoon.com/docs/errors/email_domain_not_verified) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### DELETE /email-automations/{id}

**Delete an email automation.**

Emails it already scheduled still go; cancel those with POST /scheduled-emails/{id}/cancel.

Scope: `messages:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the automation. |

#### 200 Deleted.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `deleted` (required) | `true` |  |

JSON

```
{
  "id": "5b6c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e",
  "deleted": true
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### GET /scheduled-emails

**List scheduled emails.**

Emails that go later or went: send\_at, automations, sequence steps, list sends and confirmation emails, newest first, with their status.

Scope: `messages:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `limit` | query | integer | Per page, 1 to 100. |
| `cursor` | query | string | The next\_cursor of the previous page. |
| `status` | query | `"scheduled"`, `"sending"`, `"sent"`, `"canceled"`, `"skipped"`, `"failed"` | Only this status. |
| `source` | query | `"api"`, `"automation"`, `"sequence"`, `"list"`, `"confirmation"` | Only this source. |

#### 200 The scheduled emails.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] |  |
| `next_cursor` (required) | string or null |  |

JSON

```
{
  "data": [
    {
      "id": "6c7d8e9f-0a1b-4c2d-9e3f-4a5b6c7d8e9f",
      "source": "api",
      "status": "scheduled",
      "send_at": "2026-10-16T08:00:00.000Z",
      "to": "sam@example.org",
      "subject": "Your appointment tomorrow",
      "template_id": null,
      "email_id": null,
      "reason": null,
      "test": false,
      "created_at": "2026-10-15T10:00:00.000Z"
    }
  ],
  "next_cursor": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_parameter`](https://hypamoon.com/docs/errors/invalid_parameter) |

### GET /scheduled-emails/{id}

**Get a scheduled email.**

Scope: `messages:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the scheduled email. |

#### 200 The scheduled email.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the scheduled email. cancel\_scheduled\_email takes it. |
| `source` (required) | `"api"`, `"automation"`, `"sequence"`, `"list"`, `"confirmation"` | api: send\_email with send\_at. automation, sequence, list: sent by those. confirmation: the confirmation email of a list. |
| `status` (required) | `"scheduled"`, `"sending"`, `"sent"`, `"canceled"`, `"skipped"`, `"failed"` | scheduled (waits for send\_at), sending, sent (email\_id is the email), canceled, skipped (the person unsubscribed or left the list or sequence), failed (reason says why). |
| `send_at` (required) | string (date-time) |  |
| `to` (required) | string or null |  |
| `subject` (required) | string or null |  |
| `template_id` (required) | string or null (uuid) |  |
| `email_id` (required) | string or null (uuid) | The email once it was sent; get\_email shows whether it was delivered. |
| `reason` (required) | string or null |  |
| `test` (required) | boolean |  |
| `created_at` (required) | string (date-time) |  |

JSON

```
{
  "id": "6c7d8e9f-0a1b-4c2d-9e3f-4a5b6c7d8e9f",
  "source": "api",
  "status": "scheduled",
  "send_at": "2026-10-16T08:00:00.000Z",
  "to": "sam@example.org",
  "subject": "Your appointment tomorrow",
  "template_id": null,
  "email_id": null,
  "reason": null,
  "test": false,
  "created_at": "2026-10-15T10:00:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### POST /scheduled-emails/{id}/cancel

**Cancel a scheduled email.**

An email that is still scheduled will not be sent. Once it is sent (or sending) it cannot be canceled (conflict).

Scope: `messages:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the scheduled email. |

#### 200 Canceled.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the scheduled email. cancel\_scheduled\_email takes it. |
| `source` (required) | `"api"`, `"automation"`, `"sequence"`, `"list"`, `"confirmation"` | api: send\_email with send\_at. automation, sequence, list: sent by those. confirmation: the confirmation email of a list. |
| `status` (required) | `"scheduled"`, `"sending"`, `"sent"`, `"canceled"`, `"skipped"`, `"failed"` | scheduled (waits for send\_at), sending, sent (email\_id is the email), canceled, skipped (the person unsubscribed or left the list or sequence), failed (reason says why). |
| `send_at` (required) | string (date-time) |  |
| `to` (required) | string or null |  |
| `subject` (required) | string or null |  |
| `template_id` (required) | string or null (uuid) |  |
| `email_id` (required) | string or null (uuid) | The email once it was sent; get\_email shows whether it was delivered. |
| `reason` (required) | string or null |  |
| `test` (required) | boolean |  |
| `created_at` (required) | string (date-time) |  |

JSON

```
{
  "id": "6c7d8e9f-0a1b-4c2d-9e3f-4a5b6c7d8e9f",
  "source": "api",
  "status": "canceled",
  "send_at": "2026-10-16T08:00:00.000Z",
  "to": "sam@example.org",
  "subject": "Your appointment tomorrow",
  "template_id": null,
  "email_id": null,
  "reason": "canceled",
  "test": false,
  "created_at": "2026-10-15T10:00:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |

### GET /email-sequences

**List email sequences.**

Scope: `messages:read`

#### 200 The sequences, with how many people are in each now.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] |  |

JSON

```
{
  "data": [
    {
      "id": "7d8e9f0a-1b2c-4d3e-8f4a-5b6c7d8e9f0a",
      "name": "Onboarding",
      "steps": [
        {
          "template_id": "3f1a2b3c-4d5e-4f60-8a7b-9c0d1e2f3a4b",
          "wait_minutes": 0
        },
        {
          "template_id": "8e9f0a1b-2c3d-4e4f-9a5b-6c7d8e9f0a1b",
          "wait_minutes": 2880
        }
      ],
      "stop_on": [
        "order.paid"
      ],
      "from": "Acme Plumbing <hello@acmeplumbing.com>",
      "reply_to": null,
      "category": "other",
      "active": 12,
      "created_at": "2026-10-15T10:00:00.000Z"
    }
  ]
}
```

### POST /email-sequences

**Create an email sequence.**

A series of 1 to 20 emails, each a template with a wait before it (in minutes, at most 30 days). Someone joins with POST /email-sequences/{id}/enrollments or through an automation. It stops for a person when they unsubscribe (always), when an event in stop\_on happens for their address (like order.paid), or with POST /email-sequences/{id}/stop. category other (default) gives every email an unsubscribe link.

Scope: `messages:write`

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `name` (required) | string | A name, like "Onboarding". |
| `steps` (required) | object\[\] | 1 to 20 emails, each a template with a wait before it. |
| `stop_on` | `"form.submitted"`, `"booking.created"`, `"order.paid"`, `"order.payment_failed"`, `"app_user.created"`, `"list.subscribed"`, `"subscription.payment_failed"`, `"subscription.past_due"`, `"subscription.chargeback"`, `"subscription.canceled"`, `"subscription.paused"`, `"subscription.resumed"`, `"subscription.recovered"`\[\] | Stop for a person when one of these happens for their address, like order.paid, or subscription.recovered and subscription.canceled for reminders about a failed payment. Unsubscribing always stops. |
| `from` (required) | string | The sender: an address on a verified sending domain of this project, optionally with a name, like "Acme <[hello@acme.com](mailto:hello@acme.com)\>". |
| `reply_to` | string | Optional. Where replies go, like the owner's own mailbox. |
| `category` | `"transactional"`, `"other"` | other (default): every email has an unsubscribe link. transactional only for steps that follow up on something the person did. |

JSON

```
{
  "name": "Onboarding",
  "steps": [
    {
      "template_id": "3f1a2b3c-4d5e-4f60-8a7b-9c0d1e2f3a4b",
      "wait_minutes": 0
    },
    {
      "template_id": "8e9f0a1b-2c3d-4e4f-9a5b-6c7d8e9f0a1b",
      "wait_minutes": 2880
    }
  ],
  "stop_on": [
    "order.paid"
  ],
  "from": "Acme Plumbing <hello@acmeplumbing.com>"
}
```

#### 201 The sequence.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `name` (required) | string |  |
| `steps` (required) | object\[\] |  |
| `stop_on` (required) | `"form.submitted"`, `"booking.created"`, `"order.paid"`, `"order.payment_failed"`, `"app_user.created"`, `"list.subscribed"`, `"subscription.payment_failed"`, `"subscription.past_due"`, `"subscription.chargeback"`, `"subscription.canceled"`, `"subscription.paused"`, `"subscription.resumed"`, `"subscription.recovered"`\[\] |  |
| `from` (required) | string |  |
| `reply_to` (required) | string or null |  |
| `category` (required) | `"transactional"`, `"other"` |  |
| `active` (required) | integer | How many people are in the sequence now. |
| `created_at` (required) | string (date-time) |  |

JSON

```
{
  "id": "7d8e9f0a-1b2c-4d3e-8f4a-5b6c7d8e9f0a",
  "name": "Onboarding",
  "steps": [
    {
      "template_id": "3f1a2b3c-4d5e-4f60-8a7b-9c0d1e2f3a4b",
      "wait_minutes": 0
    },
    {
      "template_id": "8e9f0a1b-2c3d-4e4f-9a5b-6c7d8e9f0a1b",
      "wait_minutes": 2880
    }
  ],
  "stop_on": [
    "order.paid"
  ],
  "from": "Acme Plumbing <hello@acmeplumbing.com>",
  "reply_to": null,
  "category": "other",
  "active": 0,
  "created_at": "2026-10-15T10:00:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`email_domain_not_verified`](https://hypamoon.com/docs/errors/email_domain_not_verified) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /email-sequences/{id}

**Get an email sequence.**

The sequence with its last 100 enrollments.

Scope: `messages:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the sequence. |

#### 200 The sequence.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `name` (required) | string |  |
| `steps` (required) | object\[\] |  |
| `stop_on` (required) | `"form.submitted"`, `"booking.created"`, `"order.paid"`, `"order.payment_failed"`, `"app_user.created"`, `"list.subscribed"`, `"subscription.payment_failed"`, `"subscription.past_due"`, `"subscription.chargeback"`, `"subscription.canceled"`, `"subscription.paused"`, `"subscription.resumed"`, `"subscription.recovered"`\[\] |  |
| `from` (required) | string |  |
| `reply_to` (required) | string or null |  |
| `category` (required) | `"transactional"`, `"other"` |  |
| `active` (required) | integer | How many people are in the sequence now. |
| `created_at` (required) | string (date-time) |  |
| `enrollments` (required) | object\[\] |  |

JSON

```
{
  "id": "7d8e9f0a-1b2c-4d3e-8f4a-5b6c7d8e9f0a",
  "name": "Onboarding",
  "steps": [
    {
      "template_id": "3f1a2b3c-4d5e-4f60-8a7b-9c0d1e2f3a4b",
      "wait_minutes": 0
    },
    {
      "template_id": "8e9f0a1b-2c3d-4e4f-9a5b-6c7d8e9f0a1b",
      "wait_minutes": 2880
    }
  ],
  "stop_on": [
    "order.paid"
  ],
  "from": "Acme Plumbing <hello@acmeplumbing.com>",
  "reply_to": null,
  "category": "other",
  "active": 12,
  "created_at": "2026-10-15T10:00:00.000Z",
  "enrollments": [
    {
      "id": "9f0a1b2c-3d4e-4f5a-8b6c-7d8e9f0a1b2c",
      "sequence_id": "7d8e9f0a-1b2c-4d3e-8f4a-5b6c7d8e9f0a",
      "email": "sam@example.org",
      "status": "active",
      "step": 0,
      "next_send_at": "2026-10-15T10:00:00.000Z",
      "stop_reason": null,
      "created_at": "2026-10-15T10:00:00.000Z"
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### DELETE /email-sequences/{id}

**Delete an email sequence.**

Everyone in it stops; steps that were scheduled are not sent.

Scope: `messages:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the sequence. |

#### 200 Deleted.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `deleted` (required) | `true` |  |

JSON

```
{
  "id": "7d8e9f0a-1b2c-4d3e-8f4a-5b6c7d8e9f0a",
  "deleted": true
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### POST /email-sequences/{id}/enrollments

**Add someone to an email sequence.**

Only someone the project already knows, like any recipient (a form submission with in\_reply\_to, a document, an app user, a buyer, a confirmed list contact, or an address the owner confirmed). data fills the variables of every step. Someone who is already in the sequence stays where they are (200).

Scope: `messages:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the sequence. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `email` (required) | string | The person's address. It must appear in the project, like any recipient. |
| `data` | object | The values for the variables, like { "name": "Sam", "order\_number": "1042" }. Text, numbers or true/false. |
| `in_reply_to` | string (uuid) | The form submission or chat conversation this person came from, when that is the only place the address appears. |

JSON

```
{
  "email": "sam@example.org",
  "data": {
    "name": "Sam"
  }
}
```

#### 200 Already in the sequence.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `sequence_id` (required) | string (uuid) |  |
| `email` (required) | string |  |
| `status` (required) | `"active"`, `"completed"`, `"stopped"` |  |
| `step` (required) | integer | The step that is next (0 is the first). |
| `next_send_at` (required) | string or null (date-time) |  |
| `stop_reason` (required) | string or null | Why it stopped: unsubscribed, stopped, or the event (like order.paid). |
| `created_at` (required) | string (date-time) |  |

JSON

```
{
  "id": "9f0a1b2c-3d4e-4f5a-8b6c-7d8e9f0a1b2c",
  "sequence_id": "7d8e9f0a-1b2c-4d3e-8f4a-5b6c7d8e9f0a",
  "email": "sam@example.org",
  "status": "active",
  "step": 0,
  "next_send_at": "2026-10-15T10:00:00.000Z",
  "stop_reason": null,
  "created_at": "2026-10-15T10:00:00.000Z"
}
```

#### 201 Added; the first step goes after its wait.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `sequence_id` (required) | string (uuid) |  |
| `email` (required) | string |  |
| `status` (required) | `"active"`, `"completed"`, `"stopped"` |  |
| `step` (required) | integer | The step that is next (0 is the first). |
| `next_send_at` (required) | string or null (date-time) |  |
| `stop_reason` (required) | string or null | Why it stopped: unsubscribed, stopped, or the event (like order.paid). |
| `created_at` (required) | string (date-time) |  |

JSON

```
{
  "id": "9f0a1b2c-3d4e-4f5a-8b6c-7d8e9f0a1b2c",
  "sequence_id": "7d8e9f0a-1b2c-4d3e-8f4a-5b6c7d8e9f0a",
  "email": "sam@example.org",
  "status": "active",
  "step": 0,
  "next_send_at": "2026-10-15T10:00:00.000Z",
  "stop_reason": null,
  "created_at": "2026-10-15T10:00:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`recipient_not_allowed`](https://hypamoon.com/docs/errors/recipient_not_allowed) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### POST /email-sequences/{id}/stop

**Stop an email sequence for someone.**

For example when the person replied. Steps that were scheduled for them are not sent.

Scope: `messages:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the sequence. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `email` (required) | string |  |

JSON

```
{
  "email": "sam@example.org"
}
```

#### 200 Stopped.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `sequence_id` (required) | string (uuid) |  |
| `email` (required) | string |  |
| `status` (required) | `"active"`, `"completed"`, `"stopped"` |  |
| `step` (required) | integer | The step that is next (0 is the first). |
| `next_send_at` (required) | string or null (date-time) |  |
| `stop_reason` (required) | string or null | Why it stopped: unsubscribed, stopped, or the event (like order.paid). |
| `created_at` (required) | string (date-time) |  |

JSON

```
{
  "id": "9f0a1b2c-3d4e-4f5a-8b6c-7d8e9f0a1b2c",
  "sequence_id": "7d8e9f0a-1b2c-4d3e-8f4a-5b6c7d8e9f0a",
  "email": "sam@example.org",
  "status": "stopped",
  "step": 0,
  "next_send_at": null,
  "stop_reason": "stopped",
  "created_at": "2026-10-15T10:00:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

## Agencies

For agencies that build for clients: client projects, access requests, owner invitations, who pays, budgets, usage, invoice lines and activity per client, and payment links and subscriptions on your own payment account for a client. Work inside a client project with the Hypamoon-Project header on any other route. For a client: which agencies have access, and revoking it.

### GET /clients

**List your client projects.**

The client projects of your agency: pending access requests and active relations, newest first. With all=true also declined and ended ones.

Scope: `clients:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `all` | query | boolean | Also include declined and ended relations. |

#### 200 The client relations.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"list"` |  |
| `data` (required) | object\[\] |  |

JSON

```
{
  "object": "list",
  "data": [
    {
      "object": "client_relation",
      "id": "6e5d4c3b-2a19-4f8e-9d7c-6b5a49382716",
      "agency": {
        "project_id": "3f2a1c4e-5b6d-4e7f-8a9b-0c1d2e3f4a5b",
        "name": "Studio North"
      },
      "client": {
        "project_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
        "name": "Bakery Jansen"
      },
      "status": "active",
      "stage": "building",
      "role": "builder",
      "max_mode": "test",
      "four_eyes": false,
      "payer": "client",
      "budget_eur": null,
      "payer_change": null,
      "owner_invite": null,
      "confirmed_at": null,
      "ended_at": null,
      "created_at": "2026-10-12T09:00:00.000Z"
    }
  ]
}
```

### POST /clients

**Set up a project for a client.**

Creates a new project for a client in the building stage: your agency is its temporary owner through the relation, everything stays in test with Free limits, until the client accepts the owner invitation (POST /clients/{id}/owner-invite). The one-project-per-owner limit of signing up does not apply here.

Scope: `clients:write`

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `name` (required) | string |  |
| `payer` | `"client"`, `"agency"` |  |

JSON

```
{
  "name": "Bakery Jansen",
  "payer": "agency"
}
```

#### 201 The new client project and its relation.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"client_relation"` |  |
| `id` (required) | string (uuid) |  |
| `agency` (required) | object |  |
| `client` (required) | object |  |
| `status` (required) | `"pending"`, `"active"`, `"declined"`, `"ended"` |  |
| `stage` (required) | `"building"`, `"client_owned"` |  |
| `role` (required) | `"viewer"`, `"builder"`, `"admin"` |  |
| `max_mode` (required) | `"test"`, `"live"` |  |
| `four_eyes` (required) | boolean |  |
| `payer` (required) | `"client"`, `"agency"` |  |
| `budget_eur` (required) | number or null |  |
| `payer_change` (required) | object or null |  |
| `owner_invite` (required) | object or null |  |
| `confirmed_at` (required) | string or null |  |
| `ended_at` (required) | string or null |  |
| `created_at` (required) | string |  |
| `transfer` | object |  |
| `ended_via` | `"client"`, `"agency"`, `"admin"`, `"handover"`, `"expired"`, `"cleanup"` |  |
| `cleanup` | object |  |
| `project` (required) | object |  |

JSON

```
{
  "object": "client_relation",
  "id": "6e5d4c3b-2a19-4f8e-9d7c-6b5a49382716",
  "agency": {
    "project_id": "3f2a1c4e-5b6d-4e7f-8a9b-0c1d2e3f4a5b",
    "name": "Studio North"
  },
  "client": {
    "project_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
    "name": "Bakery Jansen"
  },
  "status": "active",
  "stage": "building",
  "role": "builder",
  "max_mode": "test",
  "four_eyes": false,
  "payer": "client",
  "budget_eur": null,
  "payer_change": null,
  "owner_invite": null,
  "confirmed_at": null,
  "ended_at": null,
  "created_at": "2026-10-12T09:00:00.000Z",
  "project": {
    "id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
    "name": "Bakery Jansen"
  }
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### POST /clients/access-requests

**Ask a client for access to their project.**

Asks the owner of an existing project for access. The answer has confirm\_url: a page in the portal where the owner sees what your agency can do, who pays and how to revoke, and accepts or declines. With payer agency your agency offers to pay the usage; the owner can still choose to pay himself. Nothing is emailed; give the link to the client. An open request is returned as it is (200).

Scope: `clients:write`

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `project_id` (required) | string (uuid) |  |
| `message` | string |  |
| `payer` | `"client"`, `"agency"` |  |

JSON

```
{
  "project_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
  "message": "As discussed on the phone.",
  "payer": "agency"
}
```

#### 200 The open request or active relation that already existed.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"client_relation"` |  |
| `id` (required) | string (uuid) |  |
| `agency` (required) | object |  |
| `client` (required) | object |  |
| `status` (required) | `"pending"`, `"active"`, `"declined"`, `"ended"` |  |
| `stage` (required) | `"building"`, `"client_owned"` |  |
| `role` (required) | `"viewer"`, `"builder"`, `"admin"` |  |
| `max_mode` (required) | `"test"`, `"live"` |  |
| `four_eyes` (required) | boolean |  |
| `payer` (required) | `"client"`, `"agency"` |  |
| `budget_eur` (required) | number or null |  |
| `payer_change` (required) | object or null |  |
| `owner_invite` (required) | object or null |  |
| `confirmed_at` (required) | string or null |  |
| `ended_at` (required) | string or null |  |
| `created_at` (required) | string |  |
| `transfer` | object |  |
| `ended_via` | `"client"`, `"agency"`, `"admin"`, `"handover"`, `"expired"`, `"cleanup"` |  |
| `cleanup` | object |  |
| `confirm_url` (required) | string (uri) |  |

JSON

```
{
  "object": "client_relation",
  "id": "6e5d4c3b-2a19-4f8e-9d7c-6b5a49382716",
  "agency": {
    "project_id": "3f2a1c4e-5b6d-4e7f-8a9b-0c1d2e3f4a5b",
    "name": "Studio North"
  },
  "client": {
    "project_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
    "name": "Bakery Jansen"
  },
  "status": "active",
  "stage": "client_owned",
  "role": "builder",
  "max_mode": "test",
  "four_eyes": false,
  "payer": "client",
  "budget_eur": null,
  "payer_change": null,
  "owner_invite": null,
  "confirmed_at": null,
  "ended_at": null,
  "created_at": "2026-10-12T09:00:00.000Z",
  "confirm_url": "https://app.hypamoon.com/agencies?request=6e5d4c3b-2a19-4f8e-9d7c-6b5a49382716"
}
```

#### 201 The new request.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"client_relation"` |  |
| `id` (required) | string (uuid) |  |
| `agency` (required) | object |  |
| `client` (required) | object |  |
| `status` (required) | `"pending"`, `"active"`, `"declined"`, `"ended"` |  |
| `stage` (required) | `"building"`, `"client_owned"` |  |
| `role` (required) | `"viewer"`, `"builder"`, `"admin"` |  |
| `max_mode` (required) | `"test"`, `"live"` |  |
| `four_eyes` (required) | boolean |  |
| `payer` (required) | `"client"`, `"agency"` |  |
| `budget_eur` (required) | number or null |  |
| `payer_change` (required) | object or null |  |
| `owner_invite` (required) | object or null |  |
| `confirmed_at` (required) | string or null |  |
| `ended_at` (required) | string or null |  |
| `created_at` (required) | string |  |
| `transfer` | object |  |
| `ended_via` | `"client"`, `"agency"`, `"admin"`, `"handover"`, `"expired"`, `"cleanup"` |  |
| `cleanup` | object |  |
| `confirm_url` (required) | string (uri) |  |

JSON

```
{
  "object": "client_relation",
  "id": "6e5d4c3b-2a19-4f8e-9d7c-6b5a49382716",
  "agency": {
    "project_id": "3f2a1c4e-5b6d-4e7f-8a9b-0c1d2e3f4a5b",
    "name": "Studio North"
  },
  "client": {
    "project_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
    "name": "Bakery Jansen"
  },
  "status": "pending",
  "stage": "client_owned",
  "role": "builder",
  "max_mode": "test",
  "four_eyes": false,
  "payer": "client",
  "budget_eur": null,
  "payer_change": null,
  "owner_invite": null,
  "confirmed_at": null,
  "ended_at": null,
  "created_at": "2026-10-12T09:00:00.000Z",
  "confirm_url": "https://app.hypamoon.com/agencies?request=6e5d4c3b-2a19-4f8e-9d7c-6b5a49382716"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### POST /clients/{id}/owner-invite

**Invite the client to own the project.**

Invites the client to become the owner of a project in the building stage. The answer always has accept\_url, login\_email, expires\_at and share\_text (a short message to paste), so you can send the link yourself by email, WhatsApp or in person. With send\_email true (the default) Hypamoon also emails it; with false nothing is emailed (email\_sent false). The link works for 14 days and only for a signed-in user with login\_email; a client without an account creates one with that address. language (Dutch or English) sets the email and the accept page; the default is your agency's language (Dutch when your company details are in the Netherlands). Inviting again replaces the previous link. Only an owner or builder of your agency gets the link.

Scope: `clients:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the client project. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `email` (required) | string (email) |  |
| `send_email` | boolean |  |
| `language` | `"nl"`, `"en"` |  |

JSON

```
{
  "email": "owner@example.org",
  "send_email": false,
  "language": "en"
}
```

#### 200 The relation with the open invitation, and the link to send.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"client_relation"` |  |
| `id` (required) | string (uuid) |  |
| `agency` (required) | object |  |
| `client` (required) | object |  |
| `status` (required) | `"pending"`, `"active"`, `"declined"`, `"ended"` |  |
| `stage` (required) | `"building"`, `"client_owned"` |  |
| `role` (required) | `"viewer"`, `"builder"`, `"admin"` |  |
| `max_mode` (required) | `"test"`, `"live"` |  |
| `four_eyes` (required) | boolean |  |
| `payer` (required) | `"client"`, `"agency"` |  |
| `budget_eur` (required) | number or null |  |
| `payer_change` (required) | object or null |  |
| `owner_invite` (required) | object or null |  |
| `confirmed_at` (required) | string or null |  |
| `ended_at` (required) | string or null |  |
| `created_at` (required) | string |  |
| `transfer` | object |  |
| `ended_via` | `"client"`, `"agency"`, `"admin"`, `"handover"`, `"expired"`, `"cleanup"` |  |
| `cleanup` | object |  |
| `email_sent` (required) | boolean |  |
| `accept_url` (required) | string (uri) |  |
| `login_email` (required) | string (email) |  |
| `expires_at` (required) | string |  |
| `language` (required) | `"nl"`, `"en"` |  |
| `share_text` (required) | string |  |

JSON

```
{
  "object": "client_relation",
  "id": "6e5d4c3b-2a19-4f8e-9d7c-6b5a49382716",
  "agency": {
    "project_id": "3f2a1c4e-5b6d-4e7f-8a9b-0c1d2e3f4a5b",
    "name": "Studio North"
  },
  "client": {
    "project_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
    "name": "Bakery Jansen"
  },
  "status": "active",
  "stage": "building",
  "role": "builder",
  "max_mode": "test",
  "four_eyes": false,
  "payer": "client",
  "budget_eur": null,
  "payer_change": null,
  "owner_invite": {
    "email": "owner@example.org",
    "expires_at": "2026-10-26T09:00:00.000Z",
    "agency_keeps_access": true
  },
  "confirmed_at": null,
  "ended_at": null,
  "created_at": "2026-10-12T09:00:00.000Z",
  "email_sent": false,
  "accept_url": "https://app.hypamoon.com/agency-invite?token=Zm9vYmFyYmF6cXV4",
  "login_email": "owner@example.org",
  "expires_at": "2026-10-26T09:00:00.000Z",
  "language": "en",
  "share_text": "Hi! Bakery Jansen is ready for you. This link makes you its owner: https://app.hypamoon.com/agency-invite?token=Zm9vYmFyYmF6cXV4\nSign in with owner@example.org; no account yet? Create one with that address. The link works until 2026-10-26. Best, Studio North"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /clients/{id}/access

**See who has direct access to a client project.**

The people you gave direct access, with what they did since: opened\_at, chat\_connected and last\_activity\_at. Empty values mean they did nothing there yet, not that they have no account.

Scope: `clients:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the client project. |

#### 200 The people with direct access, also those whose access ended.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"list"` |  |
| `data` (required) | object\[\] |  |

JSON

```
{
  "object": "list",
  "data": [
    {
      "object": "client_access",
      "project_id": "1f2e3d4c-5b6a-4978-8695-a4b3c2d1e0f9",
      "email": "client@example.org",
      "role": "builder",
      "status": "granted",
      "granted_at": "2026-11-02T09:00:00.000Z",
      "opened_at": null,
      "chat_connected": false,
      "last_activity_at": null,
      "ended_at": null
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### POST /clients/{id}/access

**Give a client direct access to a project.**

Gives a person access to a project in the building stage, on their email address, in one step. With an account they can use it now; without one it starts the first time they sign in with that address. The answer is the same in both cases. role is builder (default), editor or viewer, always in test. A builder builds sites and apps from their own chat, and keys they create have the same limits. An editor only changes content: the text and images of existing sites and documents in existing collections; no building, deploying or publishing. A viewer only reads. No real numbers, messages, email to others or payments, no buying domains, no going live, no deleting whole sites or apps, no handing over. There is no owner or billing role: this is not ownership, and POST /clients/{id}/owner-invite stays the way to hand over. send\_email (default true) sends one short email that names the role. Giving the same address again changes nothing, unless role differs: then the role changes (role\_changed true) and nothing is emailed. A client-owned project answers 409: its owner decides under Team.

Scope: `clients:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the client project. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `email` (required) | string (email) |  |
| `send_email` | boolean |  |
| `language` | `"nl"`, `"en"` |  |
| `role` | `"builder"`, `"editor"`, `"viewer"` |  |

JSON

```
{
  "email": "client@example.org",
  "role": "editor",
  "send_email": true,
  "language": "en"
}
```

#### 200 Who got access.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"client_access"` |  |
| `project_id` (required) | string (uuid) |  |
| `email` (required) | string |  |
| `role` (required) | `"builder"`, `"editor"`, `"viewer"` |  |
| `status` (required) | `"granted"`, `"revoked"`, `"owner"` |  |
| `granted_at` (required) | string |  |
| `opened_at` (required) | string or null |  |
| `chat_connected` (required) | boolean |  |
| `last_activity_at` (required) | string or null |  |
| `ended_at` (required) | string or null |  |
| `email_sent` (required) | boolean |  |
| `already_granted` (required) | boolean |  |
| `role_changed` (required) | boolean |  |

JSON

```
{
  "object": "client_access",
  "project_id": "1f2e3d4c-5b6a-4978-8695-a4b3c2d1e0f9",
  "email": "client@example.org",
  "role": "editor",
  "status": "granted",
  "granted_at": "2026-11-02T09:00:00.000Z",
  "opened_at": null,
  "chat_connected": false,
  "last_activity_at": null,
  "ended_at": null,
  "email_sent": true,
  "already_granted": false,
  "role_changed": false
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### DELETE /clients/{id}/access

**Remove a client's direct access.**

Removes the access of this address right away. A membership that existed before you gave access stays. 404 if your agency gave this address no access.

Scope: `clients:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the client project. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `email` (required) | string (email) |  |

JSON

```
{
  "email": "client@example.org"
}
```

#### 200 The access that ended.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"client_access"` |  |
| `project_id` (required) | string (uuid) |  |
| `email` (required) | string |  |
| `role` (required) | `"builder"`, `"editor"`, `"viewer"` |  |
| `status` (required) | `"granted"`, `"revoked"`, `"owner"` |  |
| `granted_at` (required) | string |  |
| `opened_at` (required) | string or null |  |
| `chat_connected` (required) | boolean |  |
| `last_activity_at` (required) | string or null |  |
| `ended_at` (required) | string or null |  |

JSON

```
{
  "object": "client_access",
  "project_id": "1f2e3d4c-5b6a-4978-8695-a4b3c2d1e0f9",
  "email": "client@example.org",
  "role": "builder",
  "status": "revoked",
  "granted_at": "2026-11-02T09:00:00.000Z",
  "opened_at": null,
  "chat_connected": false,
  "last_activity_at": null,
  "ended_at": "2026-11-03T09:00:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### DELETE /clients/{id}

**Stop working on a client project.**

Ends your agency's access to a client project, or withdraws a pending request. What you built stays with the client. If your agency paid the usage, the client pays again from now on and the owner gets an email; payer\_stopped says so. open\_payments lists your payment links and subscriptions for this client that still run on your own payment account: cancel what should stop. A project in the building stage that nobody took over goes to the trash after 30 days and is deleted 30 days later, unless you restore it.

Scope: `clients:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the client project. |

#### 200 The ended relation.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"client_relation"` |  |
| `id` (required) | string (uuid) |  |
| `agency` (required) | object |  |
| `client` (required) | object |  |
| `status` (required) | `"pending"`, `"active"`, `"declined"`, `"ended"` |  |
| `stage` (required) | `"building"`, `"client_owned"` |  |
| `role` (required) | `"viewer"`, `"builder"`, `"admin"` |  |
| `max_mode` (required) | `"test"`, `"live"` |  |
| `four_eyes` (required) | boolean |  |
| `payer` (required) | `"client"`, `"agency"` |  |
| `budget_eur` (required) | number or null |  |
| `payer_change` (required) | object or null |  |
| `owner_invite` (required) | object or null |  |
| `confirmed_at` (required) | string or null |  |
| `ended_at` (required) | string or null |  |
| `created_at` (required) | string |  |
| `transfer` | object |  |
| `ended_via` | `"client"`, `"agency"`, `"admin"`, `"handover"`, `"expired"`, `"cleanup"` |  |
| `cleanup` | object |  |
| `payer_stopped` | boolean |  |
| `open_payments` | object\[\] |  |

JSON

```
{
  "object": "client_relation",
  "id": "6e5d4c3b-2a19-4f8e-9d7c-6b5a49382716",
  "agency": {
    "project_id": "3f2a1c4e-5b6d-4e7f-8a9b-0c1d2e3f4a5b",
    "name": "Studio North"
  },
  "client": {
    "project_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
    "name": "Bakery Jansen"
  },
  "status": "ended",
  "stage": "building",
  "role": "builder",
  "max_mode": "test",
  "four_eyes": false,
  "payer": "client",
  "budget_eur": null,
  "payer_change": null,
  "owner_invite": null,
  "confirmed_at": null,
  "ended_at": "2026-10-20T09:00:00.000Z",
  "created_at": "2026-10-12T09:00:00.000Z",
  "payer_stopped": false,
  "open_payments": []
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### POST /clients/{id}/transfer

**Hand over a client project.**

Hands over a project in the building stage. With to\_email the client becomes the owner after accepting on their own confirmation page; agency\_keeps\_access says whether your agency keeps working on it (true) or stops (false, then the client pays from then on). With to\_agency\_project\_id another agency takes it over after an owner or builder there accepts in their portal (Clients); your access ends at that moment. A project the client already owns cannot be handed over: the client chooses its agencies. The answer lists open\_payments: your payment links and subscriptions for this client, to cancel what should stop.

Scope: `clients:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the client project. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `to_email` | string (email) |  |
| `agency_keeps_access` | boolean |  |
| `to_agency_project_id` | string (uuid) |  |
| `message` | string |  |

JSON

```
{
  "to_agency_project_id": "5c4b3a29-1807-4f6e-8d5c-4b3a29180706",
  "message": "As agreed, you take over the build."
}
```

#### 202 The handover waits for the receiving side.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"client_relation"` |  |
| `id` (required) | string (uuid) |  |
| `agency` (required) | object |  |
| `client` (required) | object |  |
| `status` (required) | `"pending"`, `"active"`, `"declined"`, `"ended"` |  |
| `stage` (required) | `"building"`, `"client_owned"` |  |
| `role` (required) | `"viewer"`, `"builder"`, `"admin"` |  |
| `max_mode` (required) | `"test"`, `"live"` |  |
| `four_eyes` (required) | boolean |  |
| `payer` (required) | `"client"`, `"agency"` |  |
| `budget_eur` (required) | number or null |  |
| `payer_change` (required) | object or null |  |
| `owner_invite` (required) | object or null |  |
| `confirmed_at` (required) | string or null |  |
| `ended_at` (required) | string or null |  |
| `created_at` (required) | string |  |
| `transfer` | object |  |
| `ended_via` | `"client"`, `"agency"`, `"admin"`, `"handover"`, `"expired"`, `"cleanup"` |  |
| `cleanup` | object |  |
| `transfer_relation` | object |  |
| `open_payments` (required) | object\[\] |  |

JSON

```
{
  "object": "client_relation",
  "id": "6e5d4c3b-2a19-4f8e-9d7c-6b5a49382716",
  "agency": {
    "project_id": "3f2a1c4e-5b6d-4e7f-8a9b-0c1d2e3f4a5b",
    "name": "Studio North"
  },
  "client": {
    "project_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
    "name": "Bakery Jansen"
  },
  "status": "active",
  "stage": "building",
  "role": "builder",
  "max_mode": "test",
  "four_eyes": false,
  "payer": "client",
  "budget_eur": null,
  "payer_change": null,
  "owner_invite": null,
  "confirmed_at": null,
  "ended_at": null,
  "created_at": "2026-10-12T09:00:00.000Z",
  "transfer": {
    "direction": "outgoing",
    "agency": {
      "project_id": "5c4b3a29-1807-4f6e-8d5c-4b3a29180706",
      "name": "Studio South"
    },
    "relation_id": "7f6e5d4c-3b2a-4190-8f7e-6d5c4b3a2918",
    "expires_at": "2026-10-26T09:00:00.000Z"
  },
  "open_payments": []
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### DELETE /clients/{id}/transfer

**Cancel a handover.**

Withdraws an open owner invitation or an open handover to another agency for a project in the building stage. canceled says how many were withdrawn.

Scope: `clients:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the client project. |

#### 200 The relation, without the open handover.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"client_relation"` |  |
| `id` (required) | string (uuid) |  |
| `agency` (required) | object |  |
| `client` (required) | object |  |
| `status` (required) | `"pending"`, `"active"`, `"declined"`, `"ended"` |  |
| `stage` (required) | `"building"`, `"client_owned"` |  |
| `role` (required) | `"viewer"`, `"builder"`, `"admin"` |  |
| `max_mode` (required) | `"test"`, `"live"` |  |
| `four_eyes` (required) | boolean |  |
| `payer` (required) | `"client"`, `"agency"` |  |
| `budget_eur` (required) | number or null |  |
| `payer_change` (required) | object or null |  |
| `owner_invite` (required) | object or null |  |
| `confirmed_at` (required) | string or null |  |
| `ended_at` (required) | string or null |  |
| `created_at` (required) | string |  |
| `transfer` | object |  |
| `ended_via` | `"client"`, `"agency"`, `"admin"`, `"handover"`, `"expired"`, `"cleanup"` |  |
| `cleanup` | object |  |
| `canceled` (required) | integer |  |

JSON

```
{
  "object": "client_relation",
  "id": "6e5d4c3b-2a19-4f8e-9d7c-6b5a49382716",
  "agency": {
    "project_id": "3f2a1c4e-5b6d-4e7f-8a9b-0c1d2e3f4a5b",
    "name": "Studio North"
  },
  "client": {
    "project_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
    "name": "Bakery Jansen"
  },
  "status": "active",
  "stage": "building",
  "role": "builder",
  "max_mode": "test",
  "four_eyes": false,
  "payer": "client",
  "budget_eur": null,
  "payer_change": null,
  "owner_invite": null,
  "confirmed_at": null,
  "ended_at": null,
  "created_at": "2026-10-12T09:00:00.000Z",
  "canceled": 1
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### POST /clients/{id}/restore

**Restore an ended client project.**

Brings back a project in the building stage that your agency ended and nobody took over, also from the trash, as long as it was not deleted yet. Your agency is its temporary owner again.

Scope: `clients:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the client project. |

#### 200 The new relation.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"client_relation"` |  |
| `id` (required) | string (uuid) |  |
| `agency` (required) | object |  |
| `client` (required) | object |  |
| `status` (required) | `"pending"`, `"active"`, `"declined"`, `"ended"` |  |
| `stage` (required) | `"building"`, `"client_owned"` |  |
| `role` (required) | `"viewer"`, `"builder"`, `"admin"` |  |
| `max_mode` (required) | `"test"`, `"live"` |  |
| `four_eyes` (required) | boolean |  |
| `payer` (required) | `"client"`, `"agency"` |  |
| `budget_eur` (required) | number or null |  |
| `payer_change` (required) | object or null |  |
| `owner_invite` (required) | object or null |  |
| `confirmed_at` (required) | string or null |  |
| `ended_at` (required) | string or null |  |
| `created_at` (required) | string |  |
| `transfer` | object |  |
| `ended_via` | `"client"`, `"agency"`, `"admin"`, `"handover"`, `"expired"`, `"cleanup"` |  |
| `cleanup` | object |  |

JSON

```
{
  "object": "client_relation",
  "id": "6e5d4c3b-2a19-4f8e-9d7c-6b5a49382716",
  "agency": {
    "project_id": "3f2a1c4e-5b6d-4e7f-8a9b-0c1d2e3f4a5b",
    "name": "Studio North"
  },
  "client": {
    "project_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
    "name": "Bakery Jansen"
  },
  "status": "active",
  "stage": "building",
  "role": "builder",
  "max_mode": "test",
  "four_eyes": false,
  "payer": "client",
  "budget_eur": null,
  "payer_change": null,
  "owner_invite": null,
  "confirmed_at": null,
  "ended_at": null,
  "created_at": "2026-10-12T09:00:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |

### GET /clients/{id}/usage

**Get the usage of a client project.**

Costs and usage per calendar month (UTC), oldest first: cost\_eur with cost\_by\_source and cost\_by\_payer (client: the project's own credit, agency: paid by your agency), top\_ups\_eur and the app meters, plus the current payer and budget\_eur. For invoicing your client with your own markup, or your own client portal.

Scope: `clients:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the client project. |
| `months` | query | integer | How many months back, the current month included (at most 12). |

#### 200 Usage per month.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"client_usage"` |  |
| `project_id` (required) | string (uuid) |  |
| `currency` (required) | `"EUR"` |  |
| `payer` | `"client"`, `"agency"` |  |
| `budget_eur` | number or null |  |
| `months` (required) | object\[\] |  |

JSON

```
{
  "object": "client_usage",
  "project_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
  "currency": "EUR",
  "payer": "agency",
  "budget_eur": 50,
  "months": [
    {
      "month": "2026-10",
      "cost_eur": 4.2,
      "cost_by_source": {
        "calls": 3.9,
        "sms": 0.3
      },
      "cost_by_payer": {
        "client": 0,
        "agency": 4.2
      },
      "cost_by_payer_source": {
        "client": {},
        "agency": {
          "calls": 3.9,
          "sms": 0.3
        }
      },
      "top_ups_eur": 0,
      "app_requests": 1830,
      "app_errors": 2,
      "app_cpu_ms": 51200
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### PUT /clients/{id}/payer

**Change who pays for a client project.**

Proposes who pays the usage of a client project (client or agency), or agrees to what the client proposed. It only changes when both sides agree: the client accepts in the portal under Agencies. Choosing the current payer withdraws an open proposal. In the building stage your agency decides alone; the client sees it when taking over. applied tells whether it changed now.

Scope: `clients:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the client project. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `payer` (required) | `"client"`, `"agency"` |  |

JSON

```
{
  "payer": "agency"
}
```

#### 200 The relation, with payer\_change while it waits for the client.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"client_relation"` |  |
| `id` (required) | string (uuid) |  |
| `agency` (required) | object |  |
| `client` (required) | object |  |
| `status` (required) | `"pending"`, `"active"`, `"declined"`, `"ended"` |  |
| `stage` (required) | `"building"`, `"client_owned"` |  |
| `role` (required) | `"viewer"`, `"builder"`, `"admin"` |  |
| `max_mode` (required) | `"test"`, `"live"` |  |
| `four_eyes` (required) | boolean |  |
| `payer` (required) | `"client"`, `"agency"` |  |
| `budget_eur` (required) | number or null |  |
| `payer_change` (required) | object or null |  |
| `owner_invite` (required) | object or null |  |
| `confirmed_at` (required) | string or null |  |
| `ended_at` (required) | string or null |  |
| `created_at` (required) | string |  |
| `transfer` | object |  |
| `ended_via` | `"client"`, `"agency"`, `"admin"`, `"handover"`, `"expired"`, `"cleanup"` |  |
| `cleanup` | object |  |
| `applied` (required) | boolean |  |

JSON

```
{
  "object": "client_relation",
  "id": "6e5d4c3b-2a19-4f8e-9d7c-6b5a49382716",
  "agency": {
    "project_id": "3f2a1c4e-5b6d-4e7f-8a9b-0c1d2e3f4a5b",
    "name": "Studio North"
  },
  "client": {
    "project_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
    "name": "Bakery Jansen"
  },
  "status": "active",
  "stage": "client_owned",
  "role": "builder",
  "max_mode": "test",
  "four_eyes": false,
  "payer": "client",
  "budget_eur": null,
  "payer_change": {
    "to": "agency",
    "proposed_by": "agency",
    "proposed_at": "2026-10-12T09:00:00.000Z"
  },
  "owner_invite": null,
  "confirmed_at": null,
  "ended_at": null,
  "created_at": "2026-10-12T09:00:00.000Z",
  "applied": false
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### PUT /clients/{id}/budget

**Set the monthly budget for a client project.**

The most your agency pays for this client project per calendar month, in euros excluding VAT, or null for no budget of its own (your project's spending cap still applies). When it is reached, new paid usage in the project gets a 402 billing\_blocked and your agency gets one email that month.

Scope: `clients:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the client project. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `monthly_budget_eur` (required) | number or null |  |

JSON

```
{
  "monthly_budget_eur": 50
}
```

#### 200 The relation with the budget.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"client_relation"` |  |
| `id` (required) | string (uuid) |  |
| `agency` (required) | object |  |
| `client` (required) | object |  |
| `status` (required) | `"pending"`, `"active"`, `"declined"`, `"ended"` |  |
| `stage` (required) | `"building"`, `"client_owned"` |  |
| `role` (required) | `"viewer"`, `"builder"`, `"admin"` |  |
| `max_mode` (required) | `"test"`, `"live"` |  |
| `four_eyes` (required) | boolean |  |
| `payer` (required) | `"client"`, `"agency"` |  |
| `budget_eur` (required) | number or null |  |
| `payer_change` (required) | object or null |  |
| `owner_invite` (required) | object or null |  |
| `confirmed_at` (required) | string or null |  |
| `ended_at` (required) | string or null |  |
| `created_at` (required) | string |  |
| `transfer` | object |  |
| `ended_via` | `"client"`, `"agency"`, `"admin"`, `"handover"`, `"expired"`, `"cleanup"` |  |
| `cleanup` | object |  |

JSON

```
{
  "object": "client_relation",
  "id": "6e5d4c3b-2a19-4f8e-9d7c-6b5a49382716",
  "agency": {
    "project_id": "3f2a1c4e-5b6d-4e7f-8a9b-0c1d2e3f4a5b",
    "name": "Studio North"
  },
  "client": {
    "project_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
    "name": "Bakery Jansen"
  },
  "status": "active",
  "stage": "building",
  "role": "builder",
  "max_mode": "test",
  "four_eyes": false,
  "payer": "agency",
  "budget_eur": 50,
  "payer_change": null,
  "owner_invite": null,
  "confirmed_at": null,
  "ended_at": null,
  "created_at": "2026-10-12T09:00:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /clients/{id}/invoice-lines

**Export invoice lines for a client project.**

The usage of a client project as invoice lines per month, payer and source, from the same numbers as GET /clients/{id}/usage, so you invoice your client in your own accounting with your own markup. format=csv returns text/csv. Hypamoon does not send the invoice.

Scope: `clients:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the client project. |
| `months` | query | integer | How many months back, the current month included. |
| `payer` | query | `"agency"`, `"client"`, `"all"` | Only the lines your agency paid, only those the client paid, or all. |
| `format` | query | `"json"`, `"csv"` | json, or csv for a spreadsheet or import. |

#### 200 The invoice lines.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"list"` |  |
| `project_id` (required) | string (uuid) |  |
| `currency` (required) | `"EUR"` |  |
| `months` (required) | string\[\] |  |
| `total_eur` (required) | number |  |
| `data` (required) | object\[\] |  |

JSON

```
{
  "object": "list",
  "project_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
  "currency": "EUR",
  "months": [
    "2026-10"
  ],
  "total_eur": 4.2,
  "data": [
    {
      "month": "2026-10",
      "project_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
      "project_name": "Bakery Jansen",
      "payer": "agency",
      "source": "calls",
      "description": "Calls, Bakery Jansen, 2026-10",
      "amount_eur": 3.9,
      "currency": "EUR"
    },
    {
      "month": "2026-10",
      "project_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
      "project_name": "Bakery Jansen",
      "payer": "agency",
      "source": "sms",
      "description": "Text messages, Bakery Jansen, 2026-10",
      "amount_eur": 0.3,
      "currency": "EUR"
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### POST /clients/{id}/payment-links

**Create a payment link for a client.**

A one-time payment on your agency's own payment account (connected on your agency project), with the client project in the metadata. The money goes to your agency; Hypamoon keeps only the transaction fee you accepted when connecting. Give checkout\_url to your client yourself; nothing is emailed. Test until payments on your agency project are live. Events: client\_payment.paid and client\_payment.failed on your webhooks.

Scope: `clients:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the client project. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `amount_cents` (required) | integer |  |
| `currency` | string |  |
| `description` (required) | string |  |
| `redirect_url` (required) | string (uri) |  |
| `idempotency_key` | string |  |

JSON

```
{
  "amount_cents": 12100,
  "currency": "EUR",
  "description": "Website maintenance October",
  "redirect_url": "https://portal.studionorth.example/paid",
  "idempotency_key": "inv-2026-10-bakery"
}
```

#### 200 The payment link made earlier with this idempotency\_key.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"client_payment_link"`, `"client_subscription"` |  |
| `id` (required) | string (uuid) |  |
| `client_project_id` (required) | string (uuid) |  |
| `status` (required) | `"open"`, `"paid"`, `"failed"`, `"expired"`, `"active"`, `"canceled"` |  |
| `amount_cents` (required) | integer |  |
| `fee_cents` (required) | integer |  |
| `currency` (required) | string |  |
| `description` (required) | string |  |
| `interval` | `"month"`, `"year"`, `null` |  |
| `paid_until` | string or null |  |
| `canceled_at` | string or null |  |
| `test` (required) | boolean |  |
| `checkout_url` (required) | string or null |  |
| `paid_at` (required) | string or null |  |
| `created_at` (required) | string |  |

JSON

```
{
  "object": "client_payment_link",
  "id": "0d1e2f3a-4b5c-4d6e-8f70-81a2b3c4d5e6",
  "client_project_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
  "status": "open",
  "amount_cents": 12100,
  "fee_cents": 131,
  "currency": "EUR",
  "description": "Website maintenance October",
  "test": true,
  "checkout_url": "https://checkout.example/pay/7UhSN1zuXS",
  "paid_at": null,
  "created_at": "2026-10-12T09:00:00.000Z"
}
```

#### 201 The payment link.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"client_payment_link"`, `"client_subscription"` |  |
| `id` (required) | string (uuid) |  |
| `client_project_id` (required) | string (uuid) |  |
| `status` (required) | `"open"`, `"paid"`, `"failed"`, `"expired"`, `"active"`, `"canceled"` |  |
| `amount_cents` (required) | integer |  |
| `fee_cents` (required) | integer |  |
| `currency` (required) | string |  |
| `description` (required) | string |  |
| `interval` | `"month"`, `"year"`, `null` |  |
| `paid_until` | string or null |  |
| `canceled_at` | string or null |  |
| `test` (required) | boolean |  |
| `checkout_url` (required) | string or null |  |
| `paid_at` (required) | string or null |  |
| `created_at` (required) | string |  |

JSON

```
{
  "object": "client_payment_link",
  "id": "0d1e2f3a-4b5c-4d6e-8f70-81a2b3c4d5e6",
  "client_project_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
  "status": "open",
  "amount_cents": 12100,
  "fee_cents": 131,
  "currency": "EUR",
  "description": "Website maintenance October",
  "test": true,
  "checkout_url": "https://checkout.example/pay/7UhSN1zuXS",
  "paid_at": null,
  "created_at": "2026-10-12T09:00:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 502 | [`upstream_error`](https://hypamoon.com/docs/errors/upstream_error) |

### POST /clients/{id}/subscriptions

**Create a subscription for a client.**

A subscription on your agency's own payment account, with the client project in the metadata: the payer pays the first period through checkout\_url, which also sets up the mandate; after that the payment provider charges every month or year. Not every payment account supports this yet; a 409 says so. Events: client\_subscription.active, client\_subscription.payment\_paid, client\_subscription.payment\_failed and client\_subscription.canceled.

Scope: `clients:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the client project. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `amount_cents` (required) | integer |  |
| `currency` | string |  |
| `description` (required) | string |  |
| `redirect_url` (required) | string (uri) |  |
| `idempotency_key` | string |  |
| `interval` (required) | `"month"`, `"year"` |  |
| `email` (required) | string (email) |  |
| `name` | string |  |

JSON

```
{
  "amount_cents": 4900,
  "currency": "EUR",
  "interval": "month",
  "description": "Hosting and support",
  "email": "owner@example.org",
  "name": "Bakery Jansen",
  "redirect_url": "https://portal.studionorth.example/subscribed"
}
```

#### 200 The subscription made earlier with this idempotency\_key.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"client_payment_link"`, `"client_subscription"` |  |
| `id` (required) | string (uuid) |  |
| `client_project_id` (required) | string (uuid) |  |
| `status` (required) | `"open"`, `"paid"`, `"failed"`, `"expired"`, `"active"`, `"canceled"` |  |
| `amount_cents` (required) | integer |  |
| `fee_cents` (required) | integer |  |
| `currency` (required) | string |  |
| `description` (required) | string |  |
| `interval` | `"month"`, `"year"`, `null` |  |
| `paid_until` | string or null |  |
| `canceled_at` | string or null |  |
| `test` (required) | boolean |  |
| `checkout_url` (required) | string or null |  |
| `paid_at` (required) | string or null |  |
| `created_at` (required) | string |  |

JSON

```
{
  "object": "client_subscription",
  "id": "0d1e2f3a-4b5c-4d6e-8f70-81a2b3c4d5e6",
  "client_project_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
  "status": "open",
  "amount_cents": 12100,
  "fee_cents": 131,
  "currency": "EUR",
  "description": "Website maintenance October",
  "test": true,
  "checkout_url": "https://checkout.example/pay/7UhSN1zuXS",
  "paid_at": null,
  "created_at": "2026-10-12T09:00:00.000Z",
  "interval": "month",
  "paid_until": null,
  "canceled_at": null
}
```

#### 201 The subscription, open until the first payment.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"client_payment_link"`, `"client_subscription"` |  |
| `id` (required) | string (uuid) |  |
| `client_project_id` (required) | string (uuid) |  |
| `status` (required) | `"open"`, `"paid"`, `"failed"`, `"expired"`, `"active"`, `"canceled"` |  |
| `amount_cents` (required) | integer |  |
| `fee_cents` (required) | integer |  |
| `currency` (required) | string |  |
| `description` (required) | string |  |
| `interval` | `"month"`, `"year"`, `null` |  |
| `paid_until` | string or null |  |
| `canceled_at` | string or null |  |
| `test` (required) | boolean |  |
| `checkout_url` (required) | string or null |  |
| `paid_at` (required) | string or null |  |
| `created_at` (required) | string |  |

JSON

```
{
  "object": "client_subscription",
  "id": "0d1e2f3a-4b5c-4d6e-8f70-81a2b3c4d5e6",
  "client_project_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
  "status": "open",
  "amount_cents": 4900,
  "fee_cents": 59,
  "currency": "EUR",
  "description": "Hosting and support",
  "test": true,
  "checkout_url": "https://checkout.example/pay/7UhSN1zuXS",
  "paid_at": null,
  "created_at": "2026-10-12T09:00:00.000Z",
  "interval": "month",
  "paid_until": null,
  "canceled_at": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 502 | [`upstream_error`](https://hypamoon.com/docs/errors/upstream_error) |

### GET /clients/{id}/payments

**List payment links and subscriptions for a client.**

The payment links and subscriptions your agency made for this client project, newest first. Without the payer's email or name.

Scope: `clients:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the client project. |
| `limit` | query | integer | How many. |

#### 200 The payments.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"list"` |  |
| `data` (required) | object\[\] |  |

JSON

```
{
  "object": "list",
  "data": [
    {
      "object": "client_payment_link",
      "id": "0d1e2f3a-4b5c-4d6e-8f70-81a2b3c4d5e6",
      "client_project_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
      "status": "open",
      "amount_cents": 12100,
      "fee_cents": 131,
      "currency": "EUR",
      "description": "Website maintenance October",
      "test": true,
      "checkout_url": "https://checkout.example/pay/7UhSN1zuXS",
      "paid_at": null,
      "created_at": "2026-10-12T09:00:00.000Z"
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### DELETE /clients/{id}/subscriptions/{subscriptionId}

**Cancel a client subscription.**

Stops a subscription at your payment provider right away: no more charges. What was paid stays paid; nothing is refunded.

Scope: `clients:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the client project. |
| `subscriptionId` (required) | path | string (uuid) | The id of the subscription. |

#### 200 The canceled subscription.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"client_payment_link"`, `"client_subscription"` |  |
| `id` (required) | string (uuid) |  |
| `client_project_id` (required) | string (uuid) |  |
| `status` (required) | `"open"`, `"paid"`, `"failed"`, `"expired"`, `"active"`, `"canceled"` |  |
| `amount_cents` (required) | integer |  |
| `fee_cents` (required) | integer |  |
| `currency` (required) | string |  |
| `description` (required) | string |  |
| `interval` | `"month"`, `"year"`, `null` |  |
| `paid_until` | string or null |  |
| `canceled_at` | string or null |  |
| `test` (required) | boolean |  |
| `checkout_url` (required) | string or null |  |
| `paid_at` (required) | string or null |  |
| `created_at` (required) | string |  |

JSON

```
{
  "object": "client_subscription",
  "id": "0d1e2f3a-4b5c-4d6e-8f70-81a2b3c4d5e6",
  "client_project_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
  "status": "canceled",
  "amount_cents": 12100,
  "fee_cents": 131,
  "currency": "EUR",
  "description": "Website maintenance October",
  "test": true,
  "checkout_url": null,
  "paid_at": null,
  "created_at": "2026-10-12T09:00:00.000Z",
  "interval": "month",
  "paid_until": "2026-11-12T09:00:00.000Z",
  "canceled_at": "2026-10-20T09:00:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |

### DELETE /clients/{id}/payment-links/{linkId}

**Withdraw an open payment link.**

Marks an open payment link of your agency as expired, also after your relation with the client ended. The checkout at your payment provider expires on its own; if it is still paid, the money is on your own account.

Scope: `clients:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the client project. |
| `linkId` (required) | path | string (uuid) | The id of the payment link. |

#### 200 The withdrawn payment link.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"client_payment_link"`, `"client_subscription"` |  |
| `id` (required) | string (uuid) |  |
| `client_project_id` (required) | string (uuid) |  |
| `status` (required) | `"open"`, `"paid"`, `"failed"`, `"expired"`, `"active"`, `"canceled"` |  |
| `amount_cents` (required) | integer |  |
| `fee_cents` (required) | integer |  |
| `currency` (required) | string |  |
| `description` (required) | string |  |
| `interval` | `"month"`, `"year"`, `null` |  |
| `paid_until` | string or null |  |
| `canceled_at` | string or null |  |
| `test` (required) | boolean |  |
| `checkout_url` (required) | string or null |  |
| `paid_at` (required) | string or null |  |
| `created_at` (required) | string |  |

JSON

```
{
  "object": "client_payment_link",
  "id": "0d1e2f3a-4b5c-4d6e-8f70-81a2b3c4d5e6",
  "client_project_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
  "status": "expired",
  "amount_cents": 12100,
  "fee_cents": 131,
  "currency": "EUR",
  "description": "Website maintenance October",
  "test": true,
  "checkout_url": null,
  "paid_at": null,
  "created_at": "2026-10-12T09:00:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### GET /clients/{id}/activity

**Read the activity log of a client project.**

The activity log of a client project, newest first. Actions by your agency carry details.via\_bureau. For the next page, pass next\_before as before.

Scope: `clients:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the client project. |
| `limit` | query | integer | How many entries. |
| `before` | query | string | next\_before from the previous page. |

#### 200 The log entries.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"list"` |  |
| `project_id` (required) | string (uuid) |  |
| `data` (required) | object\[\] |  |
| `next_before` (required) | string or null |  |

JSON

```
{
  "object": "list",
  "project_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
  "data": [],
  "next_before": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /agencies

**List the agencies on this project.**

For a client: the agencies that work on this project or asked to, newest first. Accepting a request is only possible in the portal, where the owner reads what the agency can do.

Scope: `project:read`

#### 200 The agency relations of this project.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"list"` |  |
| `data` (required) | object\[\] |  |

JSON

```
{
  "object": "list",
  "data": [
    {
      "object": "client_relation",
      "id": "6e5d4c3b-2a19-4f8e-9d7c-6b5a49382716",
      "agency": {
        "project_id": "3f2a1c4e-5b6d-4e7f-8a9b-0c1d2e3f4a5b",
        "name": "Studio North"
      },
      "client": {
        "project_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
        "name": "Bakery Jansen"
      },
      "status": "active",
      "stage": "client_owned",
      "role": "builder",
      "max_mode": "test",
      "four_eyes": false,
      "payer": "client",
      "budget_eur": null,
      "payer_change": null,
      "owner_invite": null,
      "confirmed_at": null,
      "ended_at": null,
      "created_at": "2026-10-12T09:00:00.000Z"
    }
  ]
}
```

### DELETE /agencies/{id}

**Revoke an agency's access.**

For the owner of a client project: ends an agency's access right away, or declines its open request. What the agency built stays.

Scope: `project:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the agency relation. |

#### 200 The ended relation.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"client_relation"` |  |
| `id` (required) | string (uuid) |  |
| `agency` (required) | object |  |
| `client` (required) | object |  |
| `status` (required) | `"pending"`, `"active"`, `"declined"`, `"ended"` |  |
| `stage` (required) | `"building"`, `"client_owned"` |  |
| `role` (required) | `"viewer"`, `"builder"`, `"admin"` |  |
| `max_mode` (required) | `"test"`, `"live"` |  |
| `four_eyes` (required) | boolean |  |
| `payer` (required) | `"client"`, `"agency"` |  |
| `budget_eur` (required) | number or null |  |
| `payer_change` (required) | object or null |  |
| `owner_invite` (required) | object or null |  |
| `confirmed_at` (required) | string or null |  |
| `ended_at` (required) | string or null |  |
| `created_at` (required) | string |  |
| `transfer` | object |  |
| `ended_via` | `"client"`, `"agency"`, `"admin"`, `"handover"`, `"expired"`, `"cleanup"` |  |
| `cleanup` | object |  |

JSON

```
{
  "object": "client_relation",
  "id": "6e5d4c3b-2a19-4f8e-9d7c-6b5a49382716",
  "agency": {
    "project_id": "3f2a1c4e-5b6d-4e7f-8a9b-0c1d2e3f4a5b",
    "name": "Studio North"
  },
  "client": {
    "project_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
    "name": "Bakery Jansen"
  },
  "status": "ended",
  "stage": "client_owned",
  "role": "builder",
  "max_mode": "test",
  "four_eyes": false,
  "payer": "client",
  "budget_eur": null,
  "payer_change": null,
  "owner_invite": null,
  "confirmed_at": null,
  "ended_at": "2026-10-20T09:00:00.000Z",
  "created_at": "2026-10-12T09:00:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

## Containers

A full app or server on a site: an image of your own, or Node or Python source that we build. Every path of the site goes to it.

### GET /containers

**List containers.**

The containers of the project, newest first.

Scope: `sites:read`

#### 200 The containers.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] |  |

JSON

```
{
  "data": [
    {
      "id": "5b1e2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
      "site_id": "9d2e4f6a-1b3c-4d5e-8f70-a1b2c3d4e5f6",
      "name": "Orders API",
      "url": "https://orders-demo.hypamoon.app",
      "mode": "live",
      "status": "running",
      "version": 3,
      "instance_type": "basic",
      "instances": 1,
      "always_on": false,
      "sleep_after": "5m",
      "port": 8080,
      "health_path": "/health",
      "allowed_hosts": [
        "api.example-payments.com"
      ],
      "secrets": [
        "payments_key"
      ],
      "env_secrets": [],
      "env_names": [
        "LOG_LEVEL"
      ],
      "created_at": "2026-10-17T10:00:00.000Z",
      "updated_at": "2026-10-17T10:05:00.000Z"
    }
  ]
}
```

### POST /containers

**Deploy a container on a site.**

Puts a container on a site: every path of the site (and its own domain) then goes to it. Send a public image, or the source of a Node or Python app without a Dockerfile: we install the dependencies on Linux, scan them and build the image. The work runs after the answer (202): get\_container shows when the version is live. A new version only gets traffic after its health\_path answers 2xx; if it never does, the previous version keeps running. Settings left out on a new version are kept from the running one.

Scope: `sites:write`

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `site_id` (required) | string (uuid) | The site that serves the container: every path of the site (and its own domain) goes to it. Create the site first with deploy\_site. |
| `name` | string |  |
| `image` | string | A public linux/amd64 image, like ghcr.io/acme/api:1.4 or docker.io/library/nginx@sha256:... We copy it, so a later change upstream changes nothing here. Use image or source, not both. |
| `source` | object | The app as files, without a Dockerfile: a Node app (package.json) or a Python app (requirements.txt or pyproject.toml). We install the dependencies on Linux and build the image. |
| `runtime` | `"node"`, `"python"` | Only with source. Left out: package.json means node, requirements.txt or pyproject.toml means python. |
| `build_command` | string | Only with source. Left out: npm run build when package.json has a build script, nothing for Python. |
| `start_command` | string | Only with source. Left out: npm start (or node main), or the web line of a Procfile, or python main.py/app.py. |
| `port` | integer | The port the server listens on. Default 8080; the container also gets it as PORT. |
| `instance_type` | `"lite"`, `"basic"`, `"standard-1"`, `"standard-2"` | Size: lite (1/16 vCPU, 256 MiB), basic (1/4 vCPU, 1 GiB), standard-1 (1/2 vCPU, 4 GiB), standard-2 (1 vCPU, 6 GiB). Default lite. |
| `instances` | integer | How many instances share the traffic. Default 1. |
| `always_on` | boolean | true keeps the instances running (no start-up wait, for webhooks and realtime). Default false: the container sleeps after sleep\_after without traffic and starts on the next request. |
| `sleep_after` | string | Idle time before sleeping, like "5m" or "1h". Default 5m. Ignored with always\_on. |
| `health_path` | string | A path that answers 2xx when the app is ready. A new version only gets traffic after this answers. Default /. |
| `env` | object | Plain environment variables (not secret). Left out on a new version: the running version's env is kept. |
| `secrets` | string\[\] | Vault secrets the container may use without ever seeing them: send a request with the header x-hypamoon-secret: <name> and we add the secret on the way out (the safe default). |
| `env_secrets` | object\[\] | Vault secrets the code itself must know (a database URL, an HMAC key), as environment variables. The code can read and send these; prefer secrets when an API key in a header is enough. A signing secret for incoming webhooks, or a secret waiting for set\_app\_secret, cannot be an env\_secret. A secret with allowed\_hosts only goes in when the allowed\_hosts of the container are not empty and every one of them is a host of that secret: no other host and no wildcard. |
| `allowed_hosts` | string\[\] | The only hosts the container may call over HTTPS, like api.example-payments.com or \*.example.com. api.hypamoon.com is always allowed. Nothing else gets out; empty means only api.hypamoon.com. With env\_secrets that have allowed\_hosts, this list may only hold hosts of those secrets, and it cannot be empty. |

JSON

```
{
  "site_id": "9d2e4f6a-1b3c-4d5e-8f70-a1b2c3d4e5f6",
  "source": {
    "files": [
      {
        "path": "package.json",
        "content": "{\"scripts\":{\"start\":\"node server.js\"},\"dependencies\":{\"express\":\"^5.1.0\"}}"
      },
      {
        "path": "server.js",
        "content": "require('express')().get('/health',(q,r)=>r.send('ok')).listen(process.env.PORT)"
      }
    ]
  },
  "health_path": "/health"
}
```

#### 202 The container and the deploy in the queue.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `site_id` (required) | string (uuid) |  |
| `name` (required) | string |  |
| `url` (required) | string |  |
| `mode` (required) | `"live"`, `"test"` |  |
| `status` (required) | `"deploying"`, `"running"`, `"failed"`, `"suspended"` |  |
| `suspended` | object |  |
| `version` (required) | integer | The live version; 0 until the first deploy is live. |
| `instance_type` (required) | string |  |
| `instances` (required) | integer |  |
| `always_on` (required) | boolean |  |
| `sleep_after` (required) | string |  |
| `port` (required) | integer |  |
| `health_path` (required) | string |  |
| `allowed_hosts` (required) | string\[\] |  |
| `secrets` (required) | string\[\] |  |
| `env_secrets` (required) | object\[\] |  |
| `env_names` (required) | string\[\] | Names of the plain environment variables (never the values of secrets). |
| `created_at` (required) | string |  |
| `updated_at` (required) | string |  |
| `deploy` (required) | object |  |
| `kept` | string\[\] |  |

JSON

```
{
  "id": "5b1e2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
  "site_id": "9d2e4f6a-1b3c-4d5e-8f70-a1b2c3d4e5f6",
  "name": "Orders API",
  "url": "https://orders-demo.hypamoon.app",
  "mode": "live",
  "status": "running",
  "version": 3,
  "instance_type": "basic",
  "instances": 1,
  "always_on": false,
  "sleep_after": "5m",
  "port": 8080,
  "health_path": "/health",
  "allowed_hosts": [
    "api.example-payments.com"
  ],
  "secrets": [
    "payments_key"
  ],
  "env_secrets": [],
  "env_names": [
    "LOG_LEVEL"
  ],
  "created_at": "2026-10-17T10:00:00.000Z",
  "updated_at": "2026-10-17T10:05:00.000Z",
  "deploy": {
    "version": 4,
    "status": "queued",
    "source": {
      "kind": "build",
      "runtime": "node"
    },
    "created_at": "2026-10-17T11:00:00.000Z"
  }
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 402 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 403 | [`site_offline`](https://hypamoon.com/docs/errors/site_offline) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 409 | [`plan_limit_reached`](https://hypamoon.com/docs/errors/plan_limit_reached) |
| 413 | [`app_too_large`](https://hypamoon.com/docs/errors/app_too_large) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`app_blocked`](https://hypamoon.com/docs/errors/app_blocked) |
| 429 | [`deploy_limit_reached`](https://hypamoon.com/docs/errors/deploy_limit_reached) |

### GET /containers/{id}

**Get a container.**

The container with its newest deploys (status, steps, errors, the dependency scan) and its usage of the last 30 days.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the container. |

#### 200 The container.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `site_id` (required) | string (uuid) |  |
| `name` (required) | string |  |
| `url` (required) | string |  |
| `mode` (required) | `"live"`, `"test"` |  |
| `status` (required) | `"deploying"`, `"running"`, `"failed"`, `"suspended"` |  |
| `suspended` | object |  |
| `version` (required) | integer | The live version; 0 until the first deploy is live. |
| `instance_type` (required) | string |  |
| `instances` (required) | integer |  |
| `always_on` (required) | boolean |  |
| `sleep_after` (required) | string |  |
| `port` (required) | integer |  |
| `health_path` (required) | string |  |
| `allowed_hosts` (required) | string\[\] |  |
| `secrets` (required) | string\[\] |  |
| `env_secrets` (required) | object\[\] |  |
| `env_names` (required) | string\[\] | Names of the plain environment variables (never the values of secrets). |
| `created_at` (required) | string |  |
| `updated_at` (required) | string |  |
| `deploys` (required) | object\[\] | The newest deploys, newest first. |
| `usage_30d` (required) | object |  |

JSON

```
{
  "id": "5b1e2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
  "site_id": "9d2e4f6a-1b3c-4d5e-8f70-a1b2c3d4e5f6",
  "name": "Orders API",
  "url": "https://orders-demo.hypamoon.app",
  "mode": "live",
  "status": "running",
  "version": 3,
  "instance_type": "basic",
  "instances": 1,
  "always_on": false,
  "sleep_after": "5m",
  "port": 8080,
  "health_path": "/health",
  "allowed_hosts": [
    "api.example-payments.com"
  ],
  "secrets": [
    "payments_key"
  ],
  "env_secrets": [],
  "env_names": [
    "LOG_LEVEL"
  ],
  "created_at": "2026-10-17T10:00:00.000Z",
  "updated_at": "2026-10-17T10:05:00.000Z",
  "deploys": [
    {
      "version": 4,
      "status": "live",
      "source": {
        "kind": "build",
        "runtime": "node"
      },
      "created_at": "2026-10-17T11:00:00.000Z"
    }
  ],
  "usage_30d": {
    "cpu_seconds": 5400,
    "memory_gib_hours": 180,
    "egress_gb": 1.2,
    "days": 30
  }
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### DELETE /containers/{id}

**Delete a container.**

Removes the container: traffic stops within seconds, then the instances, versions and images go. The site itself stays.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the container. |

#### 204 Deleted.

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### GET /containers/{id}/versions

**List the versions of a container.**

All kept versions, newest first, with status, source, rollout steps and errors.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the container. |

#### 200 The versions.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] |  |

JSON

```
{
  "data": [
    {
      "version": 4,
      "status": "live",
      "source": {
        "kind": "build",
        "runtime": "node"
      },
      "created_at": "2026-10-17T11:00:00.000Z"
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### POST /containers/{id}/rollback

**Roll a container back.**

Puts an earlier version live again (same image and settings) as a new version, with the same health check as a deploy (202).

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the container. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `version` (required) | integer | The version to go back to (list\_container\_versions). |

JSON

```
{
  "version": 2
}
```

#### 202 The container and the rollback in the queue.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `site_id` (required) | string (uuid) |  |
| `name` (required) | string |  |
| `url` (required) | string |  |
| `mode` (required) | `"live"`, `"test"` |  |
| `status` (required) | `"deploying"`, `"running"`, `"failed"`, `"suspended"` |  |
| `suspended` | object |  |
| `version` (required) | integer | The live version; 0 until the first deploy is live. |
| `instance_type` (required) | string |  |
| `instances` (required) | integer |  |
| `always_on` (required) | boolean |  |
| `sleep_after` (required) | string |  |
| `port` (required) | integer |  |
| `health_path` (required) | string |  |
| `allowed_hosts` (required) | string\[\] |  |
| `secrets` (required) | string\[\] |  |
| `env_secrets` (required) | object\[\] |  |
| `env_names` (required) | string\[\] | Names of the plain environment variables (never the values of secrets). |
| `created_at` (required) | string |  |
| `updated_at` (required) | string |  |
| `deploy` (required) | object |  |
| `kept` | string\[\] |  |

JSON

```
{
  "id": "5b1e2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
  "site_id": "9d2e4f6a-1b3c-4d5e-8f70-a1b2c3d4e5f6",
  "name": "Orders API",
  "url": "https://orders-demo.hypamoon.app",
  "mode": "live",
  "status": "running",
  "version": 3,
  "instance_type": "basic",
  "instances": 1,
  "always_on": false,
  "sleep_after": "5m",
  "port": 8080,
  "health_path": "/health",
  "allowed_hosts": [
    "api.example-payments.com"
  ],
  "secrets": [
    "payments_key"
  ],
  "env_secrets": [],
  "env_names": [
    "LOG_LEVEL"
  ],
  "created_at": "2026-10-17T10:00:00.000Z",
  "updated_at": "2026-10-17T10:05:00.000Z",
  "deploy": {
    "version": 4,
    "status": "queued",
    "source": {
      "kind": "rollback",
      "from_version": 2
    },
    "created_at": "2026-10-17T11:00:00.000Z"
  }
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### POST /containers/{id}/restart

**Restart a container.**

Restarts the instances of the live version and waits until health\_path answers 2xx.

Scope: `sites:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the container. |

#### 200 The container, healthy again.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `site_id` (required) | string (uuid) |  |
| `name` (required) | string |  |
| `url` (required) | string |  |
| `mode` (required) | `"live"`, `"test"` |  |
| `status` (required) | `"deploying"`, `"running"`, `"failed"`, `"suspended"` |  |
| `suspended` | object |  |
| `version` (required) | integer | The live version; 0 until the first deploy is live. |
| `instance_type` (required) | string |  |
| `instances` (required) | integer |  |
| `always_on` (required) | boolean |  |
| `sleep_after` (required) | string |  |
| `port` (required) | integer |  |
| `health_path` (required) | string |  |
| `allowed_hosts` (required) | string\[\] |  |
| `secrets` (required) | string\[\] |  |
| `env_secrets` (required) | object\[\] |  |
| `env_names` (required) | string\[\] | Names of the plain environment variables (never the values of secrets). |
| `created_at` (required) | string |  |
| `updated_at` (required) | string |  |

JSON

```
{
  "id": "5b1e2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
  "site_id": "9d2e4f6a-1b3c-4d5e-8f70-a1b2c3d4e5f6",
  "name": "Orders API",
  "url": "https://orders-demo.hypamoon.app",
  "mode": "live",
  "status": "running",
  "version": 3,
  "instance_type": "basic",
  "instances": 1,
  "always_on": false,
  "sleep_after": "5m",
  "port": 8080,
  "health_path": "/health",
  "allowed_hosts": [
    "api.example-payments.com"
  ],
  "secrets": [
    "payments_key"
  ],
  "env_secrets": [],
  "env_names": [
    "LOG_LEVEL"
  ],
  "created_at": "2026-10-17T10:00:00.000Z",
  "updated_at": "2026-10-17T10:05:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 503 | [`container_unhealthy`](https://hypamoon.com/docs/errors/container_unhealthy) |

### GET /containers/{id}/logs

**Get the log of a container.**

The newest lines: requests, instance starts and stops (with exit codes), health checks after a deploy, and outbound calls (allowed, through the vault, refused). Never headers, queries, bodies or secrets. Seven days.

Scope: `sites:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the container. |
| `limit` | query | integer | How many lines (default 50). |
| `errors_only` | query | boolean | Only errors, failed health checks, crashes and refused outbound calls. |

#### 200 The lines, newest first.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] |  |

JSON

```
{
  "data": [
    {
      "at": "2026-10-17T11:02:00.000Z",
      "kind": "healthy",
      "method": "",
      "path": "/health",
      "status": 200,
      "duration_ms": 1300,
      "message": "",
      "version": "4"
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_parameter`](https://hypamoon.com/docs/errors/invalid_parameter) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

## Marketplaces

A marketplace in an app: sellers with their own products, one checkout over several sellers, commission for the holder, and payouts through the holder's own Stripe account. Rules per country decide who may sell what, where.

### GET /marketplaces/{id}

**Get the marketplace of an app.**

The marketplace of the app: holder country, status, commission, payout moment and the settings. Sellers and buyers see only the country and status.

Scope: `data:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app that holds the marketplace. |

#### 200 The marketplace.

| Field | Type |  |
| --- | --- | --- |
| `app_id` (required) | string |  |
| `holder_country` (required) | string |  |
| `status` (required) | `"setup"`, `"open"`, `"closed"` |  |
| `test` (required) | boolean |  |

JSON

```
{
  "app_id": "5b1e2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
  "holder_country": "NL",
  "status": "open",
  "test": true,
  "review_listings": false,
  "allowed_seller_kinds": [
    "trader",
    "private"
  ],
  "disabled_default_rules": [],
  "commission": {
    "percentage_bp": 1000,
    "fixed_cents": 0
  },
  "payout_moment": {
    "when": "on_shipment",
    "days": 0
  },
  "rule_set_version": "2026-10-23.1"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### PUT /marketplaces/{id}

**Set up or change the marketplace.**

Creates the marketplace of an app or changes it: holder\_country (where the holder is established; decides the tax role and reporting duties), commission (basis points of each seller's subtotal plus a fixed amount), payout\_moment, allowed\_seller\_kinds, review\_listings and default rules the holder turns off with a statement. Only the holder (project:write). A live marketplace opens only with the holder's Stripe account connected and the marketplace terms published.

Scope: `data:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app that holds the marketplace. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `holder_country` | string | ISO 3166-1 country code, or ISO 3166-2 for a subdivision where the rules differ (like GB-SCT). |
| `status` | `"setup"`, `"open"`, `"closed"` |  |
| `review_listings` | boolean | true: every new or changed product waits for approval. Restricted categories (alcohol, tobacco, vapes) always wait. |
| `allowed_seller_kinds` | `"trader"`, `"private"`\[\] |  |
| `disabled_default_rules` | object\[\] | Default rules the holder turns off, each with the holder's own statement. Hard rules cannot be turned off. |
| `emails` | object | Which emails Hypamoon sends for this marketplace. They go in the language of the app's site (Dutch or English), with replies to the project's contact address, and from the project's own verified sending domain when it has one. |
| `commission` | object |  |
| `payout_moment` | object |  |

JSON

```
{
  "holder_country": "NL",
  "commission": {
    "percentage_bp": 1000
  },
  "payout_moment": {
    "when": "on_shipment"
  }
}
```

#### 200 The changed marketplace.

| Field | Type |  |
| --- | --- | --- |
| `app_id` (required) | string |  |
| `holder_country` (required) | string |  |
| `status` (required) | `"setup"`, `"open"`, `"closed"` |  |
| `test` (required) | boolean |  |

JSON

```
{
  "app_id": "5b1e2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
  "holder_country": "NL",
  "status": "open",
  "test": true,
  "review_listings": false,
  "allowed_seller_kinds": [
    "trader",
    "private"
  ],
  "disabled_default_rules": [],
  "commission": {
    "percentage_bp": 1000,
    "fixed_cents": 0
  },
  "payout_moment": {
    "when": "on_shipment",
    "days": 0
  },
  "rule_set_version": "2026-10-23.1"
}
```

#### 201 The new marketplace, with the rules for its holder country.

| Field | Type |  |
| --- | --- | --- |
| `app_id` (required) | string |  |
| `holder_country` (required) | string |  |
| `status` (required) | `"setup"`, `"open"`, `"closed"` |  |
| `test` (required) | boolean |  |

JSON

```
{
  "app_id": "5b1e2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
  "holder_country": "NL",
  "status": "open",
  "test": true,
  "review_listings": false,
  "allowed_seller_kinds": [
    "trader",
    "private"
  ],
  "disabled_default_rules": [],
  "commission": {
    "percentage_bp": 1000,
    "fixed_cents": 0
  },
  "payout_moment": {
    "when": "on_shipment",
    "days": 0
  },
  "rule_set_version": "2026-10-23.1"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`rule_blocked`](https://hypamoon.com/docs/errors/rule_blocked) |

### GET /marketplaces/{id}/rules

**The rules for a seller, a delivery and a category.**

Evaluates the rule set for this marketplace and a combination of seller\_country, seller\_kind, delivery\_country and category (with abv and distilled): allowed, refusals, minimum age, credentials, notices and every rule that applied, with its explanation, certainty and sources.

Scope: `data:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app that holds the marketplace. |
| `category` | query | string | A category from the rule set, like alcohol\_beer\_wine. |
| `seller_country` | query | string | The seller's country. |
| `seller_kind` | query | `"trader"`, `"private"` | trader or private. |
| `delivery_country` | query | string | The country of delivery. |
| `abv` | query | number | Alcohol by volume, for drinks. |
| `distilled` | query | boolean | true for spirits. |

#### 200 The outcome and the rules.

| Field | Type |  |
| --- | --- | --- |
| `allowed` (required) | boolean |  |
| `refusals` (required) | object\[\] |  |
| `rules` (required) | object\[\] |  |

JSON

```
{
  "allowed": true,
  "refusals": [],
  "min_age": 18,
  "rules": [
    {
      "id": "NL.alcohol.min_age",
      "explain": "Alcohol is only sold to people of 18 or older.",
      "certainty": "zeker"
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### GET /marketplaces/{id}/sellers

**List the sellers.**

The holder sees every seller with status, verification and credentials; a seller sees only themself. The tax number never comes back, only tin\_on\_file.

Scope: `data:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app that holds the marketplace. |

#### 200 The sellers.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] |  |

JSON

```
{
  "data": [
    {
      "id": "6c2f3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
      "user_id": "7d3a4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
      "email": "seller@example.invalid",
      "name": "Wine shop A",
      "kind": "trader",
      "country": "NL",
      "status": "active",
      "categories": [
        "alcohol_beer_wine"
      ],
      "tin_on_file": false,
      "trader_declaration": true,
      "onboarding_complete": true,
      "credentials": [],
      "payments": {
        "provider": "stripe",
        "account_id": "acct_1Q2w3E4r5T6y7U8i",
        "kyc_status": "verified"
      },
      "suspension": null
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### POST /marketplaces/{id}/sellers

**Invite a seller.**

Makes an app user a seller. The user must already be a user of the app with the role seller (invite\_app\_user first). With country and kind, the rules of the marketplace are checked before anything is stored: a country or kind that is not admitted gives rule\_blocked with the rule\_id.

Scope: `data:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app that holds the marketplace. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `user_id` (required) | string | The app user who becomes the seller (invite them with invite\_app\_user and the role seller first). |
| `email` | string (email) |  |
| `name` | string |  |
| `country` | string | ISO 3166-1 country code, or ISO 3166-2 for a subdivision where the rules differ (like GB-SCT). |
| `kind` | `"trader"`, `"private"` |  |

JSON

```
{
  "user_id": "7d3a4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
  "email": "seller@example.invalid",
  "country": "NL",
  "kind": "trader"
}
```

#### 201 The seller, waiting for their onboarding.

JSON

```
{
  "id": "6c2f3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
  "user_id": "7d3a4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
  "email": "seller@example.invalid",
  "name": "Wine shop A",
  "kind": "trader",
  "country": "NL",
  "status": "invited",
  "categories": [
    "alcohol_beer_wine"
  ],
  "tin_on_file": false,
  "trader_declaration": true,
  "onboarding_complete": true,
  "credentials": [],
  "payments": {
    "provider": "stripe",
    "account_id": "acct_1Q2w3E4r5T6y7U8i",
    "kyc_status": "verified"
  },
  "suspension": null,
  "next_step": "The seller signs in to the app with the role seller and completes PUT /sellers/{id}/onboarding."
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`rule_blocked`](https://hypamoon.com/docs/errors/rule_blocked) |

### GET /marketplaces/{id}/sellers/{sellerId}

**Get one seller.**

One seller with status, onboarding, credentials and the verification by Stripe. A seller only reaches themself; another id is 404.

Scope: `data:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app that holds the marketplace. |
| `sellerId` (required) | path | string (uuid) | The id of the seller. |

#### 200 The seller.

JSON

```
{
  "id": "6c2f3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
  "user_id": "7d3a4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
  "email": "seller@example.invalid",
  "name": "Wine shop A",
  "kind": "trader",
  "country": "NL",
  "status": "active",
  "categories": [
    "alcohol_beer_wine"
  ],
  "tin_on_file": false,
  "trader_declaration": true,
  "onboarding_complete": true,
  "credentials": [],
  "payments": {
    "provider": "stripe",
    "account_id": "acct_1Q2w3E4r5T6y7U8i",
    "kyc_status": "verified"
  },
  "suspension": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### PATCH /marketplaces/{id}/sellers/{sellerId}

**Activate, suspend or close a seller.**

The holder sets a seller to active (after onboarding and the verification by Stripe), suspended (with a reason the seller gets) or closed.

Scope: `data:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app that holds the marketplace. |
| `sellerId` (required) | path | string (uuid) | The id of the seller. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `status` (required) | `"active"`, `"suspended"`, `"closed"` |  |
| `reason` | string |  |
| `until` | string (date-time) |  |

JSON

```
{
  "status": "suspended",
  "reason": "Listings did not match the products sent."
}
```

#### 200 The seller.

JSON

```
{
  "id": "6c2f3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
  "user_id": "7d3a4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
  "email": "seller@example.invalid",
  "name": "Wine shop A",
  "kind": "trader",
  "country": "NL",
  "status": "suspended",
  "categories": [
    "alcohol_beer_wine"
  ],
  "tin_on_file": false,
  "trader_declaration": true,
  "onboarding_complete": true,
  "credentials": [],
  "payments": {
    "provider": "stripe",
    "account_id": "acct_1Q2w3E4r5T6y7U8i",
    "kyc_status": "verified"
  },
  "suspension": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### POST /marketplaces/{id}/sellers/{sellerId}/suspend

**Suspend a seller.**

Only the holder. Suspends the seller right away, with a reason the seller gets by email (the EU platform-to-business rules ask for it) and optionally until, the date that is in that email. A suspended seller does not appear in the quote or the checkout, and their products leave the product collection. Paid sub-orders stay theirs to ship. Suspending again updates the reason and the date; reinstate lifts it.

Scope: `data:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app that holds the marketplace. |
| `sellerId` (required) | path | string (uuid) | The id of the seller. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `reason` (required) | string |  |
| `until` | string (date-time) |  |

JSON

```
{
  "reason": "Listings did not match the products sent.",
  "until": "2026-11-24T00:00:00.000Z"
}
```

#### 200 The suspended seller.

JSON

```
{
  "id": "6c2f3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
  "user_id": "7d3a4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
  "email": "seller@example.invalid",
  "name": "Wine shop A",
  "kind": "trader",
  "country": "NL",
  "status": "suspended",
  "categories": [
    "alcohol_beer_wine"
  ],
  "tin_on_file": false,
  "trader_declaration": true,
  "onboarding_complete": true,
  "credentials": [],
  "payments": {
    "provider": "stripe",
    "account_id": "acct_1Q2w3E4r5T6y7U8i",
    "kyc_status": "verified"
  },
  "suspension": {
    "reason": "Listings did not match the products sent.",
    "until": "2026-11-24T00:00:00.000Z"
  }
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### POST /marketplaces/{id}/sellers/{sellerId}/reinstate

**Lift a seller's suspension.**

Only the holder. The seller is active again (or back in onboarding when that or the verification by Stripe is not done) and gets an email; their approved products are for sale again. 409 when the seller is not suspended.

Scope: `data:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app that holds the marketplace. |
| `sellerId` (required) | path | string (uuid) | The id of the seller. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `reason` | string |  |

JSON

```
{}
```

#### 200 The seller.

JSON

```
{
  "id": "6c2f3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
  "user_id": "7d3a4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
  "email": "seller@example.invalid",
  "name": "Wine shop A",
  "kind": "trader",
  "country": "NL",
  "status": "active",
  "categories": [
    "alcohol_beer_wine"
  ],
  "tin_on_file": false,
  "trader_declaration": true,
  "onboarding_complete": true,
  "credentials": [],
  "payments": {
    "provider": "stripe",
    "account_id": "acct_1Q2w3E4r5T6y7U8i",
    "kyc_status": "verified"
  },
  "suspension": null
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### PUT /marketplaces/{id}/sellers/{sellerId}/onboarding

**The seller's own details.**

Only the seller, signed in to the app: country, kind (their own declaration), name, address, the fields the reporting duties ask, categories and credentials. Answers what is still missing.

Scope: `data:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app that holds the marketplace. |
| `sellerId` (required) | path | string (uuid) | The id of the seller. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `country` (required) | string | ISO 3166-1 country code, or ISO 3166-2 for a subdivision where the rules differ (like GB-SCT). |
| `kind` (required) | `"trader"`, `"private"` | trader: selling as a business. private: a private individual. The seller's own declaration (Omnibus). |
| `name` (required) | string |  |
| `email` | string (email) |  |
| `phone` | string |  |
| `address` | object |  |
| `date_of_birth` | string |  |
| `trade_register_number` | string |  |
| `vat_number` | string |  |
| `financial_account` | string |  |
| `tin_country` | string | The country that issued the tax number. The number itself goes through the tin step, and only when it is needed. |
| `permanent_establishments` | string\[\] |  |
| `trader_declaration` | `true` | Traders: I only offer products and services that comply with EU law (DSA art. 30). |
| `categories` | string\[\] |  |
| `credentials` | object\[\] |  |

JSON

```
{
  "country": "NL",
  "kind": "private",
  "name": "Bea",
  "date_of_birth": "1990-01-01",
  "address": {
    "line1": "Laan 2",
    "postal_code": "2000 BB",
    "city": "Haarlem",
    "country": "NL"
  },
  "financial_account": "NL91ABNA0417164300",
  "tin_country": "NL",
  "categories": [
    "general"
  ]
}
```

#### 200 The seller with missing and credentials\_required.

JSON

```
{
  "id": "6c2f3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
  "user_id": "7d3a4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
  "email": "seller@example.invalid",
  "name": "Wine shop A",
  "kind": "trader",
  "country": "NL",
  "status": "active",
  "categories": [
    "alcohol_beer_wine"
  ],
  "tin_on_file": false,
  "trader_declaration": true,
  "onboarding_complete": true,
  "credentials": [],
  "payments": {
    "provider": "stripe",
    "account_id": "acct_1Q2w3E4r5T6y7U8i",
    "kyc_status": "verified"
  },
  "suspension": null,
  "missing": [],
  "credentials_required": []
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`rule_blocked`](https://hypamoon.com/docs/errors/rule_blocked) |

### PATCH /marketplaces/{id}/sellers/{sellerId}/credentials/{type}

**Approve or reject a credential.**

The holder approves or rejects a licence the seller gave, like a licence to sell spirits.

Scope: `data:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app that holds the marketplace. |
| `sellerId` (required) | path | string (uuid) | The id of the seller. |
| `type` (required) | path | string | The type of credential, like spirits\_licence. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `status` (required) | `"verified"`, `"rejected"` |  |

JSON

```
{
  "status": "verified"
}
```

#### 200 The credential.

JSON

```
{
  "type": "spirits_licence",
  "number": "123",
  "status": "verified",
  "reviewed_at": "2026-10-24T10:00:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### PUT /marketplaces/{id}/sellers/{sellerId}/tin

**The seller's tax number, above the reporting threshold.**

Only the seller, and only once they are above the reporting threshold: stored encrypted, never shown again, not even in part.

Scope: `data:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app that holds the marketplace. |
| `sellerId` (required) | path | string (uuid) | The id of the seller. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `tin` (required) | string |  |
| `tin_country` (required) | string |  |

JSON

```
{
  "tin": "111222333",
  "tin_country": "NL"
}
```

#### 200 Stored.

JSON

```
{
  "seller_id": "6c2f3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
  "tin_on_file": true,
  "tin_country": "NL"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /marketplaces/{id}/sellers/{sellerId}/shipping

**A seller's shipping methods.**

The holder or the seller themself.

Scope: `data:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app that holds the marketplace. |
| `sellerId` (required) | path | string (uuid) | The id of the seller. |

#### 200 The shipping methods.

JSON

```
{
  "seller_id": "6c2f3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
  "shipping": {
    "methods": [
      {
        "id": "post",
        "name": "PostNL",
        "price_cents": 495
      }
    ]
  }
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### PUT /marketplaces/{id}/sellers/{sellerId}/shipping

**Set a seller's shipping methods.**

The holder or the seller themself. Each method has a price, optional countries and an optional free-above amount.

Scope: `data:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app that holds the marketplace. |
| `sellerId` (required) | path | string (uuid) | The id of the seller. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `ships_from` | string |  |
| `methods` (required) | object\[\] |  |

JSON

```
{
  "methods": [
    {
      "id": "post",
      "name": "PostNL",
      "price_cents": 495,
      "countries": [
        "NL",
        "BE"
      ]
    }
  ]
}
```

#### 200 The shipping methods.

JSON

```
{
  "seller_id": "6c2f3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
  "shipping": {
    "methods": [
      {
        "id": "post",
        "name": "PostNL",
        "price_cents": 495,
        "countries": [
          "NL",
          "BE"
        ]
      }
    ]
  }
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### POST /marketplaces/{id}/sellers/{sellerId}/payments

**A link to the verification by Stripe for a seller.**

A new link to Stripe's hosted onboarding (KYC) for the seller, on the holder's Stripe account. The seller themself or the holder (to send it on). A link expires; ask a new one then.

Scope: `data:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app that holds the marketplace. |
| `sellerId` (required) | path | string (uuid) | The id of the seller. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `return_url` (required) | string (uri) |  |
| `refresh_url` (required) | string (uri) |  |
| `currency` | `"EUR"`, `"USD"`, `"GBP"`, `"CAD"`, `"AUD"`, `"CHF"`, `"SEK"`, `"NOK"`, `"DKK"`, `"PLN"` | The seller's payout currency; default EUR. |

JSON

```
{
  "return_url": "https://shop.example.com/seller/done",
  "refresh_url": "https://shop.example.com/seller/again"
}
```

#### 201 The link.

JSON

```
{
  "seller_id": "6c2f3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
  "url": "https://connect.example.com/setup/e/acct_1Q2w3E4r5T6y7U8i/abc",
  "expires_at": "2026-10-24T10:05:00.000Z",
  "kyc_status": "pending"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /marketplaces/{id}/listings

**List the products of the sellers.**

The holder sees all (filter with seller\_id and status), a seller their own, a buyer only live products of active sellers.

Scope: `data:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app that holds the marketplace. |
| `seller_id` | query | string (uuid) | Only this seller. |
| `status` | query | `"pending_review"`, `"live"`, `"rejected"`, `"removed"` | Only this status. |

#### 200 The products.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] |  |

JSON

```
{
  "data": [
    {
      "id": "8e4b5f6a-7b8c-4d9e-8f0a-2b3c4d5e6f7a",
      "seller": {
        "id": "6c2f3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e"
      },
      "product": {
        "name": "Rioja 2019",
        "price_cents": 1500
      },
      "category": "alcohol_beer_wine",
      "abv": 13.5,
      "status": "live"
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### POST /marketplaces/{id}/listings

**Add a product (seller).**

Only a seller, signed in to the app. The category is checked against the rules for the seller's country; a restricted category waits for the holder's review.

Scope: `data:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app that holds the marketplace. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `product` (required) | object |  |
| `category` (required) | string | A category from the rule set, like general, alcohol\_beer\_wine or alcohol\_spirits. |
| `abv` | number |  |
| `distilled` | boolean |  |
| `nicotine` | boolean |  |
| `disposable` | boolean |  |

JSON

```
{
  "product": {
    "name": "Rioja 2019",
    "price_cents": 1500
  },
  "category": "alcohol_beer_wine",
  "abv": 13.5
}
```

#### 201 The product.

JSON

```
{
  "id": "8e4b5f6a-7b8c-4d9e-8f0a-2b3c4d5e6f7a",
  "seller": {
    "id": "6c2f3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e"
  },
  "product": {
    "name": "Rioja 2019",
    "price_cents": 1500
  },
  "category": "alcohol_beer_wine",
  "status": "pending_review"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`rule_blocked`](https://hypamoon.com/docs/errors/rule_blocked) |

### GET /marketplaces/{id}/listings/{listingId}

**Get one product.**

A seller only reaches their own; a buyer only a live product of an active seller.

Scope: `data:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app that holds the marketplace. |
| `listingId` (required) | path | string (uuid) | The id of the listing. |

#### 200 The product.

JSON

```
{
  "id": "8e4b5f6a-7b8c-4d9e-8f0a-2b3c4d5e6f7a",
  "seller": {
    "id": "6c2f3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e"
  },
  "product": {
    "name": "Rioja 2019",
    "price_cents": 1500
  },
  "category": "alcohol_beer_wine"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### PATCH /marketplaces/{id}/listings/{listingId}

**Change, approve or remove a product.**

The seller changes or removes their own product; the holder approves (live), rejects (with a reason) or removes it. Going live checks the rules again.

Scope: `data:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app that holds the marketplace. |
| `listingId` (required) | path | string (uuid) | The id of the listing. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `product` | object |  |
| `category` | string |  |
| `abv` | number or null |  |
| `distilled` | boolean or null |  |
| `nicotine` | boolean or null |  |
| `disposable` | boolean or null |  |
| `status` | `"live"`, `"rejected"`, `"removed"` |  |
| `reason` | string |  |

JSON

```
{
  "status": "live"
}
```

#### 200 The product.

JSON

```
{
  "id": "8e4b5f6a-7b8c-4d9e-8f0a-2b3c4d5e6f7a",
  "status": "live"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`rule_blocked`](https://hypamoon.com/docs/errors/rule_blocked) |

### GET /marketplaces/{id}/suborders

**List the sub-orders.**

One sub-order per seller per order. The holder sees all (filter with seller\_id, order\_id and status); a seller only their own.

Scope: `data:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app that holds the marketplace. |
| `seller_id` | query | string (uuid) | Only this seller (holder). |
| `order_id` | query | string (uuid) | Only this order. |
| `status` | query | `"paid"`, `"shipped"`, `"delivered"`, `"canceled"`, `"refunded"` | Only this status. |
| `limit` | query | integer | At most this many (default 100). |

#### 200 The sub-orders.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] |  |

JSON

```
{
  "data": [
    {
      "id": "a06d7b8c-9d0e-4f1a-8b2c-4d5e6f7a8b9c",
      "order_id": "9f5c6a7b-8c9d-4e0f-9a1b-3c4d5e6f7a8b",
      "seller_id": "6c2f3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
      "currency": "EUR",
      "lines": [
        {
          "listing_id": "8e4b5f6a-7b8c-4d9e-8f0a-2b3c4d5e6f7a",
          "name": "Rioja 2019",
          "quantity": 2,
          "unit_cents": 1500
        }
      ],
      "subtotal_cents": 3000,
      "shipping_cents": 495,
      "commission_cents": 300,
      "status": "paid",
      "tracking": null,
      "delivery_age_check": true,
      "refunded_cents": 0,
      "payout": {
        "status": "waiting",
        "amount_cents": 3195,
        "reversed_cents": 0,
        "not_before": null,
        "paid_out_at": null
      },
      "shipped_at": null,
      "created_at": "2026-10-24T10:00:00.000Z"
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### GET /marketplaces/{id}/suborders/{suborderId}

**Get one sub-order.**

The holder, or the seller of this sub-order (another seller gets 404).

Scope: `data:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app that holds the marketplace. |
| `suborderId` (required) | path | string (uuid) | The id of the sub-order. |

#### 200 The sub-order.

JSON

```
{
  "id": "a06d7b8c-9d0e-4f1a-8b2c-4d5e6f7a8b9c",
  "order_id": "9f5c6a7b-8c9d-4e0f-9a1b-3c4d5e6f7a8b",
  "seller_id": "6c2f3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
  "currency": "EUR",
  "lines": [
    {
      "listing_id": "8e4b5f6a-7b8c-4d9e-8f0a-2b3c4d5e6f7a",
      "name": "Rioja 2019",
      "quantity": 2,
      "unit_cents": 1500
    }
  ],
  "subtotal_cents": 3000,
  "shipping_cents": 495,
  "commission_cents": 300,
  "status": "paid",
  "tracking": null,
  "delivery_age_check": true,
  "refunded_cents": 0,
  "payout": {
    "status": "waiting",
    "amount_cents": 3195,
    "reversed_cents": 0,
    "not_before": null,
    "paid_out_at": null
  },
  "shipped_at": null,
  "created_at": "2026-10-24T10:00:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### PATCH /marketplaces/{id}/suborders/{suborderId}

**Mark a sub-order shipped or delivered.**

The holder or the seller of this sub-order. With the payout moment on\_shipment or after\_shipment, this starts the seller's payout.

Scope: `data:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app that holds the marketplace. |
| `suborderId` (required) | path | string (uuid) | The id of the sub-order. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `status` (required) | `"shipped"`, `"delivered"` |  |
| `tracking_number` | string |  |
| `tracking_url` | string (uri) |  |

JSON

```
{
  "status": "shipped",
  "tracking_number": "3SABCD1234567",
  "tracking_url": "https://tracking.example.com/3SABCD1234567"
}
```

#### 200 The sub-order.

JSON

```
{
  "id": "a06d7b8c-9d0e-4f1a-8b2c-4d5e6f7a8b9c",
  "order_id": "9f5c6a7b-8c9d-4e0f-9a1b-3c4d5e6f7a8b",
  "seller_id": "6c2f3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
  "currency": "EUR",
  "lines": [
    {
      "listing_id": "8e4b5f6a-7b8c-4d9e-8f0a-2b3c4d5e6f7a",
      "name": "Rioja 2019",
      "quantity": 2,
      "unit_cents": 1500
    }
  ],
  "subtotal_cents": 3000,
  "shipping_cents": 495,
  "commission_cents": 300,
  "status": "shipped",
  "tracking": null,
  "delivery_age_check": true,
  "refunded_cents": 0,
  "payout": {
    "status": "waiting",
    "amount_cents": 3195,
    "reversed_cents": 0,
    "not_before": null,
    "paid_out_at": null
  },
  "shipped_at": null,
  "created_at": "2026-10-24T10:00:00.000Z"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### POST /marketplaces/{id}/suborders/{suborderId}/refund

**Refund one sub-order.**

Only the holder. Refunds the buyer from the holder's Stripe account, at most what is left on this sub-order, and takes the seller's share back (a transfer reversal, or less to pay out). The same idempotency\_key is the same refund. If the seller's balance is too low, the buyer still gets the money and the holder carries the difference.

Scope: `data:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app that holds the marketplace. |
| `suborderId` (required) | path | string (uuid) | The id of the sub-order. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `amount_cents` | integer | Without it: everything that is left on this sub-order. |
| `reason` | string |  |
| `idempotency_key` | string |  |

JSON

```
{
  "amount_cents": 1500,
  "reason": "One bottle arrived broken."
}
```

#### 200 The same refund again.

JSON

```
{
  "refund_id": "re_1Q2w3E",
  "amount_cents": 1500,
  "seller_share_cents": 1350,
  "seller_recovery": "reversal",
  "already_done": true
}
```

#### 201 The refund.

JSON

```
{
  "refund_id": "re_1Q2w3E",
  "amount_cents": 1500,
  "seller_share_cents": 1350,
  "seller_recovery": "reversal",
  "already_done": false
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### POST /marketplaces/{id}/suborders/{suborderId}/reverse

**Take a payout back after a dispute.**

Only the holder, after a buyer's bank opened a dispute: reverses (part of) the transfer to the seller.

Scope: `data:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app that holds the marketplace. |
| `suborderId` (required) | path | string (uuid) | The id of the sub-order. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `amount_cents` | integer |  |

JSON

```
{
  "amount_cents": 3195
}
```

#### 201 The reversal.

JSON

```
{
  "reversal_id": "trr_1Q2w3E",
  "amount_cents": 3195
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### GET /marketplaces/{id}/payments

**The connection with the holder's Stripe account.**

Whether the holder's Stripe account is connected, in which mode, and without a connection the permissions the restricted key needs. Never the key.

Scope: `data:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app that holds the marketplace. |

#### 200 The connection.

JSON

```
{
  "connected": true,
  "provider": "stripe",
  "mode": "test",
  "holder_account": "acct_1Q2w3E4r5T6y7U8i",
  "key_ending": "x9Yz"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### PUT /marketplaces/{id}/payments

**Connect the holder's Stripe account.**

Only with a project key or connection (project:write), never from inside the app. restricted\_key is a Stripe restricted key (rk\_test\_ for a test marketplace, rk\_live\_ for a live one) with the permissions in required\_permissions. Stored encrypted; never returned. sk\_ and pk\_ keys are refused.

Scope: `data:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app that holds the marketplace. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `restricted_key` (required) | string | A Stripe restricted key (rk\_test\_ or rk\_live\_) from the holder's own Stripe account, with the permissions in required\_permissions. |

JSON

```
{
  "restricted_key": "rk_test_REPLACE_WITH_THE_HOLDERS_KEY"
}
```

#### 200 The connection.

JSON

```
{
  "connected": true,
  "provider": "stripe",
  "mode": "test",
  "holder_account": "acct_1Q2w3E4r5T6y7U8i",
  "key_ending": "x9Yz"
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### DELETE /marketplaces/{id}/payments

**Disconnect the holder's Stripe account.**

Removes the webhook and event destination on the holder's account and forgets the key.

Scope: `data:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app that holds the marketplace. |

#### 200 Disconnected.

JSON

```
{
  "disconnected": true
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### POST /marketplaces/{id}/quote

**Quote a cart over several sellers.**

Per seller the lines, shipping and notices, with the rules of the delivery country. A product that cannot be bought there is in refusals with its rule\_id.

Scope: `data:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app that holds the marketplace. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `items` (required) | object\[\] |  |
| `delivery` (required) | object | The delivery address; the rules of the delivery country apply. |
| `shipping` | object | Per seller id the shipping method id; without it the cheapest that ships to the country. |
| `code` | any |  |
| `codes` | any |  |

JSON

```
{
  "items": [
    {
      "listing_id": "8e4b5f6a-7b8c-4d9e-8f0a-2b3c4d5e6f7a",
      "quantity": 2
    }
  ],
  "delivery": {
    "country": "NL"
  }
}
```

#### 200 The quote.

JSON

```
{
  "currency": "EUR",
  "delivery_country": "NL",
  "total_cents": 3495,
  "parts": [],
  "min_age": 18,
  "refusals": []
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |

### POST /marketplaces/{id}/checkout

**Start the checkout over several sellers.**

One checkout on the holder's own Stripe account; after payment one sub-order and one transfer per seller. A rule that refuses gives rule\_blocked and no checkout.

Scope: `data:write`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app that holds the marketplace. |

#### Request body

| Field | Type |  |
| --- | --- | --- |
| `items` (required) | object\[\] |  |
| `delivery` (required) | object | The delivery address; the rules of the delivery country apply. |
| `shipping` | object | Per seller id the shipping method id; without it the cheapest that ships to the country. |
| `code` | any |  |
| `codes` | any |  |
| `email` | string (email) |  |
| `success_url` (required) | string (uri) |  |
| `cancel_url` (required) | string (uri) |  |
| `idempotency_key` | string |  |

JSON

```
{
  "items": [
    {
      "listing_id": "8e4b5f6a-7b8c-4d9e-8f0a-2b3c4d5e6f7a",
      "quantity": 2
    }
  ],
  "delivery": {
    "country": "NL"
  },
  "success_url": "https://shop.example.com/thanks",
  "cancel_url": "https://shop.example.com/cart"
}
```

#### 201 The order and the checkout link.

JSON

```
{
  "order_id": "9f5c6a7b-8c9d-4e0f-9a1b-3c4d5e6f7a8b",
  "checkout_url": "https://checkout.example.com/c/pay/cs_test_abc",
  "currency": "EUR",
  "total_cents": 3495
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 400 | [`invalid_json`](https://hypamoon.com/docs/errors/invalid_json) |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |
| 409 | [`conflict`](https://hypamoon.com/docs/errors/conflict) |
| 422 | [`validation_failed`](https://hypamoon.com/docs/errors/validation_failed) |
| 422 | [`rule_blocked`](https://hypamoon.com/docs/errors/rule_blocked) |

### GET /marketplaces/{id}/orders/{orderId}

**Get an order with its sub-orders.**

Only the holder.

Scope: `data:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app that holds the marketplace. |
| `orderId` (required) | path | string (uuid) | The id of the order. |

#### 200 The order.

JSON

```
{
  "id": "9f5c6a7b-8c9d-4e0f-9a1b-3c4d5e6f7a8b",
  "status": "paid",
  "currency": "EUR",
  "total_cents": 3495,
  "suborders": [
    {
      "id": "a06d7b8c-9d0e-4f1a-8b2c-4d5e6f7a8b9c",
      "order_id": "9f5c6a7b-8c9d-4e0f-9a1b-3c4d5e6f7a8b",
      "seller_id": "6c2f3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
      "currency": "EUR",
      "lines": [
        {
          "listing_id": "8e4b5f6a-7b8c-4d9e-8f0a-2b3c4d5e6f7a",
          "name": "Rioja 2019",
          "quantity": 2,
          "unit_cents": 1500
        }
      ],
      "subtotal_cents": 3000,
      "shipping_cents": 495,
      "commission_cents": 300,
      "status": "paid",
      "tracking": null,
      "delivery_age_check": true,
      "refunded_cents": 0,
      "payout": {
        "status": "waiting",
        "amount_cents": 3195,
        "reversed_cents": 0,
        "not_before": null,
        "paid_out_at": null
      },
      "shipped_at": null,
      "created_at": "2026-10-24T10:00:00.000Z"
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### GET /marketplaces/{id}/payouts

**Payouts per seller.**

Per seller and currency what was paid out, what is waiting and what was taken back, with the sub-orders. The holder sees all (or one seller with seller\_id); a seller only their own.

Scope: `data:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app that holds the marketplace. |
| `seller_id` | query | string (uuid) | Only this seller. |
| `status` | query | `"waiting"`, `"in_progress"`, `"paid_out"`, `"void"`, `"failed"` | Only this payout status. |

#### 200 The payouts.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] |  |

JSON

```
{
  "payout_moment": {
    "when": "on_shipment",
    "days": 0
  },
  "data": [
    {
      "seller_id": "6c2f3d4e-5f6a-4b7c-8d9e-0f1a2b3c4d5e",
      "currency": "EUR",
      "paid_out_cents": 0,
      "waiting_cents": 3195,
      "reversed_cents": 0,
      "failed": 0,
      "suborders": []
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

### GET /marketplaces/{id}/readiness

**Is the marketplace ready to go live?.**

Only the holder. Checks the connection with the holder's own Stripe account, the marketplace terms, the sellers (active and verified) and the rules for the holder's country. Advice: it blocks nothing.

Scope: `data:read`

| Parameter | In | Type |  |
| --- | --- | --- | --- |
| `id` (required) | path | string (uuid) | The id of the app that holds the marketplace. |

#### 200 The checks.

| Field | Type |  |
| --- | --- | --- |
| `ready` (required) | boolean |  |
| `checks` (required) | object\[\] |  |

JSON

```
{
  "app_id": "5b1e2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
  "test": true,
  "status": "open",
  "ready": false,
  "checks": [
    {
      "id": "payments_connected",
      "ok": false,
      "detail": "The holder's Stripe account is not connected yet.",
      "next_tool": "connect_marketplace_payments"
    }
  ]
}
```

#### Errors

Besides the errors on every endpoint:

| Status | Type |
| --- | --- |
| 403 | [`forbidden`](https://hypamoon.com/docs/errors/forbidden) |
| 404 | [`not_found`](https://hypamoon.com/docs/errors/not_found) |

## Webhook events

What we `POST` to your endpoint. See [Webhooks](https://hypamoon.com/docs/webhooks) for signatures, retries and endpoints.

### call.completed

**A call ended.**

Sent after a call ends.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string | The id of the event, evt\_ plus 32 hex characters. It stays the same on retries. |
| `type` (required) | `"call.completed"` |  |
| `created_at` (required) | string (date-time) | When the event happened. |
| `data` (required) | object |  |

JSON

```
{
  "id": "evt_4f1c2a9b8e7d6c5b4a39281706f5e4d3",
  "created_at": "2026-10-01T09:15:38.000Z",
  "type": "call.completed",
  "data": {
    "call": {
      "id": "c1a2b3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
      "direction": "inbound",
      "from": "+447700900456",
      "to": "+•••••••••42",
      "status": "ai_handled",
      "created_at": "2026-10-01T09:14:02.000Z",
      "started_at": "2026-10-01T09:14:02.000Z",
      "answered_at": "2026-10-01T09:14:03.000Z",
      "ended_at": "2026-10-01T09:15:37.000Z",
      "duration_sec": 94,
      "hangup_cause": "normal_clearing",
      "has_summary": true,
      "summary_ready_at": null,
      "test": false,
      "outbound": null
    }
  }
}
```

### call.summary.ready

**The summary of a call is ready.**

Sent when the summary of a call is ready. Without the transcript: fetch that with GET /calls/{data.call.id}.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string | The id of the event, evt\_ plus 32 hex characters. It stays the same on retries. |
| `type` (required) | `"call.summary.ready"` |  |
| `created_at` (required) | string (date-time) | When the event happened. |
| `data` (required) | object |  |

JSON

```
{
  "id": "evt_4f1c2a9b8e7d6c5b4a39281706f5e4d3",
  "created_at": "2026-10-01T09:15:38.000Z",
  "type": "call.summary.ready",
  "data": {
    "call": {
      "id": "c1a2b3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
      "direction": "inbound",
      "from": "+447700900456",
      "to": "+•••••••••42",
      "status": "ai_handled",
      "created_at": "2026-10-01T09:14:02.000Z",
      "started_at": "2026-10-01T09:14:02.000Z",
      "answered_at": "2026-10-01T09:14:03.000Z",
      "ended_at": "2026-10-01T09:15:37.000Z",
      "duration_sec": 94,
      "hangup_cause": "normal_clearing",
      "has_summary": true,
      "summary_ready_at": null,
      "test": false,
      "outbound": null
    },
    "summary": {
      "text": "The caller has a leaking kitchen tap and wants someone to come today.",
      "topics": [
        "leak",
        "appointment"
      ],
      "sentiment": "neutral",
      "action_items": [
        "Call back within the hour to plan a visit."
      ],
      "next_step": "Plan a visit today."
    }
  }
}
```

### message.delivered

**An SMS was delivered.**

Sent when the phone of the recipient confirmed the message.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string | The id of the event, evt\_ plus 32 hex characters. It stays the same on retries. |
| `type` (required) | `"message.delivered"` |  |
| `created_at` (required) | string (date-time) | When the event happened. |
| `data` (required) | object |  |

JSON

```
{
  "id": "evt_4f1c2a9b8e7d6c5b4a39281706f5e4d3",
  "created_at": "2026-10-01T09:00:04.000Z",
  "type": "message.delivered",
  "data": {
    "message": {
      "id": "8f7e6d5c-4b3a-4291-8f0e-1d2c3b4a5968",
      "to": "+447700900321",
      "from": "Acme Shop",
      "body": "Hi Sam, thanks for your order 10432 at Acme Shop. We are packing it now; you get a track and trace link as soon as it ships.",
      "segments": 1,
      "encoding": "gsm7",
      "status": "delivered",
      "error": null,
      "reference": "order-10432",
      "created_at": "2026-10-01T09:00:00.000Z",
      "status_updated_at": "2026-10-01T09:00:04.000Z",
      "test": true
    }
  }
}
```

### message.failed

**An SMS could not be delivered.**

Sent when a message could not be delivered. data.message.error says why.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string | The id of the event, evt\_ plus 32 hex characters. It stays the same on retries. |
| `type` (required) | `"message.failed"` |  |
| `created_at` (required) | string (date-time) | When the event happened. |
| `data` (required) | object |  |

JSON

```
{
  "id": "evt_4f1c2a9b8e7d6c5b4a39281706f5e4d3",
  "created_at": "2026-10-01T09:00:04.000Z",
  "type": "message.failed",
  "data": {
    "message": {
      "id": "8f7e6d5c-4b3a-4291-8f0e-1d2c3b4a5968",
      "to": "+447700900321",
      "from": "Acme Shop",
      "body": "Hi Sam, thanks for your order 10432 at Acme Shop. We are packing it now; you get a track and trace link as soon as it ships.",
      "segments": 1,
      "encoding": "gsm7",
      "status": "failed",
      "error": "delivery_failed",
      "reference": "order-10432",
      "created_at": "2026-10-01T09:00:00.000Z",
      "status_updated_at": "2026-10-01T09:00:04.000Z",
      "test": true
    }
  }
}
```

### conversation.summary.ready

**The summary of a chat conversation is ready.**

Sent when the summary of a closed chat conversation is ready. Without the messages: fetch those with GET /conversations/{data.conversation.id}.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string | The id of the event, evt\_ plus 32 hex characters. It stays the same on retries. |
| `type` (required) | `"conversation.summary.ready"` |  |
| `created_at` (required) | string (date-time) | When the event happened. |
| `data` (required) | object |  |

JSON

```
{
  "id": "evt_4f1c2a9b8e7d6c5b4a39281706f5e4d3",
  "created_at": "2026-10-01T09:31:10.000Z",
  "type": "conversation.summary.ready",
  "data": {
    "conversation": {
      "id": "2c9d8e7f-6a5b-4c3d-9e2f-1a0b9c8d7e6f",
      "channel": "chat",
      "status": "closed",
      "reference": "session-8841",
      "metadata": {
        "page": "/pricing",
        "plan": "pro"
      },
      "customer": {
        "name": "Sam Jones",
        "phone": null,
        "email": "sam@example.com"
      },
      "language": "en",
      "turns": 2,
      "max_turns": 30,
      "created_at": "2026-10-01T09:00:00.000Z",
      "last_message_at": "2026-10-01T09:01:05.000Z",
      "closed_at": "2026-10-01T09:31:05.000Z",
      "close_reason": "inactive",
      "has_summary": true,
      "summary_ready_at": "2026-10-01T09:31:09.000Z",
      "test": false
    },
    "summary": {
      "text": "Sam Jones has a leaking kitchen tap and wants someone to come today. Sam left the number +447700900321 for a call back.",
      "topics": [
        "leak",
        "visit"
      ],
      "sentiment": "neutral",
      "action_items": [
        "Call Sam Jones back on +447700900321 within the hour to plan a visit."
      ],
      "next_step": "Call back within the hour."
    }
  }
}
```

### balance.low

**The balance dropped below the top-up threshold.**

Sent when a charge takes the balance below the automatic top-up threshold. Carries balance\_eur and threshold\_eur.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string | The id of the event, evt\_ plus 32 hex characters. It stays the same on retries. |
| `type` (required) | `"balance.low"` |  |
| `created_at` (required) | string (date-time) | When the event happened. |
| `data` (required) | object |  |

JSON

```
{
  "id": "evt_4f1c2a9b8e7d6c5b4a39281706f5e4d3",
  "created_at": "2026-10-01T11:00:01.000Z",
  "type": "balance.low",
  "data": {
    "balance_eur": 4.88,
    "threshold_eur": 5
  }
}
```

### balance.topped\_up

**A top-up was added to the balance.**

Sent when a top-up was paid and added to the balance, by hand or automatically. Carries balance\_eur and transaction.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string | The id of the event, evt\_ plus 32 hex characters. It stays the same on retries. |
| `type` (required) | `"balance.topped_up"` |  |
| `created_at` (required) | string (date-time) | When the event happened. |
| `data` (required) | object |  |

JSON

```
{
  "id": "evt_4f1c2a9b8e7d6c5b4a39281706f5e4d3",
  "created_at": "2026-10-01T11:00:01.000Z",
  "type": "balance.topped_up",
  "data": {
    "balance_eur": 24.76,
    "transaction": {
      "id": "4c3b2a19-0f8e-4d7c-9b6a-5e4d3c2b1a09",
      "type": "top_up",
      "source": "payment",
      "amount_eur": 20,
      "balance_after_eur": 24.76,
      "description": "Top-up",
      "quantity": null,
      "unit": null,
      "reference_id": "b7e5a1c4-2d93-4f60-8a1e-9c3d5b7f2e10",
      "created_at": "2026-10-01T09:30:00.000Z"
    }
  }
}
```

### balance.reload\_failed

**An automatic top-up failed.**

Sent when an automatic top-up failed. Carries balance\_eur, threshold\_eur and reload. After three failures in a row automatic top-up is switched off.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string | The id of the event, evt\_ plus 32 hex characters. It stays the same on retries. |
| `type` (required) | `"balance.reload_failed"` |  |
| `created_at` (required) | string (date-time) | When the event happened. |
| `data` (required) | object |  |

JSON

```
{
  "id": "evt_4f1c2a9b8e7d6c5b4a39281706f5e4d3",
  "created_at": "2026-10-01T11:00:01.000Z",
  "type": "balance.reload_failed",
  "data": {
    "balance_eur": 4.88,
    "threshold_eur": 5,
    "reload": {
      "id": "d2f4a6b8-1c3e-4a5b-9d7f-0e1a3c5b7d92",
      "amount_eur": 20,
      "status": "failed",
      "failure_reason": "insufficient_funds",
      "created_at": "2026-10-01T11:00:00.000Z"
    }
  }
}
```

### document.created

**A document was added to a collection.**

Sent for every new document in a collection with webhook\_on\_insert, from the API or a form. A document deleted before delivery is not sent.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string | The id of the event, evt\_ plus 32 hex characters. It stays the same on retries. |
| `type` (required) | `"document.created"` |  |
| `created_at` (required) | string (date-time) | When the event happened. |
| `data` (required) | object |  |

JSON

```
{
  "id": "evt_4f1c2a9b8e7d6c5b4a39281706f5e4d3",
  "created_at": "2026-10-01T09:30:01.000Z",
  "type": "document.created",
  "data": {
    "collection": {
      "id": "3c4d5e6f-7a8b-4c9d-8e0f-1a2b3c4d5e6f",
      "name": "contact"
    },
    "document": {
      "id": "7f6e5d4c-3b2a-4190-8f7e-6d5c4b3a2918",
      "data": {
        "name": "Anna de Vries",
        "email": "anna@example.com",
        "message": "Can you come and look at a leaking tap on Friday?"
      },
      "source": "public",
      "created_at": "2026-10-01T09:30:00.000Z"
    }
  }
}
```

### email.sent

**An email was accepted for delivery (one event per recipient).**

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string | The event id, evt\_ plus 32 hex characters. The same on retries. |
| `type` (required) | `"email.sent"` |  |
| `created_at` (required) | string |  |
| `data` (required) | object |  |

JSON

```
{
  "id": "evt_3b2f6c1d9e8a4f7b8c6d5e4f3a2b1c0d",
  "type": "email.sent",
  "created_at": "2026-10-15T09:30:05.000Z",
  "data": {
    "email_id": "7c1e2d3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
    "app_id": "5a4b3c2d-1e0f-4a9b-8c7d-6e5f4a3b2c1d",
    "recipient": "sam@example.org",
    "recipient_field": "to",
    "status": "sent",
    "reason": null,
    "occurred_at": "2026-10-15T09:30:04.000Z",
    "test": false
  }
}
```

### email.delivered

**An email reached the recipient's mail server.**

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string | The event id, evt\_ plus 32 hex characters. The same on retries. |
| `type` (required) | `"email.delivered"` |  |
| `created_at` (required) | string |  |
| `data` (required) | object |  |

JSON

```
{
  "id": "evt_3b2f6c1d9e8a4f7b8c6d5e4f3a2b1c0d",
  "type": "email.delivered",
  "created_at": "2026-10-15T09:30:05.000Z",
  "data": {
    "email_id": "7c1e2d3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
    "app_id": "5a4b3c2d-1e0f-4a9b-8c7d-6e5f4a3b2c1d",
    "recipient": "sam@example.org",
    "recipient_field": "to",
    "status": "delivered",
    "reason": null,
    "occurred_at": "2026-10-15T09:30:04.000Z",
    "test": false
  }
}
```

### email.delayed

**Delivery of an email is delayed; it is retried automatically.**

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string | The event id, evt\_ plus 32 hex characters. The same on retries. |
| `type` (required) | `"email.delayed"` |  |
| `created_at` (required) | string |  |
| `data` (required) | object |  |

JSON

```
{
  "id": "evt_3b2f6c1d9e8a4f7b8c6d5e4f3a2b1c0d",
  "type": "email.delayed",
  "created_at": "2026-10-15T09:30:05.000Z",
  "data": {
    "email_id": "7c1e2d3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
    "app_id": "5a4b3c2d-1e0f-4a9b-8c7d-6e5f4a3b2c1d",
    "recipient": "sam@example.org",
    "recipient_field": "to",
    "status": "sent",
    "reason": "Delayed: the recipient's mail server has not accepted it yet. Delivery is retried automatically.",
    "occurred_at": "2026-10-15T09:30:04.000Z",
    "test": false
  }
}
```

### email.bounced

**An email bounced.**

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string | The event id, evt\_ plus 32 hex characters. The same on retries. |
| `type` (required) | `"email.bounced"` |  |
| `created_at` (required) | string |  |
| `data` (required) | object |  |

JSON

```
{
  "id": "evt_3b2f6c1d9e8a4f7b8c6d5e4f3a2b1c0d",
  "type": "email.bounced",
  "created_at": "2026-10-15T09:30:05.000Z",
  "data": {
    "email_id": "7c1e2d3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
    "app_id": "5a4b3c2d-1e0f-4a9b-8c7d-6e5f4a3b2c1d",
    "recipient": "sam@example.org",
    "recipient_field": "to",
    "status": "bounced",
    "reason": "The address does not exist or does not accept email.",
    "occurred_at": "2026-10-15T09:30:04.000Z",
    "test": false
  }
}
```

### email.complained

**The recipient marked an email as spam.**

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string | The event id, evt\_ plus 32 hex characters. The same on retries. |
| `type` (required) | `"email.complained"` |  |
| `created_at` (required) | string |  |
| `data` (required) | object |  |

JSON

```
{
  "id": "evt_3b2f6c1d9e8a4f7b8c6d5e4f3a2b1c0d",
  "type": "email.complained",
  "created_at": "2026-10-15T09:30:05.000Z",
  "data": {
    "email_id": "7c1e2d3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
    "app_id": "5a4b3c2d-1e0f-4a9b-8c7d-6e5f4a3b2c1d",
    "recipient": "sam@example.org",
    "recipient_field": "to",
    "status": "complained",
    "reason": "The recipient marked it as spam.",
    "occurred_at": "2026-10-15T09:30:04.000Z",
    "test": false
  }
}
```

### email.received

**An email arrived on one of the project's inbound addresses (not for spam).**

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string |  |
| `type` (required) | `"email.received"` |  |
| `created_at` (required) | string |  |
| `data` (required) | object |  |

JSON

```
{
  "id": "evt_5f6e7d8c9b0a1f2e3d4c5b6a",
  "type": "email.received",
  "created_at": "2026-10-15T10:12:01.000Z",
  "data": {
    "inbound_email_id": "4d5e6f70-8192-4ca3-b4c5-d6e7f8091a2b",
    "app_id": null,
    "address_id": "3c4d5e6f-7081-4b92-a3b4-c5d6e7f8091a",
    "to": "support@in.acmeplumbing.com",
    "from": "sam@example.org",
    "attachment_count": 1,
    "received_at": "2026-10-15T10:12:00.000Z"
  }
}
```

### webhook.test

**A test event from POST /webhooks/{id}/test.**

Sent by POST /webhooks/{id}/test. Needs no subscription.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string | The id of the event, evt\_ plus 32 hex characters. It stays the same on retries. |
| `type` (required) | `"webhook.test"` |  |
| `created_at` (required) | string (date-time) | When the event happened. |
| `data` (required) | object |  |

JSON

```
{
  "id": "evt_4f1c2a9b8e7d6c5b4a39281706f5e4d3",
  "created_at": "2026-10-01T09:15:38.000Z",
  "type": "webhook.test",
  "data": {
    "endpoint_id": "9e8d7c6b-5a49-4382-9716-a5b4c3d2e1f0"
  }
}
```

## Objects

### McpRequest

| Field | Type |  |
| --- | --- | --- |
| `jsonrpc` (required) | `"2.0"` |  |
| `id` | one of |  |
| `method` (required) | string |  |
| `params` | object |  |

### McpResponse

| Field | Type |  |
| --- | --- | --- |
| `jsonrpc` (required) | `"2.0"` |  |
| `id` (required) | one of |  |
| `result` | object |  |

### Project

The project behind the API key.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the project. |
| `name` (required) | string | The name of the project. The assistant uses it in its greeting. |
| `edition` (required) | string | Always api for a project of the Hypamoon API. |
| `created_at` (required) | string (date-time) | When the project was created. |
| `spending_limit_eur` | number or null | The most the project can spend per month, in euros. Null in test mode: a test project costs nothing. Left out for a key or connection limited to some sites and apps. |
| `numbers_count` | integer | How many numbers the project has. Left out for a limited key or connection. |
| `mode` (required) | `"live"`, `"test"` | live or test: the mode of the key, which is always the mode of its project. |
| `live_project_id` | string or null (uuid) | Only in test mode: the live project this test project belongs to, or the project itself when it has no separate test project. |
| `rails` | object | Per function with real-world effects, for this request: live (in use) or test (simulated: not used yet, or a test key). A function on test becomes live the first time it is asked for, once the project is verified for it; until then the request answers verification\_required with a link. A test key is test everywhere. Left out for a limited key or connection. Sites, data and apps are always real and have no mode. |
| `verification` | object | The verification (KYC) of the project. In test mode: the verification of the live project. |
| `access` (required) | object or null | Null: this key or connection can use the whole project. Otherwise only these sites, apps and collections: lists show only those, and anything for the whole project (billing, team, domains, numbers, a new site or app) is refused with 403 and a user\_message. |

### Advice

| Field | Type |  |
| --- | --- | --- |
| `type` (required) | `"webshop"`, `"bookings"`, `"restaurant"`, `"course_membership"`, `"wordpress_portal"` |  |
| `title` (required) | string |  |
| `summary` (required) | string |  |
| `country` (required) | string or null | The country the advice is for; null when none is known: nothing is assumed, the country question is then blocking. |
| `country_source` (required) | `"argument"`, `"company_details"`, `null` | Where the country came from: the country argument, or the project's company details (set\_company\_details). Null when no country is known. |
| `region` (required) | `"eu"`, `"uk"`, `"us"`, `"other"` | eu (detailed), uk and us (basics), other (a general fallback, also when no country is known). |
| `audience` (required) | `"consumers"`, `"businesses"`, `"both"` |  |
| `how_to_use` (required) | string | For the agent: inform yourself, ask only the blocking questions, use the defaults for the rest, and offer the checklist; never a questionnaire or a gate. |
| `ask_first` (required) | object\[\] |  |
| `build_plan` (required) | object\[\] |  |
| `go_live_checklist` (required) | object\[\] |  |
| `pitfalls` (required) | object\[\] |  |
| `structured_data` (required) | object | Structured data for search engines, ready to fill in and add with deploy\_site. |
| `note` (required) | string | Guidance, not legal or tax advice. |
| `other_types` (required) | object |  |
| `known_problems` (required) | object\[\] | Known problems (an upload blocked by a sandbox, an image too large, version\_conflict, phone verification, a site nobody else can see, is Hypamoon down), each with what to do and what to tell the user. GET /advice?topic=<id> returns one. |
| `recipes` (required) | object\[\] | Recipes to build with existing tools and adjust to the user's words, like dunning for course\_membership: reminder emails on subscription.payment\_failed on day 1, 4 and 10 with the buyer's signed pay\_url. Empty when there are none. |
| `summary_markdown` (required) | string |  |

### Status

Whether Hypamoon is working, per component.

| Field | Type |  |
| --- | --- | --- |
| `status` (required) | `"operational"`, `"degraded"`, `"down"`, `"unknown"` | The overall status: the worst of the components (unknown does not count). |
| `source` (required) | `"status_page"`, `"self_check"` | status\_page: from status.hypamoon.com. self\_check: that page did not answer, so only a minimal check of our own. |
| `components` (required) | object\[\] | Per component: sites, api, portal, phone, ai, mail, payments. |
| `incidents` (required) | object\[\] | Reported problems that are not resolved yet. |
| `status_page` (required) | string | The public status page. |
| `checked_at` (required) | string | When the status was measured. |
| `user_message` (required) | string | One calm sentence for the user, like "Hypamoon is working normally. The problem is likely in your chat app." |
| `next_step` (required) | string | What the chat or agent should do next. |

### Recipe

| Field | Type |  |
| --- | --- | --- |
| `slug` (required) | string |  |
| `title` (required) | string |  |
| `summary` (required) | string |  |
| `say` (required) | string | The short sentence a user types, like Build the Hypamoon recipe coffee-quiz. |
| `page` (required) | string | The recipe page on hypamoon.com. |
| `demo` | string | A live example of the result, for recipes that build a site. |
| `kind` (required) | `"plan"`, `"track"`, `"request"`, `"check"`, `"calculate"`, `"share"`, `"sell"`, `"connect"`, `"business"` | What the recipe does for the user: plan, track, request, check, calculate, share, sell, connect or business. |
| `size` (required) | `"small"`, `"medium"`, `"large"` | small is one screen, a list or a form with its own data, without sign-in, payments or a link to another system. |
| `start` | `true` | A starter idea for a first build. |
| `live_examples` | object\[\] | Examples of the result that are live. |
| `origin` | object | Where the prompt comes from, when that is known: real means the live example was built with this prompt, or a new try with it gave that example in one go. |
| `prompt_proven` (required) | boolean | True only when the prompt is real (origin.type real): then it is shown as the prompt to copy. |
| `instruction` (required) | string | How to build it: in one go, without questions, one deploy, then the live link. Follow it. |
| `prompt` (required) | string | The full build brief. |
| `acceptance` (required) | string\[\] | Check these yourself before you give the link. |
| `you_get` (required) | string\[\] |  |
| `parts` (required) | object\[\] |  |
| `tools` (required) | string\[\] |  |
| `cost` (required) | object |  |
| `needs` | object\[\] | What the user needs before starting. |
| `examples` | object\[\] | Worked examples. |

### RecipeList

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] |  |
| `next_step` (required) | string |  |

### MoveToLiveInput

Move sites from the test project to the live project.

| Field | Type |  |
| --- | --- | --- |
| `sites` | string\[\] | Optional. The sites to move, by id or slug. Leave it out to move every site of the test project. |
| `collections` | string\[\] | Optional. The collections to move, by name or id. Leave it out to move the collections the chosen sites use (a site uses a collection when its files name it, like a form from get\_form\_snippet). |
| `shared_collections` | `"refuse"`, `"copy"` | What to do with a collection that a site staying in test also uses. refuse (default): nothing is moved and the answer lists them. copy: the live project gets its own copy with all documents; the test site keeps the original. |

### MoveToLiveUndoInput

Undo a move to live within 24 hours.

| Field | Type |  |
| --- | --- | --- |
| `move_id` | string (uuid) | Optional. The id from move\_to\_live. Leave it out to undo the latest move of this project. |

### MoveToLive

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string | The id of this move, for undo\_move\_to\_live. |
| `status` (required) | `"done"`, `"partly_done"` | partly\_done: some steps after the move did not finish; see errors. Support is notified. |
| `from_project` (required) | object |  |
| `to_project` (required) | object |  |
| `moved` (required) | object |  |
| `stayed_in_test` (required) | object |  |
| `warnings` (required) | string\[\] |  |
| `errors` (required) | string\[\] |  |
| `undo` (required) | object |  |
| `connection` (required) | object or null | For a chat connected through OAuth: which project the connection points to now. |
| `summary` (required) | string |  |
| `next_step` (required) | string |  |

### MoveToLiveUndo

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string |  |
| `status` (required) | `"undone"`, `"partly_undone"` |  |
| `sites` (required) | string\[\] |  |
| `collections` (required) | number |  |
| `apps` (required) | number |  |
| `agents` (required) | number |  |
| `domains` (required) | number |  |
| `errors` (required) | string\[\] |  |
| `summary` (required) | string |  |
| `next_step` (required) | string |  |

### SiteReadiness

| Field | Type |  |
| --- | --- | --- |
| `site` (required) | object |  |
| `type` (required) | `"webshop"`, `"bookings"`, `"restaurant"`, `"course_membership"`, `"wordpress_portal"`, `null` |  |
| `type_source` (required) | `"given"`, `"detected"`, `"none"` |  |
| `region` (required) | `"eu"`, `"uk"`, `"us"`, `"other"` |  |
| `country` (required) | string or null |  |
| `works` (required) | object\[\] |  |
| `missing` (required) | object\[\] |  |
| `check_with_owner` (required) | object\[\] | What cannot be checked on the site; ask the owner, never require an answer. |
| `pages_checked` (required) | integer |  |
| `note` (required) | string |  |
| `summary_markdown` (required) | string |  |

### SearchConsoleVerifyInput

| Field | Type |  |
| --- | --- | --- |
| `site_id` | string (uuid) | The site to verify. For method meta this is the site that gets the tag; for dns the domain connected to this site is used. |
| `domain` | string | A domain connected in this project (connect\_domain), like example.com. For method dns; for meta, the site on this domain. |
| `method` (required) | `"dns"`, `"meta"` | dns: a TXT record on the connected domain (a domain property in Search Console). meta: a meta tag on the home page (property type URL prefix). |
| `token` (required) | string | The verification token from Search Console: the value alone, google-site-verification=..., or the whole meta tag. |

### SearchConsoleVerification

| Field | Type |  |
| --- | --- | --- |
| `method` (required) | `"dns"`, `"meta"` |  |
| `status` (required) | `"added"`, `"already_present"`, `"waiting_for_approval"` | added: done now. already\_present: it was there already. waiting\_for\_approval: the project needs a second person to approve the new version first. |
| `site_id` (required) | string or null |  |
| `domain` (required) | string or null |  |
| `property` (required) | string | What to enter in Search Console: sc-domain:<domain> for a domain property, or the address for a URL prefix property. |
| `record` | object |  |
| `version` | integer or null | The new site version with the tag (meta), when versions are on. |
| `sitemap` (required) | string | The sitemap to submit in Search Console under Sitemaps; the site serves it automatically. |
| `next_steps` (required) | string\[\] |  |

### SiteStats

| Field | Type |  |
| --- | --- | --- |
| `site_id` (required) | string |  |
| `slug` (required) | string |  |
| `days` (required) | integer |  |
| `from` (required) | string | The first day (UTC) in the range. |
| `to` (required) | string | The last day (UTC), today. |
| `totals` (required) | object |  |
| `per_day` (required) | object\[\] |  |
| `top_pages` (required) | object\[\] | Up to 10 paths with the most page views. Paths are recorded since 9 October 2026. |
| `origins` (required) | object\[\] | Where page views came from: direct (no referrer), internal (from the site itself), search, social, email, shortener or external (another site). |
| `note` (required) | string |  |
| `password_logins` | object | Only for a site behind a password: successful logins with the site password per day in the range, and the times of the last 20. Who logged in is not recorded (no IP address, no device); kept for 90 days. |
| `recipients` | object\[\] | Only for a site with recipient passwords (POST /sites/{id}/recipients): per recipient whether they opened it, page views and opens in the range, correct password entries, first and last time and the pages viewed. Counted from the session the password gave; no other cookie and no IP address. |

### SitePage

| Field | Type |  |
| --- | --- | --- |
| `url` (required) | string | The address that was asked for. |
| `final_url` (required) | string | The address that answered, after the redirects that were followed. |
| `method` (required) | `"GET"`, `"HEAD"` |  |
| `status` (required) | integer | The HTTP status of the final answer. |
| `ok` (required) | boolean | true for a 2xx status. |
| `headers` (required) | object | content-type, cache-control, location, etag, x-\* and a few more. Never set-cookie. |
| `redirects` (required) | object\[\] | The redirects that were followed, in order. |
| `redirect_blocked` | string | Set when a redirect was not followed (another host, not https, or too many); status and headers are then of that redirect. |
| `content_type` (required) | string or null |  |
| `body` (required) | string or null | The body as text, at most 20 KB; null for HEAD, an empty body or a body that is not text. |
| `body_bytes` (required) | integer | Bytes received (reading stops after 256 KB). |
| `truncated` (required) | boolean | true when the body is longer than what is returned. |
| `body_note` | string | Why the body is not shown, when it is not. |
| `elapsed_ms` (required) | integer |  |

### SiteFileContent

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"site_file"` |  |
| `site_id` (required) | string (uuid) |  |
| `path` (required) | string | The path of the file, like /index.html. |
| `content_type` (required) | string |  |
| `bytes` (required) | integer |  |
| `sha256` (required) | string or null | The SHA-256 of the file's bytes as hex. |
| `version` (required) | string | The site's current version: send it as if\_match\_version when you change the site (deploy\_site or edit\_site\_file). |
| `encoding` (required) | `"utf8"` |  |
| `content` (required) | string | The file's current text, complete (at most 256 KB). |

### CompanyInput

Who the project belongs to, and who its phone numbers are registered to: a business or a personal account (account\_type). For a business: company\_name, the address, the number in its country's business register (kvk\_number in the Netherlands, registration\_number elsewhere) and, in the EU, vat\_number (checked with VIES). For a personal account: the user's address and the contact (the user), without company fields.

| Field | Type |  |
| --- | --- | --- |
| `account_type` | `"personal"`, `"business"` | personal (someone without a company: no company\_name, kvk\_number, registration\_number or vat\_number) or business. Leave it out to keep the project's current type. A national number needs business. When a personal account is not available for the address, validation\_failed says so. |
| `company_name` | string or null | The legal name. Required for a business, not allowed for a personal account. |
| `kvk_number` | string or null | For a company in the Netherlands (required there): the KvK number, 8 digits. Spaces and dots are removed. |
| `registration_number` | string or null | For a company outside the Netherlands: the number in its country's business register (like a UK Companies House number or a German HRB number). Needed for the company verification level outside the EU. |
| `vat_number` | string or null | The VAT number. In the EU outside the Netherlands it is needed for the company verification level and checked with VIES: send it with or without the country prefix. A number that VIES rejects returns vat\_number\_invalid. |
| `address` (required) | object |  |
| `contact` (required) | object | A person the regulator can reach today. For a personal account: the user. |
| `registrar_contact_name` | string or null | Optional, for a business: the name on the contacts of the domains registered or transferred through Hypamoon, when it should differ from contact.name. Use a role, like Administration or Webmaster, so the domain registration carries no personal name while contact.name stays the person that number registration needs. Leave it out to keep the saved value; send null to use contact.name again. Not allowed for a personal account. |

### Company

The company details of the project (or, for a personal account, your own details), as saved.

| Field | Type |  |
| --- | --- | --- |
| `account_type` (required) | `"personal"`, `"business"` | personal (your own details, no business register number) or business. |
| `company_name` (required) | string or null | The legal company name; null for a personal account. |
| `kvk_number` (required) | string or null | 8 digits, for a company in the Netherlands; null elsewhere. |
| `registration_number` (required) | string or null | The number in the business register of the company's country, for a company outside the Netherlands (there it is kvk\_number). |
| `vat_number` (required) | string or null | The VAT number, with country prefix in the EU (like DE123456789). |
| `vat_status` (required) | `"valid"`, `"invalid"`, `"unverified"`, `"missing"`, `"not_required"` | For a company in the EU: the VIES check of vat\_number (unverified when VIES did not answer; we retry automatically). missing: no VAT number yet. not\_required: no VIES check needed for this country. |
| `vat_checked_at` (required) | string or null | When VIES last checked vat\_number, ISO 8601. |
| `address` (required) | object |  |
| `contact` (required) | object |  |
| `registrar_contact_name` | string or null | Only for a business: the name on the domain contacts at the registry when it differs from contact.name, or null (then contact.name is used). |
| `complete` (required) | boolean | The details are complete enough for the company or personal verification level: a business needs its business register number and, in the EU, a valid VAT number; a personal account needs a complete address. |
| `domain_contacts` | object\[\] | Only when the project has domains registered or transferred through Hypamoon: per domain, whether the new details reached the domain's contact at the registry. A change of organization, registration number or (for a personal account) person is never sent: that is a change of holder. |

### Number

A phone number of the project.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the number. Use it for the call plan. |
| `e164` (required) | string | The number in E.164, like +447700900123. |
| `type` (required) | string | national (non-geographic), geographic (with an area code), mobile or tollfree. |
| `status` (required) | string | pending (the registration is with the carrier, usually active within one business day), active or porting. |
| `created_at` (required) | string (date-time) | When the number was added to the project. |
| `test` (required) | boolean | true for a test number (test mode), from the range +447700900000 to +447700900999. It can never be called for real. |

### OrderedNumber

The number you ordered.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the number. Use it for the call plan. |
| `e164` (required) | string | The number in E.164, like +447700900123. |
| `type` (required) | string | national (non-geographic), geographic (with an area code), mobile or tollfree. |
| `status` (required) | string | pending (the registration is with the carrier, usually active within one business day), active or porting. |
| `created_at` (required) | string (date-time) | When the number was added to the project. |
| `test` (required) | boolean | true for a test number (test mode), from the range +447700900000 to +447700900999. It can never be called for real. |
| `from_stock` (required) | boolean | Whether the number came from our stock. A number from stock works right away. |

### NumberList

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | Number\[\] |  |

### ReleasedNumber

A test number that was released.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the number that was released. |
| `e164` (required) | string | The number in E.164, like +447700900123. |
| `released` (required) | `true` | Always true: the number is no longer in the project. |
| `test` (required) | `true` | Always true: only test numbers can be released through the API. |

### AvailableNumber

A number you can order with POST /numbers.

| Field | Type |  |
| --- | --- | --- |
| `e164` (required) | string | The number in E.164, like +447700900123. |
| `type` (required) | `"national"`, `"geographic"` |  |
| `from_stock` (required) | boolean | Whether the number is in our stock and works right away. |
| `test` (required) | boolean | true for a test number (test mode). |

### AvailableNumberList

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | AvailableNumber\[\] |  |

### NumberOrder

Send either phone\_number or area, not both.

| Field | Type |  |
| --- | --- | --- |
| `phone_number` | string | A number from GET /numbers/available, in E.164. With a test key: a test number from that same search. |
| `area` | string | Instead of phone\_number: we pick the first free number with this area code, as GET /numbers/available returns it. |

### AssistantInput

PUT replaces all fields: a field you leave out goes back to its default.

| Field | Type |  |
| --- | --- | --- |
| `voice` | `"saar"`, `"fenna"`, `"merel"`, `"julia"`, `"roos"`, `"tim"`, `"bram"`, `"daan"`, `"ruben"`, `"ava"`, `"nora"`, `"liam"`, `"owen"`, `"lena"`, `"mara"`, `"jonas"`, `"felix"`, `"chloe"`, `"manon"`, `"hugo"`, `"theo"`, `"lucia"`, `"elena"`, `"pablo"`, `"diego"` | The voice. It must speak the language: nl saar, fenna, merel, julia, roos, tim, bram, daan, ruben; en ava, nora, liam, owen; de lena, mara, jonas, felix; fr chloe, manon, hugo, theo; es lucia, elena, pablo, diego. Case does not matter. Default: the first voice of the language. |
| `language` | `"nl"`, `"en"`, `"de"`, `"fr"`, `"es"` | The language the assistant opens and speaks in: en (English), nl (Dutch), de (German), fr (French) or es (Spanish). The greeting follows it. Default: the language of the country of your first number (Dutch while the project has no number yet). |
| `languages` | `"nl"`, `"en"`, `"de"`, `"fr"`, `"es"`\[\] | The languages your callers speak; language always comes first. One language is the most reliable, because speech recognition never has to guess. Two or more switch it to multi, which follows the caller sentence by sentence, and the assistant switches with them. auto and multi are not accepted. Default: \[language\]. |
| `instructions` | string | What the assistant does, as free text. Default empty. |
| `website` | string or null | Optional. We read the page and use it for opening hours, address and services. Must be a public web address. |
| `greeting` | string or null | Optional. The first sentence callers hear, in the language set by language, at most 300 characters; keep it short, callers can only speak after it. It must say the caller is talking to an AI (EU AI Act, article 50), like "digital assistant", "virtual assistant" or "AI": if it does not, we put a short disclosure in front and say so in warnings. null or an empty string goes back to the default greeting. Unlike the other fields, leaving it out keeps the greeting you have. |

### Assistant

The assistant of the project.

| Field | Type |  |
| --- | --- | --- |
| `configured` (required) | boolean | Whether the assistant was ever set up with PUT /assistant. |
| `voice` (required) | string or null | The voice, like ava. It speaks the language. |
| `language` (required) | string | The language the assistant opens and speaks in, like en. |
| `languages` (required) | string\[\] | The languages your callers speak, with language first. |
| `speech_recognition` (required) | string | The language of speech recognition: the one language, or multi when there are two or more. |
| `instructions` (required) | string | What the assistant does: your instructions. |
| `website` (required) | string or null | The website the assistant reads for opening hours, address and services. |
| `greeting` (required) | string | The first sentence callers hear. Your own (greeting on PUT), or the default that follows from the project name and the language. It always says the caller is talking to a digital assistant. |
| `greeting_custom` (required) | boolean | true when greeting is your own text; false for the default. |
| `synced_at` (required) | string or null (date-time) | When the assistant was last updated at the carrier. |

### AssistantSaved

The assistant as saved.

| Field | Type |  |
| --- | --- | --- |
| `configured` (required) | boolean | Whether the assistant was ever set up with PUT /assistant. |
| `voice` (required) | string or null | The voice, like ava. It speaks the language. |
| `language` (required) | string | The language the assistant opens and speaks in, like en. |
| `languages` (required) | string\[\] | The languages your callers speak, with language first. |
| `speech_recognition` (required) | string | The language of speech recognition: the one language, or multi when there are two or more. |
| `instructions` (required) | string | What the assistant does: your instructions. |
| `website` (required) | string or null | The website the assistant reads for opening hours, address and services. |
| `greeting` (required) | string | The first sentence callers hear. Your own (greeting on PUT), or the default that follows from the project name and the language. It always says the caller is talking to a digital assistant. |
| `greeting_custom` (required) | boolean | true when greeting is your own text; false for the default. |
| `synced_at` (required) | string or null (date-time) | When the assistant was last updated at the carrier. |
| `sync` (required) | `"synced"`, `"failed"`, `"skipped_test_mode"` | synced when the assistant was updated right away; failed when not. Your settings are saved either way and applied with the next PUT. skipped\_test\_mode with a test key: a test project has no live assistant. |
| `call_plan` (required) | `"added"`, `"in_plan"`, `"not_in_plan"` | added: the project only had the default plan (voicemail), so it now has a call plan where the assistant answers every call, with voicemail if the assistant is not available. in\_plan: the call plan already sends calls to the assistant. not\_in\_plan: your own call plan does not use the assistant yet; add an ai\_agent node with PUT /numbers/{id}/call-plan. |
| `next_step` (required) | string | What to do next. |
| `user_message` (required) | string | A sentence you can show the user as it is. |
| `warnings` | string\[\] | Only when something was adjusted, like a greeting without the AI disclosure: we put a short disclosure in front. Tell the user and offer to choose their own wording. |

### CallPlan

A call plan: a small graph. entry is the first node; every node points to the next by id. At most 50 nodes, and every node must be reachable from entry. Field names inside the plan are camelCase: the plan is stored exactly as you send it.

| Field | Type |  |
| --- | --- | --- |
| `entry` (required) | string | The id of the first node. |
| `nodes` (required) | object | The nodes by id. The key must be the same as the node's id. |

### CallPlanResponse

| Field | Type |  |
| --- | --- | --- |
| `number_id` (required) | string (uuid) |  |
| `version` (required) | integer | The version of the number's own plan; 0 when the number has no own plan yet. Also in the ETag header. |
| `source` (required) | `"number"`, `"project"`, `"none"` | Where plan comes from. number: the number has its own plan. project: the number has no own plan and follows the plan of the project (set\_assistant sets that one up); this is what callers get. none: no plan at all. |
| `plan` (required) | one of | The plan that calls to this number follow: its own plan, or else the plan of the project; null when there is none. |

### CallPlanSaved

| Field | Type |  |
| --- | --- | --- |
| `number_id` (required) | string (uuid) |  |
| `version` (required) | integer | The version of the number's own plan; 0 when the number has no own plan yet. Also in the ETag header. |
| `plan` (required) | CallPlan | A call plan: a small graph. entry is the first node; every node points to the next by id. At most 50 nodes, and every node must be reachable from entry. Field names inside the plan are camelCase: the plan is stored exactly as you send it. |
| `assistant_sync` (required) | `"synced"`, `"failed"`, `"not_needed"`, `"skipped_test_mode"` | Whether the assistant was updated with this plan. not\_needed for a plan without ai\_agent; skipped\_test\_mode with a test key. |

### Call

A call. The same shape in GET /calls, GET /calls/{id} and every webhook.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the call. |
| `direction` (required) | `"inbound"`, `"outbound"`, `null` | inbound, or outbound for a call your assistant made with POST /calls. |
| `from` (required) | string or null | The caller, in E.164. |
| `to` (required) | string or null | The number that was called, in E.164. |
| `status` (required) | string or null | The status as we track it: ringing, active, completed, missed, failed, voicemail, ai\_handled. New values may be added; treat an unknown value like completed. |
| `created_at` (required) | string or null (date-time) | When the call reached us. |
| `started_at` (required) | string or null (date-time) | When the call started. |
| `answered_at` (required) | string or null (date-time) | When the platform picked up. With a call plan the platform always picks up first, so this does not prove a person answered. |
| `ended_at` (required) | string or null (date-time) | When the call ended. |
| `duration_sec` (required) | integer or null | The length of the call in seconds. |
| `hangup_cause` (required) | string or null | Why the call ended, as reported by the carrier, like normal\_clearing. |
| `has_summary` (required) | boolean | Whether the call has a summary. Fetch it with GET /calls/{id}. |
| `summary_ready_at` (required) | string or null (date-time) | When the summary of a recorded call was ready. Empty for a call handled by the voice AI; look at has\_summary instead. |
| `test` (required) | boolean | true for a simulated call from POST /test/calls or POST /calls with a test key (test mode). Also in webhooks, so you can keep test traffic apart. |
| `outbound` (required) | object or null | The request behind an outbound call started with POST /calls. |

### CallDetail

A call with its transcript and summary.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the call. |
| `direction` (required) | `"inbound"`, `"outbound"`, `null` | inbound, or outbound for a call your assistant made with POST /calls. |
| `from` (required) | string or null | The caller, in E.164. |
| `to` (required) | string or null | The number that was called, in E.164. |
| `status` (required) | string or null | The status as we track it: ringing, active, completed, missed, failed, voicemail, ai\_handled. New values may be added; treat an unknown value like completed. |
| `created_at` (required) | string or null (date-time) | When the call reached us. |
| `started_at` (required) | string or null (date-time) | When the call started. |
| `answered_at` (required) | string or null (date-time) | When the platform picked up. With a call plan the platform always picks up first, so this does not prove a person answered. |
| `ended_at` (required) | string or null (date-time) | When the call ended. |
| `duration_sec` (required) | integer or null | The length of the call in seconds. |
| `hangup_cause` (required) | string or null | Why the call ended, as reported by the carrier, like normal\_clearing. |
| `has_summary` (required) | boolean | Whether the call has a summary. Fetch it with GET /calls/{id}. |
| `summary_ready_at` (required) | string or null (date-time) | When the summary of a recorded call was ready. Empty for a call handled by the voice AI; look at has\_summary instead. |
| `test` (required) | boolean | true for a simulated call from POST /test/calls or POST /calls with a test key (test mode). Also in webhooks, so you can keep test traffic apart. |
| `outbound` (required) | object or null | The request behind an outbound call started with POST /calls. |
| `transcript` (required) | string or null | The transcript. Only here, never in a webhook. |
| `summary` (required) | one of | The summary of a call. |
| `warnings` | string\[\] | Only in the response of POST /calls, when something was adjusted: for example an opening without the AI disclosure got a short sentence in front of it. Tell the user. |

### CallList

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | Call\[\] |  |
| `has_more` (required) | boolean | Whether there is a next page. |
| `next_cursor` (required) | string or null | Pass this as cursor to get the next page. Null on the last page. |

### CallTimeline

The timeline of a call: its legs, its events, the outcome and who answered.

| Field | Type |  |
| --- | --- | --- |
| `call_id` (required) | string (uuid) | The call you asked for. |
| `outcome` (required) | `"answered"`, `"missed"`, `"no_answer"`, `"voicemail"`, `"assistant"`, `"in_progress"`, `"failed"`, `"unknown"` | How the call went, the same way the portal says it: answered, missed (inbound and nobody picked up), no\_answer (outbound and nobody picked up), voicemail, assistant (the voice AI handled it), in\_progress, failed or unknown. |
| `answered_by` (required) | one of | Who on your side picked up: the first forward that was answered, else the assistant when it handled the call, else null. |
| `legs` (required) | object\[\] | The legs, primary first, then the forwards oldest first. |
| `events` (required) | object\[\] | What happened, oldest first. |

### Summary

The summary of a call.

| Field | Type |  |
| --- | --- | --- |
| `text` (required) | string or null | The summary in a few sentences. |
| `topics` (required) | string\[\] | What the call was about. |
| `sentiment` (required) | `"positive"`, `"neutral"`, `"negative"`, `null` | The mood of the caller. |
| `action_items` (required) | string\[\] | What someone has to do after this call. |
| `next_step` (required) | string or null | The agreed next step, if any. |

### TestCallInput

| Field | Type |  |
| --- | --- | --- |
| `number_id` (required) | string (uuid) | The id of one of your test numbers, from GET /numbers. |
| `scenario` (required) | `"reservation"`, `"callback_request"`, `"question"`, `"missed"` | What happens in the call: reservation, callback\_request, question, missed. missed has no transcript and no summary, so only call.completed is sent. |
| `from` | string | Optional: the caller, a fictional number from +447700900000 to +447700900999. |
| `caller_goal` | string |  |

### WebhookEndpointInput

A new webhook endpoint.

| Field | Type |  |
| --- | --- | --- |
| `url` (required) | string | An https URL with a domain name on the default port, without credentials, that resolves to a public address. |
| `events` (required) | `"call.completed"`, `"call.summary.ready"`, `"message.delivered"`, `"message.failed"`, `"conversation.summary.ready"`, `"balance.low"`, `"balance.topped_up"`, `"balance.reload_failed"`, `"document.created"`, `"email.sent"`, `"email.delivered"`, `"email.delayed"`, `"email.bounced"`, `"email.complained"`\[\] | The events to receive, from call.completed, call.summary.ready, message.delivered, message.failed, conversation.summary.ready, balance.low, balance.topped\_up, balance.reload\_failed, document.created, email.sent, email.delivered, email.delayed, email.bounced, email.complained. The email events come once per recipient. |
| `app_id` | string (uuid) | Optional, for email events only: receive only the email events of emails this app sent (an id from list\_apps). Without it, the endpoint gets the events of every email of the project. |

### WebhookEndpoint

A webhook endpoint. Never with the secret.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `url` (required) | string |  |
| `events` (required) | string\[\] | The subscribed events, from call.completed, call.summary.ready, message.delivered, message.failed, conversation.summary.ready, balance.low, balance.topped\_up, balance.reload\_failed, document.created. |
| `active` (required) | boolean | false after 50 failed deliveries in a row; switch it back on with POST /webhooks/{id}/enable. |
| `secret_prefix` (required) | string | The first characters of the secret, to recognize it. |
| `created_at` (required) | string (date-time) | When the endpoint was created. |
| `last_success_at` (required) | string or null (date-time) | The last delivery that got a 2xx. |
| `last_failure_at` (required) | string or null (date-time) | The last delivery that failed. |
| `consecutive_failures` (required) | integer | Failed deliveries in a row. |
| `app_id` | string (uuid) | Only with a filter on one app: the endpoint gets the email events of that app's emails only. |

### WebhookEndpointCreated

The new webhook endpoint, with its secret.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) |  |
| `url` (required) | string |  |
| `events` (required) | string\[\] | The subscribed events, from call.completed, call.summary.ready, message.delivered, message.failed, conversation.summary.ready, balance.low, balance.topped\_up, balance.reload\_failed, document.created. |
| `active` (required) | boolean | false after 50 failed deliveries in a row; switch it back on with POST /webhooks/{id}/enable. |
| `secret_prefix` (required) | string | The first characters of the secret, to recognize it. |
| `created_at` (required) | string (date-time) | When the endpoint was created. |
| `last_success_at` (required) | string or null (date-time) | The last delivery that got a 2xx. |
| `last_failure_at` (required) | string or null (date-time) | The last delivery that failed. |
| `consecutive_failures` (required) | integer | Failed deliveries in a row. |
| `app_id` | string (uuid) | Only with a filter on one app: the endpoint gets the email events of that app's emails only. |
| `secret` (required) | string | The signing secret, whsec\_ plus 43 characters. Shown only in this response: store it now. |

### WebhookEndpointList

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | WebhookEndpoint\[\] |  |

### EmailSentEvent

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string | The event id, evt\_ plus 32 hex characters. The same on retries. |
| `type` (required) | `"email.sent"` |  |
| `created_at` (required) | string |  |
| `data` (required) | object |  |

### EmailDeliveredEvent

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string | The event id, evt\_ plus 32 hex characters. The same on retries. |
| `type` (required) | `"email.delivered"` |  |
| `created_at` (required) | string |  |
| `data` (required) | object |  |

### EmailDelayedEvent

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string | The event id, evt\_ plus 32 hex characters. The same on retries. |
| `type` (required) | `"email.delayed"` |  |
| `created_at` (required) | string |  |
| `data` (required) | object |  |

### EmailBouncedEvent

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string | The event id, evt\_ plus 32 hex characters. The same on retries. |
| `type` (required) | `"email.bounced"` |  |
| `created_at` (required) | string |  |
| `data` (required) | object |  |

### EmailComplainedEvent

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string | The event id, evt\_ plus 32 hex characters. The same on retries. |
| `type` (required) | `"email.complained"` |  |
| `created_at` (required) | string |  |
| `data` (required) | object |  |

### EmailReceivedEvent

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string |  |
| `type` (required) | `"email.received"` |  |
| `created_at` (required) | string |  |
| `data` (required) | object |  |

### WebhookTestResult

| Field | Type |  |
| --- | --- | --- |
| `delivery_id` (required) | string (uuid) |  |
| `event_id` (required) | string | The id of the webhook.test event, evt\_ plus 32 hex characters. |
| `status` (required) | `"delivered"`, `"pending"`, `"failed"` | delivered: your endpoint answered 2xx. pending: it did not, and we retry with backoff. failed: we gave up. |
| `response_status` (required) | integer or null | The HTTP status your endpoint answered with, if any. |
| `error` (required) | `"timeout"`, `"connection_failed"`, `"non_2xx_status"`, `"not_public_host"`, `"invalid_url"`, `"response_too_large"`, `"secret_unreadable"`, `"endpoint_disabled"`, `"call_deleted"`, `"summary_deleted"`, `"message_deleted"`, `"conversation_deleted"`, `"document_deleted"`, `"invalid_reference"`, `"delivery_failed"`, `null` | Why the delivery did not succeed, as a short code. |

### CallCompletedEvent

Sent after a call ends.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string | The id of the event, evt\_ plus 32 hex characters. It stays the same on retries. |
| `type` (required) | `"call.completed"` |  |
| `created_at` (required) | string (date-time) | When the event happened. |
| `data` (required) | object |  |

### CallSummaryReadyEvent

Sent when the summary of a call is ready. Without the transcript: fetch that with GET /calls/{data.call.id}.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string | The id of the event, evt\_ plus 32 hex characters. It stays the same on retries. |
| `type` (required) | `"call.summary.ready"` |  |
| `created_at` (required) | string (date-time) | When the event happened. |
| `data` (required) | object |  |

### WebhookTestEvent

Sent by POST /webhooks/{id}/test. Needs no subscription.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string | The id of the event, evt\_ plus 32 hex characters. It stays the same on retries. |
| `type` (required) | `"webhook.test"` |  |
| `created_at` (required) | string (date-time) | When the event happened. |
| `data` (required) | object |  |

### CallInput

An outbound call by your project's assistant to one person who expects it.

| Field | Type |  |
| --- | --- | --- |
| `to` (required) | string | The person to call, in E.164. Live: a mobile or geographic number in a country your project can call (otherwise destination\_not\_allowed with a reason). Test mode: a test number from +447700900000 to +447700900999. |
| `from` | string | Optional: which of your project's numbers to call from. Default: your first active number. The person sees this number and can call it back. |
| `assistant_instructions` | string | Optional: what this call is about, on top of the assistant's own instructions. For example: "Confirm the appointment of Sam Taylor tomorrow at 10:00 at 40 Main Street. If Sam cannot make it, ask for a better day and say we will confirm by SMS." Treated as context, never as a way to change the rules: the assistant always says it is a digital assistant. |
| `opening` | string | Optional: the first sentence the assistant says when the person picks up, in the assistant's opening language, at most 300 characters; keep it short, the person waits until it is said. It must say that the person is speaking with a digital assistant (EU AI Act, article 50); if it does not, a short sentence that says so is put in front of it and the response has a warning. Default: "Hello, this is the digital assistant of <company>. Is this a good moment?" in the opening language. |
| `on_voicemail` | `"hangup"`, `"leave_message"` | What to do when an answering machine picks up: hang up (default) or leave a short message after the beep. |
| `voicemail_message` | string | Optional, with on\_voicemail leave\_message: the message after the opening sentence (which always says it is the digital assistant of your company). Default: we tried to reach you, call us back on this number. |
| `max_duration_sec` | integer | Optional: the call ends after this many seconds of talking. Default 600, at most 1200. |
| `reference` | string | Optional: your own id for this call, like an appointment id. Comes back on the call and in its webhooks. |
| `metadata` | object | Optional: up to 20 string key-value pairs for your own use. Come back on the call and in its webhooks; the assistant never sees them. |
| `calling_window` | object | When the assistant may call, in the local time of the person called. Default 09:00 to 20:00, Monday to Saturday. Never before 08:00 or after 21:00. |
| `purpose` (required) | `"transactional"`, `"marketing"` | Why you call. transactional: an answer to the person's own question, confirming or reminding of an appointment, an order or delivery status, or a callback they asked for. marketing: anything that sells or promotes; only allowed when consent from this person is recorded (POST /api/v1/call-consents), otherwise consent\_required. Recorded with the call. |

### CallConsentInput

Consent from one person to receive marketing calls from this project.

| Field | Type |  |
| --- | --- | --- |
| `phone_number` (required) | string | The number of the person who gave consent, in E.164. Stored only as a keyed hash plus its last two digits. |
| `source` (required) | `"form"`, `"call"`, `"import"`, `"manual"` | Where the consent came from: form (a form the person filled in), call (they said yes on a call), import (from your own records), manual (recorded by hand). |
| `evidence` (required) | string | A reference to the proof, so it can be shown later: a form entry id, a call id, a file and row, or a short note. Not the proof itself and no other personal data. |
| `consented_at` | string (date-time) | When the person gave consent (ISO 8601). Default: now. Cannot be in the future. |

### CallConsent

Recorded consent from one person to receive marketing calls from this project.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the consent. |
| `phone_number_ending` (required) | string | The last two digits of the number. The number itself is never stored, only a keyed hash. |
| `source` (required) | `"form"`, `"call"`, `"import"`, `"manual"` | Where the consent came from: form, call, import or manual. |
| `evidence` (required) | string | Your reference to the proof. |
| `consented_at` (required) | string (date-time) | When the person gave consent. |
| `recorded_at` (required) | string (date-time) | When it was recorded here. |
| `revoked_at` (required) | string or null (date-time) | When it was revoked; null while it is valid. |
| `status` (required) | `"active"`, `"revoked"` | active: marketing calls to this number are allowed. revoked: no longer. |

### CallConsentList

The project's recorded consents.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | CallConsent\[\] | The consents, newest first (at most 100). |

### MessageInput

A transactional SMS to one recipient.

| Field | Type |  |
| --- | --- | --- |
| `to` (required) | string | The recipient in E.164. Live: a mobile number in a country your project can text (otherwise destination\_not\_allowed with a reason). Test mode: a test number from +447700900000 to +447700900999. |
| `body` (required) | string | The text. At most 6 SMS segments: 918 characters in plain text (GSM-7), 402 with an emoji or another character outside GSM-7. Typographic quotes and dashes are replaced by plain ones. |
| `from` | string | Optional sender name: 1 to 11 letters, digits and spaces, with at least one letter. Default: your project name. A phone number is not possible. |
| `reference` | string | Optional: your own id for this message, like an order number. Comes back in the message and its webhooks. |

### Message

An SMS message. The same shape in POST /messages, GET /messages, GET /messages/{id} and the message webhooks.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the message. |
| `to` (required) | string | The recipient, in E.164. |
| `from` (required) | string | The sender the recipient sees: an alphanumeric name of up to 11 characters. |
| `body` (required) | string | The text as it was sent, after typographic quotes and dashes were made SMS-safe. |
| `segments` (required) | integer | How many SMS segments the text took. A segment is 160 GSM-7 or 70 UCS-2 characters (153 and 67 when split). |
| `encoding` (required) | `"gsm7"`, `"ucs2"`, `null` | gsm7, or ucs2 when the text has a character outside GSM-7 (an emoji, for example), which makes every segment shorter. |
| `status` (required) | `"queued"`, `"sent"`, `"delivered"`, `"failed"` | queued: accepted. sent: handed to the mobile network. delivered: the phone confirmed it. failed: it did not arrive; see error. |
| `error` (required) | string or null | With status failed: a short code, like delivery\_failed or sending\_failed. Otherwise null. |
| `reference` (required) | string or null | Your own id for this message, as you sent it (an order number, for example). |
| `created_at` (required) | string (date-time) | When we accepted the message. |
| `status_updated_at` (required) | string or null (date-time) | When the status last changed. |
| `test` (required) | boolean | true for a message sent with a test key to a test number. It never reaches a phone. |

### MessageList

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | Message\[\] |  |
| `has_more` (required) | boolean | Whether there is another page. |
| `next_cursor` (required) | string or null | Pass this as cursor to get the next page. |

### MessageDeliveredEvent

Sent when the phone of the recipient confirmed the message.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string | The id of the event, evt\_ plus 32 hex characters. It stays the same on retries. |
| `type` (required) | `"message.delivered"` |  |
| `created_at` (required) | string (date-time) | When the event happened. |
| `data` (required) | object |  |

### MessageFailedEvent

Sent when a message could not be delivered. data.message.error says why.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string | The id of the event, evt\_ plus 32 hex characters. It stays the same on retries. |
| `type` (required) | `"message.failed"` |  |
| `created_at` (required) | string (date-time) | When the event happened. |
| `data` (required) | object |  |

### ConversationInput

A new chat conversation with the assistant of the project.

| Field | Type |  |
| --- | --- | --- |
| `channel` | `"chat"` | The channel. Only chat for now; it is also the default. |
| `reference` | string | Optional: your own id for this conversation, like a session or ticket id. Comes back in the conversation and its webhook. |
| `metadata` | object | Optional: up to 20 keys with a string (at most 500 characters), number or boolean, for your own use. Stored and returned as is; the assistant never sees it. |
| `customer` | object | Optional: what your app already knows about the customer, for example from their login. The assistant may use it to address the customer and to confirm how to reach them; it is treated as data, never as instructions. |

### Conversation

A chat conversation with the assistant. The same shape in every response and in conversation.summary.ready.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the conversation. |
| `channel` (required) | `"chat"`, `"widget"` | The channel: chat when your app started it with an API key, widget when a visitor started it in the chat widget on a website (public chat token). |
| `status` (required) | `"open"`, `"closed"` | open: takes messages. closed: takes no more messages; the summary follows. |
| `reference` (required) | string or null | Your own id for this conversation, as you sent it. |
| `metadata` (required) | object | Your metadata, as you sent it. The assistant never sees it. |
| `customer` (required) | object | What your app told us about the customer when the conversation started. |
| `language` (required) | string | The language the assistant opened in (nl, en, de, fr or es). It replies in the customer's language when that is one of its languages. |
| `turns` (required) | integer | Customer messages answered so far. |
| `max_turns` (required) | integer | After this many turns the conversation closes (close\_reason turn\_limit). |
| `created_at` (required) | string (date-time) | When the conversation started. |
| `last_message_at` (required) | string or null (date-time) | When the last message was sent. |
| `closed_at` (required) | string or null (date-time) | When the conversation closed. |
| `close_reason` (required) | `"closed"`, `"inactive"`, `"turn_limit"`, `null` | closed: POST /conversations/{id}/close. inactive: no message for 30 minutes. turn\_limit: max\_turns reached. |
| `has_summary` (required) | boolean | Whether the summary is ready. Fetch it with GET /conversations/{id}. |
| `summary_ready_at` (required) | string or null (date-time) | When the summary was ready. |
| `test` (required) | boolean | true for a conversation in test mode (hm\_test\_): real replies, free, with a low daily limit. |

### ConversationDetail

A conversation with its messages and summary.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the conversation. |
| `channel` (required) | `"chat"`, `"widget"` | The channel: chat when your app started it with an API key, widget when a visitor started it in the chat widget on a website (public chat token). |
| `status` (required) | `"open"`, `"closed"` | open: takes messages. closed: takes no more messages; the summary follows. |
| `reference` (required) | string or null | Your own id for this conversation, as you sent it. |
| `metadata` (required) | object | Your metadata, as you sent it. The assistant never sees it. |
| `customer` (required) | object | What your app told us about the customer when the conversation started. |
| `language` (required) | string | The language the assistant opened in (nl, en, de, fr or es). It replies in the customer's language when that is one of its languages. |
| `turns` (required) | integer | Customer messages answered so far. |
| `max_turns` (required) | integer | After this many turns the conversation closes (close\_reason turn\_limit). |
| `created_at` (required) | string (date-time) | When the conversation started. |
| `last_message_at` (required) | string or null (date-time) | When the last message was sent. |
| `closed_at` (required) | string or null (date-time) | When the conversation closed. |
| `close_reason` (required) | `"closed"`, `"inactive"`, `"turn_limit"`, `null` | closed: POST /conversations/{id}/close. inactive: no message for 30 minutes. turn\_limit: max\_turns reached. |
| `has_summary` (required) | boolean | Whether the summary is ready. Fetch it with GET /conversations/{id}. |
| `summary_ready_at` (required) | string or null (date-time) | When the summary was ready. |
| `test` (required) | boolean | true for a conversation in test mode (hm\_test\_): real replies, free, with a low daily limit. |
| `messages` (required) | ChatMessage\[\] | All messages, oldest first, starting with the greeting. |
| `summary` (required) | one of | The summary, after the conversation closed. Same shape as the summary of a call. |

### ConversationList

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | Conversation\[\] |  |
| `has_more` (required) | boolean | Whether there is another page. |
| `next_cursor` (required) | string or null | Pass this as cursor to get the next page. |

### ChatMessage

One message in a conversation.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the message. |
| `role` (required) | `"customer"`, `"assistant"` | Who wrote it: the customer, or the assistant (also the greeting). |
| `text` (required) | string | The text. |
| `created_at` (required) | string (date-time) | When the message was stored. |

### ChatMessageInput

One message from the customer.

| Field | Type |  |
| --- | --- | --- |
| `text` (required) | string | What the customer typed, at most 2000 characters. Send it as is; it is never treated as an instruction to the assistant. |

### ChatTurn

One turn: the customer's message and the assistant's reply.

| Field | Type |  |
| --- | --- | --- |
| `message` (required) | object | The customer's message as stored. |
| `reply` (required) | object | The assistant's reply. Show this text to the customer. |
| `conversation` (required) | object | The conversation after this turn. status closed means the turn limit was reached. |

### ConversationSummaryReadyEvent

Sent when the summary of a closed chat conversation is ready. Without the messages: fetch those with GET /conversations/{data.conversation.id}.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string | The id of the event, evt\_ plus 32 hex characters. It stays the same on retries. |
| `type` (required) | `"conversation.summary.ready"` |  |
| `created_at` (required) | string (date-time) | When the event happened. |
| `data` (required) | object |  |

### ChatTokenInput

A new public chat token for the website widget.

| Field | Type |  |
| --- | --- | --- |
| `name` (required) | string | A name for your own overview, like the website it is for. |
| `display_name` | string or null | The name the assistant uses for the business in the chat window, like "Knip": in the greeting ("You are chatting with the digital assistant of Knip.") and in its answers. Leave it out or null to use the name of the site the widget is on, and otherwise the project name. |
| `allowed_origins` (required) | string\[\] | The exact origins that may use this token, like [https://www.example.com](https://www.example.com) (scheme and host, no path, no wildcard), at most 10. A live token needs at least one https origin. A test token may always be used from localhost. |
| `turnstile` | boolean | Ask for a bot check before a conversation starts. Default true. |
| `max_conversations_per_day` | integer | New conversations per day through this token. Default 200, at most 1000. |

### ChatTokenUpdate

Change a public chat token. Fields you leave out stay as they are.

| Field | Type |  |
| --- | --- | --- |
| `name` | string |  |
| `display_name` | string or null | The name the assistant uses for the business in the chat window, like "Knip": in the greeting ("You are chatting with the digital assistant of Knip.") and in its answers. null or an empty string goes back to the name of the site the widget is on, and otherwise the project name. |
| `allowed_origins` | string\[\] |  |
| `turnstile` | boolean |  |
| `max_conversations_per_day` | integer |  |

### ChatToken

A public chat token for the chat widget on a website.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the public chat token. Use it to change or revoke the token. |
| `name` (required) | string | Your name for the token, like the website it is for. |
| `display_name` (required) | string or null | The name the assistant uses for the business in the chat window and its greeting, or null: then the name of the site the widget is on, and otherwise the project name. |
| `token` (required) | string | The public chat token: hm\_pub\_ (live) or hm\_pubtest\_ (test project) plus 24 characters. Not a secret: it goes in the page source of your website. |
| `mode` (required) | `"live"`, `"test"` | live or test, from the project the key belongs to. |
| `allowed_origins` (required) | string\[\] | The exact origins that may use the token, like [https://www.example.com](https://www.example.com). A test token also works from localhost. |
| `turnstile` (required) | boolean | Whether a visitor passes a bot check before a conversation starts. |
| `max_conversations_per_day` (required) | integer | New conversations per day through this token, counted until midnight, Europe/Amsterdam. |
| `revoked` (required) | boolean | true once the token is revoked: the widget stops working right away, also in open conversations. |
| `revoked_at` (required) | string or null (date-time) | When the token was revoked. |
| `last_used_at` (required) | string or null (date-time) | When a browser last used the token, to the minute. |
| `created_at` (required) | string (date-time) | When the token was created. |
| `embed_code` (required) | string | The script tag for your website, with this token in it. Paste it before </body>. |
| `kind` (required) | `"chat"`, `"form"`, `"shop"` | chat: the chat widget, the cart, the checkout and forms. form: only forms that post to a collection with public\_write (made by Hypamoon for a form on a site); it cannot chat. shop: the buy button, the cart and forms of one site (made by Hypamoon for a buy button on a site); it cannot chat. |
| `warnings` | object\[\] | Only in the answer of POST /chat-tokens, and only when there is something to tell. The token is created either way. |

### ChatTokenList

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | ChatToken\[\] | The public chat tokens of the project, newest first, also the revoked ones. |
| `daily_spend_limit_eur` (required) | number | What the public chat of this project may spend per day in replies, in euro. Default 5; change it in the portal. 0 turns the live widget off. |

### SiteInput

A new static site.

| Field | Type |  |
| --- | --- | --- |
| `slug` | string | The address: `https://<slug>.hypamoon.app`. 3 to 40 characters, lowercase letters, digits and hyphens. Leave it out to derive it from name (with a short suffix if that one is taken). |
| `name` (required) | string | A name for your own overview, like the business or the page. |
| `files` (required) | object\[\] | All files of the site: complete, ready for a browser, with at least /index.html. At most 50 files, 1 MB per file (also PDF, video and audio) and 5 MB together. |
| `password` | string or null | Optional. One shared password for the whole site (4 to 72 characters): visitors enter it once per browser, like password protection on a preview. Not a login system: no accounts, no per-visitor access. null or an empty string removes it. Never returned; the site shows password\_protected instead. |
| `for_app` | boolean | true: this site will carry a new app (POST /apps with its site\_id next). On the Free plan the site of an app does not count as the project's site. |
| `media` | string\[\] | Optional. Files from the project's media library (list\_media) to put on the site, without uploading them again: folders like "portfolio/" (with subfolders), file ids, or paths like /media/logo.webp. Each file lands at its library path with its 640 version next to it; private originals never go on a site. A file you also send in files wins. |
| `message` | string | Optional, but always send it: what changed and why, in one short sentence (up to 200 characters), like a commit message: "New opening hours for the summer" or "Spring menu, the user asked for it". It shows in the version history; without it Hypamoon writes a short summary like "Changed /index.html". |

### SiteUpdate

Change a site: a new name, new files, a password (or null to remove it), or a combination. The slug stays the same. The usual way: send only the changed files with keep\_existing: true and if\_match\_version, images preferably as source\_url.

| Field | Type |  |
| --- | --- | --- |
| `name` | string | A name for your own overview, like the business or the page. |
| `files` | object\[\] | Usually with keep\_existing: true: only the files you add or change; every other file stays as it is, so never send images that are already on the site again. Without keep\_existing, files is the complete new set of files: a file you leave out is removed, and the answer lists it in warnings. |
| `keep_existing` | boolean | true: a partial update. Only the files in files are added or replaced, delete\_paths removes files, and every other file stays. Needs if\_match\_version. The limits, the checks and four-eyes approval apply to the whole site as it will be after the update. |
| `delete_paths` | string\[\] | Only with keep\_existing: true. Paths of existing files to remove, like /old.html. A path that is not on the site is an error. |
| `media` | string\[\] | Optional. Files from the project's media library (list\_media) to put on the site, without uploading them again: folders like "portfolio/" (with subfolders), file ids, or paths like /media/logo.webp. Each file lands at its library path with its 640 version next to it; private originals never go on a site. A file you also send in files wins. |
| `if_match_version` | string | The version of the site you are changing, from list\_sites, get\_site or the last deploy (version). Required with keep\_existing. If the site changed since, you get 409 version\_conflict with current\_version and nothing changes: read the site again and redo your change. |
| `password` | string or null | Optional. One shared password for the whole site (4 to 72 characters): visitors enter it once per browser, like password protection on a preview. Not a login system: no accounts, no per-visitor access. null or an empty string removes it. Never returned; the site shows password\_protected instead. |
| `security_txt` | `"auto"`, `"off"` | auto (default): when the site has no /.well-known/security.txt of its own, Hypamoon serves one with the project's contact address (the shop contact\_email, else the billing email; none set means no file). off: no security.txt from Hypamoon. A file of your own at that path always wins. |
| `message` | string | Optional, but always send it: what changed and why, in one short sentence (up to 200 characters), like a commit message: "New opening hours for the summer" or "Spring menu, the user asked for it". It shows in the version history; without it Hypamoon writes a short summary like "Changed /index.html". |
| `preview` | boolean | true: do not put this change live. It becomes a preview version at a secret link (preview.url in the answer, not indexed), and the live site stays as it is. Put it live later with promote\_site\_version. Only files (with keep\_existing as usual), no name or password. Use it for large changes the user should see first. |
| `confirm_replace` | boolean | Only after the user agreed. A deploy without keep\_existing that removes more than half of the files, makes the site more than half smaller, or rewrites most of /index.html while other files disappear, is held as a preview instead of going live (guardrail in the answer). Send confirm\_replace: true only when the user has said yes to replacing the site like that; then it goes live right away. |

### Site

A static site on hypamoon.app.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the site. Use it to update or delete the site. |
| `slug` (required) | string | The first part of the address: `https://<slug>.hypamoon.app`. |
| `name` (required) | string | Your name for the site. |
| `url` (required) | string | The public address of the site, live right away. |
| `files` (required) | SiteFile\[\] | The files of the site, sorted by path, without their content. |
| `created_at` (required) | string (date-time) | When the site was created. |
| `updated_at` (required) | string (date-time) | When the site or its files last changed. |
| `version` (required) | string | The version that is live now. Changes on every update; every file on the site carries it as its ETag, so you can check that a page shows this version. |
| `password_protected` (required) | boolean | true when visitors have to enter a password first: the site's shared password (set with password on POST /sites or PUT /sites/{id}) or a personal password per recipient. Passwords themselves are never returned. |
| `test` (required) | boolean | true for a site of a test project. It is public all the same. |
| `security_txt` | `"auto"`, `"off"` | auto: without a /.well-known/security.txt of its own, the site serves one with the project's contact address. off: none from Hypamoon. Set with security\_txt on PUT /sites/{id}. |
| `taken_offline` (required) | object or null | null while the site is live. Set when Hypamoon took the site offline because of abuse: visitors get a page that says it is unavailable, the files are kept, and PUT and DELETE return 403 site\_offline. To object, the owner replies to the email or writes to [hello@hypamoon.com](mailto:hello@hypamoon.com). |
| `warnings` | one of\[\] | Only in the answer of a deploy, and only when there is something to tell: files a deploy without keep\_existing removed, and build hints. Warnings never block a deploy. |

### DomainConnectInput

| Field | Type |  |
| --- | --- | --- |
| `domain` (required) | string | The domain, like example.com. |
| `site_id` | string or null (uuid) | Optional. A site of this project (from deploy\_site or list\_sites) to serve on the domain and on www. |
| `method` | `"nameservers"`, `"cname"` | nameservers (default): the user points the domain's nameservers to the two we return; existing records, mail included, are copied first. cname: fallback when the nameservers cannot change: only www, through a CNAME and a TXT record at the user's DNS provider. |
| `dkim_selectors` | string\[\] | Optional. The DKIM selector(s) of the user's mail provider (like google or selector1), so their DKIM records are copied too. |
| `replace_existing` | boolean | Optional, default false. For a subdomain of a domain this project has on Hypamoon's nameservers: if the subdomain still has an A, AAAA or CNAME record pointing elsewhere (like an old host), the call is refused with what is live there now. true replaces those records (only after the user agreed); undo\_dns\_change puts them back for 30 days. |

### DomainRegisterInput

| Field | Type |  |
| --- | --- | --- |
| `domain` (required) | string | The domain, like example.com. |
| `years` | integer | Registration period in years. Most extensions only allow 1. |
| `accept_registry_terms` (required) | boolean | Must be true: the user (the registrant) explicitly accepted the terms of the registry at registry\_terms\_url from check\_domain. |
| `max_price_eur` (required) | number | The highest total the user agreed to pay for all years together, as shown by check\_domain. Refused if the price is higher. |
| `accept_price_eur` | number | Only for a name with a higher registry price (premium true in check\_domain): the price\_eur for the first year exactly as check\_domain showed it and the user confirmed. Without it, or if the price changed, nothing is bought. |
| `site_id` | string or null (uuid) | Optional. A site of this project to serve on the domain once it is active. |

### DomainSiteInput

| Field | Type |  |
| --- | --- | --- |
| `site_id` (required) | string or null (uuid) | The site to serve on the domain, or null for none. |

### DomainUpdateInput

| Field | Type |  |
| --- | --- | --- |
| `hsts` | `"off"`, `"on"`, `"on_with_subdomains"` | Tells browsers to always open the domain over https (HSTS). off (default): no such instruction. on: for one year. on\_with\_subdomains: the same, for every subdomain too. Once on, browsers that visited the site remember it for about a year and will only open the domain over https, even if you turn it off again. Only choose on\_with\_subdomains if every subdomain of the domain (like mail or shop) works over https too. Only possible when the site is live on the domain with a valid certificate. |
| `auto_renew` | boolean | Only for a domain bought or transferred through Hypamoon. true (default): Hypamoon renews it for a year before it expires, from the project's balance. false: it is not renewed and expires on its expiry date. |
| `primary` | `"apex"`, `"www"` | Which address of the domain is the main one. apex (default): example.com, and [www.example.com](http://www.example.com) redirects to it. www: [www.example.com](http://www.example.com), and example.com redirects to it. The redirect is permanent (301) and keeps the path and query; canonical links and the sitemap follow the main address. Only for method nameservers. |

### DnsRecordInput

| Field | Type |  |
| --- | --- | --- |
| `record_id` | string | Optional. The id from list\_dns\_records of the record to change or delete. Without it, a new record is added. |
| `type` (required) | `"A"`, `"AAAA"`, `"CNAME"`, `"MX"`, `"TXT"`, `"SRV"`, `"CAA"`, `"NS"` | The record type. |
| `name` (required) | string | The name: @ for the domain itself, or a subdomain like www, mail or \_dmarc. |
| `content` | string | The value: an IP address, a hostname, or the text of a TXT record. For SRV: 'priority weight port target'. For CAA: 'flags tag "value"'. |
| `ttl` | integer | Seconds; 1 means automatic. |
| `priority` | integer | For MX: the priority (lower is preferred). |
| `proxied` | boolean | For A, AAAA and CNAME: through the CDN (true) or DNS only (false, default). |
| `delete` | boolean | true deletes the record with record\_id. |
| `confirm_overwrite` | boolean | Optional, default false. A change that replaces or deletes a record that is live now (on an active domain) is refused first with a preflight: what changes, what is live there now, and whether mail is affected. Show it to the user; only after they agree, call again with true. undo\_dns\_change reverses it for 30 days. |

### DeployApproval

Four-eyes approval is on for this project: the deploy waits until another owner or builder approves it in the portal (or with approve\_deploy). Nothing changed on the live site yet.

| Field | Type |  |
| --- | --- | --- |
| `object` (required) | `"deploy_approval"` |  |
| `id` (required) | string (uuid) | The id of the request; pass it as approval\_id to approve\_deploy or reject\_deploy. |
| `status` (required) | `"pending"`, `"processing"`, `"approved"`, `"rejected"`, `"failed"`, `"superseded"`, `"expired"` | pending until another owner or builder decides. superseded: a newer deploy of the same site replaced it. expired: after 7 days. |
| `kind` (required) | `"new_site"`, `"site_update"`, `"site_delete"`, `"app_deploy"`, `"app_rollback"` | app\_deploy and app\_rollback: server code of an app (deploy\_app, rollback\_app); files and bytes are its modules. |
| `site_id` (required) | string or null (uuid) |  |
| `name` (required) | string or null |  |
| `slug` (required) | string or null |  |
| `url` (required) | string or null | The address of the site. For an update or deletion it still shows the live version until approval. |
| `files` (required) | integer |  |
| `bytes` (required) | integer |  |
| `password_change` (required) | `"none"`, `"remove"`, `"set"` |  |
| `requested_by` (required) | object |  |
| `requested_at` (required) | string |  |
| `expires_at` (required) | string |  |
| `reviewed_by` (required) | string or null (uuid) |  |
| `reviewed_at` (required) | string or null |  |
| `reason` (required) | string or null |  |
| `result` (required) | object or null |  |

### ZoneFileInput

| Field | Type |  |
| --- | --- | --- |
| `zone_file` (required) | string | The zone file in BIND format, as exported from the current DNS provider (often called 'export zone' or 'download zone file'). At most 256 KB. |
| `replace_existing` | boolean | Optional, default false. true: for every name and type in the file, records here that are not in the file are deleted. false: records are only added. |

### DnsRestoreInput

| Field | Type |  |
| --- | --- | --- |
| `snapshot_id` | string (uuid) | Optional. The id of a restore point from dns\_snapshots in get\_domain. Without it: the newest restore point of the previous DNS (a zone file, or the scan when the domain was connected). |

### DomainTransferInput

| Field | Type |  |
| --- | --- | --- |
| `domain` (required) | string | The domain to move to Hypamoon, like example.com. |
| `authcode` | string | The transfer code (auth code, EPP code; for .nl the token) the user got from their current registrar. Required for most extensions. Never stored. |
| `accept_registry_terms` (required) | boolean | Must be true: the user (the registrant) explicitly accepted the terms of the registry at registry\_terms\_url from check\_domain. |
| `max_price_eur` (required) | number | The highest amount the user agreed to pay for the transfer. Refused if the price is higher. |
| `dns` | `"hypamoon"`, `"keep"` | hypamoon (default): the nameservers switch to the DNS zone here when the transfer completes; run preflight\_domain first. keep: the nameservers stay as they are; switch later with switch\_domain\_nameservers. |
| `site_id` | string or null (uuid) | Optional. A site of this project to serve on the domain once it is active. |
| `dkim_selectors` | string\[\] | Optional. The DKIM selector(s) of the user's mail provider, so their DKIM records are copied too. |
| `ignore_preflight` | boolean | Optional, default false. With dns hypamoon the nameservers switch when the transfer completes, so the transfer is refused (confirmation\_required, nothing charged) while preflight\_domain is not ready. true transfers anyway, only when the user accepts the listed differences. |

### DomainNameserversInput

| Field | Type |  |
| --- | --- | --- |
| `use` (required) | `"hypamoon"`, `"previous"` | hypamoon: the nameservers of the DNS zone here. previous: back to the nameservers the domain had before (to undo the move). |
| `ignore_preflight` | boolean | Optional, default false. With use hypamoon, the switch is refused while preflight\_domain is not ready; true switches anyway (only when the user accepts the listed differences). |

### SiteImportInput

| Field | Type |  |
| --- | --- | --- |
| `url` (required) | string | The https address of the existing site, on a domain this project connected (like [https://www.example.com](https://www.example.com)). |
| `site_id` | string (uuid) | Optional. An existing site of this project to replace with the imported files. Without it, a new site is created. |
| `name` | string | Optional. A name for the new site; default the host name. |
| `slug` | string | Optional. The address of a new site, like deploy\_site's slug. |
| `max_pages` | integer | Optional. At most this many pages (default 25, at most 50). |

### WordpressInspectInput

| Field | Type |  |
| --- | --- | --- |
| `url` (required) | string | The https address of the WordPress site, like [https://www.example.com](https://www.example.com). Any public site: nothing is changed and no login is used. |

### WordpressImportInput

| Field | Type |  |
| --- | --- | --- |
| `url` (required) | string | The https address of the WordPress site, on a domain this project has proven it owns (like [https://www.example.com](https://www.example.com)). |
| `site_id` | string (uuid) | Optional. An existing site of this project to put the import in. Without it, a new site is created. |
| `keep_existing` | boolean | Only with site\_id. true: a partial update. The imported files are added or replaced and every other file of the site stays; images already on the site are not fetched again. Needs if\_match\_version. |
| `if_match_version` | string | With keep\_existing: the version of the site from get\_site or list\_sites. If the site changed since, nothing changes (409). |
| `name` | string | Optional. A name for the new site; default the site's own name. |
| `slug` | string | Optional. The address of a new site, like deploy\_site's slug. |
| `max_posts` | integer | Optional. Read at most this many posts, newest first (default all, at most 500). |

### WordpressMigrateInput

| Field | Type |  |
| --- | --- | --- |
| `url` (required) | string | The https address of the WordPress site, like [https://www.example.com](https://www.example.com). |
| `action` | `"plan"`, `"import"`, `"media"`, `"woocommerce"`, `"backup"`, `"finish"` | plan (default): see what can move and what is missing, changes nothing. import: pages and posts to a site. media: the media library to Media, in rounds. woocommerce: products (and only with an explicit yes, customers and orders). backup: read a backup link from the hosting. finish: advice to revoke the passwords, and with confirm remove them from the vault. |
| `wordpress_secret` | string | Optional. The name of the vault secret with the WordPress application password (default wordpress\_app\_password). |
| `woocommerce_secret` | string | Optional. The name of the vault secret with the WooCommerce API key (default woocommerce\_api\_key). |
| `cursor` | string | Only for media, woocommerce and backup: the cursor from the previous answer, to continue where it stopped. |
| `site_id` | string (uuid) | Only for import: an existing site of this project to put the import in. Without it, a new site is created. |
| `keep_existing` | boolean | Only for import with site\_id: add or replace only the imported files. Needs if\_match\_version. |
| `if_match_version` | string | With keep\_existing: the version of the site from get\_site. |
| `name` | string | Only for import: a name for the new site. |
| `slug` | string | Only for import: the address of a new site. |
| `max_posts` | integer | Only for import: read at most this many posts, newest first. |
| `source` | `"site"`, `"backup"` | Only for import: site (default) reads the live site; backup uses the pages and posts from the database dump that action backup found. If the site's content API is closed, import uses the backup on its own when there is one. |
| `include_personal_data` | boolean | Only for woocommerce: true to also move customers and orders. Only after the user said yes in this conversation; send their answer in confirm\_text. |
| `confirm_text` | string | The user's own answer, word for word, when they agreed to move personal data or to remove the secrets. Kept in the audit log. |
| `backup_url` | string | Only for backup: an https link to a .zip or .tar.gz backup of the site, made at the hosting. |
| `confirm` | boolean | Only for finish: true removes the WordPress and WooCommerce secrets of this site from the vault, after the user agreed. |

### SiteUploadInput

Ask for upload links for files that are too large to send inline.

| Field | Type |  |
| --- | --- | --- |
| `site_id` | string (uuid) | Optional. The site the files are for, when you change an existing one (from deploy\_site or list\_sites). Leave it out for a new site. |
| `files` (required) | object\[\] | The files to upload, at most 200 per request. |

### SiteUploadList

Upload links for large files.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] | One upload link per file, in the order you sent them. |
| `hint` (required) | string | What to do when the PUT to upload\_url fails from your environment (a sandbox may block it). |
| `limits` (required) | object | The site limits of this project's plan. |

### SiteDropInput

Create a drop link: a page where the user uploads files and whole folders in a browser.

| Field | Type |  |
| --- | --- | --- |
| `site_id` | string (uuid) | Optional. The site the files are for (from deploy\_site or list\_sites). Leave it out for a new site. |
| `strip` | `"location"`, `"all"`, `"none"` | Optional. What the upload page removes, in the user's browser before upload, from photos (JPEG, PNG, WebP) it keeps as they are: originals the user chooses to keep, and photos that would not get smaller as WebP. location (default) removes only the GPS location and keeps camera, date, orientation and copyright; all removes all metadata (the orientation stays so photos stay upright); none keeps the files as they are. Web versions are re-encoded and carry no metadata at all. Use all or none only when the user asks for it. |
| `folder` | string | Optional. The folder under /media/ where the files land, like portfolio or menu/2026. Folders the user drags keep their structure inside it: /media/portfolio/project-12/03.webp. Leave it out to use the user's own folder names. |
| `as_is` | boolean | Optional. For moving an existing site (like WordPress uploads): true keeps every file exactly as it is, with no web versions, the same name and extension, and the exact folder path the user drags, under /media/<folder>/. |
| `keep_zip` | boolean | Optional. true keeps a .zip the user adds as one file (a download, like a plugin or a pack of files) instead of unpacking it. On a site it is served as a download; the deploy check refuses a zip with a program, a password or another archive inside. |

### SiteDrop

A drop link and the files the user uploaded with it.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the drop link; pass it to get\_drop (GET /sites/drops/{id}). |
| `status` (required) | `"open"`, `"done"`, `"expired"` | open: waiting for the user. done: the user uploaded the files. expired: 24 hours passed; create a new one. |
| `site_id` (required) | string or null (uuid) | The site the link is for, or null. |
| `created_at` (required) | string |  |
| `expires_at` (required) | string | When the link stops working (24 hours after it was made). |
| `completed_at` (required) | string or null | When the user finished uploading, or null. |
| `images_only` (required) | boolean | True when the link only takes images (an editor made it). |
| `as_is` | boolean | True when files are kept exactly as they are (for moving a site): no web versions, same names, and paths that follow the user's folders exactly. |
| `keep_zip` | boolean | True when a .zip stays one file (a download) instead of being unpacked. |
| `strip` (required) | `"location"`, `"all"`, `"none"` | What the upload page removes from photos before upload: location (the default, only the GPS location), all (all metadata) or none. Web versions are re-encoded and carry no metadata at all. |
| `folder` (required) | string or null | The folder under /media/ the files land in, or null for the user's own folder names. |
| `max_files` (required) | integer | How many files the user can add with this link (a photo with its versions counts once). |
| `files` (required) | object\[\] | The files that arrived, in order. Private originals are not listed. |
| `originals_kept` (required) | integer | How many originals were kept. They are private: never on a site, only downloadable in the portal. |
| `site_version` (required) | object or null | With site\_id, after the user pressed Done: the new version of the site with these files (waiting: it waits for four-eyes approval). The files are already on the site; send only HTML with keep\_existing. |
| `deploy_files` (required) | object\[\] | The same files in the form deploy\_site takes: add them to files, without content. |
| `url` | string | Only when the link is created: the page to give the user. It is not shown again. |
| `user_message` | string | A sentence to give the user. |
| `next_step` | string | What to do next. |

### MediaFile

A file in the project's media library (Files).

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the file in the library. |
| `path` (required) | string | Where the file goes on a site when you add it with deploy\_site media, like /media/portfolio/project-12/03.webp. |
| `folder` (required) | string | The folder under /media/, empty for /media/ itself. |
| `name` (required) | string | The file name in the library. |
| `original_name` (required) | string or null | The name on the user's computer, when it differs. |
| `content_type` (required) | string |  |
| `bytes` (required) | integer |  |
| `width` (required) | integer or null |  |
| `height` (required) | integer or null |  |
| `alt` (required) | string or null | The alt text, set with update\_media. |
| `url` (required) | string or null | Where the file is served, on the first site that has it at this path. null: it is on no site yet; it is private until you add it with deploy\_site media. |
| `variants` (required) | object | For photos: 640, the small version for srcset and thumbnails. |
| `srcset` (required) | string or null | A ready srcset for an img tag once the file is on a site: small webp versions at 160, 320, 640 and 1280 wide (from /\_hypamoon/img on that site) plus the file itself. Always add sizes with the width it is shown at, like sizes="52px" for a thumbnail. |
| `thumbnail_url` (required) | string or null | A small webp, 160 wide, for thumbnails up to about 80 px (search suggestions, lists, a cart). null while the file is on no site, or for a file that is not a photo. |
| `original_kept` (required) | boolean | The full-size original is kept privately. It never goes on a site; the user downloads it in the portal. |
| `sites` (required) | object\[\] | The sites that use this file right now, with the path and url there. |
| `source` (required) | `"upload"`, `"portaal"`, `"site"`, `"import"` | upload: an upload link; portaal: the portal; site: it was already on a site; import: an import. |
| `access` (required) | `"team"`, `"public"`, `"paid"` | Who can open the file. team: only the project's members and this chat (the default for every file). |
| `title` (required) | string or null | A display name, set with update\_media. |
| `description` (required) | string or null | A free description, set with update\_media. |
| `tags` (required) | string\[\] | Tags to filter on, set with update\_media. |
| `kind` (required) | `"image"`, `"video"`, `"audio"`, `"pdf"`, `"font"`, `"archive"`, `"document"`, `"data"`, `"other"` | image, video, audio, pdf, font, archive, document, data or other, from the file type. |
| `deleted_at` (required) | string or null | When it went to the trash; null when it is not in the trash. A file stays in the trash for 30 days. |
| `purge_at` (required) | string or null | When the trash deletes it for good. Restore it before then with update\_media restore: true. |
| `deleted_from` (required) | string or null | The path it had before it went to the trash; restore puts it back there. |
| `created_at` (required) | string |  |
| `updated_at` (required) | string |  |

### MediaList

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | MediaFile\[\] |  |
| `folders` (required) | object\[\] | Every folder in the library with its number of files (empty is /media/ itself). |
| `next_cursor` (required) | string or null | Pass it as cursor for the next page; null when there is no more. |

### MediaUpdate

Rename or move a file in the library, set its alt text, title, description or tags, or restore it from the trash. Sites keep the file under the path they have until you deploy again.

| Field | Type |  |
| --- | --- | --- |
| `name` | string | A new file name. The extension always stays that of the file. |
| `folder` | string or null | Move the file to this folder under /media/; null or an empty string for /media/ itself. |
| `alt` | string or null | The alt text for the image; null removes it. |
| `title` | string or null | A display name; null removes it. |
| `description` | string or null | A free description; null removes it. |
| `tags` | string\[\] | The tags of the file, replacing the old ones; \[\] removes them. At most 20. |
| `restore` | `true` | Put a file from the trash back where it was (or next to it, when that name is taken now). |

### MediaLinkInput

Create an upload page for the media library.

| Field | Type |  |
| --- | --- | --- |
| `folder` | string | Optional. The folder under /media/ where the files land, like portfolio or menu/2026. Folders the user drags keep their structure inside it: /media/portfolio/project-12/03.webp. Leave it out to use the user's own folder names. |
| `site_id` | string (uuid) | Optional. With a site, Done also puts the files on that site as a new version. |
| `images_only` | boolean | Optional. true: the page only takes images. |
| `strip` | `"location"`, `"all"`, `"none"` | Optional. What the upload page removes, in the user's browser before upload, from photos (JPEG, PNG, WebP) it keeps as they are: originals the user chooses to keep, and photos that would not get smaller as WebP. location (default) removes only the GPS location and keeps camera, date, orientation and copyright; all removes all metadata (the orientation stays so photos stay upright); none keeps the files as they are. Web versions are re-encoded and carry no metadata at all. Use all or none only when the user asks for it. |
| `keep_zip` | boolean | Optional. true keeps a .zip the user adds as one file (a download, like a plugin or a pack of files) instead of unpacking it. On a site it is served as a download; the deploy check refuses a zip with a program, a password or another archive inside. |

### SiteFile

One file of a site, without its content.

| Field | Type |  |
| --- | --- | --- |
| `path` (required) | string | The path of the file on the site, like /index.html. |
| `content_type` (required) | string | The type it is served with, like text/html. |
| `bytes` (required) | integer | The size of the file in bytes. |
| `updated_at` (required) | string (date-time) | When the file was last written. |

### SiteList

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | Site\[\] | The sites of the project, newest first. Deleted sites are not listed. |

### DeletedSite

A deleted site that can still be restored.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the site. Send it to POST /sites/{id}/restore. |
| `slug` (required) | string | The address it had and will get back: `https://<slug>.hypamoon.app`. It stays reserved for this project. |
| `name` (required) | string | Your name for the site. |
| `deleted_at` (required) | string (date-time) | When the site was deleted. |
| `restore_until` (required) | string (date-time) | Until when the site can be restored. After that its files are erased for good. |
| `test` (required) | boolean | true for a site of a test project. |

### DeletedSiteList

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | DeletedSite\[\] | The deleted sites that can still be restored, most recently deleted first. |

### RestoredSite

The restored site, live again at its old address.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the site. Use it to update or delete the site. |
| `slug` (required) | string | The first part of the address: `https://<slug>.hypamoon.app`. |
| `name` (required) | string | Your name for the site. |
| `url` (required) | string | The public address of the site, live right away. |
| `files` (required) | SiteFile\[\] | The files of the site, sorted by path, without their content. |
| `created_at` (required) | string (date-time) | When the site was created. |
| `updated_at` (required) | string (date-time) | When the site or its files last changed. |
| `version` (required) | string | The version that is live now. Changes on every update; every file on the site carries it as its ETag, so you can check that a page shows this version. |
| `password_protected` (required) | boolean | true when visitors have to enter a password first: the site's shared password (set with password on POST /sites or PUT /sites/{id}) or a personal password per recipient. Passwords themselves are never returned. |
| `test` (required) | boolean | true for a site of a test project. It is public all the same. |
| `security_txt` | `"auto"`, `"off"` | auto: without a /.well-known/security.txt of its own, the site serves one with the project's contact address. off: none from Hypamoon. Set with security\_txt on PUT /sites/{id}. |
| `taken_offline` (required) | object or null | null while the site is live. Set when Hypamoon took the site offline because of abuse: visitors get a page that says it is unavailable, the files are kept, and PUT and DELETE return 403 site\_offline. To object, the owner replies to the email or writes to [hello@hypamoon.com](mailto:hello@hypamoon.com). |
| `warnings` | one of\[\] | Only in the answer of a deploy, and only when there is something to tell: files a deploy without keep\_existing removed, and build hints. Warnings never block a deploy. |
| `visibility` | `"public"`, `"unlisted"` | public or unlisted, as before the site was deleted. |
| `restore_notes` (required) | string\[\] | What did not come back with the site (an app on it, a custom domain), and how to set it up again. |

### CollectionInput

A new collection.

| Field | Type |  |
| --- | --- | --- |
| `name` (required) | string | The name of the collection, unique in the project: 2 to 40 characters, a lowercase letter first, then lowercase letters, digits and underscores (contact, signups, menu). A form posts to it by this name. |
| `description` | string | What the collection is for, for your own overview. |
| `access` | object | Who may use the collection besides your API key. Leave it out for private: all false. |
| `triggers` | object | What happens when a document is added, through the API or a form. |
| `email_routing` | object | Where the email of email\_on\_insert goes, instead of the billing email address: at most 5 different addresses in to and rules together. An address must be confirmed before it gets anything: the billing email, the email of a project member and an address on a domain connected to the project are confirmed right away; any other address gets one email with a link to confirm (live projects only). When none of the chosen addresses is confirmed, the email goes to the billing email address. Reply-To stays the email field of the entry. |
| `schema` | object | Optional JSON Schema (a subset of draft 2020-12, at most 16 kB) that every document must match, with type "object" at the root. Supported: type, properties, required, additionalProperties, items, minItems, maxItems, enum, const, minLength, maxLength, pattern, format (email, uri, date, date-time, time), minimum, maximum, exclusiveMinimum, exclusiveMaximum, title and description. |
| `app_access` | object | Share this collection with apps of the project: {"<app id or name>": "read" | "write" | "none"}. The code of an app (env.HYPAMOON) only reaches the collections it created itself and the ones shared with it here; everything else is closed to it by default. read: the app reads the collection and its documents; write: it may also add, change and delete documents; none: no longer shared. Only the apps you name change. A collection an app created itself cannot be shared. |

### CollectionUpdate

Change a collection. Fields you leave out stay as they are.

| Field | Type |  |
| --- | --- | --- |
| `name` | string | The name of the collection, unique in the project: 2 to 40 characters, a lowercase letter first, then lowercase letters, digits and underscores (contact, signups, menu). A form posts to it by this name. |
| `description` | string or null | What the collection is for, for your own overview. |
| `access` | object | Who may use the collection besides your API key. Leave it out for private: all false. |
| `triggers` | object | What happens when a document is added, through the API or a form. |
| `email_routing` | object or null | Where the email of email\_on\_insert goes, instead of the billing email address: at most 5 different addresses in to and rules together. An address must be confirmed before it gets anything: the billing email, the email of a project member and an address on a domain connected to the project are confirmed right away; any other address gets one email with a link to confirm (live projects only). When none of the chosen addresses is confirmed, the email goes to the billing email address. Reply-To stays the email field of the entry. |
| `schema` | object or null | Optional JSON Schema (a subset of draft 2020-12, at most 16 kB) that every document must match, with type "object" at the root. Supported: type, properties, required, additionalProperties, items, minItems, maxItems, enum, const, minLength, maxLength, pattern, format (email, uri, date, date-time, time), minimum, maximum, exclusiveMinimum, exclusiveMaximum, title and description. |
| `app_access` | object | Share this collection with apps of the project: {"<app id or name>": "read" | "write" | "none"}. The code of an app (env.HYPAMOON) only reaches the collections it created itself and the ones shared with it here; everything else is closed to it by default. read: the app reads the collection and its documents; write: it may also add, change and delete documents; none: no longer shared. Only the apps you name change. A collection an app created itself cannot be shared. |

### Collection

A collection of JSON documents: the data layer of a project.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the collection. Its name works in the path as well. |
| `name` (required) | string | The name, unique in the project. A form posts to it by this name. |
| `description` (required) | string or null | What the collection is for, or null. |
| `access` (required) | object | Who may use the collection besides your API key. All false is private. |
| `triggers` (required) | object |  |
| `email_routing` (required) | object or null | Where the email of email\_on\_insert goes. null: the billing email address. |
| `schema` (required) | object or null | The JSON Schema every document must match, or null. |
| `personal_data` | boolean | true when the collection holds personal data: its schema has fields about people (see personal\_data\_fields), or it was imported from WordPress (form entries, orders, customers, users, reviews; those always stay private). An editor reads such a collection only when the owner allowed personal data for them. |
| `personal_data_fields` | string\[\] | The fields of the schema that are about a person: names like name, email, phone, address or birth date (also naam, e-mail, telefoon, contact\_email), or format email. Empty without a schema. |
| `document_count` (required) | integer | How many documents the collection has now. |
| `app_id` | string or null | The app that created this collection from its own code; only that app (and its staging) reaches it. null: a collection of the project, closed to every app unless shared through app\_access. |
| `app_access` | object\[\] | The apps this collection of the project is shared with (set with app\_access on update\_collection). Not shown to the key of an app, and absent on a collection of an app. |
| `created_at` (required) | string (date-time) | When the collection was created. |
| `updated_at` (required) | string (date-time) | When the collection last changed. |
| `test` (required) | boolean | true for a collection of a test project. |

### CollectionList

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | Collection\[\] | The collections of the project, newest first. Deleted collections are not listed. |

### DocumentInput

A new document.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object | The document: any JSON object, at most 64 kB. |

### DocumentUpdate

Change a document: send data to replace it, or merge to change some fields. Not both.

| Field | Type |  |
| --- | --- | --- |
| `data` | object | The document: any JSON object, at most 64 kB. |
| `merge` | object | Merged into the document as a JSON Merge Patch (RFC 7396): a field you send replaces that field, null removes it, an object is merged field by field. |

### Document

A document in a collection.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the document. |
| `collection_id` (required) | string (uuid) | The id of its collection. |
| `data` (required) | object | The document itself: a JSON object. |
| `source` (required) | `"api"`, `"public"` | api: added with an API key. public: sent from a form on a website. |
| `created_at` (required) | string (date-time) | When the document was added. |
| `updated_at` (required) | string (date-time) | When the document last changed. |
| `test` (required) | boolean | true for a document of a test project. No email was sent for it. |

### DocumentList

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | Document\[\] | The documents, newest first. |
| `has_more` (required) | boolean | Whether there is another page. |
| `next_cursor` (required) | string or null | Pass this as cursor to get the next page. |

### PublicDocumentInput

A document from a form on a website.

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object | The fields of the form as a JSON object, like { "name": "Anna", "email": "[anna@example.com](mailto:anna@example.com)", "message": "..." }. |
| `turnstile_token` | string | The bot-check token from the challenge frame (GET /public/challenge). Required; form.js does this for you. |
| `honeypot` | string | The value of a hidden field that people leave empty. When it is filled in, the answer is 201 but nothing is stored. |

### PublicDocumentCreated

A form entry was stored. The data is not sent back.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the new document. |
| `created_at` (required) | string (date-time) | When it was stored. |
| `test` (required) | boolean | true when the public token is a test token: stored, but no email is sent. |

### PublicDocumentList

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | object\[\] | The newest documents, newest first: only data and created\_at. |

### PublicChatConfig

What the chat widget needs before a conversation starts.

| Field | Type |  |
| --- | --- | --- |
| `name` (required) | string | The name of the project, as the widget shows it. |
| `greeting` (required) | string | The greeting, in the language the assistant opens in: the default, or your own chat.greeting (configure\_texts), always with the AI disclosure. |
| `language` (required) | string | The language the assistant opens in (nl, en, de, fr or es). |
| `languages` (required) | string\[\] | The languages of the assistant. |
| `mode` (required) | `"live"`, `"test"` | live or test, from the token. |
| `turnstile` (required) | boolean | Whether POST /public/conversations needs a turnstile\_token. |
| `max_message_length` (required) | integer | The longest message a visitor can send, in characters. |
| `max_turns` (required) | integer | After this many turns the conversation closes. |
| `branding` (required) | boolean | Whether the widget shows "Powered by Hypamoon". True on Free, false from Maker. |
| `texts` | object | Only when the project chose its own widget texts (configure\_texts): per language, key (like send) to text. The widget uses them over its built-in texts. |

### PublicTexts

The texts for checkout.js, cart.js and form.js.

| Field | Type |  |
| --- | --- | --- |
| `language` (required) | `"en"`, `"nl"`, `"de"`, `"fr"`, `"es"` | The language of the texts. |
| `texts` (required) | object | Per part (checkout, cart, form): key to text, the default in this language with the project's own texts over it. {1} marks where the script puts a number, code or date. |

### PublicConversationInput

Start a conversation from the chat widget.

| Field | Type |  |
| --- | --- | --- |
| `turnstile_token` | string | The bot-check token from the challenge frame. Required when the public token has turnstile on (the default); the widget does this for you. |

### PublicConversation

A conversation as the widget sees it: only what concerns the visitor. No metadata, customer details or summary; your backend reads those with GET /conversations/{id}.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string (uuid) | The id of the conversation. |
| `channel` (required) | `"widget"` | Always widget: started through a public chat token. |
| `status` (required) | `"open"`, `"closed"` | open: takes messages. closed: takes no more messages. |
| `language` (required) | string | The language the assistant opened in. |
| `turns` (required) | integer | Visitor messages answered so far. |
| `max_turns` (required) | integer | After this many turns the conversation closes (close\_reason turn\_limit). |
| `created_at` (required) | string (date-time) | When the conversation started. |
| `last_message_at` (required) | string or null (date-time) | When the last message was sent. |
| `closed_at` (required) | string or null (date-time) | When the conversation closed. |
| `close_reason` (required) | `"closed"`, `"inactive"`, `"turn_limit"`, `null` | Why it closed: inactive after 30 minutes without a message, or turn\_limit. |
| `test` (required) | boolean | true for a conversation through a test token (hm\_pubtest\_). |

### PublicConversationStart

A new conversation from the widget, with its secret.

| Field | Type |  |
| --- | --- | --- |
| `conversation` (required) | PublicConversation | A conversation as the widget sees it: only what concerns the visitor. No metadata, customer details or summary; your backend reads those with GET /conversations/{id}. |
| `messages` (required) | ChatMessage\[\] | The greeting, as the first message. |
| `conversation_token` (required) | string | The secret of this conversation, for this visitor only. Send it as X-Conversation-Token on every next request about this conversation. Keep it in the page (or sessionStorage), never in a URL. |
| `expires_at` (required) | string (date-time) | When conversation\_token stops working (6 hours after the start). |

### PublicConversationDetail

The visitor's own conversation with its messages.

| Field | Type |  |
| --- | --- | --- |
| `conversation` (required) | PublicConversation | A conversation as the widget sees it: only what concerns the visitor. No metadata, customer details or summary; your backend reads those with GET /conversations/{id}. |
| `messages` (required) | ChatMessage\[\] | All messages, oldest first, starting with the greeting. |

### PublicChatTurn

One turn in the widget: the visitor's message and the assistant's reply.

| Field | Type |  |
| --- | --- | --- |
| `message` (required) | object | The visitor's message as stored. |
| `reply` (required) | object | The assistant's reply. Show this text. |
| `conversation` (required) | object | The conversation after this turn. status closed means the turn limit was reached. |

### Balance

The prepaid balance with the latest transactions.

| Field | Type |  |
| --- | --- | --- |
| `balance_eur` (required) | number | The prepaid balance in euro, excluding VAT. Can be slightly below zero after a call that ran on. |
| `currency` (required) | `"EUR"` | Always EUR. |
| `spent_this_month_eur` (required) | number | What was deducted this calendar month (minus refunds). Counts toward the spending cap. |
| `spend_cap_eur` (required) | number or null | The spending cap per calendar month, or null without one. |
| `auto_reload` (required) | AutoReload | Automatic top-up with a saved card. |
| `transactions` (required) | Transaction\[\] | The latest 20 transactions, newest first. |
| `test` (required) | boolean | true with a test key: you see the balance of the live project, read-only. Test mode is free and never touches the balance. |

### Transaction

One line in the ledger of the prepaid balance. The same shape in GET /balance and the balance webhooks.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string | The id of the transaction. |
| `type` (required) | `"top_up"`, `"charge"`, `"refund"`, `"adjustment"` | top\_up: money added with a payment. charge: usage deducted. refund: a charge given back (an SMS the carrier refused, for example). adjustment: a correction by Hypamoon support. |
| `source` (required) | `"payment"`, `"sms"`, `"call"`, `"number"`, `"chat"`, `"site"`, `"support"` | What caused it: a payment, an SMS, a call, a number, a chat reply of the assistant, site requests above what the plan includes, or Hypamoon support. |
| `amount_eur` (required) | number | The amount in euro excluding VAT, with a sign: positive for a top-up or refund, negative for a charge. Up to four decimals. |
| `balance_after_eur` (required) | number | The balance right after this transaction, in euro excluding VAT. |
| `description` (required) | string | What it was for, in a few words. |
| `quantity` (required) | number or null | How many units, like 2 SMS segments or 3 minutes. Null for a top-up. |
| `unit` (required) | string or null | The unit of quantity, like segment, minute or month. Null for a top-up. |
| `reference_id` (required) | string or null | The id of what caused it: a message, a call, a number or a payment. |
| `created_at` (required) | string (date-time) | When the transaction was booked. |

### AutoReload

Automatic top-up with a saved card.

| Field | Type |  |
| --- | --- | --- |
| `enabled` (required) | boolean | Whether automatic top-up is switched on. Change it in the portal. |
| `active` (required) | boolean | Whether it can run now: switched on, with a saved card that has not expired. |
| `threshold_eur` (required) | number | When the balance drops below this amount, a top-up starts. |
| `amount_eur` (required) | number | How much each automatic top-up adds, excluding VAT. |
| `max_per_month` (required) | integer | The most automatic top-ups per calendar month. |
| `used_this_month` (required) | integer | How many automatic top-ups ran this calendar month. |
| `disabled_reason` (required) | string or null | Why it is off or cannot run: no\_card, card\_expired, repeated\_failures or turned\_off. Null when it is active. |
| `card` (required) | object or null | The saved card used for automatic top-up, or null without one. |

### Reload

An automatic top-up that failed.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string | The id of the top-up payment. |
| `amount_eur` (required) | number | The amount it tried to add, excluding VAT. |
| `status` (required) | string | The status of the payment, like failed, canceled or expired. |
| `failure_reason` (required) | string or null | A short code for why it failed, or null. |
| `created_at` (required) | string (date-time) | When the top-up started. |

### BalanceLowEvent

Sent when a charge takes the balance below the automatic top-up threshold. Carries balance\_eur and threshold\_eur.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string | The id of the event, evt\_ plus 32 hex characters. It stays the same on retries. |
| `type` (required) | `"balance.low"` |  |
| `created_at` (required) | string (date-time) | When the event happened. |
| `data` (required) | object |  |

### BalanceToppedUpEvent

Sent when a top-up was paid and added to the balance, by hand or automatically. Carries balance\_eur and transaction.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string | The id of the event, evt\_ plus 32 hex characters. It stays the same on retries. |
| `type` (required) | `"balance.topped_up"` |  |
| `created_at` (required) | string (date-time) | When the event happened. |
| `data` (required) | object |  |

### BalanceReloadFailedEvent

Sent when an automatic top-up failed. Carries balance\_eur, threshold\_eur and reload. After three failures in a row automatic top-up is switched off.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string | The id of the event, evt\_ plus 32 hex characters. It stays the same on retries. |
| `type` (required) | `"balance.reload_failed"` |  |
| `created_at` (required) | string (date-time) | When the event happened. |
| `data` (required) | object |  |

### DocumentCreatedEvent

Sent for every new document in a collection with webhook\_on\_insert, from the API or a form. A document deleted before delivery is not sent.

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string | The id of the event, evt\_ plus 32 hex characters. It stays the same on retries. |
| `type` (required) | `"document.created"` |  |
| `created_at` (required) | string (date-time) | When the event happened. |
| `data` (required) | object |  |

### Problem

An error, as application/problem+json (RFC 9457).

| Field | Type |  |
| --- | --- | --- |
| `type` (required) | string (uri) | A URL that explains the error and the fix: `https://hypamoon.com/docs/errors/<slug>`. |
| `title` (required) | string | The HTTP status in words. |
| `status` (required) | integer | The HTTP status. |
| `detail` (required) | string | What went wrong in this request. |
| `request_id` (required) | string | The id of this request, also in the X-Request-Id header. Mention it when you contact support. |
| `user_message` (required) | string | One calm sentence in plain English for the end user, without technical terms. A chat or app can show it as it is. |
| `next_step` | string | With some errors: what the chat or agent itself should do next. |
| `errors` | FieldError\[\] | With validation\_failed, schema\_mismatch and team\_targets\_not\_allowed: every problem. |
| `missing` | string\[\] | With company\_details\_missing: the missing fields, as paths of PUT /project/company. |
| `current_version` | one of | With version\_conflict: the version that is there now (a number on a call plan, a string on a site; send it as if\_match\_version). |
| `spend_cap_eur` | number | With billing\_blocked: the spending cap per calendar month. |
| `spent_eur` | number | With billing\_blocked: what was spent this calendar month. |
| `balance_eur` | number | With insufficient\_balance: the prepaid balance now. |
| `required_eur` | number | With insufficient\_balance: what this request costs. |
| `auto_reload_started` | boolean | With insufficient\_balance: true when an automatic top-up just started; retry in a minute. |

### FieldError

| Field | Type |  |
| --- | --- | --- |
| `path` (required) | string | Where the problem is, with dots, like address.postal\_code. body means the body as a whole. |
| `message` (required) | string | What is wrong, in English. |

### RecentError

| Field | Type |  |
| --- | --- | --- |
| `id` (required) | string |  |
| `at` (required) | string |  |
| `source` (required) | `"mcp"`, `"rest"` |  |
| `client` (required) | string |  |
| `tool` (required) | string or null |  |
| `route` (required) | string or null |  |
| `error` (required) | string |  |
| `status` (required) | integer |  |
| `detail` (required) | string |  |
| `duration_ms` (required) | integer or null |  |
| `request_id` (required) | string |  |
| `mode` (required) | string or null |  |
| `arguments` (required) | object or null |  |
| `field_errors` (required) | object\[\] |  |

### RecentErrorList

| Field | Type |  |
| --- | --- | --- |
| `data` (required) | RecentError\[\] |  |
| `next_before` (required) | string or null |  |
| `dropped_today` (required) | integer |  |

[PreviousErrors](https://hypamoon.com/docs/errors)

Hypamoon is the infrastructure your chat or agent builds on for a business. Hypamoon API, version 1.[hypamoon.com](https://hypamoon.com/)
