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

# Publish environment

> Publish the target environment's draft as its new published version. The environment can be targeted by ID or alias.



## OpenAPI

````yaml /specs/realtime/openapi.public.json post /v1alpha1/project/{projectID}/environment/{projectEnvironmentIDorAlias}/publish
openapi: 3.0.0
info:
  title: Realtime
  description: Realtime gateway API service
  version: 1.0.0
  contact: {}
servers:
  - url: https://realtime-api.voiceflow.com
security: []
paths:
  /v1alpha1/project/{projectID}/environment/{projectEnvironmentIDorAlias}/publish:
    post:
      tags:
        - EnvironmentPublicApi
        - Public-Docs
      summary: Publish environment
      description: >-
        Publish the target environment's draft as its new published version. The
        environment can be targeted by ID or alias.
      operationId: ProjectEnvironmentApiPublicHTTPController_publishOne
      parameters:
        - name: projectID
          required: true
          in: path
          description: ID of the project that owns the environments.
          schema:
            type: string
        - name: projectEnvironmentIDorAlias
          required: true
          in: path
          description: ID or alias of the environment to publish.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublishProjectEnvironmentRequest'
      responses:
        '201':
          description: The updated environment and created release.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectEnvironmentPublishResponse'
      security:
        - auth: []
components:
  schemas:
    PublishProjectEnvironmentRequest:
      type: object
      properties:
        name:
          type: string
          minLength: 1
        description:
          nullable: true
          type: string
      required:
        - name
        - description
    ProjectEnvironmentPublishResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            projectEnvironment:
              $ref: '#/components/schemas/ProjectEnvironment'
            projectEnvironmentRelease:
              $ref: '#/components/schemas/ProjectEnvironmentRelease'
          required:
            - projectEnvironment
            - projectEnvironmentRelease
      required:
        - data
    ProjectEnvironment:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        alias:
          type: string
        isMain:
          type: boolean
        releases:
          type: array
          items:
            $ref: '#/components/schemas/ProjectEnvironmentRelease'
        createdAt:
          type: string
        draftVersionID:
          type: string
        createdByUserID:
          type: number
        clonedFromMainAt:
          nullable: true
          type: string
        trafficPercentage:
          type: number
          minimum: 0
          maximum: 100
        nextReleaseNumber:
          type: number
        publishedVersionID:
          type: string
        draftVersionIDsHistory:
          type: array
          items:
            type: string
      required:
        - id
        - name
        - alias
        - isMain
        - releases
        - createdAt
        - draftVersionID
        - createdByUserID
        - trafficPercentage
        - nextReleaseNumber
        - publishedVersionID
        - draftVersionIDsHistory
    ProjectEnvironmentRelease:
      type: object
      properties:
        name:
          type: string
        backupID:
          type: number
        createdAt:
          type: string
        versionID:
          type: string
        description:
          nullable: true
          type: string
        autogenerated:
          type: boolean
        createdByUserID:
          nullable: true
          type: number
      required:
        - name
        - backupID
        - createdAt
        - versionID
        - description
        - autogenerated
        - createdByUserID
  securitySchemes:
    auth:
      type: apiKey
      in: header
      name: authorization
      description: Voiceflow API key

````