Approvals - Update

Update status of an approval

PATCH https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/approvals/{approvalId}?api-version=5.0

URI Parameters

Name In Required Type Description
approvalId
path True

integer

int32

Id of the approval.

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 '5.0' to use this version of the api.

Request Body

Name Type Description
approvalType

ApprovalType

Gets or sets the type of approval.

approvedBy

IdentityRef

Gets the identity who approved.

approver

IdentityRef

Gets or sets the identity who should approve.

attempt

integer

Gets or sets attempt which specifies as which deployment attempt it belongs.

comments

string

Gets or sets comments for approval.

createdOn

string

Gets date on which it got created.

history

ReleaseApprovalHistory[]

Gets history which specifies all approvals associated with this approval.

id

integer

Gets the unique identifier of this field.

isAutomated

boolean

Gets or sets as approval is automated or not.

isNotificationOn

boolean

modifiedOn

string

Gets date on which it got modified.

rank

integer

Gets or sets rank which specifies the order of the approval. e.g. Same rank denotes parallel approval.

release

ReleaseShallowReference

Gets releaseReference which specifies the reference of the release to which this approval is associated.

releaseDefinition

ReleaseDefinitionShallowReference

Gets releaseDefinitionReference which specifies the reference of the release definition to which this approval is associated.

releaseEnvironment

ReleaseEnvironmentShallowReference

Gets releaseEnvironmentReference which specifies the reference of the release environment to which this approval is associated.

revision

integer

Gets the revision number.

status

ApprovalStatus

Gets or sets the status of the approval.

trialNumber

integer

url

string

Gets url to access the approval.

Responses

Name Type Description
200 OK

ReleaseApproval

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.release_manage Grants the ability to read, update and delete release artifacts, including releases, release definitions and release envrionment, and the ability to queue and approve a new release.

Examples

Approve a release

Sample request

PATCH https://vsrm.dev.azure.com/fabrikam/MyFirstProject/_apis/release/approvals/{approvalId}?api-version=5.0

{
  "status": "approved",
  "comments": "Good to go!"
}

Sample response

{
  "id": 20,
  "revision": 1,
  "approver": {
    "id": "4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
    "displayName": "Chuck Reinhart",
    "uniqueName": "fabfiber@outlook.com",
    "url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
    "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=4adb1680-0eac-6149-b5ee-fc8b4f6ca227"
  },
  "approvedBy": {
    "id": "4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
    "displayName": "Chuck Reinhart",
    "uniqueName": "fabfiber@outlook.com",
    "url": "https://vssps.dev.azure.com/fabrikam/_apis/Identities/4adb1680-0eac-6149-b5ee-fc8b4f6ca227",
    "imageUrl": "https://dev.azure.com/fabrikam/_api/_common/identityImage?id=4adb1680-0eac-6149-b5ee-fc8b4f6ca227"
  },
  "approvalType": "preDeploy",
  "createdOn": "2017-05-31T18:07:40.45Z",
  "modifiedOn": "2017-05-31T18:08:09.577Z",
  "status": "approved",
  "comments": "Good to go!",
  "isAutomated": false,
  "isNotificationOn": true,
  "trialNumber": 1,
  "attempt": 1,
  "rank": 1,
  "history": [],
  "release": {
    "id": 3,
    "name": "Release-3",
    "url": "https://https://vsrm.dev.azure.com/fabrikamMyFirstProject/_apis/Release/releases/3",
    "_links": {}
  },
  "releaseDefinition": {
    "id": 1,
    "name": "MyShuttle.CD",
    "url": "https://https://vsrm.dev.azure.com/fabrikamd07908bc-118f-47d2-8a13-ff75601a6b1a/_apis/Release/definitions/1",
    "_links": {}
  },
  "releaseEnvironment": {
    "id": 9,
    "name": "Dev",
    "_links": {}
  },
  "url": "https://https://vsrm.dev.azure.com/fabrikamMyFirstProject/_apis/Release/approvals/20"
}

