Skip to main content
POST
/
api
/
v2
/
approval-requests
Create approval request
curl --request POST \
  --url https://app.launchdarkly.com/api/v2/approval-requests \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "resourceId": "proj/projKey:env/envKey:flag/flagKey",
  "description": "Requesting to update targeting",
  "instructions": "[{\"kind\": \"addUserTargets\", \"values\": [ \"user-key-123abc\"], \"variationId\": \"ce67d625-a8b9-4fb5-a344-ab909d9d4f4d\" }]",
  "comment": "optional comment",
  "notifyMemberIds": [
    "1234a56b7c89d012345e678f"
  ],
  "notifyTeamKeys": [
    "example-reviewer-team"
  ],
  "integrationConfig": {}
}
'
{
  "_id": "12ab3c45de678910abc12345",
  "_version": 1,
  "creationDate": "1654104600000",
  "serviceKind": "launchdarkly",
  "reviewStatus": "pending",
  "allReviews": [
    {
      "_id": "12ab3c45de678910abc12345",
      "kind": "approve",
      "creationDate": "1653606981113",
      "comment": "Approved!",
      "memberId": "12ab3c45de678910abc12345",
      "serviceTokenId": "12ab3c45de678910abc12345"
    }
  ],
  "notifyMemberIds": [
    "1234a56b7c89d012345e678f"
  ],
  "status": "pending",
  "instructions": "[{\"kind\": \"turnFlagOn\"}]",
  "conflicts": [
    {
      "instruction": {},
      "reason": "<string>"
    }
  ],
  "_links": {},
  "requestorId": "12ab3c45de678910abc12345",
  "description": "example: request approval from someone",
  "appliedDate": "1654104600000",
  "appliedByMemberId": "1234a56b7c89d012345e678f",
  "appliedByServiceTokenId": "1234a56b7c89d012345e678f",
  "executionDate": "1654104600000",
  "operatingOnId": "12ab3c45de678910abc12345",
  "integrationMetadata": {
    "externalId": "<string>",
    "externalStatus": {
      "display": "<string>",
      "value": "<string>"
    },
    "externalUrl": "<string>",
    "lastChecked": 123
  },
  "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,
    "serviceKind": "launchdarkly",
    "serviceConfig": {},
    "requiredApprovalTags": [
      "require-approval"
    ],
    "autoApplyApprovedChanges": true,
    "serviceKindConfigurationId": "1ef45a85-218f-4428-a8b2-a97e5f56c258"
  }
}

Documentation Index

Fetch the complete documentation index at: https://launchdarkly-preview.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Body

application/json
resourceId
string
required

String representation of the resource specifier

Example:

"proj/projKey:env/envKey:flag/flagKey"

description
string
required

A brief description of the changes you're requesting

Example:

"Requesting to update targeting"

instructions
object[]
required

List of instructions in semantic patch format to be applied to the feature flag. Review the Update feature flag documentation for details on available instructions.

Example:

"[{\"kind\": \"addUserTargets\", \"values\": [ \"user-key-123abc\"], \"variationId\": \"ce67d625-a8b9-4fb5-a344-ab909d9d4f4d\" }]"

comment
string

Optional comment describing the approval request

Example:

"optional comment"

notifyMemberIds
string[]

An array of member IDs. These members are notified to review the approval request.

Example:
["1234a56b7c89d012345e678f"]
notifyTeamKeys
string[]

An array of team keys. The members of these teams are notified to review the approval request.

Example:
["example-reviewer-team"]
integrationConfig
object

Additional approval request fields for third-party integration approval systems. If you are using a third-party integration to manage approval requests, these additional fields will be described in the manifest.json for that integration, at https://github.com/launchdarkly/integration-framework.

Response

Approval request response

_id
string
required

The ID of this approval request

Example:

"12ab3c45de678910abc12345"

_version
integer
required

Version of the approval request

Example:

1

creationDate
integer<int64>
required

Timestamp of when the approval request was created

Example:

"1654104600000"

serviceKind
string
required

The approval service for this request. May be LaunchDarkly or an external approval service, such as ServiceNow or JIRA.

Example:

"launchdarkly"

reviewStatus
enum<string>
required

Current status of the review of this approval request

Available options:
approved,
declined,
pending
Example:

"pending"

allReviews
object[]
required

An array of individual reviews of this approval request

notifyMemberIds
string[]
required

An array of member IDs. These members are notified to review the approval request.

Example:
["1234a56b7c89d012345e678f"]
status
enum<string>
required

Current status of the approval request

Available options:
pending,
completed,
failed,
scheduled
Example:

"pending"

instructions
object[]
required

List of instructions in semantic patch format to be applied to the feature flag

Example:

"[{\"kind\": \"turnFlagOn\"}]"

conflicts
object[]
required

Details on any conflicting approval requests

The location and content type of related resources

requestorId
string

The ID of the member who requested the approval

Example:

"12ab3c45de678910abc12345"

description
string

A human-friendly name for the approval request

Example:

"example: request approval from someone"

appliedDate
integer<int64>

Timestamp of when the approval request was applied

Example:

"1654104600000"

appliedByMemberId
string

The member ID of the member who applied the approval request

Example:

"1234a56b7c89d012345e678f"

appliedByServiceTokenId
string

The service token ID of the service token which applied the approval request

Example:

"1234a56b7c89d012345e678f"

executionDate
integer<int64>

Timestamp for when instructions will be executed

Example:

"1654104600000"

operatingOnId
string

ID of scheduled change to edit or delete

Example:

"12ab3c45de678910abc12345"

integrationMetadata
object

Details about the object in an external service corresponding to this approval request, such as a ServiceNow change request or a JIRA ticket, if an external approval service is being used

source
object

Details about the source feature flag, if copied

customWorkflowMetadata
object

Details about the custom workflow, if this approval request is part of a custom workflow

resourceId
string

String representation of a resource

approvalSettings
object

The settings for this approval