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

# Gets a development deployment's patch state

> Returns the patch point the deployment is recorded as running and the latest staged-but-unsynced point, if any. The watch client computes its next patch off the pending point when present, else the running point.



## OpenAPI

````yaml get /v1/models/{model_id}/deployments/{deployment_id}/patches/state
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/state:
    parameters:
      - $ref: '#/components/parameters/model_id'
      - $ref: '#/components/parameters/deployment_id'
    get:
      summary: Gets a development deployment's patch state
      description: >-
        Returns the patch point the deployment is recorded as running and the
        latest staged-but-unsynced point, if any. The watch client computes its
        next patch off the pending point when present, else the running point.
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetDeploymentPatchesStateResponseV1'
      x-codeSamples:
        - lang: bash
          source: >
            curl --request GET \

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

            --header "Authorization: Bearer $BASETEN_API_KEY"
        - 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/state"


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


            response = requests.request(
                "GET",
                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:
    GetDeploymentPatchesStateResponseV1:
      description: >-
        The patch state of the development deployment.


        The watch client computes its next patch off `pending_patch_point` when
        present,

        else `running_patch_point`.
      properties:
        running_patch_point:
          $ref: '#/components/schemas/DeploymentPatchPointWithHashV1'
          description: The patch point the deployment is recorded as running.
        pending_patch_point:
          anyOf:
            - $ref: '#/components/schemas/DeploymentPatchPointWithHashV1'
            - type: 'null'
          default: null
          description: >-
            The latest staged-but-unsynced patch point, or null when the
            deployment is recorded as caught up.
      required:
        - running_patch_point
      title: GetDeploymentPatchesStateResponseV1
      type: object
    DeploymentPatchPointWithHashV1:
      description: >-
        A patch point plus its server-assigned content hash, returned in
        responses.


        Requests omit the hash (the server derives it from the source state);
        responses

        include it so the watch client can echo it back as the next patch's

        `prev_patch_hash` without having to recompute the fold itself.
      properties:
        content_hashes:
          additionalProperties:
            anyOf:
              - type: string
              - type: 'null'
          description: >-
            Map of every non-ignored source path, relative and forward-slash, to
            its content hash: files map to the hex blake3 digest of their bytes,
            directories map to null. This is the full signature of the source
            tree and what the content hash is derived from.
          title: Content Hashes
          type: object
        config:
          description: The verbatim config.yaml text for this source state.
          title: Config
          type: string
        requirements:
          description: >-
            Requirements resolved from the config's requirements file, when it
            points at one. Empty when requirements are declared inline in the
            config.
          items:
            type: string
          title: Requirements
          type: array
        hash:
          description: >-
            Content hash identifying this exact source state, and the link
            patches build on. It is derived deterministically from
            `content_hashes`, so a request need not send it - the server derives
            it. It is derived by sorting the `content_hashes` keys as paths,
            splitting each key on '/' into its path components and ordering the
            keys by comparing those component lists element by element, each
            component compared by Unicode code point (equivalently UTF-8 byte
            order). Treating '/' as a path separator this way, rather than as
            the ordinary character U+002F, means a key that is an ancestor path
            sorts before a sibling whose name extends the first differing
            component (so e.g. 'a/b' sorts before 'a.b'). A blake3 hasher is
            then built, and for each key in that order updated with the blake3
            digest (32 raw bytes) of the key encoded as UTF-8, then, when the
            entry is a file (non-null value), with that file's digest as 32 raw
            bytes. The stream uses raw digest bytes, but the values in
            `content_hashes` are those digests hex-encoded (64 hex chars), so
            decode each value from hex first. Directory entries (null value)
            contribute only their key digest. The result is the hasher's own hex
            digest.
          title: Hash
          type: string
      required:
        - content_hashes
        - config
        - hash
      title: DeploymentPatchPointWithHashV1
      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.

````