---
title: "Deploy"
method: POST
path: "/deployments/{deployment_id}/deploy"
tags: ["Deployments"]
---

# Deploy

`POST /deployments/{deployment_id}/deploy`

Trigger a deployment to its target device.

## Path parameters

- `deployment_id` string, required

## Query parameters

- `expand` DeploymentExpansion[]

## Response `200`

Successfully triggered the deployment.

- Deployment
  - `object` 'deployment', required — The object type, which is always `deployment`.
  - `id` string, required — ID of the deployment.
  - `description` string, required — The description of the deployment.
  - `status` 'drifted' | 'staged' | 'queued' | 'deployed' | 'removing' | 'archived' | 'failed' | 'retrying', required — 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'.
  - `activity_status` 'drifted' | 'staged' | 'queued' | 'deployed' | 'removing' | 'archived', required — 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.
  - `error_status` 'none' | 'failed' | 'retrying', required — 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.
  - `target_status` 'staged' | 'deployed' | 'archived', required — 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.
  - `device_id` string, required — ID of the device.
  - `release_id` string, required — ID of the release.
  - `created_at` string, date-time, required — Timestamp of when the device release was created.
  - `updated_at` string, date-time, required — Timestamp of when the device release was last updated.
  - `device` Device
    - `object` 'device', required — The object type, which is always `device`.
    - `id` string, required — ID of the device.
    - `name` string, required — Name of the device.
    - `status` 'inactive' | 'activating' | 'online' | 'offline', required — The status of the device. - Inactive: The miru agent has not yet been installed / authenticated - Activating: The miru agent is currently being installed / authenticated (should only last for a few seconds) - Online: The miru agent has successfully pinged the server within the last 60 seconds. - Offline: The miru agent has not successfully pinged the server within the last 60 seconds (e.g. network issues, device is powered off, etc.)
    - `agent_version` string, nullable, required — The version of the agent the device is running.
    - `last_connected_at` string, date-time, nullable, required — Timestamp of when the device was last made an initial connection (this is not the same as the last time the device was seen).
    - `last_disconnected_at` string, date-time, nullable, required — Timestamp of when the device was last disconnected (this is not the same as the last time the device was seen).
    - `created_at` string, date-time, required — Timestamp of when the device was created.
    - `updated_at` string, date-time, required — Timestamp of when the device was last updated.
    - `current_deployment` Deployment — recursive
    - `current_release` Release
      - `object` 'release', required — The object type, which is always `release`.
      - `id` string, required — ID of the release.
      - `version` string, required — The version of the release.
      - `git_commit_id` string, nullable, required — The ID of the git commit associated with this release.
      - `created_at` string, date-time, required — Timestamp of when the release was created.
      - `updated_at` string, date-time, required — Timestamp of when the release was last updated.
      - `config_schemas` ConfigSchema[] — Expand the config schemas using 'expand=config_schemas' in the query string.
        - `object` 'config_schema', required — The object type, which is always `config_schema`.
        - `id` string, required — ID of the config schema.
        - `digest` string, required — The digest of the config schema.
        - `config_type_name` string, required — The name of the config type.
        - `instance_filepath` string, required — The absolute file system path where config instances for this schema are written.
        - `created_at` string, date-time, required — Timestamp of when the config schema was created.
        - `updated_at` string, date-time, required — Timestamp of when the config schema was last updated.
        - `config_type_id` string, required — ID of the config type.
        - `language` 'jsonschema' | 'cue', required
        - `format` 'json' | 'yaml' | 'cue', required
        - `documents` SchemaDocument[]
          - `id` string, required — The unique identifier for this document.
          - `name` string, required — The document filename.
          - `data` string, required — The raw document content.
        - `config_type` ConfigType
          - `object` 'config_type', required — The object type, which is always `config_type`.
          - `id` string, required — ID of the config type.
          - `name` string, required — Name of the config type.
          - `slug` string, required — An immutable, code-friendly name for the config type.
          - `created_at` string, date-time, required — Timestamp of when the config type was created.
          - `updated_at` string, date-time, required — Timestamp of when the config type was last updated.
  - `release` Release
    - `object` 'release', required — The object type, which is always `release`.
    - `id` string, required — ID of the release.
    - `version` string, required — The version of the release.
    - `git_commit_id` string, nullable, required — The ID of the git commit associated with this release.
    - `created_at` string, date-time, required — Timestamp of when the release was created.
    - `updated_at` string, date-time, required — Timestamp of when the release was last updated.
    - `config_schemas` ConfigSchema[] — Expand the config schemas using 'expand=config_schemas' in the query string.
      - `object` 'config_schema', required — The object type, which is always `config_schema`.
      - `id` string, required — ID of the config schema.
      - `digest` string, required — The digest of the config schema.
      - `config_type_name` string, required — The name of the config type.
      - `instance_filepath` string, required — The absolute file system path where config instances for this schema are written.
      - `created_at` string, date-time, required — Timestamp of when the config schema was created.
      - `updated_at` string, date-time, required — Timestamp of when the config schema was last updated.
      - `config_type_id` string, required — ID of the config type.
      - `language` 'jsonschema' | 'cue', required
      - `format` 'json' | 'yaml' | 'cue', required
      - `documents` SchemaDocument[]
        - `id` string, required — The unique identifier for this document.
        - `name` string, required — The document filename.
        - `data` string, required — The raw document content.
      - `config_type` ConfigType
        - `object` 'config_type', required — The object type, which is always `config_type`.
        - `id` string, required — ID of the config type.
        - `name` string, required — Name of the config type.
        - `slug` string, required — An immutable, code-friendly name for the config type.
        - `created_at` string, date-time, required — Timestamp of when the config type was created.
        - `updated_at` string, date-time, required — Timestamp of when the config type was last updated.
  - `config_instances` ConfigInstance[] — Expand the config instances using 'expand=config_instances' in the query string.
    - `object` 'config_instance', required — The object type, which is always `config_instance`.
    - `id` string, required — ID of the config instance.
    - `config_type_name` string, required — The name of the config type.
    - `filepath` string, required — The absolute file system path where this config instance is written.
    - `created_at` string, date-time, required — The timestamp of when the config instance was created.
    - `config_schema_id` string, required — ID of the config schema which the config instance must adhere to.
    - `config_type_id` string, required — ID of the config type which the config instance (and its schema) is a part of.
    - `config_schema` ConfigSchema
      - `object` 'config_schema', required — The object type, which is always `config_schema`.
      - `id` string, required — ID of the config schema.
      - `digest` string, required — The digest of the config schema.
      - `config_type_name` string, required — The name of the config type.
      - `instance_filepath` string, required — The absolute file system path where config instances for this schema are written.
      - `created_at` string, date-time, required — Timestamp of when the config schema was created.
      - `updated_at` string, date-time, required — Timestamp of when the config schema was last updated.
      - `config_type_id` string, required — ID of the config type.
      - `language` 'jsonschema' | 'cue', required
      - `format` 'json' | 'yaml' | 'cue', required
      - `documents` SchemaDocument[]
        - `id` string, required — The unique identifier for this document.
        - `name` string, required — The document filename.
        - `data` string, required — The raw document content.
      - `config_type` ConfigType
        - `object` 'config_type', required — The object type, which is always `config_type`.
        - `id` string, required — ID of the config type.
        - `name` string, required — Name of the config type.
        - `slug` string, required — An immutable, code-friendly name for the config type.
        - `created_at` string, date-time, required — Timestamp of when the config type was created.
        - `updated_at` string, date-time, required — Timestamp of when the config type was last updated.
    - `config_type` ConfigType
      - `object` 'config_type', required — The object type, which is always `config_type`.
      - `id` string, required — ID of the config type.
      - `name` string, required — Name of the config type.
      - `slug` string, required — An immutable, code-friendly name for the config type.
      - `created_at` string, date-time, required — Timestamp of when the config type was created.
      - `updated_at` string, date-time, required — Timestamp of when the config type was last updated.
    - `content` InstanceContent
      - `format` 'json' | 'yaml' | 'jsonc', required
      - `data` string, required — The configuration values associated with the config instance.

---

[API](https://skmtc.dev/mirurobotics/apis/miru-api.md) · [All operations](https://skmtc.dev/mirurobotics/apis/miru-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/mirurobotics/miru-api/revisions/cd84166b2b52/schema)
