Approvals

Last Update: 3/21/2017

api-version = 3.0-preview.1

On-premises use : An earlier, and slightly different version of the Release Management API is available in Team Foundation Server 2015 Update 2. To use this earlier version, you must specify an API version of 2.2-preview.1.

Get a list of approvals

GET https://{account}.vsrm.visualstudio.com/defaultcollection/{project}/_apis/release/approvals/?api-version={version}[&releaseidFilter={int}&statusFilter={string}&assignedtoFilter={string}]
Parameter Type Notes
URL
account string Your Visual Studio Team Services account.
project string Team project ID or name.
Query
api-version string Version of the API to use.
releaseIdsFilter string Approvals for release id(s) mentioned in the filter. Multiple releases can be mentioned by separating them with ',' e.g. releaseIdsFilter=1,2,3,4
statusFilter enum {
  Approved,
  ReAssigned,
  Rejected
}
Approvals with this status.
assignedToFilter string Approvals assigned to this user. chuckreinhart@outlook.com, for example.

Pending for all users

Sample request

GET https://fabfiber.vsrm.visualstudio.com/DefaultCollection/ff213d65-d61d-447c-b39d-d16f21b18364/_apis/release/approvals?api-version=3.0-preview.1

Sample response

Status code: 200
{
  "count": 4,
  "value": [
    {
      "id": 240,
      "revision": 1,
      "approver": {
        "id": "c1f4b9a6-aee1-41f9-a2e0-070a79973ae9",
        "displayName": "Noah Munger",
        "uniqueName": "noahmunger@outlook.com",
        "url": "https://fabfiber.vssps.visualstudio.com/_apis/Identities/c1f4b9a6-aee1-41f9-a2e0-070a79973ae9",
        "imageUrl": "https://fabfiber.visualstudio.com/DefaultCollection/_api/_common/identityImage?id=c1f4b9a6-aee1-41f9-a2e0-070a79973ae9"
      },
      "approvalType": "preDeploy",
      "createdOn": "2016-04-12T08:14:07.287Z",
      "modifiedOn": "2016-04-12T08:14:07.287Z",
      "status": "pending",
      "comments": "",
      "isAutomated": false,
      "isNotificationOn": true,
      "trialNumber": 1,
      "attempt": 1,
      "rank": 1,
      "release": {
        "id": 119,
        "name": "Release-17",
        "url": "https://fabfiber.vsrm.visualstudio.com/DefaultCollection/ff213d65-d61d-447c-b39d-d16f21b18364/_apis/Release/releases/119"
      },
      "releaseDefinition": {
        "id": 12,
        "name": "Fabrikam-Website",
        "url": "https://fabfiber.vsrm.visualstudio.com/DefaultCollection/ff213d65-d61d-447c-b39d-d16f21b18364/_apis/Release/definitions/12"
      },
      "releaseEnvironment": {
        "id": 258,
        "name": "QA"
      }
    },
    {
      "id": 241,
      "revision": 1,
      "approver": {
        "id": "52a5bc8d-4730-400a-95c7-7276d4ae5953",
        "displayName": "Chuck Reinhart",
        "uniqueName": "chuckreinhart@outlook.com",
        "url": "https://fabfiber.vssps.visualstudio.com/_apis/Identities/52a5bc8d-4730-400a-95c7-7276d4ae5953",
        "imageUrl": "https://fabfiber.visualstudio.com/DefaultCollection/_api/_common/identityImage?id=52a5bc8d-4730-400a-95c7-7276d4ae5953"
      },
      "approvalType": "preDeploy",
      "createdOn": "2016-04-12T08:14:07.297Z",
      "modifiedOn": "2016-04-12T08:14:07.297Z",
      "status": "pending",
      "comments": "",
      "isAutomated": false,
      "isNotificationOn": true,
      "trialNumber": 1,
      "attempt": 1,
      "rank": 1,
      "release": {
        "id": 119,
        "name": "Release-17",
        "url": "https://fabfiber.vsrm.visualstudio.com/DefaultCollection/ff213d65-d61d-447c-b39d-d16f21b18364/_apis/Release/releases/119"
      },
      "releaseDefinition": {
        "id": 12,
        "name": "Fabrikam-Website",
        "url": "https://fabfiber.vsrm.visualstudio.com/DefaultCollection/ff213d65-d61d-447c-b39d-d16f21b18364/_apis/Release/definitions/12"
      },
      "releaseEnvironment": {
        "id": 257,
        "name": "Dev"
      }
    },
    {
      "id": 242,
      "revision": 1,
      "approver": {
        "id": "52a5bc8d-4730-400a-95c7-7276d4ae5953",
        "displayName": "Chuck Reinhart",
        "uniqueName": "chuckreinhart@outlook.com",
        "url": "https://fabfiber.vssps.visualstudio.com/_apis/Identities/52a5bc8d-4730-400a-95c7-7276d4ae5953",
        "imageUrl": "https://fabfiber.visualstudio.com/DefaultCollection/_api/_common/identityImage?id=52a5bc8d-4730-400a-95c7-7276d4ae5953"
      },
      "approvalType": "preDeploy",
      "createdOn": "2016-04-12T08:14:13.97Z",
      "modifiedOn": "2016-04-12T08:14:13.97Z",
      "status": "pending",
      "comments": "",
      "isAutomated": false,
      "isNotificationOn": true,
      "trialNumber": 1,
      "attempt": 1,
      "rank": 1,
      "release": {
        "id": 120,
        "name": "Release-18",
        "url": "https://fabfiber.vsrm.visualstudio.com/DefaultCollection/ff213d65-d61d-447c-b39d-d16f21b18364/_apis/Release/releases/120"
      },
      "releaseDefinition": {
        "id": 12,
        "name": "Fabrikam-Website",
        "url": "https://fabfiber.vsrm.visualstudio.com/DefaultCollection/ff213d65-d61d-447c-b39d-d16f21b18364/_apis/Release/definitions/12"
      },
      "releaseEnvironment": {
        "id": 260,
        "name": "Dev"
      }
    },
    {
      "id": 243,
      "revision": 1,
      "approver": {
        "id": "c1f4b9a6-aee1-41f9-a2e0-070a79973ae9",
        "displayName": "Noah Munger",
        "uniqueName": "noahmunger@outlook.com",
        "url": "https://fabfiber.vssps.visualstudio.com/_apis/Identities/c1f4b9a6-aee1-41f9-a2e0-070a79973ae9",
        "imageUrl": "https://fabfiber.visualstudio.com/DefaultCollection/_api/_common/identityImage?id=c1f4b9a6-aee1-41f9-a2e0-070a79973ae9"
      },
      "approvalType": "preDeploy",
      "createdOn": "2016-04-12T08:14:13.977Z",
      "modifiedOn": "2016-04-12T08:14:13.977Z",
      "status": "pending",
      "comments": "",
      "isAutomated": false,
      "isNotificationOn": true,
      "trialNumber": 1,
      "attempt": 1,
      "rank": 1,
      "release": {
        "id": 120,
        "name": "Release-18",
        "url": "https://fabfiber.vsrm.visualstudio.com/DefaultCollection/ff213d65-d61d-447c-b39d-d16f21b18364/_apis/Release/releases/120"
      },
      "releaseDefinition": {
        "id": 12,
        "name": "Fabrikam-Website",
        "url": "https://fabfiber.vsrm.visualstudio.com/DefaultCollection/ff213d65-d61d-447c-b39d-d16f21b18364/_apis/Release/definitions/12"
      },
      "releaseEnvironment": {
        "id": 261,
        "name": "QA"
      }
    }
  ]
}

