Get Previous Deployment Using API

I’m trying to obtain the previous deployment to an environment using dynamic dashboard API like this.

$uri = “$OctopusURI/api/dashboard/dynamic?environments=Environments-61&projects=Projects-8&includePrevious=True”
$header = @{“X-Octopus-ApiKey” = $octopusApiKey}
$dash = Invoke-RestMethod -Uri $uri -Headers $Header -Method Get

For some reason $dash.PreviousItems doesn’t’ contain anything. I’ve tried different environment and projects and it’s always null. Does this not work anymore, or am I doing something wrong?

Hi Matthew,

Thanks for getting in touch! Unfortunately this property is always empty and the reasoning behind this decision and possible workaround are described here.

Please let me know if there is anything else I can do to help.



Thanks for the reply, however the link goes to a deleted or private post

Matt Olson

On May 16, 2017 9:17 PM, Pawel Pabich wrote:

Hi Matt,

Sorry about that. I didn’t check the status of this conversation but the summary of it is that we don’t populate this property as it is very expensive.

To get previous deployments you would have to use our [deployments API] (

Please let me know you go