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

# Create App

> Create a new app by mapping a workspace port to a public subdomain.



## OpenAPI

````yaml POST /api/v1/apps
openapi: 3.1.0
info:
  title: Rigbox Public API
  description: >-
    Gateway-owned public API for Rigbox. The gateway composes its local
    lifecycle API with service-owned exported specs.
  contact:
    name: Rigbox
    url: https://rigbox.dev
  license:
    name: ''
  version: 1.0.0
servers:
  - url: https://api.rigbox.dev
    description: Production gateway
security: []
tags:
  - name: Workspaces
  - name: CLI
  - name: Observability
  - name: Auth
  - name: API Keys
  - name: Access Control
  - name: Apps
  - name: App Catalog
  - name: Logs
  - name: AI
  - name: Tools
  - name: Snapshots
  - name: SSH Keys
  - name: Templates
  - name: Setup Scripts
  - name: Service Specs
  - name: Deploy
  - name: Community
  - name: User Settings
  - name: Roadmap
  - name: System
paths:
  /api/v1/apps:
    post:
      tags:
        - Apps
      summary: Create a new app.
      description: Create a new app in a workspace with a unique name and subdomain.
      operationId: create_app
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAppRequest'
        required: true
      responses:
        '201':
          description: App created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAppResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
        '404':
          description: Workspace not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
        '409':
          description: Name or subdomain conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
      security:
        - bearer: []
components:
  schemas:
    CreateAppRequest:
      type: object
      required:
        - name
        - workspace_id
      properties:
        app_kind:
          $ref: '#/components/schemas/CreateAppKind'
        description:
          type:
            - string
            - 'null'
        metadata: {}
        name:
          type: string
        port:
          type:
            - integer
            - 'null'
          format: int32
          minimum: 0
        protocol:
          type:
            - string
            - 'null'
        workspace_id:
          type: string
    GetAppResponse:
      type: object
      required:
        - app
      properties:
        app:
          $ref: '#/components/schemas/AppView'
    ApiErrorBody:
      type: object
      description: JSON body returned for all errors.
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ApiErrorDetail'
    CreateAppKind:
      type: string
      enum:
        - service
        - cli
    AppView:
      allOf:
        - $ref: '#/components/schemas/ApiApp'
    ApiErrorDetail:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
        details: {}
        message:
          type: string
    ApiApp:
      type: object
      description: >-
        OpenAPI-facing mirror of the canonical app payload.


        Response types can keep serializing `rig_data_store::models::App` while

        pointing schema generation at this local mirror to avoid cross-crate
        derive

        coupling in `utoipa`.
      required:
        - id
        - name
        - subdomain
        - user_id
        - node_id
        - workspace_id
        - port
        - visibility
        - allowed_emails
        - status
        - metadata
        - system_tags
        - protocol
        - app_kind
        - managed
        - depends_on
        - custom_domain_verified
        - created_at
        - updated_at
      properties:
        allowed_emails:
          type: array
          items:
            type: string
        app_kind:
          type: string
        created_at:
          type: string
          format: date-time
        custom_domain:
          type:
            - string
            - 'null'
        custom_domain_verified:
          type: boolean
        depends_on:
          type: array
          items:
            type: string
        description:
          type:
            - string
            - 'null'
        id:
          type: string
        managed:
          type: boolean
        metadata: {}
        name:
          type: string
        node_id:
          type: string
        port:
          type: integer
          format: int32
          minimum: 0
        protocol:
          type: string
        status:
          $ref: '#/components/schemas/AppStatus'
        subdomain:
          type: string
        system_tags:
          type: array
          items:
            type: string
        updated_at:
          type: string
          format: date-time
        user_id:
          type: string
        visibility:
          $ref: '#/components/schemas/Visibility'
        workspace_id:
          type: string
    AppStatus:
      type: string
      enum:
        - active
        - inactive
        - installing
        - error
    Visibility:
      type: string
      enum:
        - private
        - public
        - privileged
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````