Approvals

Get approval request

GET
/api/v2/approval-requests/{id}

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:

  • environments includes the environments the approval request relates to
  • flag includes the flag the approval request belongs to
  • project includes the project the approval request belongs to
  • resource includes details on the resource (flag or segment) 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

Path Parameters

id*string

The approval request ID

Formatstring

Query Parameters

expand?string

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

Formatstring

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/v2/approval-requests/string"
{  "_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    }  }}