Approvals (beta)

This feature is in beta

To use this feature, pass in a header including the LD-API-Version key with value set to beta. Use this header with each call. To learn more, read Beta resources.

Resources that are in beta are still undergoing testing and development. They may change without notice, including becoming backwards incompatible.

List approval requests

Get all approval requests.

Filtering approvals

LaunchDarkly supports the filter query param for filtering, with the following fields:

  • notifyMemberIds filters for only approvals that are assigned to a member in the specified list. For example: filter=notifyMemberIds anyOf ["memberId1", "memberId2"].
  • requestorId filters for only approvals that correspond to the ID of the member who requested the approval. For example: filter=requestorId equals 457034721476302714390214.
  • resourceId filters for only approvals that correspond to the the specified resource identifier. For example: filter=resourceId equals proj/my-project:env/my-environment:flag/my-flag.
  • reviewStatus filters for only approvals which correspond to the review status in the specified list. The possible values are approved, declined, and pending. For example: filter=reviewStatus anyOf ["pending", "approved"].
  • status filters for only approvals which correspond to the status in the specified list. The possible values are pending, scheduled, failed, and completed. For example: filter=status anyOf ["pending", "scheduled"].

You can also apply multiple filters at once. For example, setting filter=projectKey equals my-project, reviewStatus anyOf ["pending","approved"] matches approval requests which correspond to the my-project project key, and a review status of either pending or approved.

Expanding approval response

LaunchDarkly supports the expand query param to include additional fields in the response, with the following fields:

  • flag includes the flag the approval request belongs to
  • project includes the project the approval request belongs to
  • environments includes the environments the approval request relates to

For example, expand=project,flag includes the project and flag fields in the response.

Request
query Parameters
filter
string <string>

A comma-separated list of filters. Each filter is of the form field operator value. Supported fields are explained above.

expand
string <string>

A comma-separated list of fields to expand in the response. Supported fields are explained above.

limit
integer <int64>

The number of approvals to return. Defaults to -1, which returns all approvals.

offset
integer <int64>

Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query limit.

Responses
200

Approval request collection response

400

Unsupported filter field. Filter field must be one of: requestorId, projectKey, notifyMemberIds, reviewStatus, or status

401

Invalid access token

403

Forbidden

429

Rate limited

get/api/v2/approval-requests
Request samples
Response samples
application/json
{
  • "items": [
    ],
  • "totalCount": 1,
  • "_links": {
    }
}

Create approval request

Create an approval request.

This endpoint currently supports creating an approval request for a flag across all environments with the following instructions:

  • addVariation
  • removeVariation
  • updateVariation
  • updateDefaultVariation

For details on using these instructions, read Update feature flag.

To create an approval for a flag specific to an environment, use Create approval request for a flag.

Request
Request Body schema: application/json
resourceId
required
string

String representation of a resource

comment
string

Optional comment describing the approval request

description
required
string

A brief description of the changes you're requesting

required
Array of objects (Instructions)
notifyMemberIds
Array of strings

An array of member IDs. These members are notified to review the approval request.

notifyTeamKeys
Array of strings

An array of team keys. The members of these teams are notified to review the approval request.

object (FormVariableConfig)
Responses
201

Approval request response

400

Invalid request

401

Invalid access token

403

Forbidden

429

Rate limited

post/api/v2/approval-requests
Request samples
application/json
{
  • "resourceId": "string",
  • "comment": "optional comment",
  • "description": "Requesting to update targeting",
  • "instructions": [
    ],
  • "notifyMemberIds": [
    ],
  • "notifyTeamKeys": [
    ],
  • "integrationConfig": {
    }
}
Response samples
application/json
{
  • "_id": "12ab3c45de678910abc12345",
  • "_version": 1,
  • "creationDate": 0,
  • "serviceKind": "string",
  • "requestorId": "12ab3c45de678910abc12345",
  • "description": "example: request approval from someone",
  • "reviewStatus": "pending",
  • "allReviews": [
    ],
  • "notifyMemberIds": [
    ],
  • "appliedDate": 0,
  • "appliedByMemberId": "1234a56b7c89d012345e678f",
  • "appliedByServiceTokenId": "1234a56b7c89d012345e678f",
  • "status": "pending",
  • "instructions": [
    ],
  • "conflicts": [
    ],
  • "_links": {
    },
  • "executionDate": 0,
  • "operatingOnId": "12ab3c45de678910abc12345",
  • "integrationMetadata": {
    },
  • "source": {
    },
  • "customWorkflowMetadata": {
    },
  • "resourceId": "string",
  • "approvalSettings": {
    }
}

Get approval request

Get an approval request by approval request ID.

Expanding approval response

LaunchDarkly supports the expand query param to include additional fields in the response, with the following fields:

  • flag includes the flag the approval request belongs to
  • project includes the project the approval request belongs to
  • environments includes the environments the approval request relates to