Pending for a specific user

Sample request

GET https://fabfiber.vsrm.visualstudio.com/DefaultCollection/ff213d65-d61d-447c-b39d-d16f21b18364/_apis/release/approvals?assignedToFilter=noahmunger@outlook.com&api-version=3.0-preview.1

Sample response

Status code: 200
{
  "count": 2,
  "value": [
    {
      "id": 240,
      "revision": 1,
      "approver": {
        "id": "c1f4b9a6-aee1-41f9-a2e0-070a79973ae9",
        "displayName": "Noah Munger",
        "uniqueName": "noahmunger@outlook.com",
        "url": "https://fabfiber.vssps.visualstudio.com/_apis/Identities/c1f4b9a6-aee1-41f9-a2e0-070a79973ae9",
        "imageUrl": "https://fabfiber.visualstudio.com/DefaultCollection/_api/_common/identityImage?id=c1f4b9a6-aee1-41f9-a2e0-070a79973ae9"
      },
      "approvalType": "preDeploy",
      "createdOn": "2016-04-12T08:14:07.287Z",
      "modifiedOn": "2016-04-12T08:14:07.287Z",
      "status": "pending",
      "comments": "",
      "isAutomated": false,
      "isNotificationOn": true,
      "trialNumber": 1,
      "attempt": 1,
      "rank": 1,
      "release": {
        "id": 119,
        "name": "Release-17",
        "url": "https://fabfiber.vsrm.visualstudio.com/DefaultCollection/ff213d65-d61d-447c-b39d-d16f21b18364/_apis/Release/releases/119"
      },
      "releaseDefinition": {
        "id": 12,
        "name": "Fabrikam-Website",
        "url": "https://fabfiber.vsrm.visualstudio.com/DefaultCollection/ff213d65-d61d-447c-b39d-d16f21b18364/_apis/Release/definitions/12"
      },
      "releaseEnvironment": {
        "id": 258,
        "name": "QA"
      }
    },
    {
      "id": 243,
      "revision": 1,
      "approver": {
        "id": "c1f4b9a6-aee1-41f9-a2e0-070a79973ae9",
        "displayName": "Noah Munger",
        "uniqueName": "noahmunger@outlook.com",
        "url": "https://fabfiber.vssps.visualstudio.com/_apis/Identities/c1f4b9a6-aee1-41f9-a2e0-070a79973ae9",
        "imageUrl": "https://fabfiber.visualstudio.com/DefaultCollection/_api/_common/identityImage?id=c1f4b9a6-aee1-41f9-a2e0-070a79973ae9"
      },
      "approvalType": "preDeploy",
      "createdOn": "2016-04-12T08:14:13.977Z",
      "modifiedOn": "2016-04-12T08:14:13.977Z",
      "status": "pending",
      "comments": "",
      "isAutomated": false,
      "isNotificationOn": true,
      "trialNumber": 1,
      "attempt": 1,
      "rank": 1,
      "release": {
        "id": 120,
        "name": "Release-18",
        "url": "https://fabfiber.vsrm.visualstudio.com/DefaultCollection/ff213d65-d61d-447c-b39d-d16f21b18364/_apis/Release/releases/120"
      },
      "releaseDefinition": {
        "id": 12,
        "name": "Fabrikam-Website",
        "url": "https://fabfiber.vsrm.visualstudio.com/DefaultCollection/ff213d65-d61d-447c-b39d-d16f21b18364/_apis/Release/definitions/12"
      },
      "releaseEnvironment": {
        "id": 261,
        "name": "QA"
      }
    }
  ]
}

