> ## 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 Setup Script

> Create a reusable setup script for workspace initialization.

Setup scripts run automatically when a workspace starts. Use them to install packages, configure services, or seed data.


## OpenAPI

````yaml POST /api/v1/setup-scripts
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/setup-scripts:
    post:
      tags:
        - Setup Scripts
      summary: Create a new setup script.
      description: Create a new reusable setup script on the user's account.
      operationId: create_setup_script
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSetupScriptRequest'
        required: true
      responses:
        '201':
          description: Setup script created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SetupScriptResponse'
      security:
        - bearer: []
components:
  schemas:
    CreateSetupScriptRequest:
      type: object
      required:
        - name
        - content
      properties:
        content:
          type: string
        name:
          type: string
        run_on:
          type: string
        script_order:
          type:
            - integer
            - 'null'
          format: int32
    SetupScriptResponse:
      type: object
      required:
        - id
        - user_id
        - name
        - content
        - run_on
        - script_order
        - source
        - created_at
        - updated_at
      properties:
        content:
          type: string
        created_at:
          type: string
        id:
          type: string
        name:
          type: string
        run_on:
          type: string
        script_order:
          type: integer
          format: int32
        source:
          type: string
        updated_at:
          type: string
        user_id:
          type: string
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````