List approval requests
Get all approval requests.
Filtering approvals
LaunchDarkly supports the filter query param for filtering, with the following fields:
notifyMemberIdsfilters for only approvals that are assigned to a member in the specified list. For example:filter=notifyMemberIds anyOf ["memberId1", "memberId2"].requestorIdfilters for only approvals that correspond to the ID of the member who requested the approval. For example:filter=requestorId equals 457034721476302714390214.resourceIdfilters 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.resourceKindfilters for only approvals that correspond to the specified resource kind. For example:filter=resourceKind equals flag. Currently,flag,segment, andaiConfigresource kinds are supported.reviewStatusfilters for only approvals which correspond to the review status in the specified list. The possible values areapproved,declined, andpending. For example:filter=reviewStatus anyOf ["pending", "approved"].statusfilters for only approvals which correspond to the status in the specified list. The possible values arepending,scheduled,failed, andcompleted. 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:
flagincludes the flag the approval request belongs toprojectincludes the project the approval request belongs toenvironmentsincludes the environments the approval request relates to
For example, expand=project,flag includes the project and flag fields in the response.
Authorization
ApiKey read, writeIn: header
Scope: read, write
Query Parameters
A comma-separated list of filters. Each filter is of the form field operator value. Supported fields are explained above.
stringA comma-separated list of fields to expand in the response. Supported fields are explained above.
stringThe number of approvals to return. Defaults to 20. Maximum limit is 200.
int64Where 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.
int64Response Body
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/api/v2/approval-requests"{ "items": [ { "_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" } }, "resourceId": "string", "approvalSettings": { "required": true, "bypassApprovalsForPendingChanges": false, "minNumApprovals": 1, "canReviewOwnRequest": false, "canApplyDeclinedChanges": true, "autoApplyApprovedChanges": true, "serviceKind": "launchdarkly", "serviceConfig": {}, "requiredApprovalTags": [ "require-approval" ], "serviceKindConfigurationId": "1ef45a85-218f-4428-a8b2-a97e5f56c258" }, "project": { "_links": { "environments": { "href": "/api/v2/projects/my-project/environments", "type": "application/json" }, "self": { "href": "/api/v2/projects/my-project", "type": "application/json" } }, "_id": "57be1db38b75bf0772d11383", "key": "project-key-123abc", "includeInSnippetByDefault": true, "defaultClientSideAvailability": { "usingMobileKey": true, "usingEnvironmentId": true }, "name": "My Project", "_access": { "denied": [ { "action": "string", "reason": { "resources": [ "proj/*:env/*;qa_*:/flag/*" ], "notResources": [ "string" ], "actions": [ "*" ], "notActions": [ "string" ], "effect": "allow", "role_name": "string" } } ], "allowed": [ { "action": "string", "reason": { "resources": [ "proj/*:env/*;qa_*:/flag/*" ], "notResources": [ "string" ], "actions": [ "*" ], "notActions": [ "string" ], "effect": "allow", "role_name": "string" } } ] }, "tags": [ "ops" ], "defaultReleasePipelineKey": "string", "environments": { "_links": { "property1": { "href": "string", "type": "string" }, "property2": { "href": "string", "type": "string" } }, "totalCount": 2, "items": [ { "_links": { "self": { "href": "/api/v2/projects/my-project/environments/my-environment", "type": "application/json" } }, "_id": "57be1db38b75bf0772d11384", "key": "environment-key-123abc", "name": "My Environment", "apiKey": "sdk-xxx", "mobileKey": "mob-xxx", "color": "F5A623", "defaultTtl": 5, "secureMode": true, "_access": { "denied": [ { "action": "string", "reason": { "resources": [ "proj/*:env/*;qa_*:/flag/*" ], "notResources": [ "string" ], "actions": [ "*" ], "notActions": [ "string" ], "effect": "allow", "role_name": "string" } } ], "allowed": [ { "action": "string", "reason": { "resources": [ "proj/*:env/*;qa_*:/flag/*" ], "notResources": [ "string" ], "actions": [ "*" ], "notActions": [ "string" ], "effect": "allow", "role_name": "string" } } ] }, "defaultTrackEvents": false, "requireComments": true, "confirmChanges": true, "tags": [ "ops" ], "approvalSettings": { "required": true, "bypassApprovalsForPendingChanges": false, "minNumApprovals": 1, "canReviewOwnRequest": false, "canApplyDeclinedChanges": true, "autoApplyApprovedChanges": true, "serviceKind": "launchdarkly", "serviceConfig": {}, "requiredApprovalTags": [ "require-approval" ], "serviceKindConfigurationId": "1ef45a85-218f-4428-a8b2-a97e5f56c258" }, "resourceApprovalSettings": { "property1": { "required": true, "bypassApprovalsForPendingChanges": false, "minNumApprovals": 1, "canReviewOwnRequest": false, "canApplyDeclinedChanges": true, "autoApplyApprovedChanges": true, "serviceKind": "launchdarkly", "serviceConfig": {}, "requiredApprovalTags": [ "require-approval" ], "serviceKindConfigurationId": "1ef45a85-218f-4428-a8b2-a97e5f56c258" }, "property2": { "required": true, "bypassApprovalsForPendingChanges": false, "minNumApprovals": 1, "canReviewOwnRequest": false, "canApplyDeclinedChanges": true, "autoApplyApprovedChanges": true, "serviceKind": "launchdarkly", "serviceConfig": {}, "requiredApprovalTags": [ "require-approval" ], "serviceKindConfigurationId": "1ef45a85-218f-4428-a8b2-a97e5f56c258" } }, "critical": true } ] } }, "environments": [ { "_links": { "self": { "href": "/api/v2/projects/my-project/environments/my-environment", "type": "application/json" } }, "_id": "57be1db38b75bf0772d11384", "key": "environment-key-123abc", "name": "My Environment", "apiKey": "sdk-xxx", "mobileKey": "mob-xxx", "color": "F5A623", "defaultTtl": 5, "secureMode": true, "_access": { "denied": [ { "action": "string", "reason": { "resources": [ "proj/*:env/*;qa_*:/flag/*" ], "notResources": [ "string" ], "actions": [ "*" ], "notActions": [ "string" ], "effect": "allow", "role_name": "string" } } ], "allowed": [ { "action": "string", "reason": { "resources": [ "proj/*:env/*;qa_*:/flag/*" ], "notResources": [ "string" ], "actions": [ "*" ], "notActions": [ "string" ], "effect": "allow", "role_name": "string" } } ] }, "defaultTrackEvents": false, "requireComments": true, "confirmChanges": true, "tags": [ "ops" ], "approvalSettings": { "required": true, "bypassApprovalsForPendingChanges": false, "minNumApprovals": 1, "canReviewOwnRequest": false, "canApplyDeclinedChanges": true, "autoApplyApprovedChanges": true, "serviceKind": "launchdarkly", "serviceConfig": {}, "requiredApprovalTags": [ "require-approval" ], "serviceKindConfigurationId": "1ef45a85-218f-4428-a8b2-a97e5f56c258" }, "resourceApprovalSettings": { "property1": { "required": true, "bypassApprovalsForPendingChanges": false, "minNumApprovals": 1, "canReviewOwnRequest": false, "canApplyDeclinedChanges": true, "autoApplyApprovedChanges": true, "serviceKind": "launchdarkly", "serviceConfig": {}, "requiredApprovalTags": [ "require-approval" ], "serviceKindConfigurationId": "1ef45a85-218f-4428-a8b2-a97e5f56c258" }, "property2": { "required": true, "bypassApprovalsForPendingChanges": false, "minNumApprovals": 1, "canReviewOwnRequest": false, "canApplyDeclinedChanges": true, "autoApplyApprovedChanges": true, "serviceKind": "launchdarkly", "serviceConfig": {}, "requiredApprovalTags": [ "require-approval" ], "serviceKindConfigurationId": "1ef45a85-218f-4428-a8b2-a97e5f56c258" } }, "critical": true } ], "flag": { "name": "My Flag", "kind": "boolean", "description": "This flag controls the example widgets", "key": "flag-key-123abc", "_version": 1, "creationDate": "1494437420312", "includeInSnippet": true, "clientSideAvailability": "{\"usingMobileKey\":true,\"usingEnvironmentId\":false}", "variations": [ { "_id": "e432f62b-55f6-49dd-a02f-eb24acf39d05", "value": true }, { "_id": "a00bf58d-d252-476c-b915-15a74becacb4", "value": false } ], "temporary": true, "tags": [ "example-tag" ], "_links": { "parent": { "href": "/api/v2/flags/my-project", "type": "application/json" }, "self": { "href": "/api/v2/flags/my-project/my-flag", "type": "application/json" } }, "maintainerId": "569f183514f4432160000007", "_maintainer": { "_links": { "self": { "href": "/api/v2/members/569f183514f4432160000007", "type": "application/json" } }, "_id": "569f183514f4432160000007", "firstName": "Ariel", "lastName": "Flores", "role": "admin", "email": "ariel@acme.com" }, "customProperties": "{\"jira.issues\":{\"name\":\"Jira issues\",\"value\":[\"is-123\",\"is-456\"]}}", "archived": false, "archivedDate": "1494437420312", "defaults": "{\"onVariation\":0,\"offVariation\":1}" }, "resource": { "kind": "flag", "aiConfig": { "key": "aiconfig-key-123abc", "name": "AI Config 1" }, "experiment": { "key": "experiment-key-123abc", "name": "My Experiment", "_access": { "denied": [ { "action": "string", "reason": { "resources": [ "proj/*:env/*;qa_*:/flag/*" ], "notResources": [ "string" ], "actions": [ "*" ], "notActions": [ "string" ], "effect": "allow", "role_name": "string" } } ], "allowed": [ { "action": "string", "reason": { "resources": [ "proj/*:env/*;qa_*:/flag/*" ], "notResources": [ "string" ], "actions": [ "*" ], "notActions": [ "string" ], "effect": "allow", "role_name": "string" } } ] } }, "flag": { "name": "My Flag", "kind": "boolean", "description": "This flag controls the example widgets", "key": "flag-key-123abc", "_version": 1, "creationDate": "1494437420312", "includeInSnippet": true, "clientSideAvailability": "{\"usingMobileKey\":true,\"usingEnvironmentId\":false}", "variations": [ { "_id": "e432f62b-55f6-49dd-a02f-eb24acf39d05", "value": true }, { "_id": "a00bf58d-d252-476c-b915-15a74becacb4", "value": false } ], "temporary": true, "tags": [ "example-tag" ], "_links": { "parent": { "href": "/api/v2/flags/my-project", "type": "application/json" }, "self": { "href": "/api/v2/flags/my-project/my-flag", "type": "application/json" } }, "maintainerId": "569f183514f4432160000007", "_maintainer": { "_links": { "self": { "href": "/api/v2/members/569f183514f4432160000007", "type": "application/json" } }, "_id": "569f183514f4432160000007", "firstName": "Ariel", "lastName": "Flores", "role": "admin", "email": "ariel@acme.com" }, "customProperties": "{\"jira.issues\":{\"name\":\"Jira issues\",\"value\":[\"is-123\",\"is-456\"]}}", "archived": false, "archivedDate": "1494437420312", "defaults": "{\"onVariation\":0,\"offVariation\":1}" }, "segment": { "name": "Example segment", "description": "Bundle our sample customers together", "tags": [ "testing" ], "creationDate": "1654104600000", "lastModifiedDate": "1654104600000", "key": "segment-key-123abc", "included": [ "user-key-123abc" ], "excluded": [ "user-key-123abc" ], "includedContexts": [ { "values": [ "string" ], "contextKind": "string" } ], "excludedContexts": [ { "values": [ "string" ], "contextKind": "string" } ], "_links": { "property1": { "href": "string", "type": "string" }, "property2": { "href": "string", "type": "string" } }, "rules": [ { "_id": "1234a56b7c89d012345e678f", "clauses": [ { "_id": "12ab3c45de678910fab12345", "attribute": "email", "negate": false, "op": "endsWith", "values": [ ".edu" ] } ] } ], "version": 1, "deleted": false, "_access": { "denied": [ { "action": "string", "reason": { "resources": [ "proj/*:env/*;qa_*:/flag/*" ], "notResources": [ "string" ], "actions": [ "*" ], "notActions": [ "string" ], "effect": "allow", "role_name": "string" } } ], "allowed": [ { "action": "string", "reason": { "resources": [ "proj/*:env/*;qa_*:/flag/*" ], "notResources": [ "string" ], "actions": [ "*" ], "notActions": [ "string" ], "effect": "allow", "role_name": "string" } } ] }, "_flags": [ { "name": "Example flag", "key": "flag-key-123abc", "_links": { "property1": { "href": "string", "type": "string" }, "property2": { "href": "string", "type": "string" } }, "_site": { "href": "string", "type": "string" } } ], "unbounded": false, "unboundedContextKind": "string", "generation": 0, "_unboundedMetadata": { "envId": "string", "segmentId": "string", "version": 0, "includedCount": 0, "excludedCount": 0, "lastModified": 0, "deleted": true }, "_external": "amplitude", "_externalLink": "https://analytics.amplitude.com/org/1234/cohort/123abc", "_importInProgress": false } } } ], "totalCount": 1, "_links": { "property1": { "href": "string", "type": "string" }, "property2": { "href": "string", "type": "string" } }}Delete application version DELETE
Delete an application version.
Create approval request POST
Create an approval request. This endpoint requires a list of `instructions`, in semantic patch format, that will be applied when the approval request is approved and applied. ### Flags If you are creating an approval request for a flag, you can use the following `instructions`: - `addVariation` - `removeVariation` - `updateVariation` - `updateDefaultVariation` For details on using these instructions, read [Update feature flag](https://launchdarkly.com/docs/api/feature-flags/patch-feature-flag). To create an approval for a flag specific to an environment, use [Create approval request for a flag](https://launchdarkly.com/docs/api/approvals/post-approval-request-for-flag). ### AgentControl If you are creating an approval request for an AgentControl config, you can use the semantic patch instructions listed under [Update config targeting](https://launchdarkly.com/docs/api/agent-control/patch-ai-config-targeting). ### Segments If you are creating an approval request for a segment, you can use the semantic patch instructions listed under [Patch segment](https://launchdarkly.com/docs/api/segments/patch-segment).