---
title: "Get a Machine Policy by ID"
method: GET
path: "/spaces/{spaceIdentifier}/machinepolicies/{id}"
tags: ["MachinePolicies"]
---

# Get a Machine Policy by ID

`GET /spaces/{spaceIdentifier}/machinepolicies/{id}`

## Path parameters

- `spaceIdentifier` string, required
- `id` string, required

## Response `200`

The requested machine policy

- MachinePolicyResource
  - `ConnectionConnectTimeout` string, date-span
  - `ConnectionRetryCountLimit` integer
  - `ConnectionRetrySleepInterval` string, date-span
  - `ConnectionRetryTimeLimit` string, date-span
  - `Description` string
  - `Id` string
  - `IsDefault` boolean
  - `LastModifiedBy` string
  - `LastModifiedOn` string, date-time
  - `Links` object
  - `MachineCleanupPolicy` MachineCleanupPolicyResource
    - `DeleteMachinesBehavior` 'DoNotDelete' | 'DeleteUnavailableMachines'
    - `DeleteMachinesElapsedTimeSpan` string, date-span
  - `MachineConnectivityPolicy` MachineConnectivityPolicyResource
    - `MachineConnectivityBehavior` 'ExpectedToBeOnline' | 'MayBeOfflineAndCanBeSkipped'
  - `MachineHealthCheckPolicy` MachineHealthCheckPolicyResource
    - `BashHealthCheckPolicy` MachineScriptPolicyResource
      - `RunType` 'InheritFromDefault' | 'Inline' | 'OnlyConnectivity'
      - `ScriptBody` string
    - `HealthCheckCron` string
    - `HealthCheckCronTimezone` string
    - `HealthCheckInterval` string, date-span
    - `HealthCheckType` 'RunScript' | 'OnlyConnectivity'
    - `PowerShellHealthCheckPolicy` MachineScriptPolicyResource
      - `RunType` 'InheritFromDefault' | 'Inline' | 'OnlyConnectivity'
      - `ScriptBody` string
  - `MachinePackageCacheRetentionPolicy` MachinePackageCacheRetentionPolicyResource
    - `PackageUnit` 'Items'
    - `QuantityOfPackagesToKeep` integer
    - `QuantityOfVersionsToKeep` integer
    - `Strategy` 'Default' | 'Quantities'
    - `VersionUnit` 'Items'
  - `MachineRpcCallRetryPolicy` MachineRpcCallRetryPolicyResource
    - `Enabled` boolean
    - `HealthCheckRetryDuration` string, date-span
    - `RetryDuration` string, date-span
  - `MachineUpdatePolicy` MachineUpdatePolicyResource
    - `CalamariUpdateBehavior` 'UpdateOnDeployment' | 'UpdateOnNewMachine' | 'UpdateAlways'
    - `KubernetesAgentUpdateBehavior` 'NeverUpdate' | 'Update' | 'Block'
    - `TentacleUpdateAccountId` string
    - `TentacleUpdateBehavior` 'NeverUpdate' | 'Update'
  - `Name` string
  - `PollingRequestQueueTimeout` string, date-span
  - `SpaceId` string

## Other responses

- `400` — Bad request. Either the payload was not structurally valid or business rules did not permit the operation.
- `404` — Not found. One or more of the entities involved in the operation was not found.

---

[API](https://skmtc.net/octopus/apis/octopus-server-api.md) · [All operations](https://skmtc.net/octopus/apis/octopus-server-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/octopus/octopus-server-api/versions/bc9158facfc7/schema)
