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

# Create a new Lambda deployment from a build (API Key)



## OpenAPI

````yaml post /api/lambda-deploy
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/lambda-deploy:
    post:
      tags:
        - deployments-sdk
      summary: Create a new Lambda deployment from a build (API Key)
      operationId: LambdaDeployApiKeyController_createDeployment
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateLambdaDeploymentDto'
      responses:
        '201':
          description: Lambda deployment created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LambdaDeployment'
        '404':
          description: Build not found
        '409':
          description: Build not in SUCCEEDED status or has no image
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CreateLambdaDeploymentDto:
      type: object
      properties:
        buildId:
          type: string
          description: ID of the Lambda build to deploy
        functionName:
          type: string
          description: Custom function name (optional, will be auto-generated)
        memorySize:
          type: number
          description: Memory size in MB (128-10240)
          default: 512
        timeout:
          type: number
          description: Timeout in seconds (1-900)
          default: 30
        architecture:
          type: string
          description: Architecture (x86_64 or arm64)
          default: x86_64
      required:
        - buildId
    LambdaDeployment:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the Lambda deployment
        buildId:
          type: string
          description: Related Lambda build ID
        projectId:
          type: string
          description: Project ID the deployment is associated with
        firebaseUid:
          type: string
          description: User ID of the owner (Firebase UID)
        functionName:
          type: string
          description: Name of the Lambda function
        functionArn:
          type: string
          description: ARN of the Lambda function
        imageUri:
          type: string
          description: URL of the ECR image deployed
        status:
          type: string
          enum:
            - PENDING
            - CREATING_ROLE
            - CREATING_FUNCTION
            - CONFIGURING_URL
            - RUNNING
            - UPDATING
            - FAILED
            - DELETING
            - DELETED
            - REPLACED
          description: Current status of the deployment
        functionUrl:
          type: string
          description: Lambda Function URL
        mcpEndpoint:
          type: string
          description: MCP endpoint URL
        healthEndpoint:
          type: string
          description: Health check endpoint URL
        roleArn:
          type: string
          description: IAM role ARN for the Lambda function
        architecture:
          type: string
          description: Lambda architecture (x86_64 or arm64)
        memorySize:
          type: number
          description: Memory size in MB
        timeout:
          type: number
          description: Timeout in seconds
        lastHealthCheck:
          type: string
          description: Last health check status
        lastHealthCheckAt:
          type: string
          description: Last health check timestamp
        errorMessage:
          type: string
          description: Error message if deployment failed
        region:
          type: string
          description: AWS region where the Lambda is deployed
        createdAt:
          type: string
          description: Timestamp of when the deployment was created
        updatedAt:
          type: string
          description: When the deployment was last updated
      required:
        - id
        - buildId
        - projectId
        - firebaseUid
        - functionName
        - functionArn
        - imageUri
        - status
        - functionUrl
        - mcpEndpoint
        - healthEndpoint
        - roleArn
        - architecture
        - memorySize
        - timeout
        - lastHealthCheck
        - lastHealthCheckAt
        - errorMessage
        - region
        - createdAt
        - updatedAt
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: Enter your LeanMCP API key

````