Pending for a specific release

Sample request

GET https://fabfiber.vsrm.visualstudio.com/DefaultCollection/ff213d65-d61d-447c-b39d-d16f21b18364/_apis/release/approvals?releaseIdsFilter=120&api-version=3.0-preview.1

Sample response

Status code: 200
{
  "count": 2,
  "value": [
    {
      "id": 242,
      "revision": 1,
      "approver": {
        "id": "52a5bc8d-4730-400a-95c7-7276d4ae5953",
        "displayName": "Chuck Reinhart",
        "uniqueName": "chuckreinhart@outlook.com",
        "url": "https://fabfiber.vssps.visualstudio.com/_apis/Identities/52a5bc8d-4730-400a-95c7-7276d4ae5953",
        "imageUrl": "https://fabfiber.visualstudio.com/DefaultCollection/_api/_common/identityImage?id=52a5bc8d-4730-400a-95c7-7276d4ae5953"
      },
      "approvalType": "preDeploy",
      "createdOn": "2016-04-12T08:14:13.97Z",
      "modifiedOn": "2016-04-12T08:14:13.97Z",
      "status": "pending",
      "comments": "",
      "isAutomated": false,
      "isNotificationOn": true,
      "trialNumber": 1,
      "attempt": 1,
      "rank": 1,
      "release": {
        "id": 120,
        "name": "Release-18",
        "url": "https://fabfiber.vsrm.visualstudio.com/DefaultCollection/ff213d65-d61d-447c-b39d-d16f21b18364/_apis/Release/releases/120"
      },
      "releaseDefinition": {
        "id": 12,
        "name": "Fabrikam-Website",
        "url": "https://fabfiber.vsrm.visualstudio.com/DefaultCollection/ff213d65-d61d-447c-b39d-d16f21b18364/_apis/Release/definitions/12"
      },
      "releaseEnvironment": {
        "id": 260,
        "name": "Dev"
      }
    },
    {
      "id": 243,
      "revision": 1,
      "approver": {
        "id": "c1f4b9a6-aee1-41f9-a2e0-070a79973ae9",
        "displayName": "Noah Munger",
        "uniqueName": "noahmunger@outlook.com",
        "url": "https://fabfiber.vssps.visualstudio.com/_apis/Identities/c1f4b9a6-aee1-41f9-a2e0-070a79973ae9",
        "imageUrl": "https://fabfiber.visualstudio.com/DefaultCollection/_api/_common/identityImage?id=c1f4b9a6-aee1-41f9-a2e0-070a79973ae9"
      },
      "approvalType": "preDeploy",
      "createdOn": "2016-04-12T08:14:13.977Z",
      "modifiedOn": "2016-04-12T08:14:13.977Z",
      "status": "pending",
      "comments": "",
      "isAutomated": false,
      "isNotificationOn": true,
      "trialNumber": 1,
      "attempt": 1,
      "rank": 1,
      "release": {
        "id": 120,
        "name": "Release-18",
        "url": "https://fabfiber.vsrm.visualstudio.com/DefaultCollection/ff213d65-d61d-447c-b39d-d16f21b18364/_apis/Release/releases/120"
      },
      "releaseDefinition": {
        "id": 12,
        "name": "Fabrikam-Website",
        "url": "https://fabfiber.vsrm.visualstudio.com/DefaultCollection/ff213d65-d61d-447c-b39d-d16f21b18364/_apis/Release/definitions/12"
      },
      "releaseEnvironment": {
        "id": 261,
        "name": "QA"
      }
    }
  ]
}

