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

# Get Current

> Get the current deployment for the device.



## OpenAPI

````yaml /references/device-api/v0.2.2/api.yaml get /deployments/current
openapi: 3.0.3
info:
  title: Miru Agent API
  description: >-
    The API between the Miru Agent and any external client living on the same
    device as the Miru Agent
  version: v0.2
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  x-release-version: v0.2.2
  x-git-commit:
    sha: 97aec4ae3541349ead148f90acedb59b0f543fdb
    url: >-
      https://github.com/mirurobotics/openapi/commit/97aec4ae3541349ead148f90acedb59b0f543fdb
    message: |-
      docs(stlc): how to change SDK custom code (#307)

      ## Why

      Hand-written SDK code goes back to stlc's intended flow (upstream docs:
      "Custom code" and "Branching and collaboration"):
      1. Edit the code in a local checkout of the staging SDK repo.
      2. Seal it with `stlc build`.
      3. Merge the tracking file through a PR here.

      A tracking file shows only two commit IDs, so the code itself needs
      somewhere to be reviewed. That's why we tried merging PRs into the
      staging repos (mirurobotics/infra#294), which stlc doesn't support.
      mirurobotics/python-device-sdk-staging#3 needed a manual re-seal (#305),
      and mirurobotics/infra#299 turns those merges off again.

      This PR documents the flow, with the review happening in a **review-only
      PR on the staging repo**.

      ## What

      New `docs/sdk-custom-code.md`, linked from the README:
      - **What custom code is:** what tracking files hold and how stlc applies
      them.
      - **Rules:**
        - nothing merges into staging `main`; PRs there are for review only;
        - prefer config over code;
        - put new code in `src/<package>/lib/`.
      - **Steps:**
        1. `stlc build` to get the local checkout.
      2. Commit on a `custom-code/<topic>` branch from staging `origin/main`,
      so the diff is only the change.
      3. Open a review-only PR on the staging repo. GitHub shows the change
      and the AI review runs.
      4. Cherry-pick the commit onto local `main` and `stlc build` to seal it.
      5. Open the tracking-file PR here, linking the staging PR, and close the
      staging PR after it lands.

      An earlier version of this PR added a CI job that commented the
      custom-code diff here. It's removed in favour of reviewing in the SDK
      repo, so the PR is now docs only.

      ## Depends on

      mirurobotics/infra#299. Until it's applied, a review PR on
      `python-device-sdk-staging` could still be merged, which is the
      situation #305 had to repair.

      🤖 Generated with [Claude Code](https://claude.com/claude-code)

      ---------

      Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
    author: ben-miru
    branch: HEAD
    dirty: false
  x-build:
    built_at: '2026-10-09T18:04:19.383464+00:00'
servers:
  - url: http://localhost/v0.2
    description: localhost
security:
  - {}
  - BearerAuth: []
paths:
  /deployments/current:
    get:
      tags:
        - Deployments
      summary: Get Current
      description: Get the current deployment for the device.
      operationId: getCurrentDeployment
      responses:
        '200':
          description: Successfully retrieved the current deployment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deployment'
      x-codeSamples:
        - lang: curl
          label: curl (Linux)
          source: |-
            curl \
              --unix-socket /run/miru/miru.sock \
              --request GET \
              --url http://localhost/v0.2/deployments/current
        - lang: powershell
          label: PowerShell (Windows)
          source: >-
            $api = Get-Content -Raw
            "$env:ProgramData\Miru\device-api\device-api.json" |
            ConvertFrom-Json; `

            Invoke-RestMethod -Method Get `
              -Uri "http://127.0.0.1:$($api.port)/v0.2/deployments/current" `
              -Headers @{ Authorization = "Bearer $($api.token)" }
        - lang: Python
          source: |-
            from miru_device_sdk import Miru

            client = Miru()
            deployment = client.deployments.current()
            print(deployment.id)
components:
  schemas:
    Deployment:
      title: Deployment
      type: object
      required:
        - object
        - id
        - description
        - status
        - activity_status
        - error_status
        - target_status
        - device_id
        - release_id
        - created_at
      properties:
        object:
          type: string
          enum:
            - deployment
          example: deployment
          x-stainless-const: true
          description: The object type, which is always `deployment`.
        id:
          type: string
          description: ID of the deployment.
          example: dpl_123
        description:
          type: string
          example: Deployment for the motion control config instance
          description: The description of the deployment.
        status:
          $ref: '#/components/schemas/DeploymentStatus'
        activity_status:
          $ref: '#/components/schemas/DeploymentActivityStatus'
        error_status:
          $ref: '#/components/schemas/DeploymentErrorStatus'
        target_status:
          $ref: '#/components/schemas/DeploymentTargetStatus'
        device_id:
          type: string
          example: dvc_123
          description: ID of the device.
        release_id:
          type: string
          example: rls_123
          description: ID of the release.
        created_at:
          type: string
          format: date-time
          example: '2024-01-01T00:00:00Z'
          description: Timestamp of when the device release was created.
      example:
        object: deployment
        id: dpl_123
        description: Deployment for the motion control config instance
        status: staged
        activity_status: staged
        error_status: none
        target_status: staged
        device_id: dvc_123
        release_id: rls_123
        created_at: '2024-01-01T00:00:00Z'
    DeploymentStatus:
      type: string
      description: >
        This status merges the 'activity_status' and 'error_status' fields, with
        error states taking precedence over activity states when errors are
        present. For example, if the activity status is 'deployed' but the error
        status is 'failed', the status is 'failed'. However, if the error status
        is 'none' and the activity status is 'deployed', the status is
        'deployed'.
      enum:
        - drifted
        - staged
        - queued
        - deployed
        - removing
        - archived
        - failed
        - retrying
      x-enum-varnames:
        - DEPLOYMENT_STATUS_DRIFTED
        - DEPLOYMENT_STATUS_STAGED
        - DEPLOYMENT_STATUS_QUEUED
        - DEPLOYMENT_STATUS_DEPLOYED
        - DEPLOYMENT_STATUS_REMOVING
        - DEPLOYMENT_STATUS_ARCHIVED
        - DEPLOYMENT_STATUS_FAILED
        - DEPLOYMENT_STATUS_RETRYING
    DeploymentActivityStatus:
      type: string
      description: >
        Last known activity state of the deployment.


        `drifted` means the device's configurations have drifted since this
        deployment was staged, and the deployment needs to be reviewed before it
        can be deployed.


        `staged` means the deployment is ready to be deployed.


        `queued` means the deployment's config instances are waiting to be
        received by the device and will be deployed as soon as the device is
        online.


        `deployed` means the deployment's config instances are currently
        available for consumption on the device.


        `removing` means the deployment's config instances are being removed
        from the device.


        `archived` means the deployment is available for historical reference
        but cannot be deployed and is not active on the device.
      enum:
        - drifted
        - staged
        - queued
        - deployed
        - removing
        - archived
      x-enum-varnames:
        - DEPLOYMENT_ACTIVITY_STATUS_DRIFTED
        - DEPLOYMENT_ACTIVITY_STATUS_STAGED
        - DEPLOYMENT_ACTIVITY_STATUS_QUEUED
        - DEPLOYMENT_ACTIVITY_STATUS_DEPLOYED
        - DEPLOYMENT_ACTIVITY_STATUS_REMOVING
        - DEPLOYMENT_ACTIVITY_STATUS_ARCHIVED
    DeploymentErrorStatus:
      type: string
      description: >
        Last known error state of the deployment.


        `none` means there are no errors.


        `retrying` means an error has been encountered and the agent is retrying
        to reach the target status.


        `failed` means a fatal error has been encountered; the deployment is
        archived and, if deployed, removed from the device.
      enum:
        - none
        - failed
        - retrying
      x-enum-varnames:
        - DEPLOYMENT_ERROR_STATUS_NONE
        - DEPLOYMENT_ERROR_STATUS_FAILED
        - DEPLOYMENT_ERROR_STATUS_RETRYING
    DeploymentTargetStatus:
      type: string
      description: >
        Desired state of the deployment.


        `staged` means the deployment is ready to be deployed.


        `deployed` means all config instances in the deployment are available
        for consumption on the device.


        `archived` means the deployment is available for historical reference
        but cannot be deployed and is not active on the device.
      enum:
        - staged
        - deployed
        - archived
      x-enum-varnames:
        - DEPLOYMENT_TARGET_STATUS_STAGED
        - DEPLOYMENT_TARGET_STATUS_DEPLOYED
        - DEPLOYMENT_TARGET_STATUS_ARCHIVED
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        The token from the agent's discovery file. Required over loopback TCP;
        not used over the Unix socket.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.