Definitions

Name Description
ApprovalStatus

Gets or sets the status of the approval.

ApprovalType

Gets or sets the type of approval.

IdentityRef
ProjectReference
ReferenceLinks

The class to represent a collection of REST reference links.

ReleaseApproval
ReleaseApprovalHistory
ReleaseDefinitionShallowReference
ReleaseEnvironmentShallowReference
ReleaseShallowReference

ApprovalStatus

Gets or sets the status of the approval.

Name Type Description
approved

string

canceled

string

pending

string

reassigned

string

rejected

string

skipped

string

undefined

string

ApprovalType

Gets or sets the type of approval.

Name Type Description
all

string

postDeploy

string

preDeploy

string

undefined

string

IdentityRef

Name Type Description
_links

ReferenceLinks

This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject.

descriptor

string

The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations.

directoryAlias

string

displayName

string

This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider.

id

string

imageUrl

string

inactive

boolean

isAadIdentity

boolean

isContainer

boolean

isDeletedInOrigin

boolean

profileUrl

string

uniqueName

string

url

string

This url is the full route to the source resource of this graph subject.

ProjectReference

Name Type Description
id

string

Gets the unique identifier of this field.

name

string

Gets name of project.

The class to represent a collection of REST reference links.

Name Type Description
links

object

The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only.

ReleaseApproval

Name Type Description
approvalType

ApprovalType

Gets or sets the type of approval.

approvedBy

IdentityRef

Gets the identity who approved.

approver

IdentityRef

Gets or sets the identity who should approve.

attempt

integer

Gets or sets attempt which specifies as which deployment attempt it belongs.

comments

string

Gets or sets comments for approval.

createdOn

string

Gets date on which it got created.

history

ReleaseApprovalHistory[]

Gets history which specifies all approvals associated with this approval.

id

integer

Gets the unique identifier of this field.

isAutomated

boolean

Gets or sets as approval is automated or not.

isNotificationOn

boolean

modifiedOn

string

Gets date on which it got modified.

rank

integer

Gets or sets rank which specifies the order of the approval. e.g. Same rank denotes parallel approval.

release

ReleaseShallowReference

Gets releaseReference which specifies the reference of the release to which this approval is associated.

releaseDefinition

ReleaseDefinitionShallowReference

Gets releaseDefinitionReference which specifies the reference of the release definition to which this approval is associated.

releaseEnvironment

ReleaseEnvironmentShallowReference

Gets releaseEnvironmentReference which specifies the reference of the release environment to which this approval is associated.

revision

integer

Gets the revision number.

status

ApprovalStatus

Gets or sets the status of the approval.

trialNumber

integer

url

string

Gets url to access the approval.

ReleaseApprovalHistory

Name Type Description
approver

IdentityRef

changedBy

IdentityRef

comments

string

createdOn

string

modifiedOn

string

revision

integer

ReleaseDefinitionShallowReference

Name Type Description
_links

ReferenceLinks

Gets the links to related resources, APIs, and views for the release definition.

id

integer

Gets the unique identifier of release definition.

name

string

Gets or sets the name of the release definition.

path

string

Gets or sets the path of the release definition.

projectReference

ProjectReference

Gets or sets project reference.

url

string

Gets the REST API url to access the release definition.

ReleaseEnvironmentShallowReference

Name Type Description
_links

ReferenceLinks

Gets the links to related resources, APIs, and views for the release environment.

id

integer

Gets the unique identifier of release environment.

name

string

Gets or sets the name of the release environment.

url

string

Gets the REST API url to access the release environment.

ReleaseShallowReference

Name Type Description
_links

ReferenceLinks

Gets the links to related resources, APIs, and views for the release.

id

integer

Gets the unique identifier of release.

name

string

Gets or sets the name of the release.

url

string

Gets the REST API url to access the release.