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

# Rollback to a previous deployment



## OpenAPI

````yaml POST /v1/agents/{agentId}/deployments/{deploymentId}/rollback
openapi: 3.1.0
info:
  title: PolyAI Agents API
  version: 1.0.11
  description: Manage PolyAI agents, telephony, deployments, and real-time configs.
servers:
  - url: https://api.us.poly.ai
    description: US region
  - url: https://api.eu.poly.ai
    description: EU region
  - url: https://api.uk.poly.ai
    description: UK region
  - url: https://api.studio.poly.ai
    description: Studio region
security:
  - polyApiKey: []
paths:
  /v1/agents/{agentId}/deployments/{deploymentId}/rollback:
    parameters:
      - name: agentId
        in: path
        required: true
        schema:
          type: string
      - name: deploymentId
        in: path
        required: true
        schema:
          type: string
    post:
      tags:
        - Deployments
      summary: Rollback to a previous deployment
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RollbackDeploymentPublicBody'
      responses:
        '200':
          description: Rolled-back deployment with triggered test run IDs
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MutationDeploymentPublicResponse'
        '404':
          description: Deployment not found
components:
  schemas:
    RollbackDeploymentPublicBody:
      type: object
      properties:
        deploymentMessage:
          type: string
          default: ''
      additionalProperties: false
      title: RollbackDeploymentPublicBody
    MutationDeploymentPublicResponse:
      type: object
      properties:
        deployment:
          type: object
          properties:
            id:
              type: string
            accountId:
              type: string
            agentId:
              type: string
            environment:
              type: string
            artifactVersion:
              type: string
            version:
              type: string
            createdBy:
              type: string
            createdAt:
              type: string
            metadata:
              type: object
              additionalProperties: {}
              nullable: true
          required:
            - id
            - accountId
            - agentId
            - environment
            - artifactVersion
            - version
            - createdBy
            - createdAt
          additionalProperties: false
        testRunIds:
          type: array
          items:
            type: string
      required:
        - deployment
        - testRunIds
      additionalProperties: false
      title: MutationDeploymentPublicResponse
  securitySchemes:
    polyApiKey:
      type: apiKey
      in: header
      name: X-API-KEY

````