provider Approvals POST
/api/v2/approval-requests @utdk/launchdarkly
/api/v2/approval-requests 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](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).
### 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](https://launchdarkly.com/docs/api/ai-configs/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).
Try it
Authentication
Configure credentials for LaunchDarkly REST API
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.
Saved automatically to browser storage.
Code snippet
Updates live as you fill in the form above.
TypeScript
import launchdarkly from '@utdk/launchdarkly';
await launchdarkly.postapprovalrequest()