Update status of an approval

PATCH https://{account}.vsrm.visualstudio.com/defaultcollection/{project}/_apis/release/approvals/{approvalid}?api-version={version}
Content-Type: application/json
{
    status:   {status}
    approver: {approver}
    comments: {comments}
}
Parameter Type Notes
URL
account string Your Visual Studio Team Services account.
project string Team project ID or name.
approvalId int ID of the release definition.
Query
api-version string Version of the API to use.
Request body
status enum {
  Approved,
  Rejected,
  Pending,
  ReAssigned
}
The new status.
approver string User to whom the approval has been re-assigned to
Alias of the user. chuckreinhart@outlook.com, for example
comments string Comment by the approver.

Approve

Sample request

PATCH https://fabfiber.vsrm.visualstudio.com/DefaultCollection/ff213d65-d61d-447c-b39d-d16f21b18364/_apis/release/approvals/240?api-version=3.0-preview.1
Content-Type: application/json
{
  "status": "Approved",
  "comments": "Good to go!"
}

Sample response

Status code: 200
{
  "id": 240,
  "revision": 2,
  "approver": {
    "id": "52a5bc8d-4730-400a-95c7-7276d4ae5953",
    "displayName": "Chuck Reinhart",
    "uniqueName": "chuckreinhart@outlook.com",
    "url": "https://fabfiber.vssps.visualstudio.com/_apis/Identities/52a5bc8d-4730-400a-95c7-7276d4ae5953",
    "imageUrl": "https://fabfiber.visualstudio.com/DefaultCollection/_api/_common/identityImage?id=52a5bc8d-4730-400a-95c7-7276d4ae5953"
  },
  "approvedBy": {
    "id": "52a5bc8d-4730-400a-95c7-7276d4ae5953",
    "displayName": "Chuck Reinhart",
    "uniqueName": "chuckreinhart@outlook.com",
    "url": "https://fabfiber.vssps.visualstudio.com/_apis/Identities/52a5bc8d-4730-400a-95c7-7276d4ae5953",
    "imageUrl": "https://fabfiber.visualstudio.com/DefaultCollection/_api/_common/identityImage?id=52a5bc8d-4730-400a-95c7-7276d4ae5953"
  },
  "approvalType": "preDeploy",
  "createdOn": "2016-04-12T08:14:07.287Z",
  "modifiedOn": "2016-04-12T08:27:34.27Z",
  "status": "approved",
  "comments": "Good to go!",
  "isAutomated": false,
  "isNotificationOn": true,
  "trialNumber": 1,
  "attempt": 1,
  "rank": 1,
  "history": [
    {
      "revision": 1,
      "comments": "",
      "approver": {
        "id": "c1f4b9a6-aee1-41f9-a2e0-070a79973ae9",
        "displayName": "Noah Munger",
        "uniqueName": "noahmunger@outlook.com",
        "url": "https://fabfiber.vssps.visualstudio.com/_apis/Identities/c1f4b9a6-aee1-41f9-a2e0-070a79973ae9",
        "imageUrl": "https://fabfiber.visualstudio.com/DefaultCollection/_api/_common/identityImage?id=c1f4b9a6-aee1-41f9-a2e0-070a79973ae9"
      },
      "changedBy": {
        "id": "52a5bc8d-4730-400a-95c7-7276d4ae5953",
        "displayName": "Chuck Reinhart",
        "uniqueName": "chuckreinhart@outlook.com",
        "url": "https://fabfiber.vssps.visualstudio.com/_apis/Identities/52a5bc8d-4730-400a-95c7-7276d4ae5953",
        "imageUrl": "https://fabfiber.visualstudio.com/DefaultCollection/_api/_common/identityImage?id=52a5bc8d-4730-400a-95c7-7276d4ae5953"
      },
      "createdOn": "2016-04-12T08:27:32.9Z",
      "modifiedOn": "2016-04-12T08:27:32.9Z"
    }
  ],
  "release": {
    "id": 119,
    "name": "Release-17",
    "url": "https://fabfiber.vsrm.visualstudio.com/DefaultCollection/ff213d65-d61d-447c-b39d-d16f21b18364/_apis/Release/releases/119"
  },
  "releaseDefinition": {
    "id": 12,
    "name": "Fabrikam-Website",
    "url": "https://fabfiber.vsrm.visualstudio.com/DefaultCollection/ff213d65-d61d-447c-b39d-d16f21b18364/_apis/Release/definitions/12"
  },
  "releaseEnvironment": {
    "id": 258,
    "name": "QA"
  }
}

