Leases - Get Retention Leases By Owner Id

Returns any leases owned by the specified entity, optionally scoped to a single pipeline definition and run.

GET https://dev.azure.com/{organization}/{project}/_apis/build/retention/leases?api-version=6.0-preview.1
GET https://dev.azure.com/{organization}/{project}/_apis/build/retention/leases?ownerId={ownerId}&definitionId={definitionId}&runId={runId}&api-version=6.0-preview.1

URI Parameters

Name In Required Type Description
organization
path True

string

The name of the Azure DevOps organization.

project
path True

string

Project ID or project name

api-version
query True

string

Version of the API to use. This should be set to '6.0-preview.1' to use this version of the api.

definitionId
query

integer

int32

An optional parameter to limit the search to a specific pipeline definition.

ownerId
query

string

runId
query

integer

int32

An optional parameter to limit the search to a single pipeline run. Requires definitionId.

Responses

Name Type Description
200 OK

RetentionLease[]

successful operation

Security

accessToken

Personal access token. Use any value for the user name and the token as the password.

Type: basic

Definitions

RetentionLease

A valid retention lease prevents automated systems from deleting a pipeline run.

Name Type Description
createdOn

string

When the lease was created.

definitionId

integer

The pipeline definition of the run.

leaseId

integer

The unique identifier for this lease.

ownerId

string

Non-unique string that identifies the owner of a retention lease.

runId

integer

The pipeline run protected by this lease.

validUntil

string

The last day the lease is considered valid.