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

# Expose Port

> Expose a port from a workspace as a new app with a public URL.



## OpenAPI

````yaml POST /api/v1/workspaces/{id}/expose-port
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/workspaces/{id}/expose-port:
    post:
      tags:
        - Apps
      summary: Detect or expose a port as a routable app.
      description: Expose a workspace port as a routable app with a public subdomain.
      operationId: expose_port
      parameters:
        - name: id
          in: path
          description: Workspace ID
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExposePortRequest'
        required: true
      responses:
        '200':
          description: Port exposed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExposePortResponse'
      security:
        - bearer: []
components:
  schemas:
    ExposePortRequest:
      type: object
      required:
        - port
        - step
      properties:
        name:
          type:
            - string
            - 'null'
        port:
          type: integer
          format: int32
          minimum: 0
        step:
          type: string
    ExposePortResponse:
      oneOf:
        - allOf:
            - $ref: '#/components/schemas/DetectResult'
            - type: object
              required:
                - step
              properties:
                step:
                  type: string
                  enum:
                    - detect
        - type: object
          required:
            - message
            - app
            - service_name
            - needs_restart
            - step
          properties:
            app:
              $ref: '#/components/schemas/App'
            message:
              type: string
            needs_restart:
              type: boolean
            service_name:
              type: string
            step:
              type: string
              enum:
                - wrap
    DetectResult:
      type: object
      description: >-
        Detection result for exposing ports - shows what was found before
        confirmation.
      required:
        - port
        - pid
        - command
        - cwd
        - env_vars
        - is_systemd
        - process_name
        - suggested_name
      properties:
        command:
          type: string
        cwd:
          type: string
        env_vars:
          type: array
          items:
            type: string
        is_systemd:
          type: boolean
        pid:
          type: integer
          format: int32
          minimum: 0
        port:
          type: integer
          format: int32
          minimum: 0
        process_name:
          type: string
        suggested_name:
          type: string
        systemd_unit:
          type:
            - string
            - 'null'
    App:
      type: object
      required:
        - id
        - name
        - subdomain
        - user_id
        - node_id
        - workspace_id
        - port
        - visibility
        - allowed_emails
        - status
        - 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

````