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

# Create a demo base stack

> Save a new shared demo base stack in status 'configured'. Nothing reaches the cluster here - materialisation happens on the first demo launch that references it. Organisation-admin only; browser session authentication with the X-Ankra-CSRF double-submit header (no bearer twin). Secret parameter values ride as ${SECRET_SLOT:<uuid>} sentinels, never resolved values.



## OpenAPI

````yaml https://platform.ankra.app/openapi.json post /org/ai-environment/demo-base-stacks
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://platform.ankra.app
security: []
paths:
  /org/ai-environment/demo-base-stacks:
    post:
      tags:
        - AI Environment
      summary: Create a demo base stack
      description: >-
        Save a new shared demo base stack in status 'configured'. Nothing
        reaches the cluster here - materialisation happens on the first demo
        launch that references it. Organisation-admin only; browser session
        authentication with the X-Ankra-CSRF double-submit header (no bearer
        twin). Secret parameter values ride as ${SECRET_SLOT:<uuid>} sentinels,
        never resolved values.
      operationId: create_demo_base_stack
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DemoBaseStackRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DemoBaseStack'
          description: The created base stack
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DemoDetailError'
          description: >-
            Validation failure: the name is not a lowercase DNS label of at most
            30 characters, the idle TTL is outside 1-720 hours, the organisation
            has no staging cluster configured, the profile binding does not
            validate, or a base stack with the same name already exists
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DemoDetailError'
          description: >-
            "Only organisation admins can change demo base stacks." (or a CSRF
            failure)
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DemoDetailError'
          description: Not found ("Unknown demo base stack for this organisation")
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    DemoBaseStackRequest:
      description: >-
        The create payload of a demo base stack. Secret parameter values ride as
        ${SECRET_SLOT:<uuid>} sentinels. The literal ${BASE_STACK_NAMESPACE} in
        a parameter value is substituted with the base stack's stable namespace
        when the stack is materialised.
      properties:
        idle_ttl_hours:
          anyOf:
            - type: integer
            - type: 'null'
          description: Between 1 and 720 hours; null disables the idle TTL.
        name:
          description: >-
            A lowercase DNS label of at most 30 characters; immutable once
            created (it derives the stable namespace).
          type: string
        parameters:
          items:
            $ref: '#/components/schemas/DemoStackParameter'
          type: array
        profile_id:
          format: uuid
          type: string
        profile_version:
          anyOf:
            - type: integer
            - type: 'null'
          description: Null tracks the profile's current version.
      required:
        - name
        - profile_id
      type: object
    DemoBaseStack:
      description: >-
        One shared demo base stack: an organisation-level stack-profile
        designation that materialises lazily as a persistent stack in a stable
        ankra-demo-base-* namespace on the staging cluster. Status is one of:
        configured (saved, never materialised), deploying, ready, failed,
        deleting, deleted.
      properties:
        cluster_id:
          format: uuid
          type: string
        created_at:
          format: date-time
          type: string
        id:
          format: uuid
          type: string
        idle_ttl_hours:
          anyOf:
            - type: integer
            - type: 'null'
          description: >-
            Idle hours after which the maintainer loop tears the stack down;
            null disables the idle TTL.
        last_error:
          type: string
        last_used_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
        live_demo_count:
          description: >-
            The number of non-destroyed demos referencing this base stack;
            deletion is refused while it is non-zero.
          type: integer
        name:
          type: string
        namespace:
          type: string
        parameters:
          items:
            $ref: '#/components/schemas/DemoStackParameter'
          type: array
        profile_id:
          format: uuid
          type: string
        profile_name:
          description: Denormalized onto reads only (never persisted).
          type: string
        profile_version:
          anyOf:
            - type: integer
            - type: 'null'
          description: Null tracks the profile's current version.
        status:
          enum:
            - configured
            - deploying
            - ready
            - failed
            - deleting
            - deleted
          type: string
      required:
        - id
        - cluster_id
        - name
        - profile_id
        - parameters
        - namespace
        - status
        - created_at
        - live_demo_count
      type: object
    DemoDetailError:
      description: >-
        The FastAPI-style detail envelope the demo routes use for
        400/403/404/409/502 responses.
      properties:
        detail:
          type: string
      required:
        - detail
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    DemoStackParameter:
      description: >-
        One stack-profile parameter binding. Secret values ride as
        ${SECRET_SLOT:<uuid>} sentinels, never resolved values.
      properties:
        name:
          type: string
        value:
          type: string
      required:
        - name
        - value
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object

````