> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pragmatiks.io/llms.txt
> Use this file to discover all available pages before exploring further.

# List Organizations

> List every organization on the platform.

Replacement for the deleted customer-realm
``GET /organizations/`` endpoint. Gated on ``require_console_user``
so only a pragmatiks-employee session token reaches it — the
Clerk SDK's JWKS check rejects customer-realm tokens, and
``require_console_user`` rejects ConsoleMachine M2M tokens with
403. This closes the tenant-enumeration primitive that a customer
``org:admin`` used to hold against the old endpoint.

Args:
    user: Authenticated ConsoleUser (unused beyond the gate).
    shared_client: Shared-namespace SurrealDB client.

Returns:
    List of organization records ordered by name.



## OpenAPI

````yaml https://api.pragmatiks.io/openapi.json get /console/organizations
openapi: 3.1.0
info:
  title: Pragma API
  version: 0.1.0
servers: []
security: []
paths:
  /console/organizations:
    get:
      tags:
        - console
      summary: List Organizations
      description: |-
        List every organization on the platform.

        Replacement for the deleted customer-realm
        ``GET /organizations/`` endpoint. Gated on ``require_console_user``
        so only a pragmatiks-employee session token reaches it — the
        Clerk SDK's JWKS check rejects customer-realm tokens, and
        ``require_console_user`` rejects ConsoleMachine M2M tokens with
        403. This closes the tenant-enumeration primitive that a customer
        ``org:admin`` used to hold against the old endpoint.

        Args:
            user: Authenticated ConsoleUser (unused beyond the gate).
            shared_client: Shared-namespace SurrealDB client.

        Returns:
            List of organization records ordered by name.
      operationId: console-list_organizations
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/Organization'
                type: array
                title: Response Console-List Organizations
components:
  schemas:
    Organization:
      properties:
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        organization_id:
          type: string
          title: Organization Id
        name:
          type: string
          title: Name
        slug:
          type: string
          title: Slug
        status:
          $ref: '#/components/schemas/OrganizationStatus'
          default: bootstrapping
        bootstrap_error:
          anyOf:
            - type: string
            - type: 'null'
          title: Bootstrap Error
      type: object
      required:
        - organization_id
        - name
        - slug
      title: Organization
      description: |-
        Organization record stored in shared SurrealDB namespace.

        Represents a Clerk organization synced via webhooks. Stored in the
        shared namespace because organization data must be accessible before
        any organization context exists (e.g., during webhook processing).

        Identity fields (frozen):
            organization_id: Clerk organization ID, used as SurrealDB record ID.

        Metadata:
            name: Display name of the organization.
            slug: URL-friendly organization identifier from Clerk.

        State (system-managed):
            status: Lifecycle status.
            bootstrap_error: Short human-readable message set when
                bootstrap fails; cleared on successful retry.

        Inherited from PragmaModel:
            created_at: Creation timestamp (frozen).
            updated_at: Last update timestamp (mutable).
    OrganizationStatus:
      type: string
      enum:
        - bootstrapping
        - ready
        - bootstrap_failed
        - deactivating
        - deleted
      title: OrganizationStatus
      description: |-
        Lifecycle status of an organization.

        Bootstrap states:
            BOOTSTRAPPING: Organization row exists, bootstrap worker has not
                yet finished provisioning tenant namespace resources.
            READY: Organization is fully provisioned and usable.
            BOOTSTRAP_FAILED: Bootstrap worker exhausted its retry budget.
                Recovery is manual during private beta: operators contact
                support or clear the failure via direct SurrealDB
                intervention.

        Teardown states:
            DEACTIVATING: Cleanup worker is tearing down tenant resources.
            DELETED: Organization fully cleaned up.

````