Percher Account API

The Account API from Percher — 4 operation(s) for account.

GitHub OpenAPI

Operations 4

GET /account/egress Fair-use bandwidth usage for the calendar month #
GET /account/export Download all stored user data (GDPR Article 20) #
GET /account/deletion-preview Inspect what would block account deletion #
DELETE /account Request account deletion (asynchronous finalize) #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/percher-app:percher-app-account-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

percher-app-account-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Percher Account API
  version: 1.0.0
  description: AI-native hosting platform. Deploy apps via CLI, MCP, or API — live at name.percher.run.
  contact:
    url: https://percher.app
servers:
- url: https://api.percher.run
  description: Production
- url: http://localhost:3000
  description: Local development
tags:
- name: Account
paths:
  /account/egress:
    get:
      tags:
      - Account
      summary: Fair-use bandwidth usage for the calendar month
      description: Bytes served by every app the account owns this UTC month (all route kinds), the plan allowance plus any operator override, the percentage, and the cap state (`ok` | `warned` | `exceeded` | `lifted`). `capBytes`/`percent` are null for exempt accounts. `resetsAt` is when an `exceeded` block lifts on its own. Optional `?month=YYYY-MM` reads history.
      security:
      - bearer: []
      parameters:
      - name: month
        in: query
        required: false
        schema:
          type: string
      responses:
        '200':
          description: Egress summary
          content:
            application/json: {}
        '401':
          description: Unauthorized
      operationId: getAccountEgress
      x-operation-id-source: derived
  /account/export:
    get:
      tags:
      - Account
      summary: Download all stored user data (GDPR Article 20)
      description: Returns a JSON blob with the user record, API tokens (metadata only), alert preferences, onboarding reminder history, shared access grants (outgoing + incoming), and all owned apps with deploy history, env var keys, and custom domains. Env var values are excluded (encrypted at rest). Build logs are excluded due to size — fetch via the logs API if needed.
      security:
      - bearer: []
      responses:
        '200':
          description: Export JSON
          content:
            application/json: {}
        '401':
          description: Unauthorized
      operationId: getAccountExport
      x-operation-id-source: derived
  /account/deletion-preview:
    get:
      tags:
      - Account
      summary: Inspect what would block account deletion
      description: 'Pure-read blocker inspection — returns the same `DeletionPreview` shape that `DELETE /account` uses internally to gate the request. Owner-only. Never 4xx for blocker state: a clean account returns 200 with `{ canDelete: true, ownedAppCount: 0, blockers: [] }`, the dashboard renders an empty ''Nothing blocking — ready to delete'' state. Auth still applies though — missing/invalid tokens get 401, and a caller whose own account is already in delete pipeline gets 403 `ACCOUNT_DELETION_IN_PROGRESS` from the auth-middleware before reaching this handler.


        Blocker kinds: `apps_owned`, `apps_with_collaborators` (accepted + non-expired only), `apps_with_pending_invites` (live invites only), `apps_with_active_pr_previews`, `pending_outgoing_transfers` (live), `deploys_in_progress`, `active_restore_jobs`. Each blocker carries `kind`, `count`, and up to 25 `details` entries (`{ appId?, appName?, ref? }`) for UI rendering. Stale-pending transfers are filtered via `expires_at > now` in the SELECT predicate and are NOT mutated by the preview call.'
      security:
      - bearer: []
      responses:
        '200':
          description: DeletionPreview JSON
          content:
            application/json: {}
        '401':
          description: Unauthorized
        '403':
          description: Account already in delete pipeline (`ACCOUNT_DELETION_IN_PROGRESS` from auth-middleware).
      operationId: getAccountDeletionPreview
      x-operation-id-source: derived
  /account:
    delete:
      tags:
      - Account
      summary: Request account deletion (asynchronous finalize)
      description: 'Fail-closed account-delete request. Flow:


        1. Confirmation gate (`?confirm=`).

        2. Stale-pending outgoing transfers are swept (flipped to `expired`) so they don''t show up as live blockers.

        3. The server re-runs `/account/deletion-preview` inside a `BEGIN IMMEDIATE` transaction. If any blocker remains → 409 with `error.blockers`/`error.ownedAppCount` and an `ACCOUNT_HAS_*` code (see below). The caller resolves blockers via the existing routes (`DELETE /apps/:ref`, `share/revoke`, `transfer/cancel`, etc.) and retries.

        4. On a clean account: `users.status` flips to `deleting`, `deletion_requested_at` + `deletion_blocker_snapshot` get stamped, **API tokens are revoked server-side in the same transaction** (so the caller''s next request returns 401), the `account.delete_requested` audit row is written, and an `account_delete` job is enqueued. Response: **202** `{ status: ''deleting'', finalizeJobId }`.


        The finalizer (`account_delete` job handler) runs `AccountDeletionService.runFinalize()` off the request path: re-validates blockers; cleans up `github_installations`, incoming `shared_access` rows keyed on the user''s email, and pending incoming `app_transfers` to that email; throwing-inserts the `account.deleted` audit row; then DELETE FROMs the user row gated on `status=''deleting''`. If a blocker reappears between the route''s accept and the finalizer running, the finalizer flips status back to `active` and emits `account.delete_aborted` — the only path where `users.status` moves backward.


        **Error codes (409):** `ACCOUNT_HAS_APPS`, `ACCOUNT_HAS_COLLABORATORS`, `ACCOUNT_HAS_PENDING_INVITES`, `ACCOUNT_HAS_ACTIVE_PR_PREVIEWS`, `ACCOUNT_HAS_PENDING_TRANSFERS`, `ACCOUNT_HAS_DEPLOYS_IN_PROGRESS`, `ACCOUNT_HAS_ACTIVE_RESTORE`. Plus `ACCOUNT_DELETION_IN_PROGRESS` (concurrent delete or status already flipped). Auth-middleware also raises `ACCOUNT_DELETION_IN_PROGRESS` (403) for any further request from a `deleting` user.'
      security:
      - bearer: []
      parameters:
      - name: confirm
        in: query
        required: true
        schema:
          type: string
        description: Must match the authenticated user's email address.
      - name: acknowledge
        in: query
        required: false
        schema:
          type: string
          enum:
          - forfeit-export-window
        description: Sunset override (only meaningful during read-only mode). Set to `forfeit-export-window` together with a valid single-use `X-Sunset-Forfeit-Grant` token header to delete during the sunset window. Both are required; the grant is minted only by the dashboard password-reauth flow, so CLI/MCP clients cannot supply it.
      responses:
        '202':
          description: 'Deletion accepted; finalization runs asynchronously. Body: `{ status: ''deleting'', finalizeJobId: string }`. API tokens are revoked server-side in the same transaction — the caller''s next request will 401.'
          content:
            application/json: {}
        '400':
          description: Missing or mismatched confirmation
        '401':
          description: Unauthorized
        '403':
          description: '`ACCOUNT_DELETION_IN_PROGRESS` from auth-middleware (the user is already in delete pipeline) — bearer token rejected before reaching the route handler.'
        '409':
          description: 'Blockers prevent deletion. Body: `{ error: { code, message, blockers, ownedAppCount } }`. `code` is one of the `ACCOUNT_HAS_*` codes listed above (the first blocker kind); `blockers` is the full list so the caller can render every category in one round.'
          content:
            application/json: {}
        '503':
          description: Platform is in sunset read-only mode (at or past T-0). Mutating routes are frozen (`platform_read_only`); app/account delete is gated (`platform_delete_gated`) unless the dashboard password-reauth override is supplied.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SunsetGate'
      operationId: deleteAccount
      x-operation-id-source: derived
components:
  schemas:
    SunsetGate:
      type: object
      properties:
        error:
          type: string
          enum:
          - platform_read_only
          - platform_delete_gated
          description: '`platform_read_only`: a mutating route is frozen during sunset. `platform_delete_gated`: app/account delete is paused; supply the dashboard password-reauth override to proceed.'
        sunsetDate:
          type: string
          format: date-time
        finalDeletionDate:
          type: string
          format: date-time
        message:
          type: string
        dashboardUrl:
          type: string
          format: uri
      required:
      - error
      - sunsetDate
      - finalDeletionDate
      - message
      - dashboardUrl
  securitySchemes:
    exportPreparation:
      type: http
      scheme: bearer
      bearerFormat: pce_<43 base64url characters>
      description: Separate preparation capability. An account API/OAuth token or operation ID is not a preparation credential.
    bearer:
      type: http
      scheme: bearer
      description: API token from `percher login`
    internalSecret:
      type: apiKey
      in: header
      name: X-Internal-Secret
      description: Internal service secret