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

> Promotes the environment’s draft to its published version, which is the copy real traffic reaches. The request names the release so it can be told apart in the history.



## OpenAPI

````yaml /specs-prettified/realtime/openapi.stable.json post /v1/stable/environment/{environmentAlias}/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: []
tags: []
paths:
  /v1/stable/environment/{environmentAlias}/publish:
    post:
      tags:
        - Environment
      summary: Publish environment
      description: >-
        Promotes the environment’s draft to its published version, which is the
        copy real traffic reaches. The request names the release so it can be
        told apart in the history.
      operationId: StableEnvironmentController_publish
      parameters:
        - name: environmentAlias
          required: true
          in: path
          schema:
            type: string
          x-vf-doc:
            description: The alias of the environment to operate on (e.g. `main`).
          description: The alias of the environment to operate on (e.g. `main`).
        - name: projectID
          required: true
          in: query
          schema:
            type: string
            description: The ID of the project to operate on.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StableEnvironmentPublishRequest'
      responses:
        '201':
          description: >-
            Returns the environment together with the release the publish
            produced, giving the release name, its description, when it was
            created, and the ID of the backup that snapshots the environment at
            that release.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StableEnvironmentPublishResponse'
          x-vf-doc:
            description: >-
              Returns the environment together with the release the publish
              produced, giving the release name, its description, when it was
              created, and the ID of the backup that snapshots the environment
              at that release.
      security:
        - token: []
components:
  schemas:
    StableEnvironmentPublishRequest:
      type: object
      properties:
        name:
          type: string
          description: The name of the release created by publishing.
        description:
          default: null
          description: An optional description of what changed in this release.
          nullable: true
          type: string
      required:
        - name
      additionalProperties: false
    StableEnvironmentPublishResponse:
      type: object
      properties:
        environment:
          $ref: '#/components/schemas/StableEnvironment'
        release:
          type: object
          properties:
            name:
              type: string
            backupID:
              type: number
              description: >-
                The ID of the backup that snapshots the environment for this
                release.
            createdAt:
              type: string
              format: date-time
              pattern: >-
                ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
            description:
              nullable: true
              description: An optional description of what changed in this release.
              type: string
            autogenerated:
              type: boolean
              description: >-
                Whether the release was created automatically by the system
                rather than published manually.
          required:
            - name
            - backupID
            - createdAt
            - description
            - autogenerated
      required:
        - environment
        - release
    StableEnvironment:
      type: object
      properties:
        name:
          type: string
        alias:
          type: string
          description: The URL-safe alias that identifies the environment (e.g. `main`).
        isMain:
          type: boolean
          description: Whether this is the main (default) environment of the project.
        releases:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              backupID:
                type: number
                description: >-
                  The ID of the backup that snapshots the environment for this
                  release.
              createdAt:
                type: string
                format: date-time
                pattern: >-
                  ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
              description:
                nullable: true
                description: An optional description of what changed in this release.
                type: string
              autogenerated:
                type: boolean
                description: >-
                  Whether the release was created automatically by the system
                  rather than published manually.
            required:
              - name
              - backupID
              - createdAt
              - description
              - autogenerated
        createdAt:
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        trafficPercentage:
          type: number
          description: >-
            The percentage of live traffic (0-100) currently routed to this
            environment.
      required:
        - name
        - alias
        - isMain
        - releases
        - createdAt
        - trafficPercentage
  securitySchemes:
    token:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: Voiceflow bearer token

````