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

# List organizations

> Lists the organizations you belong to, with your role and permissions in each. Site
administrators get the full list (paged, sortable, filterable by `status`) unless they
send `mine: true`.

Requires a signed-in user token (`Authorization: Bearer cliq_tok_…`). Results are limited to what that user can see.



## OpenAPI

````yaml /openapi/hub-by-tag/hub-organizations.yaml post /v1/orgs/get
openapi: 3.0.3
info:
  title: 'CliqHub API: Organizations'
  version: 1.0.0
  description: >-
    An organization owns realms, teams (through its scopes) and people. Every
    organization

    has four built-in roles, **Owner**, **Admin**, **Operator** and **Member**,
    and can define

    its own: a role is a named set of permissions (List permissions shows them
    all). Owners can

    do everything; `org.delete` and `org.transfer` belong to owners only.


    **Scopes** are the organization's package namespaces (`@acme`,
    `@acme-labs`): teams are

    published under a scope, and only the scope's members may publish to it. The
    organization's

    **team library** lists the teams its realms may use. Organization-wide
    notification rules

    also live here.


    People join an organization through Send an invitation. Organizations are
    created by site

    administrators for their future owner.
servers:
  - url: https://{host}
    variables:
      host:
        default: cliqhub.io
        description: CliqHub host
security: []
tags:
  - name: Organizations
    description: >-
      An organization owns realms, teams (through its scopes) and people. Every
      organization

      has four built-in roles, **Owner**, **Admin**, **Operator** and
      **Member**, and can define

      its own: a role is a named set of permissions (List permissions shows them
      all). Owners can

      do everything; `org.delete` and `org.transfer` belong to owners only.


      **Scopes** are the organization's package namespaces (`@acme`,
      `@acme-labs`): teams are

      published under a scope, and only the scope's members may publish to it.
      The organization's

      **team library** lists the teams its realms may use. Organization-wide
      notification rules

      also live here.


      People join an organization through Send an invitation. Organizations are
      created by site

      administrators for their future owner.
paths:
  /v1/orgs/get:
    post:
      tags:
        - Organizations
      summary: List organizations
      description: >-
        Lists the organizations you belong to, with your role and permissions in
        each. Site

        administrators get the full list (paged, sortable, filterable by
        `status`) unless they

        send `mine: true`.


        Requires a signed-in user token (`Authorization: Bearer cliq_tok_…`).
        Results are limited to what that user can see.
      operationId: POST_v1_orgs_get
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                query:
                  type: string
                  description: Substring match on slug or display_name
                limit:
                  type: integer
                  minimum: 1
                  maximum: 100
                  description: Maximum number of results to return (1–100)
                offset:
                  type: integer
                  minimum: 0
                  description: Zero-based offset for pagination
                mine:
                  type: boolean
                  description: >-
                    When true, return only orgs the caller is a member of
                    (ignores admin privileges)
                sort_by:
                  type: string
                  enum:
                    - slug
                    - display_name
                    - member_count
                    - scope_count
                    - created_at
                  description: >-
                    Sort column: slug | display_name | member_count |
                    scope_count | created_at. Omit for the default order (exact
                    slug match first when searching, then newest first;
                    site-admin list only — 400 with mine).
                sort_dir:
                  type: string
                  enum:
                    - asc
                    - desc
                  description: >-
                    Sort direction with sort_by (default asc); ties are broken
                    by id ascending
                status:
                  type: string
                  enum:
                    - active
                    - waiting_for_owner
                    - deleted
                  description: >-
                    Site-admin list only: only orgs in this state (`deleted`
                    lists soft-deleted orgs)
                include_deleted:
                  type: boolean
                  description: 'Site-admin list only: also list soft-deleted orgs'
            examples:
              default:
                value:
                  mine: true
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                required:
                  - ok
                  - data
                properties:
                  ok:
                    type: boolean
                    enum:
                      - true
                    description: Always `true` on success.
                  data:
                    type: object
                    properties:
                      orgs:
                        type: array
                        items:
                          allOf:
                            - $ref: '#/components/schemas/OrgData'
                            - type: object
                              properties:
                                permissions:
                                  type: array
                                  items:
                                    type: string
                                  description: Your permissions in the organization.
                                owner:
                                  type: object
                                  nullable: true
                                  properties:
                                    username:
                                      type: string
                                    status:
                                      type: string
                      total:
                        type: integer
                        description: Site-admin list only.
                      limit:
                        type: integer
                      offset:
                        type: integer
              example:
                ok: true
                data:
                  orgs:
                    - id: 2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f
                      slug: acme
                      display_name: Acme Inc.
                      member_count: 12
                      scope_count: 2
                      my_role: admin
                      created_at: '2026-01-10T00:00:00Z'
                      permissions:
                        - teams.install
                        - runs.view
                      owner:
                        username: sshah
                        status: active
        '400':
          description: >-
            `invalid_params`: `sort_by` was sent with `mine` (sorting applies to
            the site-admin list only).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HubErr'
              examples:
                invalid_params:
                  summary: invalid_params
                  value:
                    ok: false
                    error: >-
                      sort_by applies to the site-admin org list only (not with
                      mine)
                    code: invalid_params
        '401':
          description: >-
            `unauthorized`: No `Authorization` header, or the token is
            malformed, expired or revoked.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HubErr'
              examples:
                unauthorized:
                  summary: unauthorized
                  value:
                    ok: false
                    error:
                      code: unauthorized
                      message: Authentication required
        '403':
          description: '`forbidden`: A daemon token was used; this route needs a user token.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HubErr'
              examples:
                forbidden:
                  summary: forbidden
                  value:
                    ok: false
                    error:
                      code: forbidden
                      message: You do not have access to do this
        '422':
          description: >-
            `invalid_params`: The body fails the request schema: a required
            field is missing or a value has the wrong type or format. The
            message lists every issue as `field: problem`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HubErr'
              examples:
                invalid_params:
                  summary: invalid_params
                  value:
                    ok: false
                    error: 'query: Required'
                    code: invalid_params
        '500':
          description: >-
            `internal_error`: An unexpected server fault. Retry later; if it
            persists, report it with the time of the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HubErr'
              examples:
                internal_error:
                  summary: internal_error
                  value:
                    ok: false
                    error: Internal server error
                    code: internal_error
      security:
        - BearerAuth: []
