Stacktree Client spaces API

Group published pages per client ("file this under Acme"). Publishing with a `client` field auto-creates the space; these routes exist for listing, rename, and archive.

GitHub OpenAPI

Operations 9

GET /spaces List client spaces with page counts, most recently touched first #
POST /spaces Create a client space explicitly #
GET /spaces/{idOrSlug} Get one space plus a light list of its pages (id, title, path) #
PATCH /spaces/{idOrSlug} Rename a space, archive/unarchive it, or gate the whole space #
DELETE /spaces/{idOrSlug} Delete a space. Its pages detach to floating; they are never deleted #
POST /spaces/{idOrSlug}/portal Enable the client portal: a generated index page of the space’s work #
DELETE /spaces/{idOrSlug}/portal Disable the portal and remove the generated page #
POST /spaces/{idOrSlug}/portal/customize Take over the portal HTML. Regeneration stops until it is handed back #
POST /spaces/{idOrSlug}/portal/reset Hand a taken-over portal back, so it rebuilds itself again #

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/stacktr-ee:stacktr-ee-client-spaces-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

stacktr-ee-client-spaces-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Stacktree Client spaces API
  version: 1.0.0
  summary: 'Agent-first private-by-default HTML hosting: host a web page from any agent.'
  description: 'Stacktree hosts web pages for AI agents: turn generated HTML (a report, dashboard, landing page or static site) into a live, shareable webpage on a permanent private link. Publish, manage, and share static HTML sites from AI agents. Supports anonymous publishing for one-shot artefacts, API-key auth for long-lived agent jobs, and OAuth 2.1 with Dynamic Client Registration for in-product agent connectors (claude.ai, ChatGPT custom connectors, etc.). ## Versioning and deprecation The API is major version 1. Every unversioned path is also served under the `/v1/` prefix (`/v1/sites` = `/sites`); pin `/v1/` if you want the version in the URL. Breaking changes only ever ship under a new prefix (`/v2/`), never in place. Deprecations are signalled in-band with `Deprecation` and `Sunset` response headers (RFC 8594) at least 90 days before removal, and listed in the changelog at https://stacktr.ee/changelog. Nothing is deprecated today. ## Rate limits Rate-limited surfaces return standard headers on every response: `RateLimit-Limit`, `RateLimit-Remaining`, `RateLimit-Reset` (seconds until the rolling window frees), the combined `RateLimit` field, and `RateLimit-Policy`. A `429` additionally carries `Retry-After` in seconds. Current windows: anonymous publishes and per-plan daily publish caps roll over 24 h; OAuth dynamic client registration is per-IP per hour. Read the caps from `GET /me` rather than hardcoding them. See /llms.txt for the agent-readable overview, and /docs for human docs.'
  contact:
    name: Stacktree
    url: https://stacktr.ee
    email: gm@stacktr.ee
  license:
    name: Proprietary
  termsOfService: https://stacktr.ee/terms
  x-guidance: 'Stacktree hosts generated HTML (reports, dashboards, landing pages, static sites) as private, shareable web pages. Anonymous: POST /sites with a multipart `file` field to get a private 24h URL, no auth. One permanent page, no key: POST /publish and pay $0.50 over x402 or MPP. Persistent: pay $1 once over x402 at POST /provision to receive an stk_live_ API key, then POST /sites with `Authorization: Bearer <key>`. That key starts on free-tier limits (3 pages in total, each expiring after 7 days, passcodes included); POST /unlock buys more. Each response returns the private URL. Gate a site with a passcode or email domain, set an expiry, or attach your own domain via the /sites and /custom-domains routes. Plan ceilings return HTTP 402 with a plan_* error code, described in the 402 responses below.'
servers:
- url: https://api.stacktr.ee
  description: Production API host (current major version; /v1 is an identical alias)
security:
- bearerApiKey: []
- oauth2:
  - sites:write
  - sites:read
tags:
- name: Client spaces
  description: Group published pages per client ("file this under Acme"). Publishing with a `client` field auto-creates the space; these routes exist for listing, rename, and archive.
