a4sx Tenants API

The Tenants API from a4sx — 11 operation(s) for tenants.

GitHub OpenAPI

Operations 15

GET /tenants List Tenants #
POST /tenants Create Tenant #
GET /tenants/current Tenant Current #
GET /tenants/plans Tenant Plans #
GET /tenants/mine My Tenants #
POST /tenants/new New Unpaid Tenant #
POST /tenants/trial Start Trial #
POST /tenants/free-seller Start Free Seller #
POST /tenants/{tenant_id}/admin-tokens Mint Tenant Admin Token #
GET /tenants/{tenant_id}/admin-tokens List Tenant Admin Tokens #
POST /tenants/{tenant_id}/admin-tokens/{token_id}/revoke Revoke Tenant Admin Token #
GET /tenants/{tenant_id} Get Tenant #
PATCH /tenants/{tenant_id} Patch Tenant #
DELETE /tenants/{tenant_id} Delete Tenant #
POST /tenants/{tenant_id}/restore Restore Tenant #

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/session-exchange-com:session-exchange-com-tenants-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

session-exchange-com-tenants-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Session Exchange Com Tenants API
  version: 0.1.0
  description: 'Operations tagged Tenants across 2 of this provider''s published API definitions: openapi.json, session-exchange-com-openapi.json. Each path carries the servers of the definition it was published in.'
tags:
- name: Tenants
paths:
  /tenants:
    get:
      summary: List Tenants
      operationId: list_tenants_tenants_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
      tags:
      - Tenants
    post:
      summary: Create Tenant
      operationId: create_tenant_tenants_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TenantCreateRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Tenants
  /tenants/current:
    get:
      summary: Tenant Current
      description: 'Public: identify the tenant this Host resolves to (id, display_name, read_only).

        No auth — the SPA calls it pre-login to enter read-only demo mode on a demo host.'
      operationId: tenant_current_tenants_current_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
      tags:
      - Tenants
  /tenants/plans:
    get:
      summary: Tenant Plans
      description: 'Public pricing for self-serve tenant sign-up (backs the marketplace CTA) — the plan catalog. The top-level

        keys are the Workspace plan (unchanged). `lite` (#1935) is the Lite plan (collector/lite.py `catalog_entry`:

        price, VAT, mesh limits, no router), present only while Lite is offered (AGENT_MDX_LITE_TIER on and a Price at

        the current amount); absent otherwise, so /pricing shows no Lite column.'
      operationId: tenant_plans_tenants_plans_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
      tags:
      - Tenants
  /tenants/mine:
    get:
      summary: My Tenants
      description: 'The caller''s tenants (human session) with plan + trial state — backs the

        account "Your tenants" list. Members-only fields (tokens) are never included.'
      operationId: my_tenants_tenants_mine_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
      tags:
      - Tenants
  /tenants/new:
    post:
      summary: New Unpaid Tenant
      description: 'Buying a workspace must always be possible, also after the free trial was used (P0): this

        creates (or returns the caller''s existing) workspace on plan=`unpaid` — READ-ONLY until its

        first paid subscription (tenant_access `awaiting_payment`; routes/billing._fulfil_subscription

        sets plan=paid). It grants nothing for free and does not consume or start a trial; the buyer

        then subscribes it through the normal /billing/checkout (target=tenant, plan=subscribe).'
      operationId: new_unpaid_tenant_tenants_new_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
      tags:
      - Tenants
  /tenants/trial:
    post:
      summary: Start Trial
      description: 'Self-serve: a logged-in human spins up their own tenant on a free trial — no

        global-admin needed. Random 8-char id, hostname ., owner membership for

        the caller. No card → 24h. One trial per person, of either kind: someone who opened a

        3-day card-trial checkout gets no no-card trial (#1154), and their older still-open card-trial

        checkouts are closed before this one starts. A user may own several tenants (capped to deter

        abuse).'
      operationId: start_trial_tenants_trial_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
      tags:
      - Tenants
  /tenants/free-seller:
    post:
      summary: Start Free Seller
      description: '#1277 — free publish & sell: give a signed-in human ONE seller workspace on plan `free_seller`

        with no subscription and no trial clock (collector/free_selling.py). Idempotent: an existing one

        (also one upgraded to a full plan since) is returned, never a second. 404 while

        AGENT_MDX_FREE_SELLING is off, so the path answers exactly as an unknown route did.'
      operationId: start_free_seller_tenants_free_seller_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
      tags:
      - Tenants
  /tenants/{tenant_id}/admin-tokens:
    post:
      summary: Mint Tenant Admin Token
      description: 'GLOBAL admin: mint a tenant-admin token for an existing tenant (e.g. to add an

        operator, or recover a lost tenant-admin token). The minted token is a PURE tenant

        admin — it lives in that tenant''s admin store, scoped to that tenant; it is NOT a

        global admin. Returns the plaintext once.'
      operationId: mint_tenant_admin_token_tenants__tenant_id__admin_tokens_post
      parameters:
      - name: tenant_id
        in: path
        required: true
        schema:
          type: string
          title: Tenant Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TenantAdminTokenRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Tenants
    get:
      summary: List Tenant Admin Tokens
      description: The tenant's admin tokens — metadata and id only, never the plaintext or hash.
      operationId: list_tenant_admin_tokens_tenants__tenant_id__admin_tokens_get
      parameters:
      - name: tenant_id
        in: path
        required: true
        schema:
          type: string
          title: Tenant Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Tenants
  /tenants/{tenant_id}/admin-tokens/{token_id}/revoke:
    post:
      summary: Revoke Tenant Admin Token
      description: 'Revoke one tenant-admin token by id. Takes effect on the next request (token lookup reads

        the in-memory registry, which the upsert updates) and survives a restart (JSONL replay keeps

        the last line per hash). Idempotent: revoking a revoked token is 200 with `already_revoked`.


        Revoking the token the request itself is authenticated with locks the caller out, so it must

        be explicit: without `?confirm=self` it is refused 409 `confirm_self_revoke` and nothing

        changes.'
      operationId: revoke_tenant_admin_token_tenants__tenant_id__admin_tokens__token_id__revoke_post
      parameters:
      - name: tenant_id
        in: path
        required: true
        schema:
          type: string
          title: Tenant Id
      - name: token_id
        in: path
        required: true
        schema:
          type: string
          title: Token Id
      - name: confirm
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Confirm
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Tenants
  /tenants/{tenant_id}:
    get:
      summary: Get Tenant
      operationId: get_tenant_tenants__tenant_id__get
      parameters:
      - name: tenant_id
        in: path
        required: true
        schema:
          type: string
          title: Tenant Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Tenants
    patch:
      summary: Patch Tenant
      operationId: patch_tenant_tenants__tenant_id__patch
      parameters:
      - name: tenant_id
        in: path
        required: true
        schema:
          type: string
          title: Tenant Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TenantPatchRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Tenants
    delete:
      summary: Delete Tenant
      description: 'Soft-delete a tenant. Allowed for a GLOBAL admin OR the tenant''s own OWNER (self-serve).

        GitHub-style guard: the caller must echo the id via `?confirm=`, so a delete can''t

        fire by accident. `default` is protected; a personal library is managed automatically, not

        deleted here.'
      operationId: delete_tenant_tenants__tenant_id__delete
      parameters:
      - name: tenant_id
        in: path
        required: true
        schema:
          type: string
          title: Tenant Id
      - name: confirm
        in: query
        required: false
        schema:
          type: string
          default: ''
          title: Confirm
      - name: owner_unreachable
        in: query
        required: false
        schema:
          type: boolean
          default: false
          title: Owner Unreachable
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Tenants
  /tenants/{tenant_id}/restore:
    post:
      summary: Restore Tenant
      description: '#1311 E: undo a workspace SOFT-delete (global admin only). Refuses when the data dir is

        already purged — that needs the single-tenant backup restore first (an ops step, not this

        route). Appends a `tenant_restore` erasure-ledger line (so the boot replay never re-tombstones

        it), sets the plan from live billing, un-hides members'' library copies, audits

        `tenant.restored`, emits the `tenant.restored` platform event and mails the owner.'
      operationId: restore_tenant_tenants__tenant_id__restore_post
      parameters:
      - name: tenant_id
        in: path
        required: true
        schema:
          type: string
          title: Tenant Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Tenants
