# PerkHost documentation > PerkHost is planned managed app hosting for people who build with AI coding tools and the agencies that serve them. It is in early development: accounts, workspaces, team members, API tokens and two-factor authentication work today, and app hosting is not available yet. # Get started Source: https://www.perkhost.com/docs/getting-started Create an account and a workspace, secure the account and reach the API. App hosting is not available yet. > **PerkHost is in early development** You can create an account and a workspace today. App hosting is not available yet, so there is nothing to deploy. See "What is available today" for the full list. ## Create an account 1. Open https://app.perkhost.com/register. 2. Enter your name, your email address and a password of 8 to 128 characters. 3. Open the link in the email PerkHost sends you (it works once and expires in 60 minutes), enter the password you chose and confirm. You are signed in, and PerkHost created a personal workspace for you and made you its owner. If Google sign-in is switched on for the site, the sign-in and registration pages offer it as well. Google sign-in does not link to an existing password account that uses the same email address; sign in with the password instead. ## Your workspace A workspace holds your members, plan and, once app hosting is available, your apps. The dashboard has a Members page, an API tokens page, a Billing page and a Settings page for each workspace. You can create more workspaces from the dashboard. ## Secure the account Turn on a second factor on the Account security page, linked from the dashboard header. Every account has a deadline for doing so. Details are in "Two-factor authentication". ## Use the API Everything the dashboard does with accounts, workspaces, members and plans is available through the API. Read "API overview" first, then create an API token if a script needs to read a workspace. # What is available today Source: https://www.perkhost.com/docs/availability What works now, and what is not available yet, so you know what these docs cover. These docs describe only what PerkHost does today. A feature that is not in the first table is not available yet, and no page documents it as if it were. ## Available | Area | What works | Read | | --- | --- | --- | | Accounts | Register, sign in, sign out, reset a password, list and end sessions, delete the account | Accounts and sessions | | Two-factor authentication | Authenticator app, email codes and recovery codes | Two-factor authentication | | Workspaces | Create and rename workspaces; roles owner, admin, developer and billing | Workspaces, roles and members | | Members | Invite people by email, change roles, remove members | Workspaces, roles and members | | API tokens | Create, list and revoke personal API tokens in the dashboard or the API; owners revoke any member's and admins any but an owner's; accepted on two read routes | API tokens | | Workspace plans | The Free plan; entitlements read from the subscription | Plans and billing | | API | Every route listed in the API reference pages | API overview | ## Not available yet - App hosting: creating apps, deployments, a URL and certificate for an app, SSH access and custom domains. - Deploying with a git push, a Docker image or a one-click template. - The perkhost command. It is built, and "The perkhost command" describes it, but no download is offered on this site yet, and perkhost deploy needs app hosting to answer. - The MCP connection for AI tools. - The app catalog: no template is published. - Databases next to an app, and backups. - Buying a Team or Agency subscription, and the agency features (client accounts, white-label portal, client billing). > **Why this page exists** The pricing page and the home page carry the same statement. When a feature ships, it moves from the second list to the first and gets its own page. # Accounts and sessions Source: https://www.perkhost.com/docs/accounts-and-sessions Register, sign in, refresh and end sessions, reset a password and delete an account through the API. These routes are what the dashboard calls. All paths are relative to https://api.perkhost.com/api/v1. Request and response fields are listed in "API reference: account and sign-in". ## Register `POST /auth/register` takes `name`, `email` and `password` (8 to 128 characters) and always answers 202 with `{ "status": "check_email" }`, whether or not the address is already registered, so it never reveals who is registered. A new address is emailed a link that works once and expires in 60 minutes; `POST /auth/register/confirm` with its `token` and the same `password` creates the account and a personal workspace named after you, with you as its owner, and signs you in (a native app sends `client` here, not to `/auth/register`, to get a refresh token). A registered address is emailed a note that someone tried to sign up, with links to sign in or reset the password, and no second account is created. ## Sign in `POST /auth/login` takes `email` and `password`. The answer depends on who is calling. - A browser session sends no `client` field and receives `token` and `user`. The token is valid for 7 days. - A script, tool or native app sends `client` with a `platform` (`web`, `cli`, `mcp` or `api`) and a `name` of up to 100 characters. It receives `token`, `expiresAt` (Unix seconds), `refreshToken` and `user`. The access token lasts 15 minutes and the refresh token 30 days. - An account with two-factor authentication on receives `mfaRequired: true` and an `mfaToken` instead of a session. Finish the sign-in with `POST /auth/mfa/verify`. The challenge expires after 5 minutes. Ten failed sign-ins for one email address within 15 minutes lock that address for 15 minutes. Sign-in, registration and the other public routes are also rate limited, and a limited request gets 429 with a `Retry-After` header. ``` curl -sS -X POST https://api.perkhost.com/api/v1/auth/login \ -H 'Content-Type: application/json' \ -d '{"email":"you@example.com","password":"your password","client":{"platform":"api","name":"my script"}}' ``` ## Use the access token Send it as `Authorization: Bearer `. Every route except the public ones needs it. ## Refresh a session `POST /auth/refresh` takes the `refreshToken` and returns a new `token`, `expiresAt` and `refreshToken`. The refresh token rotates on every use: keep the new one. Presenting a refresh token that was already used ends that session, revokes your current access tokens and revokes your API tokens, because it can mean the token was copied. A replay within 5 seconds of the rotation, as from a retry, is treated more narrowly: it ends that session and revokes only the API tokens created in it. Never reuse an old refresh token. ## Sign out and manage sessions - `POST /auth/logout` ends the session. Send the `refreshToken`, a bearer access token, or both. It answers 204. - `GET /auth/sessions` lists the sessions that have a refresh token, which are the ones started with a `client`: scripts, tools and native apps. Each has `id`, `platform`, `name`, `createdAt`, `lastUsedAt` and `current`. A browser session is not listed. - `DELETE /auth/sessions/{sessionId}` ends one of them. An unknown id gets 404. > **Signing out does not end API tokens** API tokens are separate from sessions. Revoke them with the API tokens routes. See "API tokens". ## Reset a password 1. `POST /auth/forgot` with the `email`. The answer is always 200 with the same body, whether or not an account exists, so it never reveals who is registered. 2. If the account exists, PerkHost emails a link. It works once and expires after one hour. 3. `POST /auth/reset` with the `token` from the link and a new `password`. It answers 204. A reset also revokes the account's API tokens. ## Delete an account `DELETE /auth/me` with your `password` deletes the account and answers 204. A wrong password answers 403. A workspace in which you are the only owner or admin, or in which nobody but client members would be left, is deleted together with its data. In every other workspace your membership is removed and what you created passes to another owner or admin. The request is refused with 409 while a workspace that would be deleted still has a paid subscription that is not set to cancel, or live apps. ## Google sign-in `GET /auth/google/config` says whether Google sign-in is enabled. The dashboard runs the sign-in flow itself and sends the result to `POST /auth/google`. A Google account whose email address already belongs to a password account gets 409 with the code `account_exists_use_password`, and an address Google has not verified gets 401 with `google_email_unverified`. # Two-factor authentication Source: https://www.perkhost.com/docs/two-factor-authentication Turn on an authenticator app or email codes, keep recovery codes, and meet the enrolment deadline. A second factor asks for a code in addition to your password when you sign in. Turn it on from the Account security page in the dashboard, or with the `/auth/mfa` routes. ## The factors | Factor | How it works | | --- | --- | | Authenticator app | A time-based code of 6 digits that changes every 30 seconds (RFC 6238). You scan a QR code or type the setup key into the app. | | Email codes | A code of 6 digits sent to your account email. It works once and expires after 10 minutes. | | Recovery codes | 10 codes shown once when you turn a factor on. Each works once, if you cannot get a code from the other factors. | ## Turn it on 1. Start enrolment with your password: `POST /auth/mfa/enrol` for the authenticator app or `POST /auth/mfa/email/enrol` for email codes. The authenticator route returns the `secret` and an `otpauthUri`; the email route sends a code and returns where it went. 2. Confirm with your password and the first code: `POST /auth/mfa/enable` (field `code`) or `POST /auth/mfa/email/enable` (field `code`). 3. If the other factor is already on, prove it in the same request, so a stolen session and password cannot add a factor. To add the authenticator while email codes are on, also send an `emailCode` or a `recoveryCode`. To add email codes while the authenticator is on, also send an `authenticatorCode` or a `recoveryCode`. Send one of the two, not both; without one the route answers 400. A wrong confirmation code when turning a factor on also answers 400, not 403. To get an emailed code for the first case, call `POST /auth/mfa/email/step-up`. 4. Save the recovery codes in the response. They are shown once. If you already had a factor on, the response carries no new codes and the existing set stays valid. > **Turning a factor on or off ends your other sessions** Enabling or disabling a factor signs out every other session and revokes your API tokens. The response carries a new access token for the session you are using. Create API tokens again afterwards. ## Sign in with a second factor 1. `POST /auth/login` answers `mfaRequired: true` with an `mfaToken` that is valid for 5 minutes. 2. To get an email code, call `POST /auth/mfa/email/send` with the `mfaToken`. It answers 202 with the same message for every account, so it does not reveal whether email codes are on. 3. Call `POST /auth/mfa/verify` with the `mfaToken` and exactly one of `code` (authenticator), `recoveryCode` or `emailCode`. The answer is the session, in the same shape as a normal sign-in. ## Manage it - `GET /auth/mfa` returns the status: which factors are on, how many recovery codes remain, and the enrolment deadline. - `POST /auth/mfa/recovery-codes` replaces the recovery codes. The previous set stops working. It ends no session. - `POST /auth/mfa/disable` turns the authenticator off and `POST /auth/mfa/email/disable` turns email codes off. Email codes keep working after the authenticator is turned off, and the recovery codes go when the last factor is turned off. - Each of these needs your password and proof of a second factor: a current authenticator `code` or an unused `recoveryCode`. Turning email codes off, and replacing recovery codes while only email codes are on, also accept an `emailCode`, which you get from `POST /auth/mfa/email/step-up` with your password. An emailed code never replaces the authenticator: it is refused while the authenticator is on. Operator accounts use the authenticator app only. - A wrong code on one of these manage routes answers 403 and counts towards the same lockout as a wrong sign-in code. A locked account gets 429 and nothing is checked. ## The enrolment deadline Every account has a deadline by which a second factor must be on. A new account gets 30 days from when it was created. Accounts that existed before this rule got 30 days from the day it was introduced. Read your own deadline as `requiredBy` in `GET /auth/mfa`, together with the days left. After the deadline, an account without a second factor can reach only its account routes, the two-factor routes and sign-out. Every other route answers 403 with the code `mfa_enrolment_required`, for sessions and for API tokens alike. Turning a factor on lifts it at once. # Workspaces, roles and members Source: https://www.perkhost.com/docs/workspaces-and-roles Create and rename workspaces, invite members, change roles, remove members, and what each role can do today. A workspace is where a team and its plan live. Every account starts with one personal workspace in which it is the owner, and can create more. You see only the workspaces you belong to. A workspace you are not a member of answers 404, exactly like one that does not exist. ## Create and rename - `POST /workspaces` with a `name` (1 to 120 characters) creates a workspace and makes you its owner. - `GET /workspaces` lists your workspaces with your role in each. `GET /workspaces/{id}` returns one. - `PATCH /workspaces/{id}` renames a workspace. Only the owner may; anyone else gets 403. ## Invite a member Owners and admins invite people from the Members page, or with `POST /workspaces/{workspaceId}/invitations`: an `email` and a `role`. The person does not need an account yet. They open the link, sign in or register with that same address, and accept. An invitation lasts 7 days and stays on the pending list until it is accepted, revoked or replaced. - The invitation email is queued when you create it. PerkHost does not confirm delivery, so if it does not arrive, resend it. When the server cannot send email, the response says `not_configured` and nothing is sent. - For the developer and billing roles the response also carries the link, once. Anyone who signs in as the invited address can use it. - Owner and admin invitations are delivered by email only: the response has no link. - Resending creates a new link and the earlier one stops working. `DELETE /workspaces/{workspaceId}/invitations/{invitationId}` revokes an invitation. - Only an owner can invite an owner or an admin. An address that already belongs to a member, or already has a pending invitation, gets 409. - An invitation opened while signed in as a different address is refused with 403, and an expired, revoked or unknown one answers 404. Invitations are the only way into a workspace: nobody is added without opening the link and accepting, and the answer to an invitation is the same whether or not the address has an account. The number of members is limited by the workspace plan, and pending invitations count towards it. When the limit is reached the route answers 402 with the code `plan_required`. Read the limit from the subscription, not from this page. See "Plans and billing". ## Change a role or remove a member - `PATCH /workspaces/{workspaceId}/members/{userId}` with a `role` of `owner`, `admin`, `developer` or `billing` changes a member's role. - `DELETE /workspaces/{workspaceId}/members/{userId}` removes a member and answers 204. The removed member's API tokens in this workspace stop working and the invitations they sent are dropped. - An owner can change or remove anyone. An admin can change or remove developers and billing members, and gets 403 on an owner or an admin. - A workspace always keeps one owner. Demoting or removing the last owner gets 409: make another member an owner first. - In the dashboard, a role change is staged until you save it, and removing a member asks you to type their email. ## Roles The table lists the roles you can give a member and what each may do on the routes that exist today. A dash means the route is refused with 403. | Action | Owner | Admin | Developer | Billing | | --- | --- | --- | --- | --- | | List members | Yes | Yes | Yes | - | | Invite or add a developer or billing member, and resend or revoke a developer or billing invitation | Yes | Yes | - | - | | Resend or revoke an owner or admin invitation | Yes | - | - | - | | Invite an owner or an admin, or add an admin | Yes | - | - | - | | Change the role of, or remove, a developer or billing member | Yes | Yes | - | - | | Change the role of, or remove, an admin or owner | Yes | - | - | - | | Rename the workspace | Yes | - | - | - | | Read the subscription, open checkout and the billing portal | Yes | Yes | - | Yes | | Read and change app environment variables | Yes | Yes | Yes | - | | Receive the workspace event stream (a client member can too, once client accounts exist) | Yes | Yes | Yes | - | | Manage your own API tokens | Yes | Yes | Yes | Yes | | List and revoke other members' API tokens | Yes | Yes | - | - | A fifth role, `client`, exists for the end customers of an agency. Client accounts are not available yet, so you cannot give anyone that role. # API tokens Source: https://www.perkhost.com/docs/api-tokens Create a personal API token for one workspace with the scopes it needs, use it on the routes that accept it, and revoke it. A personal API token lets a script or CI job call the API without your password. A token belongs to you and to one workspace. It starts with `phk_`. > **Dashboard or API** Each workspace has an API tokens page in the dashboard where you create, list and revoke your tokens. The same actions are available through the routes below, using a signed-in session. ## Create a token 1. Sign in with `POST /auth/login` and keep the `token` it returns. See "Accounts and sessions". 2. Call `POST /workspaces/{workspaceId}/api-tokens` with that session token, a `name` of up to 100 characters, the `scopes` the token needs and optionally `expiresInDays`. 3. Copy the `token` from the response now. It is shown once and cannot be read again. ``` curl -sS -X POST https://api.perkhost.com/api/v1/workspaces/$WORKSPACE_ID/api-tokens \ -H "Authorization: Bearer $SESSION_TOKEN" \ -H 'Content-Type: application/json' \ -d '{"name":"ci","scopes":["members:read"],"expiresInDays":30}' ``` - `scopes` is required: at least one of `members:read` and `subscription:read`, with no repeats. There is no default, so a token never gets more access than you asked for. - Every token expires. `expiresInDays` defaults to 90 and may be 1 to 365. To renew, create a new token. - You may hold up to 25 active tokens per workspace. Creating one beyond that gets 409. - Creating tokens is rate limited per user, and a limited request gets 429. - PerkHost stores only a hash of the token. Lists show the first 12 characters as the `prefix`. ## Use a token Send it as `Authorization: Bearer phk_...`. A token works only on routes that accept tokens, and only if it carries the scope the route needs. On top of its scope, it acts with the role its creator holds in that workspace at the moment of the request. Today there are two scopes, one per route: | Scope | Route | Roles that may call it | | --- | --- | --- | | members:read | GET /workspaces/{workspaceId}/members | owner, admin, developer | | subscription:read | GET /workspaces/{workspaceId}/subscription | owner, admin, billing | ``` curl -sS https://api.perkhost.com/api/v1/workspaces/$WORKSPACE_ID/subscription \ -H "Authorization: Bearer $PERKHOST_TOKEN" ``` A token without the scope gets 403 with the message "API token lacks the required scope" and the scope. On any other route a token gets 401 with the message "API tokens are not accepted on this route". A token used on another workspace gets 404. Managing tokens is session-only on purpose, so a leaked token cannot create more tokens or hide itself. ## List and revoke - `GET /workspaces/{workspaceId}/api-tokens` lists your active tokens, newest first, with `id`, `name`, `prefix`, `scopes`, `createdAt`, `lastUsedAt` and `expiresAt`. - `DELETE /workspaces/{workspaceId}/api-tokens/{tokenId}` revokes one and answers 204, also when it was already revoked. ## Tokens of other members Owners and admins can list every active token in the workspace and revoke them, so a departing or compromised member's tokens can be cut without removing the member. `GET /workspaces/{workspaceId}/member-api-tokens` pages through the tokens, newest first, and each item names its `owner`. It never returns a token or its hash. `DELETE /workspaces/{workspaceId}/member-api-tokens/{tokenId}` revokes one; only an owner can revoke a token held by an owner, and an admin gets 403 for one. Both are session-only: a token gets 401, and a developer, billing member or client gets 403. ## When a token stops working - It was revoked, by you or by an owner or admin, or it expired. - Its creator was removed from the workspace. - Its creator reset their password, or turned a two-factor factor on or off. - A refresh token of its creator was used again after it had been rotated. Tokens created in that session are revoked, and so are all the creator's tokens unless the reuse came within 5 seconds of the rotation. - Its creator passed the two-factor enrolment deadline without a second factor. The token then gets 403. The CLI signs in with one of these tokens. See "The perkhost command". # Plans and billing Source: https://www.perkhost.com/docs/plans-and-billing The workspace plans, how to read your limits from the subscription, and the checkout and billing portal routes. > **Team and Agency are not available to buy yet** Team and Agency subscriptions cannot be bought yet. The checkout route exists, and answers with the code billing_not_configured until billing is switched on. App plans are priced per app and apply once app hosting is available. See the pricing page. ## Workspace plans The figures below are generated from the same plan definitions the API enforces, so they cannot drift from the product. Prices are in US dollars and may change before paid plans can be bought. The Apps column applies once app hosting is available; apps cannot be created yet. | Plan | Price | Members | Apps | Audit log | | --- | --- | --- | --- | --- | | Free | Free | 1 | 10 | 7 days | | Team | $19/mo | 10 | 100 | 90 days | | Agency | $49/mo | 50 | Unlimited | 365 days | ## Read your limits `GET /workspaces/{workspaceId}/subscription` returns the plan and its entitlements for the workspace. Read limits from this response and never copy numbers into your own code. Owner, admin and billing roles may call it, with a session or an API token. | Field | Meaning | | --- | --- | | workspaceId | The workspace. | | planId | One of free, team, agency. | | status | One of active, past_due, cancelled, trialing. | | provider | `manual` for a plan set without a payment provider, `stripe` for a paid subscription. | | currentPeriodEnd | End of the current period as an ISO time, or null. | | cancelAtPeriodEnd | True when the subscription will end at the period end. | | entitlements | `maxMembers`, `maxApps` (null means unlimited), `clientAccounts`, `whiteLabel` and `auditLogDays`. | The `clientAccounts` and `whiteLabel` entitlements describe agency features that are not available yet. ``` curl -sS https://api.perkhost.com/api/v1/workspaces/$WORKSPACE_ID/subscription \ -H "Authorization: Bearer $PERKHOST_TOKEN" ``` ## When a limit is reached A request that would go past a plan limit, such as adding a member to a full workspace, answers 402. The body has `code: "plan_required"`, the `feature`, the current `planId` and a `message` you can show to a person. ## Checkout and the billing portal - `POST /workspaces/{workspaceId}/billing/checkout` takes `planId` (`team` or `agency`), a `successUrl` and a `cancelUrl`, both http or https URLs. It returns `{ "url": ... }`, a hosted Stripe page to send the person to. - `POST /workspaces/{workspaceId}/billing/portal` takes a `returnUrl` and returns `{ "url": ... }`, the Stripe page where a subscription is managed. - Both are for the owner, admin and billing roles, with a session. When billing is not set up they answer 409 with the code `billing_not_configured`. Stripe reports payment events to PerkHost through a signed webhook. It is not part of the API you call. # The perkhost command Source: https://www.perkhost.com/docs/cli The perkhost command line: login, logout and deploy, the environment variables it reads and its exit codes. > **perkhost deploy cannot finish yet** App hosting is not available, so the API has no apps or deployments to talk to. The CLI is not offered as a download on this site yet, so this page is a reference for the build in the source, not an install guide. ## Commands | Command | What it does | | --- | --- | | perkhost login [--workspace ] | Stores a workspace API token. The token is asked for with hidden input and is never an argument. | | perkhost logout | Removes the stored token from this machine. | | perkhost deploy [name] | Detects the stack, creates the app if needed, uploads the project, starts it and prints the URL. | | perkhost help | Shows the help. `--help` and `-h` do the same. | | perkhost --version | Shows the version. `-v` does the same. | | Option | Applies to | Meaning | | --- | --- | --- | | --workspace | login | The workspace the token belongs to. A token belongs to one workspace. | | --plan | deploy | The plan for a new app: launch, build, grow, scale, turbo. Required with --yes when the terminal is not interactive. | | --region | deploy | The region for a new app. The default is blr1. | | --yes, -y | deploy | Confirms creating a billable app without asking. | | --debug | every command | Prints one redacted line per API request. | ## Sign in 1. Create an API token for the workspace with the `members:read` scope. See "API tokens". 2. Run `perkhost login --workspace ` and paste the token when asked. Nothing is echoed. 3. The CLI checks the token by listing the workspace members, which needs the `members:read` scope and the developer role or higher, and only then saves it. A token without that scope is refused and nothing is saved. The token is stored in the operating system keychain where one is available, and otherwise in a private file. The CLI refuses a token given as an argument (`--token`, `-t`, `--api-key` or `--password`), because arguments end up in shell history and process lists. Browser sign-in is not part of this release. ## Environment variables | Variable | Meaning | | --- | --- | | PERKHOST_TOKEN | API token for CI and AI tools. Use it together with PERKHOST_WORKSPACE. When it is set, the CLI uses it directly and perkhost login stores nothing. | | PERKHOST_WORKSPACE | The workspace id the token belongs to. | | PERKHOST_API_URL | The API origin. The default is https://api.perkhost.com. | ## What deploy does 1. Reads the project folder and detects the stack. See "Stacks and perkhost.json". 2. Packs it into a compressed bundle. The limit is 100 MiB compressed, on every plan, and it is checked before anything is uploaded. 3. Looks for an app with the given name (by default the folder name) in the workspace. If there is none, asks you to confirm the plan and price, then creates it. 4. Uploads the bundle, waits while the deployment moves through its statuses and prints the URL when it is live. If it fails, it prints the last 50 log lines, and the previous release, if any, keeps serving. Files named in `.gitignore` or `.perkhostignore` are not uploaded. The `.git` file or folder, `node_modules`, `.env` and `.env.*` files, `.envrc` and `.npmrc` are never uploaded, in any letter case. Set environment variables for an app through the API instead. ## Exit codes | Code | Meaning | | --- | --- | | 0 | Success. | | 1 | An unexpected error. | | 2 | The command line was wrong: an unknown command or option, a missing value, or a token passed as an argument. | | 10 | Not signed in. Run perkhost login or set the environment variables. | | 11 | The API token is not valid. | | 12 | No stack could be detected from the project, or perkhost.json is invalid. | | 13 | The project uses a stack that is not supported, such as a Dockerfile. | | 14 | The project is above the upload limit. | | 15 | The workspace plan does not allow this. | | 16 | A payment method is required. | | 17 | The app name is taken. | | 18 | No server has room. | | 19 | The stack is not available. | | 20 | The plan or region is not available. | | 21 | Another operation on the app is in progress, or a newer deploy replaced this one. | | 22 | The deployment failed. The previous release, if any, keeps serving. | | 23 | The deployment was still running when the CLI stopped waiting. It continues on PerkHost. | | 24 | The API could not be reached. | | 25 | Not found. | | 26 | Not allowed. | | 27 | Creating a billable app needs confirmation. Nothing was created. | | 130 | Interrupted with Ctrl+C. | # Stacks and perkhost.json Source: https://www.perkhost.com/docs/stacks How PerkHost picks a stack from your project files, which stacks are supported and what perkhost.json can set. > **App hosting is not available yet** This page describes how the CLI and the stack presets are built. Nothing can be deployed until app hosting is available. ## How the stack is detected The CLI looks at the files in the root of the project you deploy. The first marker found, in the order of the table, decides the stack. A backend marker wins over `package.json` because Laravel and Django projects often carry one for their assets. | Project file | Stack | Runtime version | | --- | --- | --- | | go.mod | Go | 1.27 | | composer.json | PHP | 8.3 | | requirements.txt | Python | 3.12 | | package.json | Node.js | 22 | | index.html | Static site | Not applicable | - File names are case-sensitive. `Package.json` is refused with a message to rename it. - Python needs a `requirements.txt` in the root. A project with only `pyproject.toml`, `Pipfile`, `poetry.lock` or `setup.py` is refused with that explanation. - A project file below the root, because you deployed from the wrong folder, is refused with the folder to deploy from. - `package.json` and `composer.json` must be a JSON object, `go.mod` needs a `module` line, and `package.json`, `composer.json`, `go.mod` and `requirements.txt` may each be at most 262,144 bytes. - A project with a Dockerfile and none of these files is refused. Docker deploys are not available yet. ## perkhost.json An optional `perkhost.json` in the project root can override detection. Unknown keys are an error, and so is invalid JSON; the CLI names the field. | Key | Meaning | | --- | --- | | stack | One of `static`, `php`, `node`, `python`, `go`. It wins over detection. | | start | A shell command, on one line, that starts the app from its release folder. At most 1,024 characters. | ``` { "stack": "node", "start": "node server.js" } ``` ## The port your app listens on An app listens on one HTTP port, 8080. PerkHost also passes that number to the app in the `PORT` environment variable. ## Not supported Docker images and Dockerfiles, WordPress and catalog templates have no stack image today. # API overview Source: https://www.perkhost.com/docs/api-overview The base URL, authentication, error format and limits that apply to every PerkHost API route. ## Base URL and format Every route lives under https://api.perkhost.com/api/v1. Requests and responses are JSON, and a request with a body needs the header `Content-Type: application/json`. Request bodies are strict: a field the route does not define is rejected. ``` curl -sS https://api.perkhost.com/api/v1/health ``` `GET /health` is public. It answers `{ "status": "ok", "db": "up", "version": "..." }`, or 503 with `status: "degraded"` and `db: "down"` when the database cannot be reached. ## Authentication - Send `Authorization: Bearer ` on every route that is not marked public in the reference. - A session token comes from `POST /auth/login` and works on every signed-in route. See "Accounts and sessions". - A personal API token (`phk_...`) works only on routes marked "API token" in the reference, only if it carries the scope the route needs, and only for its own workspace. See "API tokens". - A missing, invalid or expired token gets 401. ## Workspaces and access Workspace routes are nested under `/workspaces/{workspaceId}`. The API looks up your membership on every request. If you are not a member, the answer is 404, the same as for a workspace that does not exist. If you are a member without the needed role, the answer is 403. See "Workspaces, roles and members". ## Errors An error answers with the status code and a JSON body with a `message` you can show to a person. Some errors add a machine-readable `code`. ``` { "message": "Validation failed", "issues": [{ "path": "email", "message": "Invalid email address" }] } ``` | Status | Meaning | | --- | --- | | 400 | The body, query or a path parameter is invalid. `issues` lists each field. | | 401 | Missing, invalid, revoked or expired credentials, or an API token on a route that does not accept one. | | 402 | The workspace plan does not allow this. `code` is `plan_required`, with the `feature` and `planId`. | | 403 | Your role is not allowed this action, an API token lacks the scope the route needs, or you are past the two-factor deadline without a second factor (`code`: `mfa_enrolment_required`). | | 404 | Not found, or not visible to you. | | 409 | The request conflicts with the current state, for example a person who is already a member of the workspace, or `billing_not_configured`. | | 429 | Too many requests. Wait for the number of seconds in the `Retry-After` header. | | 503 | A rate-limited write route is temporarily unavailable because the shared rate-limit store is down. Wait for the `Retry-After` header and retry. | ## Rate limits Sign-in, registration, password reset, token refresh, two-factor and API token creation are rate limited, as are several write routes. The exact limits can change, so handle 429 by waiting for `Retry-After` rather than counting requests. ## Routes that are not documented here The reference covers the routes people and their scripts call. Routes for PerkHost operators and for the servers PerkHost runs, and the signed Stripe webhook, are not part of the public API and are not listed. # API reference: account and sign-in Source: https://www.perkhost.com/docs/api-reference-account Every route for registering, signing in, sessions, password reset, Google sign-in and two-factor authentication. Paths are relative to https://api.perkhost.com/api/v1. "Session" means a bearer access token from sign-in. Read "API overview" for errors and limits. A body that is not listed for a route means the route takes none. ## Sign-in and sessions | Route | Auth | Request body | Success | | --- | --- | --- | --- | | POST /auth/register | Public | `name`, `email`, `password` (no `client`: a native app sends it to `/auth/register/confirm`) | 202 and `{ "status": "check_email" }` for every address; the outcome is emailed | | POST /auth/register/confirm | Public, with the emailed token | `token`, `password` (the one chosen at sign-up), optional `client` | 201, a session: `token` and `user`; with `client` also `expiresAt` and `refreshToken`; 400 for an invalid, expired or used link or a wrong password | | POST /auth/login | Public | `email`, `password`, optional `client` | 200, a session as for register/confirm, or `mfaRequired`, `mfaToken` and `expiresAt` when two-factor is on | | POST /auth/forgot | Public | `email` | 200, the same message for every address | | POST /auth/reset | Public, with the emailed token | `token`, `password` | 204 | | POST /auth/refresh | Refresh token | `refreshToken` | 200, `token`, `expiresAt` and a new `refreshToken` | | POST /auth/logout | Refresh token or session | optional `refreshToken` | 204 | | GET /auth/me | Session | none | 200, `id`, `email` and `name` | | DELETE /auth/me | Session | `password` | 204 | | GET /auth/sessions | Session | none | 200, a list of `id`, `platform`, `name`, `createdAt`, `lastUsedAt`, `current` for sessions started with a `client` | | DELETE /auth/sessions/{sessionId} | Session | none | 204 | `client` is `{ "platform": "web" | "cli" | "mcp" | "api", "name": "<1 to 100 characters>" }`. Registration, sign-in, password reset, refresh and account deletion are rate limited per address, per email or per user. ## Google sign-in | Route | Auth | Request body | Success | | --- | --- | --- | --- | | GET /auth/google/config | Public | none | 200, `{ "enabled": false }` or `enabled`, `clientId` and `authorizationEndpoint` | | POST /auth/google | Public | `code`, `codeVerifier`, `nonce`, `redirectUri` | 200, a session, as for login | ## Two-factor authentication | Route | Auth | Request body | Success | | --- | --- | --- | --- | | GET /auth/mfa | Session | none | 200, `enabled`, `totpEnabled`, `emailEnabled`, `emailPending`, `pending`, `enabledAt`, `recoveryCodesRemaining`, `requiredBy`, `daysLeft` | | POST /auth/mfa/verify | Sign-in challenge | `mfaToken` and one of `code`, `recoveryCode`, `emailCode` | 200, a session, as for login | | POST /auth/mfa/enrol | Session | `password` | 200, `secret` and `otpauthUri` | | POST /auth/mfa/enable | Session | `password`, `code`; with email codes on, also one of `emailCode` or `recoveryCode` | 200, `recoveryCodes` and `session` | | POST /auth/mfa/disable | Session | `password` and one of `code` or `recoveryCode` | 200, `session` | | POST /auth/mfa/recovery-codes | Session | `password` and one of `code`, `recoveryCode` or `emailCode` | 200, `recoveryCodes` | | POST /auth/mfa/email/send | Sign-in challenge | `mfaToken` | 202, `message` | | POST /auth/mfa/email/enrol | Session | `password` | 200, `sentTo` and `expiresAt` | | POST /auth/mfa/email/enable | Session | `password`, `code`; with the authenticator on, also one of `authenticatorCode` or `recoveryCode` | 200, `recoveryCodes` and `session` | | POST /auth/mfa/email/step-up | Session | `password` | 200, `sentTo` and `expiresAt`; 409 when email codes are off, 503 when the email cannot be sent | | POST /auth/mfa/email/disable | Session | `password` and one of `code`, `recoveryCode` or `emailCode` | 200, `session` | The `session` in an enable or disable answer carries the `token` to use from then on, and `expiresAt` for native sessions. Authenticator codes and email codes are 6 digits. A recovery code looks like `xxxxx-xxxxx`; case, spaces and hyphens are ignored when it is checked. # API reference: workspaces and billing Source: https://www.perkhost.com/docs/api-reference-workspaces Every route for workspaces, members, invitations, API tokens, plans, billing, apps, the event stream and app environment variables. Paths are relative to https://api.perkhost.com/api/v1. Routes marked "API token" accept either a session or a token that carries the named scope; every other signed-in route needs a session. Roles are listed where a route restricts them. ## Workspaces and members | Route | Auth | Request body | Success | | --- | --- | --- | --- | | GET /workspaces | Session | none | 200, your workspaces: `id`, `name`, `slug`, `role` | | POST /workspaces | Session | `name` | 201, the workspace, with you as owner | | GET /workspaces/{id} | Session, any member | none | 200, the workspace | | PATCH /workspaces/{id} | Session, owner | `name` | 200, the workspace | | GET /workspaces/{workspaceId}/members | Session, or API token with `members:read`; owner, admin or developer | none | 200, `userId`, `email`, `name`, `role`, ordered by email | | PATCH /workspaces/{workspaceId}/members/{userId} | Session, owner or admin | `role` (`owner`, `admin`, `developer` or `billing`) | 200, the member | | DELETE /workspaces/{workspaceId}/members/{userId} | Session, owner or admin | none | 204 | Only an owner may grant the owner or admin role, change the role of an owner or an admin, or remove one; an admin gets 403 on those. A workspace always keeps one owner: demoting or removing the last one gets 409. Removing a member also revokes that member's API tokens in the workspace and drops the invitations they sent. There is no route that adds a member directly: a person joins by accepting an invitation. Creating a workspace is rate limited per user and renaming one per user; a limited request gets 429. ## Invitations | Route | Auth | Request body | Success | | --- | --- | --- | --- | | GET /workspaces/{workspaceId}/invitations | Session, owner or admin | none | 200, pending invitations, newest first: `id`, `email`, `role`, `clientId`, `invitedBy`, `expiresAt`, `createdAt`, `expired` | | POST /workspaces/{workspaceId}/invitations | Session, owner or admin | `email`, `role`, and `clientId` only with the `client` role | 201, `invitation`, `link` and `emailDelivery` | | POST /workspaces/{workspaceId}/invitations/{invitationId}/resend | Session, owner or admin | none | 200, as for create, with a new link | | DELETE /workspaces/{workspaceId}/invitations/{invitationId} | Session, owner or admin | none | 204 | | POST /invitations/preview | Session, the invited account | `token`, from the invitation link | 200, `workspaceName`, `role`, `email`, `expiresAt` | | POST /invitations/accept | Session, the invited account | `token`, from the invitation link | 200, `workspaceId` and `role` | An invitation is valid for 7 days. `emailDelivery` is `queued` when the invitation email was queued, which does not confirm it arrived, or `not_configured` when the server cannot send email. `link` is the only time the link is returned, and it is null for the owner and admin roles, which are delivered by email only. These routes take a session, never an API token. The create and resend routes are rate limited per user and per workspace, and preview and accept per user; a limited request gets 429. The invited address must not already be a member (409) or already have a pending invitation (409). The `client` role needs a client account, and client accounts are not available yet. See "Workspaces, roles and members" for the flow. ## API tokens | Route | Auth | Request body | Success | | --- | --- | --- | --- | | GET /workspaces/{workspaceId}/api-tokens | Session, any member | none | 200, your active tokens: `id`, `name`, `prefix`, `scopes`, `createdAt`, `lastUsedAt`, `expiresAt` | | POST /workspaces/{workspaceId}/api-tokens | Session, any member | `name`, `scopes`, optional `expiresInDays` | 201, the token fields and the full `token`, shown once | | DELETE /workspaces/{workspaceId}/api-tokens/{tokenId} | Session, any member | none | 204 | | GET /workspaces/{workspaceId}/member-api-tokens | Session, owner or admin | query: optional `limit` (1 to 100, default 20) and `cursor` | 200, `items` and `nextCursor`; each item is a token as above plus `owner` (`userId`, `name`, `email`) | | DELETE /workspaces/{workspaceId}/member-api-tokens/{tokenId} | Session, owner or admin | none | 204, also when it was already revoked; 403 when an admin revokes a token held by an owner, revoked or not; 404 for a token of another workspace | ## Plans and billing | Route | Auth | Request body | Success | | --- | --- | --- | --- | | GET /plans | Public | none | 200, `workspacePlans` and `appPlans` with their prices and limits | | GET /workspaces/{workspaceId}/subscription | Session, or API token with `subscription:read`; owner, admin or billing | none | 200, the subscription and its entitlements | | POST /workspaces/{workspaceId}/billing/checkout | Session, owner, admin or billing | `planId`, `successUrl`, `cancelUrl` | 200, `url` | | POST /workspaces/{workspaceId}/billing/portal | Session, owner, admin or billing | `returnUrl` | 200, `url` | Checkout and portal share one rate limit per user and per workspace; a limited request gets 429. ## Apps > **Creating an app is not open to customers yet** App hosting is not available yet. POST /workspaces/{workspaceId}/apps works only for a PerkHost operator who has a confirmed second factor and owns that workspace. Every other caller gets 403 with the code `apps_not_available`, so no customer app exists to list, start, stop, resize or delete. The routes and their rules are listed here so scripts can be written against them. | Route | Auth | Request body | Success | | --- | --- | --- | --- | | POST /workspaces/{workspaceId}/apps | Session, owner, admin or developer | `name`, `region`, `plan`, `stack`, optional `clientId`; `catalogSlug` is required with the `catalog` stack | 202, the app with status `pending` | | GET /workspaces/{workspaceId}/apps | Session, owner, admin, developer or client; not billing | query: optional `limit` (1 to 100, default 20) and `cursor` | 200, `items` and `nextCursor`; a client member sees only the apps assigned to it | | GET /workspaces/{workspaceId}/apps/{appId} | Session, owner, admin, developer or client; not billing | none | 200, the app; 404 for an app you cannot see | | POST /workspaces/{workspaceId}/apps/{appId}/start | Session, owner, admin or developer | none | 202, the app with status `starting`; 200 when it is already starting or running | | POST /workspaces/{workspaceId}/apps/{appId}/stop | Session, owner, admin or developer | none | 202, the app with status `stopping`; 200 when it is already stopping or stopped | | POST /workspaces/{workspaceId}/apps/{appId}/resize | Session, owner, admin or developer | `plan` | 202, the app with status `resizing`; 200 with no work when that resize is already in progress or the app is already on that plan | | POST /workspaces/{workspaceId}/apps/{appId}/delete | Session, owner or admin | `confirmName`, the app name typed back | 202, the app with status `deleting`, or 200 when it was already being deleted or had never started | An app has `id`, `workspaceId`, `name`, `region`, `plan`, `stack`, `status`, `hostname`, `clientId`, `statusReason`, `targetPlan` and `createdAt`. The status is the real state of the app and moves as the work finishes: `pending`, `provisioning`, `running`, `starting`, `stopping`, `resizing`, `stopped`, `suspended`, `failed`, `deleting`, `deleted`. `statusReason` is a fixed sentence when the last operation failed, otherwise null. Poll the app, or read the event stream, until the status settles. A region is one of `blr1`, `sgp1`, `fra1`, but only blr1 accepts new apps; the others are refused with `region_unavailable`. A plan is one of `launch`, `build`, `grow`, `scale`, `turbo`, `dedicated_s`, `dedicated_m`; a Dedicated plan and a stack without a published runtime are refused with 400 and the codes `plan_unavailable` and `stack_unavailable`, and a region that is not open with 400 and `region_unavailable`. A name is 3 to 40 lowercase letters, digits and hyphens, and may not be reserved. The `clientId` needs the agency client accounts, which are not available yet. Refusals carry a stable `code` next to the message. 409 answers `name_taken` (the name is in use in that region), `invalid_state` (for example starting an app that is not stopped), `operation_in_progress` and `backups_unavailable`. Deleting an app that has ever run is refused with `backups_unavailable`, because an app is never destroyed without a backup and backups are not available yet; stop it instead. `confirmation_mismatch` is a 400 when `confirmName` is not the app name. When no host in the region has room, create answers 409 with `no_capacity`, `retryAfterSeconds` and a `Retry-After` header; a resize that does not fit on the app's server answers 409 with `host_capacity`. A workspace at its app limit gets 402 with the code `plan_required`. Creating, and starting, stopping, resizing and deleting, are rate limited per user and per workspace, and a limited request gets 429. ## Events | Route | Auth | Request body | Success | | --- | --- | --- | --- | | GET /workspaces/{workspaceId}/events | Session, owner, admin or developer; a client member too, once client accounts exist | query: optional `appId` | 200, a Server-Sent Events stream | The stream carries identifiers and statuses only, never logs, results or environment values. Event types are `app.status`, `job.status` and `deployment.status`. A comment is sent every 15 seconds to keep the connection open, and the server closes a stream after 15 minutes; reconnect with the `Last-Event-ID` header to resume. Events are kept for 24 hours: an older id gets a `resync` event, and you should reload state. One user may hold 5 open streams. App hosting is not available yet, so no app events are produced today. ## App environment variables | Route | Auth | Request body | Success | | --- | --- | --- | --- | | GET /workspaces/{workspaceId}/apps/{appId}/env-vars | Session, owner, admin or developer | none | 200, `key`, `last4`, `updatedAt`; the value is never returned | | PUT /workspaces/{workspaceId}/apps/{appId}/env-vars | Session, owner, admin or developer | `vars`, a list of `key` and `value` | 200, the stored variables, as for the list | | DELETE /workspaces/{workspaceId}/apps/{appId}/env-vars/{key} | Session, owner, admin or developer | none | 204 | A key is letters, digits and underscores and does not start with a digit, up to 128 characters. A value is up to 32,768 bytes. One request sets 1 to 200 variables and each key may appear once. An app holds at most 200 variables in total: a request that would go past that gets 409. A value is a single line, so encode a multi-line secret, for example with base64. Values are stored encrypted, and `last4` is null for a value shorter than 12 characters. These routes work on an app id; apps cannot be created yet because app hosting is not available. ## Health | Route | Auth | Request body | Success | | --- | --- | --- | --- | | GET /health | Public | none | 200, `status`, `db` and `version`; 503 when the database is down | # API reference: status pages Source: https://www.perkhost.com/docs/api-reference-status-pages The public routes that read a status page, with its incidents and history, and the ones a status site uses to subscribe an address and manage the subscription. Paths are relative to https://api.perkhost.com/api/v1. These routes need no sign-in: the person subscribing is a visitor. The subscription routes answer by page slug or by a token from an emailed link, never by a workspace id. A token that is malformed, unknown or revoked answers 404, with the same message, so a link reveals nothing about other subscribers. > **Only published public pages take subscribers** A slug that is not a published, public status page answers 404, and so does every subscribe request until the status site that the emailed links point to is configured. Status pages are published by PerkHost operators. ## Reading a page | Route | Auth | Query | Success | | --- | --- | --- | --- | | GET /public/status/{slug} | Public | none | 200, the page: `overall`, `groups` of components with `status`, `uptime` and `responseMs`, `activeIncidents`, `activeMaintenances`, `upcomingMaintenances` | | GET /public/status/{slug}/history | Public | `month` as `YYYY-MM`, optional | 200, the incidents and maintenances of that UTC month, `previousMonth`, `nextMonth` and `truncated` | | GET /public/status/{slug}/incidents/{incidentId} | Public | none | 200, one incident with its timeline and the names of its components | - Every 200 answer carries `generatedAt`. These answers can be cached for 30 seconds and served stale for another 60 while they refresh, so a new incident can take up to 90 seconds to reach a cache; the server itself keeps no copy. A read that fails is never marked cacheable. - `overall` is the worst status of any component; when nothing is worse than operational it is `maintenance` if a component is under maintenance. A page with no components is `operational`. - `uptime` has one entry for each of the last 90 UTC days, oldest first and ending today. A day with no checks has `uptimeBp` null: no data is not 100 %. `uptimeBp` and `uptimeBp90` are hundredths of a percent (9981 is 99.81 %); `uptimeBp90` counts checks over the whole window, not the mean of the days. `responseMs` lists the days that have an average and a 95th percentile, in milliseconds. - `groups[].name` is null for components that belong to no group; that entry comes first. Components inside an incident or a maintenance are listed by id, and `history` and the incident route include `components` to map an id to its name. - `history` lists incidents by the time they started and maintenances by the time they were due to start, newest first, at most 200 of each (`truncated` says there were more). Without `month` it is the current month; the first month accepted is 2020-01. `previousMonth` and `nextMonth` are the nearest months that have an entry. `upcomingMaintenances` lists up to 20 scheduled windows. - Only published incidents are shown. A slug that is unknown, not published, private or malformed answers the same 404, and so does an incident id that is unknown, a draft or not on that page. A bad `month` answers 400. - The routes are rate limited per client address, 240 requests a minute across all three, and a limited request gets 429 with a `Retry-After` header. ## Subscription routes | Route | Auth | Request body | Success | | --- | --- | --- | --- | | POST /public/status/{slug}/subscribers | Public | `email`, optional `componentIds` (up to 50) | 202, a `message`, the same for every address | | POST /public/status/subscribers/confirm | Public, emailed token | `token` | 204 | | POST /public/status/subscribers/unsubscribe | Public, emailed token | `token` | 204 | | POST /public/status/subscribers/{subscriberId}/unsubscribe/{signature} | Public, signature from the email header | none | 204 | | POST /public/status/subscribers/preferences | Public, emailed token | `token` | 200, `pageName`, `components` (`id`, `name`) and `componentIds` | | PUT /public/status/subscribers/preferences | Public, emailed token | `token`, `componentIds` | 200, the preferences, as for the read | ## How a subscription works 1. Send the address to `POST /public/status/{slug}/subscribers`. The answer is always the same 202 message, whether the address is new, waiting, already confirmed or refused, so the route never reveals who is subscribed. Nothing is sent to an address until it confirms. 2. A confirmation email carries a link. The link is valid for 48 hours, and an address that has not confirmed gets at most one confirmation email every 6 hours, however often it is submitted. 3. The status site posts the token from the link to `POST /public/status/subscribers/confirm`. An expired link answers 410, and the person subscribes again. 4. Later emails carry a manage link. Its token reads the choices with `POST /public/status/subscribers/preferences`, changes them with `PUT` on the same path, and ends the subscription with `POST /public/status/subscribers/unsubscribe`, which is safe to repeat. - `componentIds` lists the components to follow. An empty list, or none, means every component. An id that does not belong to the page answers 400. - Confirm and unsubscribe are POST, never GET, so a mail scanner that opens every link in a message cannot confirm or unsubscribe anyone. The confirm and manage tokens travel in the request body, not in a URL that a server logs. - When the API's public address is configured, each notification email also carries a one-click unsubscribe link in its `List-Unsubscribe` header, which a mail app posts to without opening a page. Its signature sits in the URL path and can only unsubscribe that one address; it cannot read or change preferences. A wrong or foreign signature answers 404, and the route is rate limited per client address. - The routes are rate limited per address and per client address, and a limited request gets 429 with a `Retry-After` header. ## Receiving status webhooks A status page can also post each notification to an https endpoint. Endpoints are added, rotated, disabled and removed by PerkHost operators; this section is for the person who writes the receiver. A delivery is a `POST` with a JSON body `{ id, type, created, page, incident | maintenance }` and these headers: `X-PerkHost-Signature`, `X-PerkHost-Event` (the `type`) and `X-PerkHost-Delivery` (unique per delivery). The `type` is one of `incident.created`, `incident.updated`, `incident.resolved`, `maintenance.scheduled`, `maintenance.rescheduled`, `maintenance.cancelled`, `maintenance.started` and `maintenance.completed`. A `maintenance.rescheduled` body carries the new `startsAt` and `endsAt` and the replaced window as `previousStartsAt` and `previousEndsAt`; a `maintenance.cancelled` body carries the cancelled window and its `status` is `cancelled`. 1. Read the raw request body bytes before any JSON parsing: the signature covers the exact bytes. 2. Parse the header `t=,v1=[,v1=]`. Reject the request when `t` is more than a few minutes from your clock. 3. Compute HMAC-SHA256, hex, over the text `.` keyed by your signing secret (the `whsec_` value). 4. Accept the request when your value equals any `v1` in the header, compared in constant time. 5. Deduplicate on `X-PerkHost-Delivery` (a retry after a lost response repeats the same id) and answer 2xx quickly. - The signing secret is shown once, when the endpoint is created or its secret is rotated, and cannot be read again. - After a rotation the replaced secret keeps signing for 24 hours: during that time every request carries two `v1` values, the new secret's first. Switch your receiver to the new secret inside that window; a receiver that holds either secret verifies the request without a change. When the window ends the header carries one `v1`, so a receiver that still holds only the replaced secret no longer verifies requests. Rotating again inside the window ends the oldest secret at once, so only the two most recent secrets are ever valid. - Any 2xx is success. Anything else, a redirect included (never followed), a timeout of 10 seconds or a refused connection is retried after 30 seconds, 2 minutes, 10 minutes and 30 minutes, and the delivery is marked failed after 5 attempts. A target that is not allowed (a private or reserved address, or plain http) is not retried: the delivery fails at once. - An endpoint that fails 10 delivery attempts in a row is disabled automatically and the operators are told. Only a delivered request resets the count, however far apart the failures are. A disabled endpoint receives nothing: the notices still waiting for it are marked failed, and neither they nor the ones it missed are sent again after an operator re-enables it.