paths:
  /spaces:
    get:
      tags:
      - Client spaces
      summary: List client spaces with page counts, most recently touched first
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  spaces:
                    type: array
                    items:
                      $ref: '#/components/schemas/ClientSpace'
        '401':
          $ref: '#/components/responses/Unauthorized'
      operationId: getSpaces
    post:
      tags:
      - Client spaces
      summary: Create a client space explicitly
      description: 'Rarely needed: publishing with a `client` field auto-creates the space with the same casing and slug rules, so this exists for setting a client up before anything ships.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - name
              properties:
                name:
                  type: string
                  description: Display name, e.g. "Acme Co".
      responses:
        '201':
          description: Created (or already existed — idempotent with the publish-path auto-create).
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                  space:
                    type: object
                    required:
                    - id
                    - name
                    - slug
                    properties:
                      id:
                        type: string
                      name:
                        type: string
                      slug:
                        type: string
        '400':
          description: Missing or invalid name.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      operationId: postSpaces
  /spaces/{idOrSlug}:
    parameters:
    - name: idOrSlug
      in: path
      required: true
      schema:
        type: string
    get:
      tags:
      - Client spaces
      summary: Get one space plus a light list of its pages (id, title, path)
      description: Full site objects live on `GET /sites?client=`.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                - id
                - name
                - slug
                - pages
                properties:
                  id:
                    type: string
                  name:
                    type: string
                  slug:
                    type: string
                  hostname:
                    type: string
                    nullable: true
                  archived_at:
                    type: integer
                    nullable: true
                  created_at:
                    type: integer
                  updated_at:
                    type: integer
                  pages:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        title:
                          type: string
                          nullable: true
                        space_path:
                          type: string
                          nullable: true
                        unlisted_token:
                          type: string
                        updated_at:
                          type: integer
                  portal:
                    type: object
                    nullable: true
                    description: 'The generated client portal, when enabled: a system-managed index page listing the space’s work, newest first.'
                    properties:
                      enabled:
                        type: boolean
                      managed:
                        type: boolean
                        description: true = regenerates automatically; false = customized, the owner edits it like any page.
                      site_id:
                        type: string
                      url:
                        type: string
                  domain:
                    type: object
                    nullable: true
                    description: The hostname bound to this space, when one exists.
                    properties:
                      hostname:
                        type: string
                      verified:
                        type: boolean
                      ssl_status:
                        type: string
                        nullable: true
        '404':
          $ref: '#/components/responses/NotFound'
      operationId: getSpacesByIdOrSlug
    patch:
      tags:
      - Client spaces
      summary: Rename a space, archive/unarchive it, or gate the whole space
      description: Renames change the display name only; the slug is a forever addressing contract and never changes. Only the fields present in the body are touched; on the two gate fields `null` means remove the gate.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: New display name.
                archived:
                  type: boolean
                  description: true to archive (the plan slot is freed; the portal and the address close to readers, each page keeps its own link), false to unarchive.
                password:
                  type: string
                  nullable: true
                  description: Passcode covering every page in the space, inherited by pages already filed under it and by ones published later. null clears it.
                allowed_email_domain:
                  type: string
                  nullable: true
                  description: 'Email gate covering every page in the space: domains and/or single addresses separated by commas ("acme.com, jane@globex.com"; strict-equal, no subdomains), up to 20. null clears it.'
      responses:
        '200':
          description: Updated.
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                required:
                - ok
        '402':
          $ref: '#/components/responses/PlanLimited'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: Another active space already answers to that name.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      operationId: patchSpacesByIdOrSlug
    delete:
      tags:
      - Client spaces
      summary: Delete a space. Its pages detach to floating; they are never deleted
      description: The generated portal page and any bound hostname ARE removed — the space is the address, and a deleted space stops resolving. Archive instead to free the plan slot and close the portal while keeping the space and every page.
      responses:
        '200':
          description: Deleted; pages detached.
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                required:
                - ok
        '404':
          $ref: '#/components/responses/NotFound'
      operationId: deleteSpacesByIdOrSlug
  /spaces/{idOrSlug}/portal:
    parameters:
    - name: idOrSlug
      in: path
      required: true
      schema:
        type: string
    post:
      tags:
      - Client spaces
      summary: 'Enable the client portal: a generated index page of the space’s work'
      description: Serves at the root of the space’s hostname once one is connected, and always at its own private stacktr.ee URL. Regenerates automatically on every publish into, removal from, or rename of the space. Enabling counts as ACTIVATING the space — the client-spaces plan unit (Solo 1, Studio 10, Firm unlimited); filing pages stays free on every plan. Idempotent.
      responses:
        '201':
          description: Enabled (or already on).
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                  site_id:
                    type: string
                  url:
                    type: string
                  managed:
                    type: boolean
        '402':
          $ref: '#/components/responses/PlanLimited'
        '404':
          $ref: '#/components/responses/NotFound'
      operationId: postSpacesByIdOrSlugPortal
    delete:
      tags:
      - Client spaces
      summary: Disable the portal and remove the generated page
      responses:
        '200':
          description: Disabled.
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                required:
                - ok
        '404':
          $ref: '#/components/responses/NotFound'
      operationId: deleteSpacesByIdOrSlugPortal
  /spaces/{idOrSlug}/portal/customize:
    parameters:
    - name: idOrSlug
      in: path
      required: true
      schema:
        type: string
    post:
      tags:
      - Client spaces
      summary: Take over the portal HTML. Regeneration stops until it is handed back
      description: 'After this, the portal is an ordinary page the owner (or an agent) edits with update_site, and membership changes no longer touch it, with one exception: put where the list goes and the document list between it and is rewritten on every change to the space (see https://stacktr.ee/docs#portal-design). POST /spaces/{idOrSlug}/portal/reset undoes it.'
      responses:
        '200':
          description: Customized; managed=false from now on.
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                required:
                - ok
        '400':
          description: Portal not enabled.
        '404':
          $ref: '#/components/responses/NotFound'
      operationId: postSpacesByIdOrSlugPortalCustomize
  /spaces/{idOrSlug}/portal/reset:
    parameters:
    - name: idOrSlug
      in: path
      required: true
      schema:
        type: string
    post:
      tags:
      - Client spaces
      summary: Hand a taken-over portal back, so it rebuilds itself again
      description: Undoes portal/customize. The portal keeps its link and address, is rebuilt from the space straight away (replacing any hand edits), and from then on updates whenever a page is published into the space.
      responses:
        '200':
          description: Managed again; managed=true.
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                required:
                - ok
        '400':
          description: Portal not enabled.
        '404':
          $ref: '#/components/responses/NotFound'
      operationId: postSpacesByIdOrSlugPortalReset