components:
  schemas:
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    TenantPatchRequest:
      properties:
        hostnames:
          anyOf:
          - items:
              type: string
            type: array
            minItems: 1
          - type: 'null'
          title: Hostnames
        status:
          anyOf:
          - type: string
            enum:
            - active
            - suspended
          - type: 'null'
          title: Status
        ingress_ready:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Ingress Ready
        display_name:
          anyOf:
          - type: string
            maxLength: 200
          - type: 'null'
          title: Display Name
        quota:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Quota
        read_only:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Read Only
        trial_expires_at:
          anyOf:
          - type: string
          - type: 'null'
          title: Trial Expires At
        plan:
          anyOf:
          - type: string
          - type: 'null'
          title: Plan
      type: object
      title: TenantPatchRequest
      description: 'Update a tenant: add/replace hostnames, suspend/resume, mark ingress ready,

        set quota. All fields optional; only provided ones are applied.'
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TenantCreateRequest:
      properties:
        id:
          type: string
          maxLength: 63
          minLength: 1
          pattern: ^[a-z][a-z0-9-]*$
          title: Id
        hostnames:
          items:
            type: string
          type: array
          minItems: 1
          title: Hostnames
        display_name:
          type: string
          maxLength: 200
          title: Display Name
          default: ''
        seed_profile:
          type: string
          enum:
          - standard
          - minimal
          title: Seed Profile
          default: standard
        ingress_ready:
          type: boolean
          title: Ingress Ready
          default: true
        quota:
          anyOf:
          - additionalProperties: true
            type: object
          - type: 'null'
          title: Quota
        description:
          type: string
          maxLength: 2000
          title: Description
          default: ''
      type: object
      required:
      - id
      - hostnames
      title: TenantCreateRequest
      description: 'Create a tenant (specs/multi-tenancy/v0.1 Phase 2). Global-admin only.

        The hostname''s DNS/TLS/Ingress is provisioned off-system FIRST; this POST then

        registers the mapping and seeds the tenant (a default env + a one-time

        tenant-admin token). `id` is also the data-subtree name.'
    TenantAdminTokenRequest:
      properties:
        label:
          type: string
          maxLength: 200
          title: Label
          default: tenant-admin (minted)
        owner_id:
          type: string
          maxLength: 200
          title: Owner Id
          default: ''
      type: object
      title: TenantAdminTokenRequest
      description: 'Mint a tenant-admin token for an existing tenant (global-admin only). The token

        is a pure tenant admin, scoped to that tenant.'
x-refined-from:
- openapi.json
- session-exchange-com-openapi.json