Skip to content

Create a deployment

POST
/api/v1/deployments
curl --request POST \
--url http://localhost:3000/api/v1/deployments \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <X-API-Key>' \
--data '{ "name": "example", "applicationDescriptionId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "deviceSelector": { "matchLabels": { "additionalProperty": "example" }, "matchExpressions": [ { "key": "example", "operator": "In", "values": [ "example" ] } ] }, "deviceGroupIds": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ], "parameterOverrides": {}, "deploymentProfileId": "example", "deploymentProfileIds": [ "example" ], "targetNamespace": "example", "desiredState": "PENDING", "priority": 1, "scheduledAt": "2026-04-15T12:00:00Z", "metadata": {}, "rolloutConfig": { "strategy": "IMMEDIATE", "canaryPercentage": 1, "canaryCount": 1, "canarySuccessWindowMinutes": 1, "autoPromote": true, "autoPromoteDelayMinutes": 1, "batchSize": 1, "wavePercentages": [ 1 ], "autoProgress": true, "autoProgressDelayMinutes": 1 }, "rollbackConfig": { "enabled": true, "thresholdType": "NONE", "thresholdValue": 1 }, "skipScheduleCheck": true, "scheduleOverrideReason": "example", "skipScopeLimitCheck": true, "scopeLimitOverrideReason": "example", "skipTargetPermissionCheck": true, "targetPermissionOverrideReason": "example", "userId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "groupIds": [ "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" ] }'

Creates a new deployment.

x-organization-id
string format: uuid

UUID of the organization (tenant) the request acts in. It selects the tenant and grants nothing: the server checks membership or an open tenant switch. Not needed for global operations. A malformed value returns 400. API keys are fixed to their own organization; another organization returns 403. The x-organization-source header grants nothing.

Media typeapplication/json
object
name
required

Name of the deployment

string
applicationDescriptionId
required

ID of the application description to deploy

string format: uuid
deviceSelector

Devices to target by device id or labels. Optional when deviceGroupIds is given. At least one of the two is required. Resolved once, at create time.

object
matchLabels

Labels a device must carry (all must match)

object
key
additional properties
string
matchExpressions

Label expressions a device must satisfy (all must match)

Array<object>
<= 100 items
object
key
required

Label key

string
operator
required

Match operator

string
Allowed values: In NotIn Exists DoesNotExist
values

Label values (for In and NotIn)

Array<string>
<= 10000 items
deviceGroupIds

Device groups to target. Their current members are resolved once, at create time, and merged with deviceSelector without duplicates. Devices added to a group later do not receive this deployment. Every id must be a live group of the organization.

Array<string>
<= 100 items unique items
parameterOverrides

Parameter values that override the application defaults

object
key
additional properties
any
deploymentProfileId

ID of the deployment profile to deploy. Required when the application description declares more than one servable profile. Deprecated: use deploymentProfileIds. Sending both is refused.

string
deploymentProfileIds

IDs of the deployment profiles to deploy. Each id creates one deployment, and all of them share one deployment group id. Every id must be declared by the application description. Sending deploymentProfileId as well is refused.

Array<string>
>= 1 items unique items
targetNamespace

Kubernetes namespace for the workload (DNS-1123 label). Defaults to the organization slug.

string
/^[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])?$/
desiredState

Desired state of the deployment

string
Allowed values: PENDING INSTALLING INSTALLED FAILED REMOVING REMOVED
priority

Priority

number
<= 100
scheduledAt

When the deployment is scheduled to start (ISO 8601)

string format: date-time
metadata

Free-form metadata

object
key
additional properties
any
rolloutConfig

Rollout configuration. Defaults to IMMEDIATE.

object
strategy
required

Rollout strategy. CANARY needs exactly one of canaryPercentage or canaryCount. ROLLING needs exactly one of batchSize or wavePercentages. Fields of another strategy are rejected.

string
Allowed values: IMMEDIATE CANARY ROLLING
canaryPercentage

Percentage of instances to deploy as canary. CANARY only, alternative to canaryCount.

number
>= 1 <= 50
canaryCount

Absolute number of canary devices. CANARY only, alternative to canaryPercentage.

number
>= 1 <= 10000
canarySuccessWindowMinutes

Minutes every canary device has to report installed before the rollout halts. Defaults to 30. CANARY only.

number
>= 1 <= 1440
autoPromote

Whether to promote automatically after the validation period. CANARY only.

boolean
autoPromoteDelayMinutes

Minutes to wait before auto-promoting, if autoPromote is true. CANARY only.

number
<= 10080
batchSize

Number of instances per wave. ROLLING only, alternative to wavePercentages.

