> ## 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.

# Create an organization

> Site administrators create an organization for its future owner: an existing user
(`owner.user_id`) or a person invited by email. The organization starts as
`waiting_for_owner` with its default roles and scope, and the owner gets an invitation;
it becomes `active` when they accept. `reactivate: true` restores a deleted organization
that holds the slug.

Requires a site administrator's user token.



## OpenAPI

````yaml /openapi/hub-by-tag/hub-organizations.yaml post /v1/orgs/new
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/new:
    post:
      tags:
        - Organizations
      summary: Create an organization
      description: >-
        Site administrators create an organization for its future owner: an
        existing user

        (`owner.user_id`) or a person invited by email. The organization starts
        as

        `waiting_for_owner` with its default roles and scope, and the owner gets
        an invitation;

        it becomes `active` when they accept. `reactivate: true` restores a
        deleted organization

        that holds the slug.


        Requires a site administrator's user token.
      operationId: POST_v1_orgs_new
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                slug:
                  type: string
                  minLength: 1
                  description: URL-safe org identifier; immutable after creation
                display_name:
                  type: string
                  description: 'Human-readable org name (default: the slug)'
                owner:
                  oneOf:
                    - type: object
                      properties:
                        user_id:
                          type: string
                          format: uuid
                          description: Existing user who will own the org
                      required:
                        - user_id
                    - type: object
                      properties:
                        email:
                          type: string
                          minLength: 1
                          description: Email of the person who will own the org
                        display_name:
                          type: string
                          description: Their display name, for a person with no account
                      required:
                        - email
                  description: 'The owner: { user_id } or { email, display_name? }'
                reactivate:
                  type: boolean
                  description: >-
                    Site admin: restore the deleted org (or owner) that holds
                    the name
              required:
                - slug
                - owner
            examples:
              default:
                value:
                  slug: acme
                  display_name: Acme Inc.
                  owner:
                    email: owner@acme.example
                    display_name: Alex Owner
      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:
                      org:
                        type: object
                        properties:
                          id:
                            type: string
                          slug:
                            type: string
                          display_name:
                            type: string
                            nullable: true
                          status:
                            type: string
                          owner:
                            type: object
                            properties:
                              user_id:
                                type: string
                              email:
                                type: string
                              status:
                                type: string
                          created_at:
                            type: string
                          reactivated:
                            type: boolean
                      owner_invite:
                        type: object
                        additionalProperties: true
                        properties:
                          invite_id:
                            type: string
                          role:
                            type: string
                            enum:
                              - owner
                          status:
                            type: string
                            enum:
                              - pending
                          expires_at:
                            type: string
                          email_sent:
                            type: boolean
              example:
                ok: true
                data:
                  org:
                    id: 2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f
                    slug: acme
                    display_name: Acme Inc.
                    status: waiting_for_owner
                    owner:
                      user_id: 1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d
                      email: owner@acme.example
                      status: invited
                    created_at: '2026-10-07T10:00:00Z'
                    reactivated: false
                  owner_invite:
                    invite_id: 3e4f5a6b-7c8d-4e9f-8a0b-1c2d3e4f5a6b
                    role: owner
                    status: pending
                    expires_at: '2026-10-14T10:00:00Z'
                    email_sent: true
        '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`: The token's user is not a site administrator, or a
            daemon token was used.
          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
        '404':
          description: '`not_found`: `owner.user_id` is not a user.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HubErr'
              examples:
                not_found:
                  summary: not_found
                  value:
                    ok: false
                    error: Owner user not found
                    code: not_found
        '409':
          description: >-
            `conflict`: The slug is taken by a live organization, user or scope.
            `details` names it.


            `deleted`: The slug belongs to a deleted organization. Send
            `reactivate` to restore it.


            `not_active`: The owner's account is suspended.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HubErr'
              examples:
                conflict:
                  summary: conflict
                  value:
                    ok: false
                    error: The name acme is already taken.
                    code: conflict
                deleted:
                  summary: deleted
                  value:
                    ok: false
                    error: The name acme belongs to a deleted organization.
                    code: deleted
                not_active:
                  summary: not_active
                  value:
                    ok: false
                    error: Unsuspend the owner first.
                    code: not_active
        '422':
          description: >-
            `invalid_params`: The slug breaks the naming rules (a letter first,
            then lowercase letters, digits and hyphens) or is reserved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HubErr'
              examples:
                invalid_params:
                  summary: invalid_params
                  value:
                    ok: false
                    error: Slug 'admin' is reserved
                    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:
    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.