Skip to main content
DELETE
/
api
/
v2
/
projects
/
{projectKey}
/
views
/
{viewKey}
/
link
/
{resourceType}
Unlink resource
curl --request DELETE \
  --url https://app.launchdarkly.com/api/v2/projects/{projectKey}/views/{viewKey}/link/{resourceType} \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'LD-API-Version: <ld-api-version>' \
  --data '
{
  "filter": "maintainerId:507f1f77bcf86cd799439011,tags:backend+beta",
  "keys": [
    "flag-1",
    "flag-2"
  ],
  "comment": ""
}
'
{
  "failedResources": [
    {
      "environmentId": "environmentId",
      "resourceKey": "resourceKey",
      "errorMessage": "errorMessage",
      "resourceType": "flag"
    },
    {
      "environmentId": "environmentId",
      "resourceKey": "resourceKey",
      "errorMessage": "errorMessage",
      "resourceType": "flag"
    }
  ],
  "successCount": 0,
  "failureCount": 6
}

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

Headers

LD-API-Version
enum<string>
required

Version of the endpoint.

Available options:
beta

Path Parameters

projectKey
string
required
viewKey
string
required
resourceType
enum<string>
required
Available options:
flags,
segments

Body

application/json

The resource to link to the view. Flags are identified by key. Segments are identified by segment ID.

keys
string[]
required

Keys of the resources (flags, segments) to link/unlink

Example:
["flag-1", "flag-2"]
filter
string

Optional filter string to determine which resources should be linked. Resources only need to match either the filter or explicitly-listed keys to be linked (union). Uses the same syntax as list endpoints: flags use comma-separated field:value filters, segments use queryfilter syntax.

Supported filters by resource type:

  • flags: query, tags, maintainerId, maintainerTeamKey, type, status, state, staleState, sdkAvailability, targeting, hasExperiment, hasDataExport, evaluated, creationDate, contextKindTargeted, contextKindsEvaluated, filterEnv, segmentTargeted, codeReferences.min, codeReferences.max, excludeSettings, releasePipeline, applicationEvaluated, purpose, guardedRollout, view, key, name, archived, followerId
  • segments (queryfilter): query, tags, keys, excludedKeys, unbounded, external, view, type Some filters are only available when the corresponding feature is enabled on your account.
Example:

"maintainerId:507f1f77bcf86cd799439011,tags:backend+beta"

comment
string
default:""

Optional comment for the link/unlink operation

Response

Successful response with unlink details

successCount
integer
required

The number of resources successfully unlinked.

failureCount
integer
required

The number of resources that failed to unlink.

failedResources
object[]

Details of resources that failed to unlink.