components:
  responses:
    Unauthorized:
      description: Missing or invalid credentials.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    PlanLimited:
      description: A plan ceiling was hit. The feature or the quota is not on this plan; the caller needs a different plan or an x402 unlock.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PlanError'
  schemas:
    ClientSpace:
      type: object
      required:
      - id
      - name
      - slug
      properties:
        id:
          type: string
        name:
          type: string
          description: Display name, e.g. "Acme Co". Renameable.
        slug:
          type: string
          description: URL-safe identifier. Stable forever — renames never change it.
        hostname:
          type: string
          nullable: true
          description: Custom hostname bound to the space, if any.
        page_count:
          type: integer
          description: Pages filed under the space.
        last_activity_at:
          type: integer
          description: Unix epoch seconds of the newest page update.
        archived_at:
          type: integer
          nullable: true
        created_at:
          type: integer
    PlanError:
      type: object
      description: A plan ceiling was hit. Render an upgrade prompt from `error` and `limit`, not the raw string.
      required:
      - error
      - plan
      properties:
        error:
          type: string
          description: Stable code for what ran out.
          enum:
          - plan_lifetime_limit_exceeded
          - plan_site_limit_exceeded
          - plan_password_not_available
          - plan_password_limit_exceeded
          - plan_viewer_gate_not_available
          - plan_viewer_gate_limit_exceeded
          - plan_domain_not_available
          - plan_domain_limit_exceeded
        plan:
          type: string
          description: The caller's current plan.
        limit:
          type: integer
          description: The cap that was hit, when the code is a *_limit_exceeded.
        used:
          type: integer
          description: How much of the cap is spent (lifetime pages).
        message:
          type: string
          description: Human-readable detail.
        upgrade_by_card:
          type: string
          description: 'On `plan_lifetime_limit_exceeded`, when card checkout is on: how to pay by card in a browser with no sign-in (https://stacktr.ee/pay). On a publish, a plan bought there with the account''s email is applied when the same request is sent again. On a claim, the one page can be kept for a one-time payment instead.'
        likely_revision_of:
          type: object
          description: 'On `plan_lifetime_limit_exceeded` only, when the upload looks like a new version of a page this account already has: that page, same shape as on the Site schema. Updating it (PUT /sites/{id}) uses no page slot and keeps its link, so it is the one call that still works.'
      example:
        error: plan_lifetime_limit_exceeded
        plan: free
        limit: 3
        used: 3
    Error:
      type: object
      required:
      - error
      properties:
        error:
          type: string
          description: Stable machine-readable error code.
        error_description:
          type: string
          description: Human-readable detail (optional).
      example:
        error: auth required
  securitySchemes:
    bearerApiKey:
      type: http
      scheme: bearer
      bearerFormat: API key (stk_live_…)
      description: 'Long-lived API key, created from app.stacktr.ee, bought over x402 at POST /provision, or minted headlessly via the RFC 8628 device-code flow (POST /api-keys/device-code). Pass as `Authorization: Bearer stk_live_…`. Accepted on every REST route AND on the MCP transport at POST /mcp.'
    walletSignature:
      type: apiKey
      in: header
      name: Authorization
      description: 'Keyless auth for the wallet that PAID for a page (x402 pay-per-publish): POST /wallet-auth/challenge {"wallet":"0x…"}, personal_sign (EIP-191) the returned message with that wallet, then send `Authorization: Wallet challenge=WAUTH-…,sig=0x…`. Single-use, 5-minute TTL, EVM EOA only. Scope: PUT /sites/{id} on pages carrying that payer_wallet (adopted pages while the wallet stays account-linked).'
    claimToken:
      type: apiKey
      in: header
      name: Authorization
      description: 'Keyless auth for an UNCLAIMED page, using the `claim_token` that page''s own publish response returned: send `Authorization: Claim <claim_token>`. Works on any rail (no wallet, no signature), which is what a Solana x402 payer and a free anonymous publisher have. Scope is deliberately that one page: PUT /sites/{idOrSlug} replaces its content, DELETE /sites/{idOrSlug} takes it down for good (an unclaimed page has no account to restore it to), and GET /sites/{idOrSlug}/activity reads whether it was opened. Never another page, never claiming or settings. It stops working the moment the page is claimed (claiming rotates the token into the account), when the page expires, and for a blocked actor. Anonymous updates are rate limited per IP (RateLimit headers on every response) and require a direct client connection. Treat the token as being as sensitive as the page: anyone holding it can replace the content behind a link already sent to a client.'
    oauth2:
      type: oauth2
      description: OAuth 2.1 with PKCE + Dynamic Client Registration (RFC 7591). Used by claude.ai connectors and other agent runtimes.
      flows:
        authorizationCode:
          authorizationUrl: https://api.stacktr.ee/oauth/authorize
          tokenUrl: https://api.stacktr.ee/oauth/token
          refreshUrl: https://api.stacktr.ee/oauth/token
          scopes:
            sites:read: List and read site metadata.
            sites:write: Create, update, and delete sites.
externalDocs:
  description: Human-readable docs
  url: https://stacktr.ee/docs
x-service-info:
  categories:
  - web
  - storage
  docs:
    homepage: https://stacktr.ee
    apiReference: https://api.stacktr.ee/openapi.json
    llms: https://stacktr.ee/llms.txt
x-discovery:
  ownershipProofs:
  - '0x3ff8b9344028603569a7eab333dc9e50c4b62a1056c0814dfcf109d30f2bb44841a0e694a1697db648082192a71ca3b76c7cee3d8c7c696c0ae1f38ef8a8996f1c'