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:457034721476302714390214.
  • projectKey filters for only approvals that correspond to the specified project key. For example: filter=projectKey:my-project.
  • 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, and completed. For example: filter=status:{"anyOf":["pending", "scheduled"]}.

You can also apply multiple filters at once. For example, setting filter=projectKey: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
  • environment includes the environment the approval request belongs 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:value. Supported fields are explained above.

expand
string <string>

A comma-separated list of fields the user wants 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": {
    }
}

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
  • environment includes the environment the approval request belongs 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 the user wants 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",
  • "status": "pending",
  • "instructions": [
    ],
  • "conflicts": [
    ],
  • "_links": {
    },
  • "executionDate": 0,
  • "operatingOnId": "12ab3c45de678910abc12345",
  • "integrationMetadata": {
    },
  • "source": {
    },
  • "customWorkflowMetadata": {
    },
  • "project": {
    },
  • "environment": {
    },
  • "flag": {
    }
}