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

# Create client

> Manually creates a client workspace with users. Optionally sends invitation emails. When `inviteToTrial=true`, the hub's configured trial plan is used and `planPublicId` is ignored (requires trial enabled in hub config).



## OpenAPI

````yaml /api-reference/openapi.json post /public/api/v1/clients
openapi: 3.1.0
info:
  contact:
    email: support@gennia.ai
    name: Gennia Support
    url: https://gennia.ai
  description: >-
    Workspace-scoped API authenticated via workspace API key (header `X-Api-Key:
    gsk_...` or `Authorization: Bearer gsk_...`).
  title: Gennia Public API
  version: v1
servers:
  - description: Production
    url: https://api.gennia.ai
security:
  - workspaceApiKey: []
tags:
  - description: Slash commands available inside the agent chat.
    name: Agent Commands
  - description: Link skills to an agent.
    name: Agent Skills
  - description: Read/rename/delete workspace knowledge sources.
    name: Knowledge Sources
  - description: Link knowledge sources to an agent.
    name: Agent Knowledge Sources
  - description: Workspace CRUD for HTTP/DB/Custom tools.
    name: HTTP Tools
  - description: Read/write the agent's model selection + capabilities.
    name: Agent Model
  - description: Discover trigger types available for Native MCP toolkits.
    name: Native MCP Triggers
  - description: Discover and toggle capability features.
    name: Agent Features
  - description: Hub access settings.
    name: Hub Access
  - description: Read conversation history and delete conversations.
    name: Conversations
  - description: Send messages to a published agent.
    name: Messages
  - description: Workspace CRUD for External MCP servers.
    name: External MCPs
  - description: Hub billing — plans, coupons, credit packages.
    name: Billing
  - description: External links shown in the hub menu.
    name: Hub External Links
  - description: Link Native MCP (Composio) instances to an agent.
    name: Agent Native MCPs
  - description: Manage AI agents in the workspace bound to the API key.
    name: Agents
  - description: Read published version snapshots and restore.
    name: Agent Versions
  - description: Read/rename/delete workspace skills.
    name: Skills
  - description: Manage hub end-customers (client workspaces).
    name: Clients
  - description: Hub domain (subdomain) management.
    name: Hub Domain
  - description: Read/write the agent's prompt context.
    name: Agent Prompt
  - description: Scheduled / trigger-based runs of an agent.
    name: Agent Automations
  - description: Link HTTP/DB/Custom tools to an agent.
    name: Agent HTTP Tools
  - description: Hub identity, branding, logos and overall configuration.
    name: Hub
  - description: Discover AI models available to this workspace.
    name: AI Models
  - description: Discover channel types and their config schemas.
    name: Channel Types
  - description: Connect agents to messaging surfaces.
    name: Agent Channels
  - description: Link workspace-registered External MCP servers to an agent.
    name: Agent External MCPs
  - description: Workspace-scoped public API (API key authentication)
    name: Public API
  - description: Dynamic-prompt variable definitions.
    name: Agent Variables
  - description: Link sub-agents as delegation targets.
    name: Agent Sub-agents
paths:
  /public/api/v1/clients:
    post:
      tags:
        - Clients
      summary: Create client
      description: >-
        Manually creates a client workspace with users. Optionally sends
        invitation emails. When `inviteToTrial=true`, the hub's configured trial
        plan is used and `planPublicId` is ignored (requires trial enabled in
        hub config).
      operationId: createClient
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePublicClientRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicClientDTO'
          description: Created
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicClientDTO'
          description: Validation failed; duplicate workspace name; plan not in this hub
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicClientDTO'
          description: Missing or invalid API key
      security:
        - workspaceApiKey: []