Re-assign

Sample request

PATCH https://fabfiber.vsrm.visualstudio.com/DefaultCollection/ff213d65-d61d-447c-b39d-d16f21b18364/_apis/release/approvals/240?api-version=3.0-preview.1
Content-Type: application/json
{
  "status": "ReAssigned",
  "comments": "ReAssigning to Chuck",
  "approver": {
    "uniquename": "chuckreinhart@outlook.com"
  }
}

Sample response

Status code: 200
{
  "id": 240,
  "revision": 2,
  "approver": {
    "id": "52a5bc8d-4730-400a-95c7-7276d4ae5953",
    "displayName": "Chuck Reinhart",
    "uniqueName": "chuckreinhart@outlook.com",
    "url": "https://fabfiber.vssps.visualstudio.com/_apis/Identities/52a5bc8d-4730-400a-95c7-7276d4ae5953",
    "imageUrl": "https://fabfiber.visualstudio.com/DefaultCollection/_api/_common/identityImage?id=52a5bc8d-4730-400a-95c7-7276d4ae5953"
  },
  "approvalType": "preDeploy",
  "createdOn": "2016-04-12T08:14:07.287Z",
  "modifiedOn": "2016-04-12T08:27:32.857Z",
  "status": "pending",
  "comments": "",
  "isAutomated": false,
  "isNotificationOn": true,
  "trialNumber": 1,
  "attempt": 1,
  "rank": 1,
  "history": [
    {
      "revision": 1,
      "comments": "ReAssigning to Chuck",
      "approver": {
        "id": "c1f4b9a6-aee1-41f9-a2e0-070a79973ae9",
        "displayName": "Noah Munger",
        "uniqueName": "noahmunger@outlook.com",
        "url": "https://fabfiber.vssps.visualstudio.com/_apis/Identities/c1f4b9a6-aee1-41f9-a2e0-070a79973ae9",
        "imageUrl": "https://fabfiber.visualstudio.com/DefaultCollection/_api/_common/identityImage?id=c1f4b9a6-aee1-41f9-a2e0-070a79973ae9"
      },
      "changedBy": {
        "id": "52a5bc8d-4730-400a-95c7-7276d4ae5953",
        "displayName": "Chuck Reinhart",
        "uniqueName": "chuckreinhart@outlook.com",
        "url": "https://fabfiber.vssps.visualstudio.com/_apis/Identities/52a5bc8d-4730-400a-95c7-7276d4ae5953",
        "imageUrl": "https://fabfiber.visualstudio.com/DefaultCollection/_api/_common/identityImage?id=52a5bc8d-4730-400a-95c7-7276d4ae5953"
      },
      "createdOn": "2016-04-12T08:27:32.9Z",
      "modifiedOn": "2016-04-12T08:27:32.9Z"
    }
  ],
  "release": {
    "id": 119,
    "name": "Release-17",
    "url": "https://fabfiber.vsrm.visualstudio.com/DefaultCollection/ff213d65-d61d-447c-b39d-d16f21b18364/_apis/Release/releases/119"
  },
  "releaseDefinition": {
    "id": 12,
    "name": "Fabrikam-Website",
    "url": "https://fabfiber.vsrm.visualstudio.com/DefaultCollection/ff213d65-d61d-447c-b39d-d16f21b18364/_apis/Release/definitions/12"
  },
  "releaseEnvironment": {
    "id": 258,
    "name": "QA"
  }
}