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

# Get deployment for a build via API key

> Get deployment associated with a specific build using API key authentication. Requires BUILD_AND_DEPLOY scope.



## OpenAPI

````yaml get /api/deployments/build/{buildId}
openapi: 3.0.0
info:
  title: LeanMCP SDK API
  description: >-
    API endpoints for LeanMCP SDK integration. These endpoints use API key
    authentication and are designed for programmatic access from the CLI and
    SDK.
  version: 1.0.0
servers:
  - url: https://api.leanmcp.com
    description: Production
  - url: http://localhost:3001
    description: Local Development
security: []
tags:
  - name: builds-sdk
  - name: chat-messages-api-key
  - name: chats-api-key
  - name: deployments-api-key
  - name: deployments-sdk
  - name: mapping-sdk
  - name: projects-api-key
paths:
  /api/deployments/build/{buildId}:
    get:
      tags:
        - deployments-api-key
      summary: Get deployment for a build via API key
      description: >-
        Get deployment associated with a specific build using API key
        authentication. Requires BUILD_AND_DEPLOY scope.
      operationId: DeploymentsApiKeyController_getDeploymentForBuild
      parameters:
        - name: buildId
          required: true
          in: path
          description: Build ID
          schema:
            example: build_123456789
            type: string
      responses:
        '200':
          description: Deployment found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deployment'
        '404':
          description: Deployment not found or access denied
      security:
        - ApiKeyAuth: []
components:
  schemas:
    Deployment:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the deployment
        buildId:
          type: string
          description: Related build ID for this deployment
        firebaseUid:
          type: string
          description: User ID of the owner
        projectId:
          type: string
          description: Project ID the deployment is associated with
        serviceName:
          type: string
          description: Name of the ECS service
        imageUri:
          type: string
          description: URL of the ECR image to deploy
        status:
          type: string
          enum:
            - PENDING
            - DEPLOYING
            - RUNNING
            - FAILED
            - STOPPED
            - DELETING
            - ALB_RULES_DELETED
            - TARGET_GROUP_DELETED
            - ECS_DELETED
            - ECR_DELETED
            - DELETED
          description: Current status of the deployment
        containerPort:
          type: number
          description: Container port that the service exposes
        publicIp:
          type: string
          description: Public IP address assigned to the deployment
        privateIp:
          type: string
          description: Private IP address of the deployment (used for ALB target)
        targetGroupArn:
          type: string
          description: ARN of the Target Group associated with this deployment
        publicUrl:
          type: string
          description: Public URL to access the deployed service
        secretIds:
          description: Array of secret IDs to include as environment variables
          type: array
          items:
            type: string
        createdAt:
          type: string
          description: Timestamp of when the deployment was created
        updatedAt:
          type: string
          description: When the deployment was last updated
      required:
        - id
        - buildId
        - firebaseUid
        - projectId
        - serviceName
        - imageUri
        - status
        - containerPort
        - publicIp
        - privateIp
        - targetGroupArn
        - publicUrl
        - createdAt
        - updatedAt
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: Enter your LeanMCP API key

````