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

# Compare deployment performance

> Compare deployment performance through the Towbar REST API.

Required permissions: alert.read. Personal keys are capped by their owner’s current team role.

See [request conventions](/docs/api/overview) and [automation workflows](/docs/api/workflows). MCP clients use the task-oriented [tool catalogue](/docs/api/mcp-tools).


## OpenAPI

````yaml api-reference/openapi.json GET /workloads/{deployableId}/deployment-comparison
openapi: 3.1.0
info:
  title: Towbar API
  version: 2.0.0
  description: >-
    Manage your Towbar control plane with a bearer API key. Keys inherit current
    workspace permissions.
servers:
  - url: https://api.example.com/v1/api
security: []
paths:
  /workloads/{deployableId}/deployment-comparison:
    get:
      tags:
        - Deployments / Performance comparisons
      summary: Compare deployment performance
      description: >-
        Required permissions: alert.read. Personal keys are capped by the
        current member role; team keys use explicit grants.
      operationId: get_workloads_by_id_deployment_comparison
      parameters:
        - name: deployableId
          in: path
          required: true
          schema:
            $schema: https://json-schema.org/draft/2020-12/schema
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        - name: baselineId
          in: query
          required: true
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        - name: candidateId
          in: query
          required: true
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        - name: windowMinutes
          in: query
          required: false
          schema:
            default: 30
            type: integer
            minimum: 5
            maximum: 1440
        - name: warmupMinutes
          in: query
          required: false
          schema:
            default: 2
            type: integer
            minimum: 0
            maximum: 60
        - name: regressionPercent
          in: query
          required: false
          schema:
            default: 0
            type: number
            minimum: 0
            maximum: 500
        - name: minimumCoveragePercent
          in: query
          required: false
          schema:
            default: 0
            type: number
            minimum: 0
            maximum: 100
        - name: statistic
          in: query
          required: false
          schema:
            default: average
            type: string
            enum:
              - average
              - peak
        - name: cpuFloorCores
          in: query
          required: false
          schema:
            default: 0
            type: number
            minimum: 0
            maximum: 1024
        - name: memoryFloorMiB
          in: query
          required: false
          schema:
            default: 0
            type: number
            minimum: 0
            maximum: 1048576
      responses:
        '200':
          description: >-
            Equal relative observation windows, aligned metrics, sample
            coverage, changes and comparison limitations.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Response_100'
                  - type: object
                    properties:
                      localization:
                        $schema: https://json-schema.org/draft/2020-12/schema
                        type: object
                        properties:
                          dateFormat:
                            type: string
                            enum:
                              - day-short-month-year
                              - short-month-day-year
                              - year-month-day
                              - day-month-year
                              - month-day-year
                          timeFormat:
                            type: string
                            enum:
                              - 24-hour
                              - 12-hour
                              - 24-hour-seconds
                              - 12-hour-seconds
                          timeZone:
                            type: string
                          timestamps:
                            type: object
                            propertyNames:
                              type: string
                            additionalProperties:
                              type: object
                              properties:
                                date:
                                  type: string
                                time:
                                  type:
                                    - string
                                    - 'null'
                                dateTime:
                                  type:
                                    - string
                                    - 'null'
                                timeZone:
                                  type: string
                                zoneLabel:
                                  type: string
                                epochMilliseconds:
                                  type: number
                                inputDateTime:
                                  type:
                                    - string
                                    - 'null'
                              required:
                                - date
                                - time
                                - dateTime
                                - timeZone
                                - zoneLabel
                                - epochMilliseconds
                                - inputDateTime
                              additionalProperties: false
                        required:
                          - dateFormat
                          - timeFormat
                          - timeZone
                          - timestamps
                        additionalProperties: false
                    required:
                      - localization
        '400':
          $ref: '#/components/responses/ApiError'
        '401':
          $ref: '#/components/responses/ApiError'
        '403':
          $ref: '#/components/responses/ApiError'
        '404':
          $ref: '#/components/responses/ApiError'
        '409':
          $ref: '#/components/responses/ApiError'
        '413':
          $ref: '#/components/responses/ApiError'
        '422':
          $ref: '#/components/responses/ApiError'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/ApiError'
      security:
        - bearerAuth: []