number
>= 1 <= 10000
wavePercentages

Ordered wave sizes in percent of the targeted devices. For example [10] means 10% first, then the remaining 90%. Each value is 1-100 and the sum is at most 100. ROLLING only, alternative to batchSize.

Array<number>
>= 1 items <= 20 items
autoProgress

Whether to progress to the next batch automatically. ROLLING only.

boolean
autoProgressDelayMinutes

Minutes to wait before progressing to the next batch, if autoProgress is true. ROLLING only.

number
<= 10080
rollbackConfig

Rollback configuration. Defaults to disabled.

object
enabled
required

Whether auto-rollback is enabled

boolean
thresholdType

Type of threshold to use. Required when enabled is true.

string
Allowed values: NONE PERCENTAGE COUNT
thresholdValue

Threshold value (percentage or count). Required when enabled is true and thresholdType is not NONE.

number
>= 1 <= 100
skipScheduleCheck

Skip the schedule check and deploy outside scheduled windows. Requires the override permission.

boolean
scheduleOverrideReason

Reason for skipping the schedule check. Required if skipScheduleCheck is true.

string
skipScopeLimitCheck

Skip the scope limit check and exceed the user’s scope limit. Requires the override permission.

boolean
scopeLimitOverrideReason

Reason for skipping the scope limit check. Required if skipScopeLimitCheck is true.

string
skipTargetPermissionCheck

Skip the target permission check and deploy to devices outside the user’s target permissions. Requires the override permission.

boolean
targetPermissionOverrideReason

Reason for skipping the target permission check. Required if skipTargetPermissionCheck is true.

string
userId

ID of the user who performs the deployment (used for permission checks)

string format: uuid
groupIds

Group IDs of the user (used for permission checks)

Array<string>

Deployment created successfully

Media typeapplication/json
object
id
required
string format: uuid
organizationId
required
string format: uuid
name
required
string
applicationDescriptionId
required
string format: uuid
deviceSelector
required
object
matchLabels

Labels a device must carry (all must match)

object
key
additional properties
string
matchExpressions

Label expressions a device must satisfy (all must match)

Array<object>
<= 100 items
object
key
required

Label key

string
operator
required

Match operator

string
Allowed values: In NotIn Exists DoesNotExist
values

Label values (for In and NotIn)

Array<string>
<= 10000 items
parameterOverrides
required

Application parameter overrides

object
key
additional properties
any
currentRevision

FM-1447: the revision number the deployment targets (1, then +1 per re-deploy). Set on the detail response only.

number
deploymentProfileId

FM-846: the manifest deploymentProfiles[].id this deployment deploys; absent when the description declared nothing to choose between

string
deploymentProfile

FM-1362: the deployed profile summarised (type + component names); absent when no profile is recorded or it is not in the manifest any more

object
id
required

The manifest deploymentProfiles[].id

string
type

Rc2 wire type of the profile’s own type; absent for an off-spec type

string
Allowed values: helm compose
components
required
Array<object>
object
name
required

Component name

string
deploymentGroupId

FM-1159: the grouping key shared by every deployment created from the same multi-profile submission; absent for an ungrouped deployment

string format: uuid
deploymentGroup

FM-1159: every sibling row of this deployment group, including this one, in creation order. Absent when the deployment is ungrouped.

object
id
required

The deployment group id

string format: uuid
members
required

All members including the deployment this group is attached to, in creation order

Array<object>
object
id
required
string format: uuid
deploymentProfileId

The manifest deploymentProfiles[].id this member deploys

string
status
required
string
Allowed values: PENDING INSTALLING INSTALLED FAILED REMOVING REMOVED
deploymentProfile

FM-1362: the member’s profile summarised (type + components), when resolvable

object
id
required

The manifest deploymentProfiles[].id

string
type

Rc2 wire type of the profile’s own type; absent for an off-spec type

string
Allowed values: helm compose
components
required
Array<object>
object
name
required

Component name

string
targetNamespace

FM-1258: the operator-chosen Margo metadata.namespace; absent when the organization slug (tenant default) is used

string
targetGroups

FM-1201: the device groups targeted at create time (name snapshots)

Array<object>
object
deviceGroupId

Device group UUID; absent when the group was deleted

string format: uuid
name
required

Name of the group when the deployment was created

string
deleted
required

True when the group no longer exists

boolean
currentName

The live group’s current name, when it differs from the snapshot

string
splitFromDeploymentId

FM-1412: the deployment this one was split from, if any

string format: uuid
deletionRequestedAt

FM-1484: when the deployment was deleted. Set while the removal is not finalised (status is REMOVING); the deployment is then read-only.