components:
  schemas:
    CreatePublicClientRequest:
      description: Body for creating a new client workspace under the hub.
      properties:
        creditsOverride:
          description: >-
            Optional credits override. When not set, uses the plan's
            creditsIncluded value.
          example: 5000
          format: int32
          type: integer
        inviteToTrial:
          description: >-
            Invite as a trial client — ignores planPublicId and uses the hub's
            configured trial plan (requires trial enabled in hub config).
            Defaults to false.
          example: false
          type: boolean
        periodEndOverride:
          description: >-
            Optional period-end override. When not set, computed from plan
            recurrence.
          example: '2026-12-31T23:59:59Z'
          format: date-time
          type: string
        planPublicId:
          description: >-
            Optional. Subscription plan public ID. If omitted, the client is
            created without a plan. Ignored when inviteToTrial=true.
          example: 9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21
          format: uuid
          type: string
        sendInvitations:
          description: >-
            Send invitation emails to the listed users immediately. Defaults to
            false.
          example: true
          type: boolean
        users:
          description: Users to provision in the client workspace (at least one).
          items:
            $ref: '#/components/schemas/ClientUser'
          minItems: 1
          type: array
        workspaceName:
          description: Display name of the client workspace.
          example: Acme Corp
          maxLength: 150
          minLength: 1
          type: string
      type: object
    PublicClientDTO:
      properties:
        createdAt:
          format: date-time
          type: string
        creditsBalance:
          type: number
        creditsUsedThisPeriod:
          type: number
        currentPeriodEnd:
          format: date-time
          type: string
        currentPeriodStart:
          format: date-time
          type: string
        extraCreditsBalance:
          type: number
        nextCreditRenewalAt:
          format: date-time
          type: string
        pendingInvitations:
          items:
            $ref: '#/components/schemas/PublicPendingInvitationDTO'
          type: array
        pendingPlan:
          $ref: '#/components/schemas/PendingPlanRef'
        plan:
          $ref: '#/components/schemas/PlanRef'
        publicId:
          format: uuid
          type: string
        seatsLimit:
          format: int32
          type: integer
        subscriptionStatus:
          enum:
            - active
            - past_due
            - canceled
            - trialing
            - pending_onboarding
            - suspended
          type: string
        unlimitedCredits:
          type: boolean
        users:
          items:
            $ref: '#/components/schemas/UserRef'
          type: array
        usersCount:
          format: int32
          type: integer
        workspaceName:
          type: string
      type: object
    ClientUser:
      description: User to create inside the new client workspace.
      properties:
        email:
          description: Email address (also used as login).
          example: ada@acme.com
          minLength: 1
          type: string
        name:
          description: Full name of the user.
          example: Ada Lovelace
          maxLength: 255
          minLength: 1
          type: string
        role:
          description: Role assigned to the user inside the client workspace.
          enum:
            - admin
            - member
            - editor
            - viewer
          type: string
      required:
        - role
      type: object
    PublicPendingInvitationDTO:
      properties:
        createdAt:
          format: date-time
          type: string
        email:
          type: string
        expiresAt:
          format: date-time
          type: string
        isExpired:
          type: boolean
        name:
          type: string
        publicId:
          format: uuid
          type: string
        role:
          type: string
      type: object
    PendingPlanRef:
      properties:
        currency:
          type: string
        effectiveAt:
          format: date-time
          type: string
        name:
          type: string
        priceCents:
          format: int32
          type: integer
        publicId:
          format: uuid
          type: string
      type: object
    PlanRef:
      properties:
        billingIntervalMonths:
          format: int32
          type: integer
        billingType:
          enum:
            - one_time
            - recurring
          type: string
        creditsIncluded:
          format: int32
          type: integer
        currency:
          type: string
        name:
          type: string
        priceCents:
          format: int32
          type: integer
        publicId:
          format: uuid
          type: string
      type: object
    UserRef:
      properties:
        completedOnboarding:
          type: boolean
        email:
          type: string
        lastSeenAt:
          format: date-time
          type: string
        name:
          type: string
        publicId:
          format: uuid
          type: string
        role:
          type: string
      type: object
  securitySchemes:
    workspaceApiKey:
      in: header
      name: X-Api-Key
      type: apiKey

````