components:
  schemas:
    Response_100:
      type: object
      properties:
        workload:
          $ref: '#/components/schemas/Response_101'
        query:
          $ref: '#/components/schemas/Response_102'
        stepSeconds:
          type: number
        baseline:
          $ref: '#/components/schemas/Response_103'
        candidate:
          $ref: '#/components/schemas/Response_103'
        metrics:
          type: array
          items:
            $ref: '#/components/schemas/Response_106'
        restarts:
          $ref: '#/components/schemas/Response_108'
        warnings:
          type: array
          items:
            type: string
      required:
        - workload
        - query
        - stepSeconds
        - baseline
        - candidate
        - metrics
        - restarts
        - warnings
    Response_101:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
      required:
        - id
        - name
    Response_102:
      type: object
      properties:
        baselineId:
          type: string
        candidateId:
          type: string
        windowMinutes:
          type: number
        warmupMinutes:
          type: number
        regressionPercent:
          type: number
        minimumCoveragePercent:
          type: number
        statistic:
          anyOf:
            - type: string
              const: average
            - type: string
              const: peak
        cpuFloorCores:
          type: number
        memoryFloorMiB:
          type: number
      required:
        - baselineId
        - candidateId
        - windowMinutes
        - warmupMinutes
        - regressionPercent
        - minimumCoveragePercent
        - statistic
        - cpuFloorCores
        - memoryFloorMiB
    Response_103:
      type: object
      properties:
        deployment:
          $ref: '#/components/schemas/Response_104'
        startAt:
          type: string
        endAt:
          type: string
        windowComplete:
          type: boolean
        historyExpired:
          type: boolean
        restarts:
          anyOf:
            - type: 'null'
            - type: number
        restartCoveragePercent:
          type: number
        points:
          type: array
          items:
            $ref: '#/components/schemas/ComparisonPoint_105'
      required:
        - deployment
        - startAt
        - endAt
        - windowComplete
        - historyExpired
        - restarts
        - restartCoveragePercent
        - points
    Response_106:
      type: object
      properties:
        baseline:
          $ref: '#/components/schemas/ComparisonMetricSummary_107'
        candidate:
          $ref: '#/components/schemas/ComparisonMetricSummary_107'
        delta:
          anyOf:
            - type: 'null'
            - type: number
        deltaPercent:
          anyOf:
            - type: 'null'
            - type: number
        assessment:
          anyOf:
            - type: string
              const: insufficient_data
            - type: string
              const: informational
            - type: string
              const: stable
            - type: string
              const: increased
            - type: string
              const: decreased
        metric:
          anyOf:
            - type: string
              const: cpuPercent
            - type: string
              const: cpuCores
            - type: string
              const: cpuLimitCores
            - type: string
              const: memoryUsedBytes
            - type: string
              const: memoryTotalBytes
            - type: string
              const: memoryLimitBytes
            - type: string
              const: memoryPercent
            - type: string
              const: swapUsedBytes
            - type: string
              const: swapTotalBytes
            - type: string
              const: diskTotalBytes
            - type: string
              const: diskUsedBytes
            - type: string
              const: diskPercent
            - type: string
              const: dockerDiskTotalBytes
            - type: string
              const: dockerDiskUsedBytes
            - type: string
              const: dockerDiskPercent
            - type: string
              const: diskReadBytesPerSecond
            - type: string
              const: diskWriteBytesPerSecond
            - type: string
              const: networkRxBytesPerSecond
            - type: string
              const: networkTxBytesPerSecond
            - type: string
              const: uptimeSeconds
            - type: string
              const: load1
            - type: string
              const: load5
            - type: string
              const: load15
            - type: string
              const: restartCount
        label:
          type: string
        unit:
          anyOf:
            - type: string
              const: bytes
            - type: string
              const: cores
            - type: string
              const: bytesPerSecond
        regression:
          type: boolean
        absoluteFloor:
          type: number
      required:
        - baseline
        - candidate
        - delta
        - deltaPercent
        - assessment
        - metric
        - label
        - unit
        - regression
        - absoluteFloor
    Response_108:
      type: object
      properties:
        baseline:
          anyOf:
            - type: 'null'
            - type: number
        candidate:
          anyOf:
            - type: 'null'
            - type: number
        assessment:
          type: string
      required:
        - baseline
        - candidate
        - assessment
    Response_104:
      type: object
      properties:
        id:
          type: string
        commitSha:
          type: string
        serverId:
          type: string
        kind:
          anyOf:
            - type: string
              const: deploy
            - type: string
              const: rollback
        finishedAt:
          type: string
        configDigest:
          anyOf:
            - type: 'null'
            - type: string
        imageDigest:
          anyOf:
            - type: 'null'
            - type: string
      required:
        - id
        - commitSha
        - serverId
        - kind
        - finishedAt
        - configDigest
        - imageDigest
    ComparisonPoint_105:
      type: object
      properties:
        offsetSeconds:
          type: number
        metrics:
          $ref: '#/components/schemas/Partial_68'
      required:
        - offsetSeconds
        - metrics
    ComparisonMetricSummary_107:
      type: object
      properties:
        average:
          anyOf:
            - type: 'null'
            - type: number
        peak:
          anyOf:
            - type: 'null'
            - type: number
        coveragePercent:
          type: number
        samples:
          type: number
      required:
        - average
        - peak
        - coveragePercent
        - samples
    Partial_68:
      type: object
  responses:
    ApiError:
      description: Request failed. The error object contains code, message, and requestId.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                required:
                  - code
                  - message
                  - requestId
                properties:
                  code:
                    type: string
                  message:
                    type: string
                  requestId:
                    type: string
    RateLimited:
      description: Request failed. The error object contains code, message, and requestId.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                required:
                  - code
                  - message
                  - requestId
                properties:
                  code:
                    type: string
                  message:
                    type: string
                  requestId:
                    type: string
      headers:
        Retry-After:
          description: Seconds before retrying
          schema:
            type: integer
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Towbar API key

````