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

# Watch deployment events

> Watch deployment events through the Towbar REST API.

Required permissions: deployment.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 /deployments/{deploymentId}/events
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:
  /deployments/{deploymentId}/events:
    get:
      tags:
        - Deployments / Progress & logs
      summary: Watch deployment events
      description: >-
        Required permissions: deployment.read. Personal keys are capped by the
        current member role; team keys use explicit grants. SSE deployment
        events containing deployment, logs, steps, and server-rendered
        localization labels. Reconnect after the bounded stream ends using
        Last-Event-ID. MCP returns a finite snapshot; call again to poll.
      operationId: get_deployments_by_id_events
      parameters:
        - name: deploymentId
          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: after
          in: query
          required: false
          schema:
            type: integer
            minimum: -1
            maximum: 9007199254740991
        - name: snapshot
          in: query
          required: false
          schema:
            type: string
            enum:
              - 'true'
              - 'false'
      responses:
        '200':
          description: JSON object containing deployment, logs, steps.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Response_270'
                  - 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
            text/event-stream:
              schema:
                type: string
                description: >-
                  Server-sent events. Each data payload has the JSON snapshot
                  schema below.
                x-towbar-event-schema:
                  allOf:
                    - $ref: '#/components/schemas/Response_270'
                    - 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_270:
      type: object
      properties:
        deployment:
          $ref: '#/components/schemas/Response_258'
        logs:
          type: array
          items:
            $ref: '#/components/schemas/Response_267'
        steps:
          type: array
          items:
            $ref: '#/components/schemas/Response_265'
      required:
        - deployment
        - logs
        - steps
    Response_258:
      type: object
      properties:
        vulnerabilityScan:
          anyOf:
            - type: 'null'
            - $ref: '#/components/schemas/Response_259'
        vulnerabilityScanningEnabled:
          type: boolean
        appId:
          type: string
        targetEnvironment:
          $ref: '#/components/schemas/Response_99'
        commitSha:
          type: string
        deployableKind:
          anyOf:
            - type: string
              const: app
            - type: string
              const: compose
            - type: string
              const: image
            - type: string
              const: postgres
            - type: string
              const: mysql
            - type: string
              const: mariadb
            - type: string
              const: mongodb
            - type: string
              const: redis
            - type: string
              const: dragonfly
            - type: string
              const: keydb
            - type: string
              const: clickhouse
        environment:
          anyOf:
            - type: string
              const: production
            - type: string
              const: preview
        createdAt:
          type: string
          format: date-time
        errorCode:
          anyOf:
            - type: 'null'
            - type: string
        errorMessage:
          anyOf:
            - type: 'null'
            - type: string
        finishedAt:
          anyOf:
            - type: 'null'
            - type: string
              format: date-time
        id:
          type: string
        gitRef:
          anyOf:
            - type: 'null'
            - type: string
        githubDeploymentId:
          anyOf:
            - type: 'null'
            - type: string
        hostname:
          anyOf:
            - type: 'null'
            - type: string
        imageDigest:
          anyOf:
            - type: 'null'
            - type: string
        imagePlatform:
          anyOf:
            - type: 'null'
            - type: string
        kind:
          anyOf:
            - type: string
              const: deploy
            - type: string
              const: rollback
        manifestDigest:
          type: string
        sourceInputDigest:
          anyOf:
            - type: 'null'
            - type: string
        serverId:
          type: string
        sourceId:
          type: string
        startedAt:
          anyOf:
            - type: 'null'
            - type: string
              format: date-time
        state:
          anyOf:
            - type: string
              const: queued
            - type: string
              const: waiting_for_server
            - type: string
              const: preparing
            - type: string
              const: validating_credentials
            - type: string
              const: checking_server
            - type: string
              const: fetching_source
            - type: string
              const: resolving_secrets
            - type: string
              const: transferring
            - type: string
              const: building
            - type: string
              const: running_pre_deploy
            - type: string
              const: starting_candidate
            - type: string
              const: checking_health
            - type: string
              const: configuring_routing
            - type: string
              const: provisioning_tls
            - type: string
              const: checking_public_endpoint
            - type: string
              const: switching_traffic
            - type: string
              const: running_post_deploy
            - type: string
              const: cleaning_up
            - type: string
              const: succeeded
            - type: string
              const: succeeded_with_warnings
            - type: string
              const: skipped
            - type: string
              const: failed
            - type: string
              const: cancelled
        trigger:
          anyOf:
            - type: string
              const: rollback
            - type: string
              const: manual
            - type: string
              const: auto_deploy
        updatedAt:
          type: string
          format: date-time
        queueBlocker:
          anyOf:
            - type: 'null'
            - type: string
              const: server_capacity
            - type: string
              const: server_check
            - type: string
              const: server_operation
            - type: string
              const: server_preparation
      required:
        - vulnerabilityScan
        - vulnerabilityScanningEnabled
        - appId
        - targetEnvironment
        - commitSha
        - deployableKind
        - environment
        - createdAt
        - errorCode
        - errorMessage
        - finishedAt
        - id
        - gitRef
        - githubDeploymentId
        - hostname
        - imageDigest
        - imagePlatform
        - kind
        - manifestDigest
        - sourceInputDigest
        - serverId
        - sourceId
        - startedAt
        - state
        - trigger
        - updatedAt
        - queueBlocker
    Response_267:
      type: object
      properties:
        content:
          type: string
        createdAt:
          type: string
          format: date-time
        id:
          type: string
        sequence:
          type: number
        stream:
          type: string
      required:
        - content
        - createdAt
        - id
        - sequence
        - stream
    Response_265:
      type: object
      properties:
        createdAt:
          type: string
          format: date-time
        finishedAt:
          anyOf:
            - type: 'null'
            - type: string
              format: date-time
        id:
          type: string
        message:
          anyOf:
            - type: 'null'
            - type: string
        sequence:
          type: number
        startedAt:
          anyOf:
            - type: 'null'
            - type: string
              format: date-time
        state:
          anyOf:
            - type: string
              const: queued
            - type: string
              const: waiting_for_server
            - type: string
              const: preparing
            - type: string
              const: validating_credentials
            - type: string
              const: checking_server
            - type: string
              const: fetching_source
            - type: string
              const: resolving_secrets
            - type: string
              const: transferring
            - type: string
              const: building
            - type: string
              const: running_pre_deploy
            - type: string
              const: starting_candidate
            - type: string
              const: checking_health
            - type: string
              const: configuring_routing
            - type: string
              const: provisioning_tls
            - type: string
              const: checking_public_endpoint
            - type: string
              const: switching_traffic
            - type: string
              const: running_post_deploy
            - type: string
              const: cleaning_up
            - type: string
              const: succeeded
            - type: string
              const: succeeded_with_warnings
            - type: string
              const: skipped
            - type: string
              const: failed
            - type: string
              const: cancelled
        status:
          anyOf:
            - type: string
              const: running
            - type: string
              const: succeeded
            - type: string
              const: skipped
            - type: string
              const: failed
            - type: string
              const: waiting
      required:
        - createdAt
        - finishedAt
        - id
        - message
        - sequence
        - startedAt
        - state
        - status
    Response_259:
      type: object
      properties:
        completedAt:
          anyOf:
            - type: 'null'
            - type: string
              format: date-time
        errorCode:
          anyOf:
            - type: 'null'
            - type: string
        errorMessage:
          anyOf:
            - type: 'null'
            - type: string
        findingsTruncated:
          type: boolean
        id:
          type: string
        imageDigest:
          type: string
        requestedAt:
          type: string
          format: date-time
        scannerName:
          anyOf:
            - type: 'null'
            - type: string
        scannerVersion:
          anyOf:
            - type: 'null'
            - type: string
        severityTotals:
          $ref: '#/components/schemas/Response_260'
        startedAt:
          anyOf:
            - type: 'null'
            - type: string
              format: date-time
        state:
          anyOf:
            - type: string
              const: running
            - type: string
              const: failed
            - type: string
              const: pending
            - type: string
              const: stale
            - type: string
              const: clean
            - type: string
              const: findings
        vulnerabilityDatabaseUpdatedAt:
          anyOf:
            - type: 'null'
            - type: string
              format: date-time
      required:
        - completedAt
        - errorCode
        - errorMessage
        - findingsTruncated
        - id
        - imageDigest
        - requestedAt
        - scannerName
        - scannerVersion
        - severityTotals
        - startedAt
        - state
        - vulnerabilityDatabaseUpdatedAt
    Response_99:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        branch:
          type: string
        mappingRevision:
          type: string
      required:
        - id
        - name
        - branch
        - mappingRevision
    Response_260:
      type: object
      properties:
        critical:
          type: number
        high:
          type: number
        low:
          type: number
        medium:
          type: number
        unknown:
          type: number
      required:
        - critical
        - high
        - low
        - medium
        - unknown
  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

````