For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Sign inTry it free
DocsGuidesSDKsIntegrationsAPI docsTutorialsFlagship blog
DocsGuidesSDKsIntegrationsAPI docsTutorialsFlagship blog
  • REST API overview
    • Access Tokens
    • Account Members
    • Account Usage Beta
    • AI Configs
    • Announcements
    • Applications Beta
    • Approvals
    • Approvals Beta
    • Audit Log
    • Code References
    • Contexts
    • Context Settings
    • Custom Roles
    • Data Export Destinations
    • Environments
    • Experiments
    • Feature Flags
    • Feature Flags Beta
    • Flag Import Configurations Beta
    • Flag Links Beta
    • Flag Triggers
    • Follow Flags
    • Holdouts Beta
    • Insights Charts Beta
    • Insights Deployments Beta
    • Insights Flag Events Beta
    • Insights Pull Requests Beta
    • Insights Repositories Beta
    • Insights Scores Beta
    • Integration Audit Log Subscriptions
    • Integration Delivery Configurations Beta
    • Integrations Beta
    • Layers
    • Metrics
    • Metrics Beta
    • OAuth2 Clients
    • Persistent Store Integrations Beta
    • Projects
      • PUTCreate or update flag defaults for project
      • POSTCreate project
      • DELDelete project
      • GETGet flag defaults for project
      • GETGet project
      • GETList projects
      • PATCHUpdate flag default for project
      • PATCHUpdate project
    • Relay Proxy Configurations
    • Release Pipelines Beta
    • Releases Beta
    • Scheduled Changes
    • Segments
    • Tags
    • Teams
    • Teams Beta
    • Users
    • Users Beta
    • User Settings
    • Views Beta
    • Webhooks
    • Workflows
    • Workflow Templates
    • Other
Sign inTry it free
LogoLogo
REST API overviewProjects

Update flag default for project

PATCH
/api/v2/projects/:projectKey/flag-defaults
PATCH
/api/v2/projects/:projectKey/flag-defaults
$curl -X PATCH https://app.launchdarkly.com/api/v2/projects/projectKey/flag-defaults \
> -H "Authorization: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '[
> {
> "op": "replace",
> "path": "/exampleField"
> }
>]'
1{
2 "tags": [
3 "tag-1",
4 "tag-2"
5 ],
6 "temporary": true,
7 "booleanDefaults": {
8 "trueDisplayName": "True",
9 "falseDisplayName": "False",
10 "trueDescription": "serve true",
11 "falseDescription": "serve false",
12 "onVariation": 0,
13 "offVariation": 1
14 },
15 "defaultClientSideAvailability": {
16 "usingMobileKey": true,
17 "usingEnvironmentId": true
18 },
19 "_links": {}
20}
Update a flag default. Updating a flag default uses a [JSON patch](https://datatracker.ietf.org/doc/html/rfc6902) or [JSON merge patch](https://datatracker.ietf.org/doc/html/rfc7386) representation of the desired changes. To learn more, read [Updates](https://launchdarkly.com/docs/api#updates).
Was this page helpful?
Previous

Update project

Next
Built with

Update a flag default. Updating a flag default uses a JSON patch or JSON merge patch representation of the desired changes. To learn more, read Updates.

Authentication

Authorizationstring
API Key authentication via header

Path parameters

projectKeystringRequiredformat: "string"
The project key

Request

This endpoint expects a list of objects.
opstringRequired
The type of operation to perform
pathstringRequired
A JSON Pointer string specifying the part of the document to operate on
valueanyOptional
A JSON value used in "add", "replace", and "test" operations

Response

Flag default response
tagslist of strings
A list of default tags for each flag
temporaryboolean
Whether the flag should be temporary by default
booleanDefaultsobject
defaultClientSideAvailabilityobject

Which client-side SDK types can use this flag by default.

_linksmap from strings to objects
The location and content type of related resources

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
429
Too Many Requests Error