Leases - Get Retention Leases By User Id
Returns any leases owned by the specified user, optionally scoped to a single pipeline definition and run.
GET https://dev.azure.com/{organization}/{project}/_apis/build/retention/leases?userOwnerId={userOwnerId}&api-version=7.1
GET https://dev.azure.com/{organization}/{project}/_apis/build/retention/leases?userOwnerId={userOwnerId}&definitionId={definitionId}&runId={runId}&api-version=7.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 '7.1' to use this version of the api. |
|
user
|
query | True |
string (uuid) |
The user id to search for. |
|
definition
|
query |
integer (int32) |
An optional parameter to limit the search to a specific pipeline definition. |
|
|
run
|
query |
integer (int32) |
An optional parameter to limit the search to a single pipeline run. Requires definitionId. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
successful operation |
Security
oauth2
Type:
oauth2
Flow:
accessCode
Authorization URL:
https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token URL:
https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer
Scopes
| Name | Description |
|---|---|
| vso.build | Grants the ability to access build artifacts, including build results, definitions, and requests, and the ability to receive notifications about build events via service hooks. |
Definitions
RetentionLease
A valid retention lease prevents automated systems from deleting a pipeline run.
| Name | Type | Description |
|---|---|---|
| createdOn |
string (date-time) |
When the lease was created. |
| definitionId |
integer (int32) |
The pipeline definition of the run. |
| leaseId |
integer (int32) |
The unique identifier for this lease. |
| ownerId |
string |
Non-unique string that identifies the owner of a retention lease. |
| protectPipeline |
boolean |
If set, this lease will also prevent the pipeline from being deleted while the lease is still valid. |
| runId |
integer (int32) |
The pipeline run protected by this lease. |
| validUntil |
string (date-time) |
The last day the lease is considered valid. |