string format: date-time
desiredState
required
string
Allowed values: PENDING INSTALLING INSTALLED FAILED REMOVING REMOVED
status
required
string
Allowed values: PENDING INSTALLING INSTALLED FAILED REMOVING REMOVED
statusMessage
string
priority
required

Priority (0-100)

number
scheduledAt
string format: date-time
startedAt
string format: date-time
completedAt
string format: date-time
metadata
required
object
key
additional properties
any
rolloutStrategy
required

Rollout strategy type

string
Allowed values: IMMEDIATE CANARY ROLLING
rolloutPhase
required

Current rollout phase

string
Allowed values: PENDING CANARY_DEPLOYING CANARY_VALIDATING CANARY_PROMOTED ROLLING_IN_PROGRESS PAUSED COMPLETED ROLLED_BACK
rolloutConfig
required

Rollout configuration (strategy-specific)

object
key
additional properties
any
rollbackConfig
required

Rollback configuration (enabled, thresholdType, thresholdValue)

object
key
additional properties
any
currentBatch
required

Current batch number (for rolling/canary)

number
totalBatches
required

Total number of batches

number
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
lastStatusChangeAt

FM-1475: when the deployment last changed state (newest of creation, start, completion and any instance status-history entry). Set on list responses only.

string format: date-time
applicationDescription
object
id
required
string format: uuid
version
required

Application version string

string
applicationPackage
object
id
required
string format: uuid
name
required
string
instances
Array<object>
object
id
required
string format: uuid
deploymentId
required
string format: uuid
deviceId
required
string format: uuid
bundleDigest

Digest of the bundle served to the device

string
status
required
string
Allowed values: PENDING INSTALLING INSTALLED FAILED REMOVING REMOVED
statusMessage
string
lastStatusReportAt
string format: date-time
downloadProgress

Download progress in percent

number
deployAttempts
required

Number of deploy attempts so far

number
lastDeployError
string
componentStatuses
required

FM-845: per-component states from the most recent status report. Empty until the device has reported.

Array<object>
object
name
required

Component name

string
state
required

Component state as reported by the device (rc2, lowercase)

string
error
object
code

Machine-readable error code

string
source

Component or subsystem that raised the error

string
message

Human-readable error message

string
statusError

FM-845: the structured status.error from the most recent report

object
code

Machine-readable error code

string
source

Component or subsystem that raised the error

string
message

Human-readable error message

string
batchNumber

Batch number for rolling updates (1-based)

number
isCanary
required

Whether this instance is part of the canary group

boolean
excludedAt

FM-1301: when the operator removed the deployment from this device alone. The device stays excluded until it is re-included.

string format: date-time
excludedBy

FM-1301: users.id of the operator who removed the deployment from this device

string
edgeDeploymentId

FM-1411: the Margo ApplicationDeployment.id the device knows this item by. Equals deploymentId unless the item was split off another deployment.

string format: uuid
viaDeviceGroupIds

FM-1202: the targeted device groups that contained the device at create time

Array<string>
directTarget

FM-1202: selected directly (device list or label selector)

boolean
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
device
object
id
required
string format: uuid
clientId
required

Margo clientId the device authenticates with

string
name

Device display name

string
status
required

Device status

string
statusHistory

Recent status history entries for this instance (up to 10, newest first)

Array<object>
object
id
required
string format: uuid
status
required

Status the instance moved to

string
message
string
reportedBy

Who or what reported the change

string
createdAt
required
string format: date-time
components

FM-845: per-component states reported at this point in time

Array<object>
object
name
required

Component name

string
state
required

Component state as reported by the device (rc2, lowercase)

string
error
object
code

Machine-readable error code

string
source

Component or subsystem that raised the error

string
message

Human-readable error message

string
error

FM-845: the structured top-level error reported at this point in time

object
code

Machine-readable error code

string
source

Component or subsystem that raised the error

string
message

Human-readable error message

string
instanceCount

Number of targeted instances

number
runningInstances

Number of instances in status INSTALLED

number
failedInstances

Number of instances in status FAILED

number
Example
{
"deviceSelector": {
"matchExpressions": [
{
"operator": "In"
}
]
},
"deploymentProfile": {
"type": "helm"
},
"deploymentGroup": {
"members": [
{
"status": "PENDING",
"deploymentProfile": {
"type": "helm"
}
}
]
},
"desiredState": "PENDING",
"status": "PENDING",
"rolloutStrategy": "IMMEDIATE",
"rolloutPhase": "PENDING",
"instances": [
{
"status": "PENDING"
}
]
}

Bad request - Invalid deployment data

Unauthorized - Invalid or missing authentication

Forbidden — caller lacks required permission