Approvals

List approval requests

GET
/api/v2/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.
  • resourceKind filters for only approvals that correspond to the specified resource kind. For example: filter=resourceKind equals flag. Currently, flag, segment, and aiConfig resource kinds are supported.
  • 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.

Authorization

ApiKey read, write
Authorization<token>

In: header

Scope: read, write

Query Parameters

filter?string

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

Formatstring
expand?string

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

Formatstring
limit?integer

The number of approvals to return. Defaults to 20. Maximum limit is 200.

Formatint64
offset?integer

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.

Formatint64

Response 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"    }  }}