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

# Publish pathway

> Publishes a specific version of a pathway to the specified environment



## OpenAPI

````yaml post /agency/pathway/{id}/publish
openapi: 3.0.0
info:
  title: ClearTalk API
  description: The ClearTalk API Documentation
  version: '1.0'
  contact:
    name: Developer Support
    email: devsupport@cleartalk.ai
servers:
  - url: https://api.cleartalk.ai
    description: ClearTalk AI API Server
security: []
tags: []
paths:
  /agency/pathway/{id}/publish:
    post:
      tags:
        - Pathway
      summary: Publish pathway
      description: Publishes a specific version of a pathway to the specified environment
      operationId: PathwayController_publishPathway
      parameters:
        - name: id
          required: true
          in: path
          description: Pathway ID
          schema:
            example: '1'
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublishPathwayDto'
      responses:
        '200':
          description: Pathway published successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PathwayPublishResponseDto'
        '400':
          description: Invalid input data
        '401':
          description: Unauthorized access
        '404':
          description: Pathway not found
      security:
        - apiKey: []
components:
  schemas:
    PublishPathwayDto:
      type: object
      properties:
        version_id:
          type: number
          description: The version ID of the pathway to publish
          example: 1
        environment:
          type: string
          description: The environment to publish the pathway to
          example: production
          enum:
            - production
            - staging
      required:
        - version_id
        - environment
    PathwayPublishResponseDto:
      type: object
      properties:
        success:
          type: string
          example: Pathway has been published successfully.
      required:
        - success
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: API Key for authentication

````