Approvals

Review approval request for a flag

POST
/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{id}/reviews

Review an approval request by approving or denying changes.

Authorization

ApiKey read, write
Authorization<token>

In: header

Scope: read, write

Path Parameters

projectKey*string

The project key

Formatstring
featureFlagKey*string

The feature flag key

Formatstring
environmentKey*string

The environment key

Formatstring
id*string

The feature flag approval request ID

Formatstring

Request Body

application/json

kind?string

The type of review for this approval request

Value in

  • "approve"
  • "comment"
  • "decline"
comment?string

Optional comment about the approval request

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/v2/projects/string/flags/string/environments/string/approval-requests/string/reviews" \  -H "Content-Type: application/json" \  -d '{}'
{  "_id": "12ab3c45de678910abc12345",  "_version": 1,  "creationDate": "1654104600000",  "serviceKind": "launchdarkly",  "requestorId": "12ab3c45de678910abc12345",  "description": "example: request approval from someone",  "reviewStatus": "pending",  "allReviews": [    {      "_id": "12ab3c45de678910abc12345",      "kind": "approve",      "creationDate": "1653606981113",      "comment": "Approved!",      "memberId": "12ab3c45de678910abc12345",      "serviceTokenId": "12ab3c45de678910abc12345"    }  ],  "notifyMemberIds": [    "1234a56b7c89d012345e678f"  ],  "notifyTeamKeys": [    "example-reviewer-team"  ],  "appliedDate": "1654104600000",  "appliedByMemberId": "1234a56b7c89d012345e678f",  "appliedByServiceTokenId": "1234a56b7c89d012345e678f",  "status": "pending",  "instructions": "[{\"kind\": \"turnFlagOn\"}]",  "conflicts": [    {      "instruction": {        "property1": null,        "property2": null      },      "reason": "string"    }  ],  "_links": {    "property1": null,    "property2": null  },  "executionDate": "1654104600000",  "operatingOnId": "12ab3c45de678910abc12345",  "integrationMetadata": {    "externalId": "string",    "externalStatus": {      "display": "string",      "value": "string"    },    "externalUrl": "string",    "lastChecked": 0  },  "source": {    "key": "source-flag-key-123abc",    "version": 1  },  "customWorkflowMetadata": {    "name": "Example workflow name",    "stage": {      "index": 0,      "name": "Stage 1"    }  }}

Apply approval request for a flag POST

Apply an approval request that has been approved. This endpoint requires a feature flag key, and can only be used for applying approval requests on flags.

Update approval request PATCH

Perform a partial update to an approval request. Updating an approval request uses the semantic patch format. This endpoint works with any approval requests. To make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](https://launchdarkly.com/docs/api#updates-using-semantic-patch). ### Instructions Semantic patch requests support the following `kind` instructions for updating an approval request. #### addReviewers Adds the specified members and teams to the existing list of reviewers. You must include at least one of `notifyMemberIds` and `notifyTeamKeys`. ##### Parameters - `notifyMemberIds`: (Optional) List of member IDs. - `notifyTeamKeys`: (Optional) List of team keys. Here's an example: ```json { "instructions": [{ "kind": "addReviewers", "notifyMemberIds": [ "user-key-123abc", "user-key-456def" ], "notifyTeamKeys": [ "team-key-789abc"] }] } ``` #### updateDescription Updates the description (title) of the approval request. ##### Parameters - `value`: (Required) The new description for the approval request. Must be non-empty and no more than 5000 characters. Here's an example: ```json { "instructions": [{ "kind": "updateDescription", "value": "Updated approval request title" }] } ```