Skip to main content

Device Deployments

Deployment endpoints provide access to enrollment deployment history for a device. Each record in device_deployments represents a single enrollment event -- when an enrollment token was used to deploy the agent to a device.

Load this data alongside Get Device to show deployment status on the device detail page.

Endpoints

EndpointMethodDescription
List DeploymentsGETPaginated deployment history for a device
Get DeploymentGETFull deployment record with error logs

List Deployments

GET /clients/{client_id}/devices/{device_id}/deployments

Returns a paginated list of enrollment deployments for a device, ordered by enrollment_date descending (newest first). The first item represents the most recent deployment attempt.

Path Parameters

ParameterTypeDescription
client_idstring (uuid)Unique identifier for the client organization
device_idstring (uuid)Unique identifier for the device

Query Parameters

ParameterTypeDefaultDescription
statusstring-Filter by deployment status: success, error, pending
sort_bystringenrollment_dateSort field: enrollment_date, status, created_at
sort_orderstringdescSort direction: asc, desc
page_sizeinteger50Items per page. Max: 500
cursorstring-Pagination cursor from a previous response

Response

FieldTypeDescription
dataDeviceDeploymentRef[]Array of deployment objects
total_countintegerTotal number of deployments matching filters
next_cursorstring | nullCursor for the next page. null when on the last page.

Example Request

curl -X GET "https://api.example.com/v2/clients/aa7cf840-9ca9-46a3-9778-9015d6580d50/devices/f1e2d3c4-b5a6-7890-abcd-ef1234567890/deployments" \
-H "Authorization: Bearer YOUR_API_TOKEN"

Example Response

{
"data": [
{
"id": "d1e2f3a4-b5c6-7890-abcd-ef1234567890",
"status": "success",
"enrollment_date": "2026-01-30T14:30:00.000Z"
},
{
"id": "c2d3e4f5-a6b7-8901-bcde-f12345678901",
"status": "error",
"enrollment_date": "2026-01-29T09:00:00.000Z"
}
],
"total_count": 2,
"next_cursor": null
}

Filter by Status

curl -X GET "https://api.example.com/v2/clients/aa7cf840-9ca9-46a3-9778-9015d6580d50/devices/f1e2d3c4-b5a6-7890-abcd-ef1234567890/deployments?status=error" \
-H "Authorization: Bearer YOUR_API_TOKEN"

Get Deployment

GET /clients/{client_id}/devices/{device_id}/deployments/{deployment_id}

Returns the full DeviceDeployment record for a single deployment event, including error logs.

Path Parameters

ParameterTypeDescription
client_idstring (uuid)Unique identifier for the client organization
device_idstring (uuid)Unique identifier for the device
deployment_idstring (uuid)Unique identifier for the deployment event

Response

Returns a single DeviceDeployment object.

Example Request

curl -X GET "https://api.example.com/v2/clients/aa7cf840-9ca9-46a3-9778-9015d6580d50/devices/f1e2d3c4-b5a6-7890-abcd-ef1234567890/deployments/c2d3e4f5-a6b7-8901-bcde-f12345678901" \
-H "Authorization: Bearer YOUR_API_TOKEN"

Example Response (Error Deployment)

{
"id": "c2d3e4f5-a6b7-8901-bcde-f12345678901",
"status": "error",
"enrollment_date": "2026-01-29T09:00:00.000Z",
"enrollment_token_id": "e1f2a3b4-c5d6-7890-abcd-ef1234567890",
"user_id": "a1d97031-04e2-4907-a249-093f7436207b",
"error_logs": [
"2026-01-29T09:00:01Z: Starting deployment...",
"2026-01-29T09:00:05Z: Downloading agent package...",
"2026-01-29T09:00:15Z: Installation failed - insufficient permissions",
"2026-01-29T09:00:15Z: Deployment aborted"
],
"created_at": "2026-01-29T09:00:00.000Z",
"updated_at": "2026-01-29T09:00:15.000Z"
}

Example Response (Successful Deployment)

{
"id": "d1e2f3a4-b5c6-7890-abcd-ef1234567890",
"status": "success",
"enrollment_date": "2026-01-30T14:30:00.000Z",
"enrollment_token_id": "e1f2a3b4-c5d6-7890-abcd-ef1234567890",
"user_id": null,
"error_logs": null,
"created_at": "2026-01-30T14:30:00.000Z",
"updated_at": "2026-01-30T14:30:45.000Z"
}

Error Responses

StatusDescription
400Invalid query parameters (e.g. unknown sort_by value)
401Authentication required
403Insufficient permissions for this client
404Device, client, or deployment not found
500Server error

Example Error Response

{
"error": {
"code": "not_found",
"message": "Deployment not found",
"details": {
"deployment_id": "c2d3e4f5-a6b7-8901-bcde-f12345678901"
}
}
}

Notes

  • Deployments are sorted by enrollment_date descending by default (newest first)
  • The first deployment in the list represents the most recent enrollment attempt
  • error_logs is only populated for failed deployments; successful deployments return null
  • status values:
    • success -- Enrollment completed successfully
    • error -- Enrollment failed (check error_logs in the detail endpoint)
    • pending -- Enrollment in progress