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

# List rollback candidates

> List past successful deployments eligible for rollback.



## OpenAPI

````yaml https://api.ravion.com/openapi.yaml get /deployments/{id}/rollback-candidates
openapi: 3.0.0
info:
  title: Ravion
  version: 0.0.0
servers:
  - url: https://api.ravion.com
security:
  - BearerAuth: []
tags:
  - name: Projects
  - name: Environments
  - name: Pipelines
  - name: PipelineRuns
  - name: TerraformResources
  - name: TerraformExecutionSummaries
  - name: PipelineStepExecutions
  - name: AwsCloudWatch
  - name: PipelineVersions
  - name: Organizations
  - name: Stacks
  - name: StackWorkspaces
  - name: Auth
  - name: OAuth
  - name: User
  - name: Health
  - name: Memberships
  - name: ServiceAccounts
  - name: AwsDefaultNetworks
  - name: AwsAccounts
  - name: ApiKeys
  - name: ExecutionEnvironments
  - name: ModuleDefinitions
  - name: ModuleVersions
  - name: ModuleInstances
  - name: DefaultValueDefinitions
  - name: DefaultValues
  - name: CodeSources
  - name: Github
  - name: Gitlab
  - name: Git
  - name: Values
  - name: Deployments
  - name: DeploymentResources
  - name: InfrastructureEvents
  - name: WebSocket
  - name: Describe
paths:
  /deployments/{id}/rollback-candidates:
    get:
      tags:
        - Deployments
      summary: List rollback candidates
      description: List past successful deployments eligible for rollback.
      operationId: ListRollbackCandidates
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  data:
                    $ref: '#/components/schemas/Deployment.RollbackCandidatesResponse'
                required:
                  - data
                type: object
          description: The request has succeeded.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: You are not authenticated
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: You do not have permission to access this resource.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: The server cannot find the requested resource.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: Server error
components:
  schemas:
    Deployment.RollbackCandidatesResponse:
      additionalProperties: false
      properties:
        data:
          items:
            $ref: '#/components/schemas/Deployment.RollbackCandidate'
          type: array
      required:
        - data
      type: object
    Errors.UserFacingErrorData:
      additionalProperties: false
      description: |-
        User-facing error presentation data.
        This is what the API returns to the frontend after formatting ErrorData
        using CEL templates from the error registry.

        Used for both:
        - Error fields on domain models (e.g., PipelineRun.error)
        - API error response bodies (HTTP 4xx/5xx responses)
      properties:
        action:
          allOf:
            - $ref: '#/components/schemas/Errors.Action'
          description: Optional action to help resolve the error
        code:
          description: Full error code, e.g., "Ravion:Pipeline:NOT_FOUND"
          type: string
        description:
          description: Additional description with more details
          type: string
        details:
          description: Structured details rendered as user-facing sections.
          items:
            $ref: '#/components/schemas/Errors.UserFacingErrorDetailSection'
          type: array
        isInternal:
          description: >-
            Indicates whether this error is internal (only set when
            ShowInternal=true).

            This allows SUPERADMINs to identify internal errors while viewing
            full details.
          type: boolean
        message:
          description: Main error message (required)
          type: string
        metadata:
          additionalProperties: {}
          description: >-
            Error params/metadata. Stripped for internal errors unless
            superadmin.
          type: object
        requestId:
          description: Request ID for correlating errors with server logs.
          type: string
      required:
        - code
        - message
      type: object
    Deployment.RollbackCandidate:
      description: |-
        A past deployment eligible to be re-deployed. Discriminated by
        deployment kind so consumers can narrow on `kind` to access
        per-type fields without optionality games.
      discriminator:
        mapping:
          aws:ecs:
            $ref: '#/components/schemas/Deployment.AwsEcsRollbackCandidate'
          aws:static:
            $ref: '#/components/schemas/Deployment.AwsStaticRollbackCandidate'
        propertyName: kind
      oneOf:
        - $ref: '#/components/schemas/Deployment.AwsEcsRollbackCandidate'
        - $ref: '#/components/schemas/Deployment.AwsStaticRollbackCandidate'
      type: object
    Errors.Action:
      additionalProperties: false
      description: Action to help user resolve the error
      properties:
        label:
          description: Button/link label text
          type: string
        url:
          description: URL to navigate to for resolution
          type: string
      required:
        - label
        - url
      type: object
    Errors.UserFacingErrorDetailSection:
      additionalProperties: false
      description: Structured user-facing error detail section.
      properties:
        items:
          description: List of detail values for this section.
          items:
            type: string
          type: array
        object:
          additionalProperties: {}
          description: Structured detail payload for object rendering.
          type: object
        render:
          description: Rendering hint for clients. Valid values are list or object.
          type: string
        title:
          description: Detail section title shown in the UI.
          type: string
      required:
        - title
        - render
      type: object
    Deployment.AwsEcsRollbackCandidate:
      additionalProperties: false
      description: |-
        AWS ECS rollback candidate — carries task-definition fields the
        dialog needs to disambiguate revisions of the same family.
      properties:
        createdAt:
          $ref: '#/components/schemas/UtcDateTime'
        deploymentId:
          type: string
        description:
          type: string
        imageRefs:
          description: |-
            Absolute image references (`repo:tag` or `repo@sha256:...`) that
            the task definition references.
          items:
            type: string
          type: array
        kind:
          enum:
            - aws:ecs
          type: string
        taskDefinitionArn:
          description: ECS task-definition ARN.
          type: string
        taskDefinitionFamily:
          description: ECS task-definition family.
          type: string
        taskDefinitionRevision:
          description: ECS task-definition revision.
          format: int32
          type: integer
      required:
        - kind
        - deploymentId
        - createdAt
        - description
        - taskDefinitionArn
        - taskDefinitionFamily
        - taskDefinitionRevision
        - imageRefs
      type: object
    Deployment.AwsStaticRollbackCandidate:
      additionalProperties: false
      description: |-
        AWS static rollback candidate — carries the promoted S3 directory,
        which is the only thing the rollback re-applies.
      properties:
        createdAt:
          $ref: '#/components/schemas/UtcDateTime'
        deploymentId:
          type: string
        description:
          type: string
        directory:
          description: |-
            Promoted S3 directory the rollback re-writes to the KVS `active`
            key.
          type: string
        kind:
          enum:
            - aws:static
          type: string
      required:
        - kind
        - deploymentId
        - createdAt
        - description
        - directory
      type: object
    UtcDateTime:
      description: UTC RFC3339 timestamp with a required Z suffix
      format: date-time
      pattern: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,9})?Z$
      type: string
      x-go-type: apitypes.UTCDateTime
      x-go-type-import:
        name: apitypes
        path: ravion/api-go/pkg/apitypes
  securitySchemes:
    BearerAuth:
      scheme: Bearer
      type: http

````