components:
  schemas:
    OrgData:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Org UUID
        slug:
          type: string
          description: Unique org slug
        display_name:
          type: string
          nullable: true
          description: Human-readable org name; null when not set
        member_count:
          type: integer
          description: Total member count
        scope_count:
          type: integer
          description: Number of package-namespace scopes owned by this org
        my_role:
          type: string
          nullable: true
          description: Caller\
        created_at:
          type: string
          description: ISO timestamp of org creation
        members:
          type: array
          items:
            description: Unresolved Zod schema `OrgMemberData`
            type: object
            additionalProperties: true
          description: Populated on get_by_id; absent on list
        roles:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
                description: Role UUID
              org_id:
                type: string
                format: uuid
                description: Owning org UUID
              slug:
                type: string
                description: URL-safe role identifier within the org
              name:
                type: string
                description: Human-readable role name
              permissions:
                type: array
                items:
                  type: string
                description: Permission slugs granted by this role
              is_system:
                type: boolean
                description: True for built-in roles that cannot be deleted
              is_default:
                type: boolean
                description: True if assigned to new org members automatically
              member_count:
                type: integer
                description: Number of org members currently assigned this role
              created_at:
                type: string
                description: ISO timestamp of role creation
            required:
              - id
              - org_id
              - slug
              - name
              - permissions
              - is_system
              - is_default
              - member_count
              - created_at
          description: Populated on get_by_id; absent on list
        scopes:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
                description: Scope UUID
              slug:
                type: string
                description: Unique scope slug (e.g. "acme" or "acme/tools")
              display_name:
                type: string
                nullable: true
                description: Human-readable name; null when not set
              visibility:
                type: string
                enum:
                  - public
                  - private
                description: Whether the scope is publicly browsable
              scope_type:
                type: string
                enum:
                  - user
                  - org
                description: >-
                  "user" scopes are owned by a single user; "org" scopes are
                  owned by an org
              owner_id:
                type: string
                format: uuid
                description: UUID of the owning user (user scopes) or org (org scopes)
              org_id:
                type: string
                format: uuid
                nullable: true
                description: Owning org UUID for org scopes; null for user scopes
              member_count:
                type: integer
                description: Number of users with publish access (included on detail views)
              team_count:
                type: integer
                description: >-
                  Number of teams published under this scope (included on detail
                  views)
              org_slug:
                type: string
                nullable: true
                description: Slug of the owning org (site-admin catalog listing)
              created_at:
                type: string
                description: ISO timestamp of scope creation
            required:
              - id
              - slug
              - display_name
              - visibility
              - scope_type
              - owner_id
              - org_id
              - created_at
          description: Populated on get_by_id; absent on list
      required:
        - id
        - slug
        - display_name
        - member_count
        - scope_count
        - created_at
    HubErr:
      type: object
      required:
        - ok
        - error
      description: >-
        Every failure. Route-policy denials (401/403/404, and 400 when neither
        realm_id nor org_id was sent) answer `error` as `{ code, message }`;
        errors raised by the endpoint answer `error` as the message with the
        code beside it in `code`. Every error has a code. See
        [Errors](/hub-api/errors).
      properties:
        ok:
          type: boolean
          description: Always false on error
        error:
          description: The message, or `{ code, message }` for an access denial.
          oneOf:
            - type: string
            - type: object
              required:
                - code
                - message
              properties:
                code:
                  type: string
                message:
                  type: string
        code:
          type: string
          description: Stable error code of an endpoint error.
        details:
          type: object
          additionalProperties: true
          description: Structured detail, when there is some.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: cliq_tok_* | cliq_dt_*
      description: >-
        User PAT (`cliq_tok_…`, including session-scoped) or realm token
        (`cliq_dt_…`).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.