Approvals
Create approval request
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.
To create an approval for a flag specific to an environment, use Create approval request for a flag.
AI Configs
If you are creating an approval request for an AI Config, you can use the semantic patch instructions listed under Update 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.
post/api/v2/approval-requests
Request body
Example request
{
"resourceId": "proj/projKey:env/envKey:flag/flagKey",
"comment": "optional comment",
"description": "Requesting to update targeting",
"notifyMemberIds": [
"1234a56b7c89d012345e678f"
],
"notifyTeamKeys": [
"example-reviewer-team"
]
}Response
Approval request response
Example response
{
"_id": "12ab3c45de678910abc12345",
"_version": 1,
"requestorId": "12ab3c45de678910abc12345",
"description": "example: request approval from someone",
"reviewStatus": "pending",
"allReviews": [
{
"_id": "12ab3c45de678910abc12345",
"kind": "approve",
"comment": "Approved!",
"memberId": "12ab3c45de678910abc12345",
"serviceTokenId": "12ab3c45de678910abc12345"
}
],
"notifyMemberIds": [
"1234a56b7c89d012345e678f"
],
"appliedByMemberId": "1234a56b7c89d012345e678f",
"appliedByServiceTokenId": "1234a56b7c89d012345e678f",
"status": "pending",
"operatingOnId": "12ab3c45de678910abc12345",
"source": {
"key": "source-flag-key-123abc",
"version": 1
},
"customWorkflowMetadata": {
"name": "Example workflow name",
"stage": {
"name": "Stage 1"
}
},
"approvalSettings": {
"required": true,
"minNumApprovals": 1,
"canApplyDeclinedChanges": true,
"autoApplyApprovedChanges": true,
"serviceKind": "launchdarkly",
"serviceConfig": {},
"requiredApprovalTags": [
"require-approval"
],
"serviceKindConfigurationId": "1ef45a85-218f-4428-a8b2-a97e5f56c258"
}
}