For example, expand=project,flag includes the project and flag fields in the response.

Request
path Parameters
id
required
string <string>

The approval request ID

query Parameters
expand
string <string>

A comma-separated list of fields to expand in the response. Supported fields are explained above.

Responses
200

Approval request response

400

Invalid Request

401

Invalid access token

403

Forbidden

404

Unable to find approval request

429

Rate limited

get/api/v2/approval-requests/{id}
Request samples
Response samples
application/json
{
  • "_id": "12ab3c45de678910abc12345",
  • "_version": 1,
  • "creationDate": 0,
  • "serviceKind": "string",
  • "requestorId": "12ab3c45de678910abc12345",
  • "description": "example: request approval from someone",
  • "reviewStatus": "pending",
  • "allReviews": [
    ],
  • "notifyMemberIds": [
    ],
  • "appliedDate": 0,
  • "appliedByMemberId": "1234a56b7c89d012345e678f",
  • "appliedByServiceTokenId": "1234a56b7c89d012345e678f",
  • "status": "pending",
  • "instructions": [
    ],
  • "conflicts": [
    ],
  • "_links": {
    },
  • "executionDate": 0,
  • "operatingOnId": "12ab3c45de678910abc12345",
  • "integrationMetadata": {
    },
  • "source": {
    },
  • "customWorkflowMetadata": {
    },
  • "resourceId": "string",
  • "approvalSettings": {
    },
  • "project": {
    },
  • "environments": [
    ],
  • "flag": {
    }
}

Delete approval request

Delete an approval request.

Request
path Parameters
id
required
string <string>

The approval request ID

Responses
204

Action succeeded

401

Invalid access token

403

Forbidden

404

Invalid resource identifier

429

Rate limited

delete/api/v2/approval-requests/{id}
Request samples
Response samples
application/json
{
  • "code": "unauthorized",
  • "message": "Invalid access token"
}

Apply approval request

Apply an approval request that has been approved.

Request
path Parameters
id
required
string <string>

The feature flag approval request ID

Request Body schema: application/json
comment
string

Optional comment about the approval request

Responses
200

Approval request apply response

400

Invalid request

401

Invalid access token

403

Forbidden

404

Invalid resource identifier

429

Rate limited

post/api/v2/approval-requests/{id}/apply
Request samples
application/json
{
  • "comment": "Looks good, thanks for updating"
}
Response samples
application/json
{
  • "_id": "12ab3c45de678910abc12345",
  • "_version": 1,
  • "creationDate": 0,
  • "serviceKind": "string",
  • "requestorId": "12ab3c45de678910abc12345",
  • "description": "example: request approval from someone",
  • "reviewStatus": "pending",
  • "allReviews": [
    ],
  • "notifyMemberIds": [
    ],
  • "appliedDate": 0,
  • "appliedByMemberId": "1234a56b7c89d012345e678f",
  • "appliedByServiceTokenId": "1234a56b7c89d012345e678f",
  • "status": "pending",
  • "instructions": [
    ],
  • "conflicts": [
    ],
  • "_links": {
    },
  • "executionDate": 0,
  • "operatingOnId": "12ab3c45de678910abc12345",
  • "integrationMetadata": {
    },
  • "source": {
    },
  • "customWorkflowMetadata": {
    },
  • "resourceId": "string",
  • "approvalSettings": {
    }
}

Review approval request

Review an approval request by approving or denying changes.

Request
path Parameters
id
required
string <string>

The approval request ID

Request Body schema: application/json
kind
string

The type of review for this approval request

Enum: "approve" "comment" "decline"
comment
string

Optional comment about the approval request

Responses
200

Approval request review response

400

Invalid request

401

Invalid access token

404

Invalid resource identifier

429

Rate limited

post/api/v2/approval-requests/{id}/reviews
Request samples
application/json
{
  • "kind": "approve",
  • "comment": "Looks good, thanks for updating"
}
Response samples
application/json
{
  • "_id": "12ab3c45de678910abc12345",
  • "_version": 1,
  • "creationDate": 0,
  • "serviceKind": "string",
  • "requestorId": "12ab3c45de678910abc12345",
  • "description": "example: request approval from someone",
  • "reviewStatus": "pending",
  • "allReviews": [
    ],
  • "notifyMemberIds": [
    ],
  • "appliedDate": 0,
  • "appliedByMemberId": "1234a56b7c89d012345e678f",
  • "appliedByServiceTokenId": "1234a56b7c89d012345e678f",
  • "status": "pending",
  • "instructions": [
    ],
  • "conflicts": [
    ],
  • "_links": {
    },
  • "executionDate": 0,
  • "operatingOnId": "12ab3c45de678910abc12345",
  • "integrationMetadata": {
    },
  • "source": {
    },
  • "customWorkflowMetadata": {
    },
  • "resourceId": "string",
  • "approvalSettings": {
    }
}