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

# Update Deployment

> You can update a deployment by providing one or both of the following:
- A new model to be used for predictions.
- A new threshold value to be used for classifying predictions.

At least one of these values must be provided for a successful update.

Updating the threshold value with a model already deployed has the
following behavior:
- If you specify a new threshold value, it will override the model's
default threshold.
- If you don't specify a new threshold value, the model's default
threshold will be used.

Updating the deployment with a new model affects the threshold value as
follows:
- If you specify a new threshold value along with the new model, the new
threshold will be used.
- If you don't specify a new threshold value, the threshold associated
with the new model will be used.



## OpenAPI

````yaml https://api.landing.ai/openapi.json put /v1/projects/{project_id}/deployments/{deployment_id}
openapi: 3.1.0
info:
  title: LandingLens API
  description: >

    **LandingLens API** is a RESTful API that allows you to use
    [LandingLens](https://app.landing.ai) programmatically.

    Our API has predictable resource-oriented URLs, returns JSON-encoded
    responses, and uses standard HTTP response codes, authentication, and verbs.


    You can use the LandingLens API to programmatically perform many tasks in
    LandingLens, including:

    * Create projects

    * Upload images to projects

    * Create classes

    * Train models

    * Deploy models to cloud-endpoints hosted by LandingAI (cloud deployment)


    ## Tutorial

    Check out this
    [tutorial](https://landing-ai.github.io/public-rest-api/tutorial/) to learn
    the basic workflow for using the LandingLens APIs.
  version: 0.1.0
servers:
  - url: https://api.landing.ai
    description: Production environment
security: []
paths:
  /v1/projects/{project_id}/deployments/{deployment_id}:
    put:
      tags:
        - Deployment
      summary: Update Deployment
      description: |-
        You can update a deployment by providing one or both of the following:
        - A new model to be used for predictions.
        - A new threshold value to be used for classifying predictions.

        At least one of these values must be provided for a successful update.

        Updating the threshold value with a model already deployed has the
        following behavior:
        - If you specify a new threshold value, it will override the model's
        default threshold.
        - If you don't specify a new threshold value, the model's default
        threshold will be used.

        Updating the deployment with a new model affects the threshold value as
        follows:
        - If you specify a new threshold value along with the new model, the new
        threshold will be used.
        - If you don't specify a new threshold value, the threshold associated
        with the new model will be used.
      operationId: >-
        update_deployment_v1_projects__project_id__deployments__deployment_id__put
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: integer
            title: Project Id
        - name: deployment_id
          in: path
          required: true
          schema:
            type: string
            format: uuid4
            title: Deployment Id
        - name: timeout
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            default: 60
            title: Timeout
        - name: apikey
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Apikey
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeploymentUpdateInput'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BaseResponse_DeploymentItem_'
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
          description: Bad Request
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    DeploymentUpdateInput:
      properties:
        modelId:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Modelid
        threshold:
          anyOf:
            - type: number
            - type: 'null'
          title: Threshold
      type: object
      title: DeploymentUpdateInput
    BaseResponse_DeploymentItem_:
      properties:
        data:
          anyOf:
            - $ref: '#/components/schemas/DeploymentItem'
            - type: 'null'
      type: object
      required:
        - data
      title: BaseResponse[DeploymentItem]
    ErrorMessage:
      properties:
        message:
          type: string
          title: Message
      type: object
      required:
        - message
      title: ErrorMessage
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DeploymentItem:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
        predictionUrl:
          type: string
          title: Predictionurl
        name:
          type: string
          title: Name
        modelId:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Modelid
        threshold:
          anyOf:
            - type: number
            - type: 'null'
          title: Threshold
      type: object
      required:
        - id
        - predictionUrl
        - name
      title: DeploymentItem
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````