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

# Syncs staged patches to a development deployment

> Applies any staged patches to the running deployment. A 2xx response means the sync reached a verdict: in sync, or a full push is required (needs_full_deploy_reason). A 503 means the sync was not attempted or failed recoverably and should be retried; any other error is terminal.



## OpenAPI

````yaml post /v1/models/{model_id}/deployments/{deployment_id}/patches/sync
openapi: 3.1.0
info:
  description: REST API for management of Baseten resources
  title: Baseten management API
  version: 1.0.0
servers:
  - url: https://api.baseten.co
security:
  - BearerAuth: []
paths:
  /v1/models/{model_id}/deployments/{deployment_id}/patches/sync:
    parameters:
      - $ref: '#/components/parameters/model_id'
      - $ref: '#/components/parameters/deployment_id'
    post:
      summary: Syncs staged patches to a development deployment
      description: >-
        Applies any staged patches to the running deployment. A 2xx response
        means the sync reached a verdict: in sync, or a full push is required
        (needs_full_deploy_reason). A 503 means the sync was not attempted or
        failed recoverably and should be retried; any other error is terminal.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SyncDeploymentPatchesRequestV1'
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SyncDeploymentPatchesResponseV1'
      x-codeSamples:
        - lang: bash
          source: >-
            curl --request POST \

            --url
            https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/patches/sync
            \

            --header "Authorization: Bearer $BASETEN_API_KEY" \

            --data '{}'
        - lang: python
          source: >-
            import requests

            import os

            API_KEY = os.environ.get("BASETEN_API_KEY", "<YOUR_API_KEY>")

            url =
            "https://api.baseten.co/v1/models/{model_id}/deployments/{deployment_id}/patches/sync"


            headers = {"Authorization": f"Bearer {API_KEY}"}


            response = requests.request(
                "POST",
                url,
                headers=headers,
                json={}
            )


            print(response.text)
components:
  parameters:
    model_id:
      schema:
        type: string
      name: model_id
      in: path
      required: true
    deployment_id:
      schema:
        type: string
      name: deployment_id
      in: path
      required: true
  schemas:
    SyncDeploymentPatchesRequestV1:
      description: >-
        Triggers a sync of any staged patches to the running deployment. Takes
        no

        fields: the deployment and its staged patches fully determine the sync.
      properties: {}
      title: SyncDeploymentPatchesRequestV1
      type: object
    SyncDeploymentPatchesResponseV1:
      description: >-
        The outcome of a sync that ran.


        Operational failures (a transient patch failure, an invalid patch
        sequence)

        are surfaced as HTTP errors rather than fields here, so a 2xx means the
        sync

        reached a verdict.
      properties:
        needs_full_deploy_reason:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            If set, the change cannot be patched and a full push is required;
            the value explains why. If null, the deployment is now in sync.
          title: Needs Full Deploy Reason
      title: SyncDeploymentPatchesResponseV1
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Send `Authorization: Bearer <api_key>`. The legacy `Authorization:
        Api-Key <api_key>` scheme is also accepted.

````