Create view
For the complete documentation index, see llms.txt. For the full documentation snapshot, see llms-full.txt.
Create a new view in the given project.
curl --request POST \
--url https://app.launchdarkly.com/api/v2/projects/{projectKey}/views \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'LD-API-Version: <ld-api-version>' \
--data '
{
"maintainerId": "maintainerId",
"name": "name",
"generateSdkKeys": false,
"maintainerTeamKey": "maintainerTeamKey",
"description": "",
"key": "key",
"tags": [
"tags",
"tags"
]
}
'import requests
url = "https://app.launchdarkly.com/api/v2/projects/{projectKey}/views"
payload = {
"maintainerId": "maintainerId",
"name": "name",
"generateSdkKeys": False,
"maintainerTeamKey": "maintainerTeamKey",
"description": "",
"key": "key",
"tags": ["tags", "tags"]
}
headers = {
"LD-API-Version": "<ld-api-version>",
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'LD-API-Version': '<ld-api-version>',
Authorization: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
maintainerId: 'maintainerId',
name: 'name',
generateSdkKeys: false,
maintainerTeamKey: 'maintainerTeamKey',
description: '',
key: 'key',
tags: ['tags', 'tags']
})
};
fetch('https://app.launchdarkly.com/api/v2/projects/{projectKey}/views', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.launchdarkly.com/api/v2/projects/{projectKey}/views",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'maintainerId' => 'maintainerId',
'name' => 'name',
'generateSdkKeys' => false,
'maintainerTeamKey' => 'maintainerTeamKey',
'description' => '',
'key' => 'key',
'tags' => [
'tags',
'tags'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json",
"LD-API-Version: <ld-api-version>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.launchdarkly.com/api/v2/projects/{projectKey}/views"
payload := strings.NewReader("{\n \"maintainerId\": \"maintainerId\",\n \"name\": \"name\",\n \"generateSdkKeys\": false,\n \"maintainerTeamKey\": \"maintainerTeamKey\",\n \"description\": \"\",\n \"key\": \"key\",\n \"tags\": [\n \"tags\",\n \"tags\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("LD-API-Version", "<ld-api-version>")
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.launchdarkly.com/api/v2/projects/{projectKey}/views")
.header("LD-API-Version", "<ld-api-version>")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"maintainerId\": \"maintainerId\",\n \"name\": \"name\",\n \"generateSdkKeys\": false,\n \"maintainerTeamKey\": \"maintainerTeamKey\",\n \"description\": \"\",\n \"key\": \"key\",\n \"tags\": [\n \"tags\",\n \"tags\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/projects/{projectKey}/views")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["LD-API-Version"] = '<ld-api-version>'
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"maintainerId\": \"maintainerId\",\n \"name\": \"name\",\n \"generateSdkKeys\": false,\n \"maintainerTeamKey\": \"maintainerTeamKey\",\n \"description\": \"\",\n \"key\": \"key\",\n \"tags\": [\n \"tags\",\n \"tags\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"metricsExpanded": {
"totalCount": 6,
"items": [
{
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"kind": "kind",
"description": "description",
"creationDate": 9,
"isActive": true,
"lastSeen": 3,
"eventKey": "eventKey",
"_versionId": "_versionId",
"isNumeric": true,
"name": "name",
"lastModified": 6,
"_id": "_id",
"category": "category",
"key": "key"
},
{
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"kind": "kind",
"description": "description",
"creationDate": 9,
"isActive": true,
"lastSeen": 3,
"eventKey": "eventKey",
"_versionId": "_versionId",
"isNumeric": true,
"name": "name",
"lastModified": 6,
"_id": "_id",
"category": "category",
"key": "key"
}
]
},
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"description": "description",
"maintainer": {
"kind": "kind",
"maintainerMember": {
"firstName": "firstName",
"lastName": "lastName",
"role": "role",
"id": "id",
"email": "email"
},
"id": "id",
"maintainerTeam": {
"name": "name",
"id": "id",
"key": "key"
}
},
"metricsSummary": {
"count": 2
},
"createdAt": 6,
"archived": false,
"projectKey": "projectKey",
"_access": {
"allowed": [
{
"reason": {
"role_name": "role_name",
"notActions": [
null,
null
],
"notResources": [
"notResources",
"notResources"
],
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"actions": [
"*"
]
},
"action": "action"
},
{
"reason": {
"role_name": "role_name",
"notActions": [
null,
null
],
"notResources": [
"notResources",
"notResources"
],
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"actions": [
"*"
]
},
"action": "action"
}
],
"denied": [
{
"reason": {
"role_name": "role_name",
"notActions": [
null,
null
],
"notResources": [
"notResources",
"notResources"
],
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"actions": [
"*"
]
},
"action": "action"
},
{
"reason": {
"role_name": "role_name",
"notActions": [
null,
null
],
"notResources": [
"notResources",
"notResources"
],
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"actions": [
"*"
]
},
"action": "action"
}
]
},
"generateSdkKeys": true,
"flagsSummary": {
"count": 2,
"linkedFlags": {
"totalCount": 7,
"items": [
{
"name": "name",
"links": {
"self": {
"href": "href",
"type": "type"
}
},
"key": "key"
},
{
"name": "name",
"links": {
"self": {
"href": "href",
"type": "type"
}
},
"key": "key"
}
]
}
},
"id": "id",
"aiConfigsSummary": {
"count": 4
},
"key": "key",
"updatedAt": 1,
"resourcesExpanded": {
"totalCount": 7,
"items": {
"flags": {
"totalCount": 5,
"items": [
{
"archived": true,
"temporary": true,
"includeInSnippet": true,
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"name": "name",
"description": "description",
"creationDate": 7,
"_version": 1,
"key": "key",
"maintainer": {
"kind": "member",
"_member": {
"firstName": "Ariel",
"lastName": "Flores",
"role": "admin",
"_links": {
"self": {
"href": "/api/v2/members/569f183514f4432160000007",
"type": "application/json"
}
},
"_id": "569f183514f4432160000007",
"email": "ariel@acme.com"
},
"_team": {
"_links": {
"key": {
"href": "href",
"type": "type"
}
},
"name": "QA Team",
"customRoleKeys": [
"access-to-test-projects"
],
"key": "team-key-123abc"
},
"key": "key"
},
"tags": [
"tags",
"tags"
]
},
{
"archived": true,
"temporary": true,
"includeInSnippet": true,
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"name": "name",
"description": "description",
"creationDate": 7,
"_version": 1,
"key": "key",
"maintainer": {
"kind": "member",
"_member": {
"firstName": "Ariel",
"lastName": "Flores",
"role": "admin",
"_links": {
"self": {
"href": "/api/v2/members/569f183514f4432160000007",
"type": "application/json"
}
},
"_id": "569f183514f4432160000007",
"email": "ariel@acme.com"
},
"_team": {
"_links": {
"key": {
"href": "href",
"type": "type"
}
},
"name": "QA Team",
"customRoleKeys": [
"access-to-test-projects"
],
"key": "team-key-123abc"
},
"key": "key"
},
"tags": [
"tags",
"tags"
]
}
]
},
"aiConfigs": {
"totalCount": 3,
"items": [
{
"createdAt": 2,
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"name": "name",
"description": "description",
"version": 1,
"key": "key",
"flagKey": "flagKey",
"tags": [
"tags",
"tags"
],
"updatedAt": 6
},
{
"createdAt": 2,
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"name": "name",
"description": "description",
"version": 1,
"key": "key",
"flagKey": "flagKey",
"tags": [
"tags",
"tags"
],
"updatedAt": 6
}
]
},
"metrics": {
"totalCount": 3,
"items": [
{
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"kind": "kind",
"description": "description",
"creationDate": 9,
"isActive": true,
"lastSeen": 3,
"eventKey": "eventKey",
"_versionId": "_versionId",
"isNumeric": true,
"name": "name",
"lastModified": 6,
"_id": "_id",
"category": "category",
"key": "key"
},
{
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"kind": "kind",
"description": "description",
"creationDate": 9,
"isActive": true,
"lastSeen": 3,
"eventKey": "eventKey",
"_versionId": "_versionId",
"isNumeric": true,
"name": "name",
"lastModified": 6,
"_id": "_id",
"category": "category",
"key": "key"
}
]
},
"segments": {
"totalCount": 6,
"items": [
{
"generation": 6,
"lastModifiedDate": 9,
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"description": "description",
"creationDate": 5,
"version": 9,
"environmentKey": "environmentKey",
"tags": [
"tags",
"tags"
],
"environmentId": "environmentId",
"deleted": true,
"name": "name",
"unbounded": true,
"key": "key"
},
{
"generation": 6,
"lastModifiedDate": 9,
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"description": "description",
"creationDate": 5,
"version": 9,
"environmentKey": "environmentKey",
"tags": [
"tags",
"tags"
],
"environmentId": "environmentId",
"deleted": true,
"name": "name",
"unbounded": true,
"key": "key"
}
]
}
}
},
"resourceSummary": {
"flagCount": 7,
"metricCount": 1,
"totalCount": 6,
"segmentCount": 1,
"aiConfigCount": 1
},
"version": 0,
"tags": [
"tags",
"tags"
],
"accountId": "accountId",
"archivedAt": 5,
"deletedAt": 5,
"deleted": false,
"name": "name",
"segmentsSummary": {
"linkedSegments": {
"totalCount": 3,
"items": [
{
"environmentId": "environmentId",
"name": "name",
"links": {
"self": {
"href": "href",
"type": "type"
}
},
"key": "key"
},
{
"environmentId": "environmentId",
"name": "name",
"links": {
"self": {
"href": "href",
"type": "type"
}
},
"key": "key"
}
]
},
"count": 9
},
"aiConfigsExpanded": {
"totalCount": 6,
"items": [
{
"createdAt": 2,
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"name": "name",
"description": "description",
"version": 1,
"key": "key",
"flagKey": "flagKey",
"tags": [
"tags",
"tags"
],
"updatedAt": 6
},
{
"createdAt": 2,
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"name": "name",
"description": "description",
"version": 1,
"key": "key",
"flagKey": "flagKey",
"tags": [
"tags",
"tags"
],
"updatedAt": 6
}
]
},
"segmentsExpanded": {
"totalCount": 8,
"items": [
{
"generation": 6,
"lastModifiedDate": 9,
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"description": "description",
"creationDate": 5,
"version": 9,
"environmentKey": "environmentKey",
"tags": [
"tags",
"tags"
],
"environmentId": "environmentId",
"deleted": true,
"name": "name",
"unbounded": true,
"key": "key"
},
{
"generation": 6,
"lastModifiedDate": 9,
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"description": "description",
"creationDate": 5,
"version": 9,
"environmentKey": "environmentKey",
"tags": [
"tags",
"tags"
],
"environmentId": "environmentId",
"deleted": true,
"name": "name",
"unbounded": true,
"key": "key"
}
]
},
"projectId": "projectId",
"flagsExpanded": {
"totalCount": 4,
"items": [
{
"archived": true,
"temporary": true,
"includeInSnippet": true,
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"name": "name",
"description": "description",
"creationDate": 7,
"_version": 1,
"key": "key",
"maintainer": {
"kind": "member",
"_member": {
"firstName": "Ariel",
"lastName": "Flores",
"role": "admin",
"_links": {
"self": {
"href": "/api/v2/members/569f183514f4432160000007",
"type": "application/json"
}
},
"_id": "569f183514f4432160000007",
"email": "ariel@acme.com"
},
"_team": {
"_links": {
"key": {
"href": "href",
"type": "type"
}
},
"name": "QA Team",
"customRoleKeys": [
"access-to-test-projects"
],
"key": "team-key-123abc"
},
"key": "key"
},
"tags": [
"tags",
"tags"
]
},
{
"archived": true,
"temporary": true,
"includeInSnippet": true,
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"name": "name",
"description": "description",
"creationDate": 7,
"_version": 1,
"key": "key",
"maintainer": {
"kind": "member",
"_member": {
"firstName": "Ariel",
"lastName": "Flores",
"role": "admin",
"_links": {
"self": {
"href": "/api/v2/members/569f183514f4432160000007",
"type": "application/json"
}
},
"_id": "569f183514f4432160000007",
"email": "ariel@acme.com"
},
"_team": {
"_links": {
"key": {
"href": "href",
"type": "type"
}
},
"name": "QA Team",
"customRoleKeys": [
"access-to-test-projects"
],
"key": "team-key-123abc"
},
"key": "key"
},
"tags": [
"tags",
"tags"
]
}
]
}
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}Authorizations
Headers
Version of the endpoint.
beta Path Parameters
Body
View object to create
Unique key for the view within the account/project
Human-readable name for the view
Optional detailed description of the view
Whether to generate SDK keys for this view
Member ID of the maintainer for this view. Only one of maintainerId or maintainerTeamKey can be specified.
Key of the maintainer team for this view. Only one of maintainerId or maintainerTeamKey can be specified.
Tags associated with this view
Response
Successful response
Unique ID of this view
ID of the account that owns this view
ID of the project this view belongs to
Key of the project this view belongs to
Unique key for the view within the account/project
Human-readable name for the view
Optional detailed description of the view
Whether to generate SDK keys for this view. Defaults to false.
Version number for tracking changes
Tags associated with this view
Whether this view is archived
Whether this view is deleted
Show child attributes
Show child attributes
{
"allowed": [
{
"reason": {
"role_name": "role_name",
"notActions": [null, null],
"notResources": ["notResources", "notResources"],
"effect": "allow",
"resources": ["proj/*:env/*;qa_*:/flag/*"],
"actions": ["*"]
},
"action": "action"
},
{
"reason": {
"role_name": "role_name",
"notActions": [null, null],
"notResources": ["notResources", "notResources"],
"effect": "allow",
"resources": ["proj/*:env/*;qa_*:/flag/*"],
"actions": ["*"]
},
"action": "action"
}
],
"denied": [
{
"reason": {
"role_name": "role_name",
"notActions": [null, null],
"notResources": ["notResources", "notResources"],
"effect": "allow",
"resources": ["proj/*:env/*;qa_*:/flag/*"],
"actions": ["*"]
},
"action": "action"
},
{
"reason": {
"role_name": "role_name",
"notActions": [null, null],
"notResources": ["notResources", "notResources"],
"effect": "allow",
"resources": ["proj/*:env/*;qa_*:/flag/*"],
"actions": ["*"]
},
"action": "action"
}
]
}
The location and content type of related resources
Show child attributes
Show child attributes
{
"parent": { "href": "href", "type": "type" },
"self": { "href": "href", "type": "type" }
}
Show child attributes
Show child attributes
{
"kind": "kind",
"maintainerMember": {
"firstName": "firstName",
"lastName": "lastName",
"role": "role",
"id": "id",
"email": "email"
},
"id": "id",
"maintainerTeam": { "name": "name", "id": "id", "key": "key" }
}
Show child attributes
Show child attributes
{
"count": 2,
"linkedFlags": {
"totalCount": 7,
"items": [
{
"name": "name",
"links": {
"self": { "href": "href", "type": "type" }
},
"key": "key"
},
{
"name": "name",
"links": {
"self": { "href": "href", "type": "type" }
},
"key": "key"
}
]
}
}
Show child attributes
Show child attributes
{
"linkedSegments": {
"totalCount": 3,
"items": [
{
"environmentId": "environmentId",
"name": "name",
"links": {
"self": { "href": "href", "type": "type" }
},
"key": "key"
},
{
"environmentId": "environmentId",
"name": "name",
"links": {
"self": { "href": "href", "type": "type" }
},
"key": "key"
}
]
},
"count": 9
}
Show child attributes
Show child attributes
{ "count": 2 }
Show child attributes
Show child attributes
{ "count": 4 }
Show child attributes
Show child attributes
{
"flagCount": 7,
"metricCount": 1,
"totalCount": 6,
"segmentCount": 1,
"aiConfigCount": 1
}
Details on linked flags for a view - requires passing the 'allFlags' expand field
Show child attributes
Show child attributes
{
"totalCount": 4,
"items": [
{
"archived": true,
"temporary": true,
"includeInSnippet": true,
"_links": {
"parent": { "href": "href", "type": "type" },
"self": { "href": "href", "type": "type" }
},
"name": "name",
"description": "description",
"creationDate": 7,
"_version": 1,
"key": "key",
"maintainer": {
"kind": "member",
"_member": {
"firstName": "Ariel",
"lastName": "Flores",
"role": "admin",
"_links": {
"self": {
"href": "/api/v2/members/569f183514f4432160000007",
"type": "application/json"
}
},
"_id": "569f183514f4432160000007",
"email": "ariel@acme.com"
},
"_team": {
"_links": { "key": { "href": "href", "type": "type" } },
"name": "QA Team",
"customRoleKeys": ["access-to-test-projects"],
"key": "team-key-123abc"
},
"key": "key"
},
"tags": ["tags", "tags"]
},
{
"archived": true,
"temporary": true,
"includeInSnippet": true,
"_links": {
"parent": { "href": "href", "type": "type" },
"self": { "href": "href", "type": "type" }
},
"name": "name",
"description": "description",
"creationDate": 7,
"_version": 1,
"key": "key",
"maintainer": {
"kind": "member",
"_member": {
"firstName": "Ariel",
"lastName": "Flores",
"role": "admin",
"_links": {
"self": {
"href": "/api/v2/members/569f183514f4432160000007",
"type": "application/json"
}
},
"_id": "569f183514f4432160000007",
"email": "ariel@acme.com"
},
"_team": {
"_links": { "key": { "href": "href", "type": "type" } },
"name": "QA Team",
"customRoleKeys": ["access-to-test-projects"],
"key": "team-key-123abc"
},
"key": "key"
},
"tags": ["tags", "tags"]
}
]
}
Details on linked segments for a view - requires passing the 'allSegments' expand field
Show child attributes
Show child attributes
{
"totalCount": 8,
"items": [
{
"generation": 6,
"lastModifiedDate": 9,
"_links": {
"parent": { "href": "href", "type": "type" },
"self": { "href": "href", "type": "type" }
},
"description": "description",
"creationDate": 5,
"version": 9,
"environmentKey": "environmentKey",
"tags": ["tags", "tags"],
"environmentId": "environmentId",
"deleted": true,
"name": "name",
"unbounded": true,
"key": "key"
},
{
"generation": 6,
"lastModifiedDate": 9,
"_links": {
"parent": { "href": "href", "type": "type" },
"self": { "href": "href", "type": "type" }
},
"description": "description",
"creationDate": 5,
"version": 9,
"environmentKey": "environmentKey",
"tags": ["tags", "tags"],
"environmentId": "environmentId",
"deleted": true,
"name": "name",
"unbounded": true,
"key": "key"
}
]
}
Show child attributes
Show child attributes
{
"totalCount": 6,
"items": [
{
"_links": {
"parent": { "href": "href", "type": "type" },
"self": { "href": "href", "type": "type" }
},
"kind": "kind",
"description": "description",
"creationDate": 9,
"isActive": true,
"lastSeen": 3,
"eventKey": "eventKey",
"_versionId": "_versionId",
"isNumeric": true,
"name": "name",
"lastModified": 6,
"_id": "_id",
"category": "category",
"key": "key"
},
{
"_links": {
"parent": { "href": "href", "type": "type" },
"self": { "href": "href", "type": "type" }
},
"kind": "kind",
"description": "description",
"creationDate": 9,
"isActive": true,
"lastSeen": 3,
"eventKey": "eventKey",
"_versionId": "_versionId",
"isNumeric": true,
"name": "name",
"lastModified": 6,
"_id": "_id",
"category": "category",
"key": "key"
}
]
}
Show child attributes
Show child attributes
{
"totalCount": 6,
"items": [
{
"createdAt": 2,
"_links": {
"parent": { "href": "href", "type": "type" },
"self": { "href": "href", "type": "type" }
},
"name": "name",
"description": "description",
"version": 1,
"key": "key",
"flagKey": "flagKey",
"tags": ["tags", "tags"],
"updatedAt": 6
},
{
"createdAt": 2,
"_links": {
"parent": { "href": "href", "type": "type" },
"self": { "href": "href", "type": "type" }
},
"name": "name",
"description": "description",
"version": 1,
"key": "key",
"flagKey": "flagKey",
"tags": ["tags", "tags"],
"updatedAt": 6
}
]
}
Details on linked resources for a view - requires passing the 'allResources' expand field
Show child attributes
Show child attributes
{
"totalCount": 7,
"items": {
"flags": {
"totalCount": 5,
"items": [
{
"archived": true,
"temporary": true,
"includeInSnippet": true,
"_links": {
"parent": { "href": "href", "type": "type" },
"self": { "href": "href", "type": "type" }
},
"name": "name",
"description": "description",
"creationDate": 7,
"_version": 1,
"key": "key",
"maintainer": {
"kind": "member",
"_member": {
"firstName": "Ariel",
"lastName": "Flores",
"role": "admin",
"_links": {
"self": {
"href": "/api/v2/members/569f183514f4432160000007",
"type": "application/json"
}
},
"_id": "569f183514f4432160000007",
"email": "ariel@acme.com"
},
"_team": {
"_links": { "key": { "href": "href", "type": "type" } },
"name": "QA Team",
"customRoleKeys": ["access-to-test-projects"],
"key": "team-key-123abc"
},
"key": "key"
},
"tags": ["tags", "tags"]
},
{
"archived": true,
"temporary": true,
"includeInSnippet": true,
"_links": {
"parent": { "href": "href", "type": "type" },
"self": { "href": "href", "type": "type" }
},
"name": "name",
"description": "description",
"creationDate": 7,
"_version": 1,
"key": "key",
"maintainer": {
"kind": "member",
"_member": {
"firstName": "Ariel",
"lastName": "Flores",
"role": "admin",
"_links": {
"self": {
"href": "/api/v2/members/569f183514f4432160000007",
"type": "application/json"
}
},
"_id": "569f183514f4432160000007",
"email": "ariel@acme.com"
},
"_team": {
"_links": { "key": { "href": "href", "type": "type" } },
"name": "QA Team",
"customRoleKeys": ["access-to-test-projects"],
"key": "team-key-123abc"
},
"key": "key"
},
"tags": ["tags", "tags"]
}
]
},
"aiConfigs": {
"totalCount": 3,
"items": [
{
"createdAt": 2,
"_links": {
"parent": { "href": "href", "type": "type" },
"self": { "href": "href", "type": "type" }
},
"name": "name",
"description": "description",
"version": 1,
"key": "key",
"flagKey": "flagKey",
"tags": ["tags", "tags"],
"updatedAt": 6
},
{
"createdAt": 2,
"_links": {
"parent": { "href": "href", "type": "type" },
"self": { "href": "href", "type": "type" }
},
"name": "name",
"description": "description",
"version": 1,
"key": "key",
"flagKey": "flagKey",
"tags": ["tags", "tags"],
"updatedAt": 6
}
]
},
"metrics": {
"totalCount": 3,
"items": [
{
"_links": {
"parent": { "href": "href", "type": "type" },
"self": { "href": "href", "type": "type" }
},
"kind": "kind",
"description": "description",
"creationDate": 9,
"isActive": true,
"lastSeen": 3,
"eventKey": "eventKey",
"_versionId": "_versionId",
"isNumeric": true,
"name": "name",
"lastModified": 6,
"_id": "_id",
"category": "category",
"key": "key"
},
{
"_links": {
"parent": { "href": "href", "type": "type" },
"self": { "href": "href", "type": "type" }
},
"kind": "kind",
"description": "description",
"creationDate": 9,
"isActive": true,
"lastSeen": 3,
"eventKey": "eventKey",
"_versionId": "_versionId",
"isNumeric": true,
"name": "name",
"lastModified": 6,
"_id": "_id",
"category": "category",
"key": "key"
}
]
},
"segments": {
"totalCount": 6,
"items": [
{
"generation": 6,
"lastModifiedDate": 9,
"_links": {
"parent": { "href": "href", "type": "type" },
"self": { "href": "href", "type": "type" }
},
"description": "description",
"creationDate": 5,
"version": 9,
"environmentKey": "environmentKey",
"tags": ["tags", "tags"],
"environmentId": "environmentId",
"deleted": true,
"name": "name",
"unbounded": true,
"key": "key"
},
{
"generation": 6,
"lastModifiedDate": 9,
"_links": {
"parent": { "href": "href", "type": "type" },
"self": { "href": "href", "type": "type" }
},
"description": "description",
"creationDate": 5,
"version": 9,
"environmentKey": "environmentKey",
"tags": ["tags", "tags"],
"environmentId": "environmentId",
"deleted": true,
"name": "name",
"unbounded": true,
"key": "key"
}
]
}
}
}
curl --request POST \
--url https://app.launchdarkly.com/api/v2/projects/{projectKey}/views \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'LD-API-Version: <ld-api-version>' \
--data '
{
"maintainerId": "maintainerId",
"name": "name",
"generateSdkKeys": false,
"maintainerTeamKey": "maintainerTeamKey",
"description": "",
"key": "key",
"tags": [
"tags",
"tags"
]
}
'import requests
url = "https://app.launchdarkly.com/api/v2/projects/{projectKey}/views"
payload = {
"maintainerId": "maintainerId",
"name": "name",
"generateSdkKeys": False,
"maintainerTeamKey": "maintainerTeamKey",
"description": "",
"key": "key",
"tags": ["tags", "tags"]
}
headers = {
"LD-API-Version": "<ld-api-version>",
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'LD-API-Version': '<ld-api-version>',
Authorization: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
maintainerId: 'maintainerId',
name: 'name',
generateSdkKeys: false,
maintainerTeamKey: 'maintainerTeamKey',
description: '',
key: 'key',
tags: ['tags', 'tags']
})
};
fetch('https://app.launchdarkly.com/api/v2/projects/{projectKey}/views', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.launchdarkly.com/api/v2/projects/{projectKey}/views",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'maintainerId' => 'maintainerId',
'name' => 'name',
'generateSdkKeys' => false,
'maintainerTeamKey' => 'maintainerTeamKey',
'description' => '',
'key' => 'key',
'tags' => [
'tags',
'tags'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json",
"LD-API-Version: <ld-api-version>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.launchdarkly.com/api/v2/projects/{projectKey}/views"
payload := strings.NewReader("{\n \"maintainerId\": \"maintainerId\",\n \"name\": \"name\",\n \"generateSdkKeys\": false,\n \"maintainerTeamKey\": \"maintainerTeamKey\",\n \"description\": \"\",\n \"key\": \"key\",\n \"tags\": [\n \"tags\",\n \"tags\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("LD-API-Version", "<ld-api-version>")
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.launchdarkly.com/api/v2/projects/{projectKey}/views")
.header("LD-API-Version", "<ld-api-version>")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"maintainerId\": \"maintainerId\",\n \"name\": \"name\",\n \"generateSdkKeys\": false,\n \"maintainerTeamKey\": \"maintainerTeamKey\",\n \"description\": \"\",\n \"key\": \"key\",\n \"tags\": [\n \"tags\",\n \"tags\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.launchdarkly.com/api/v2/projects/{projectKey}/views")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["LD-API-Version"] = '<ld-api-version>'
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"maintainerId\": \"maintainerId\",\n \"name\": \"name\",\n \"generateSdkKeys\": false,\n \"maintainerTeamKey\": \"maintainerTeamKey\",\n \"description\": \"\",\n \"key\": \"key\",\n \"tags\": [\n \"tags\",\n \"tags\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"metricsExpanded": {
"totalCount": 6,
"items": [
{
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"kind": "kind",
"description": "description",
"creationDate": 9,
"isActive": true,
"lastSeen": 3,
"eventKey": "eventKey",
"_versionId": "_versionId",
"isNumeric": true,
"name": "name",
"lastModified": 6,
"_id": "_id",
"category": "category",
"key": "key"
},
{
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"kind": "kind",
"description": "description",
"creationDate": 9,
"isActive": true,
"lastSeen": 3,
"eventKey": "eventKey",
"_versionId": "_versionId",
"isNumeric": true,
"name": "name",
"lastModified": 6,
"_id": "_id",
"category": "category",
"key": "key"
}
]
},
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"description": "description",
"maintainer": {
"kind": "kind",
"maintainerMember": {
"firstName": "firstName",
"lastName": "lastName",
"role": "role",
"id": "id",
"email": "email"
},
"id": "id",
"maintainerTeam": {
"name": "name",
"id": "id",
"key": "key"
}
},
"metricsSummary": {
"count": 2
},
"createdAt": 6,
"archived": false,
"projectKey": "projectKey",
"_access": {
"allowed": [
{
"reason": {
"role_name": "role_name",
"notActions": [
null,
null
],
"notResources": [
"notResources",
"notResources"
],
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"actions": [
"*"
]
},
"action": "action"
},
{
"reason": {
"role_name": "role_name",
"notActions": [
null,
null
],
"notResources": [
"notResources",
"notResources"
],
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"actions": [
"*"
]
},
"action": "action"
}
],
"denied": [
{
"reason": {
"role_name": "role_name",
"notActions": [
null,
null
],
"notResources": [
"notResources",
"notResources"
],
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"actions": [
"*"
]
},
"action": "action"
},
{
"reason": {
"role_name": "role_name",
"notActions": [
null,
null
],
"notResources": [
"notResources",
"notResources"
],
"effect": "allow",
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"actions": [
"*"
]
},
"action": "action"
}
]
},
"generateSdkKeys": true,
"flagsSummary": {
"count": 2,
"linkedFlags": {
"totalCount": 7,
"items": [
{
"name": "name",
"links": {
"self": {
"href": "href",
"type": "type"
}
},
"key": "key"
},
{
"name": "name",
"links": {
"self": {
"href": "href",
"type": "type"
}
},
"key": "key"
}
]
}
},
"id": "id",
"aiConfigsSummary": {
"count": 4
},
"key": "key",
"updatedAt": 1,
"resourcesExpanded": {
"totalCount": 7,
"items": {
"flags": {
"totalCount": 5,
"items": [
{
"archived": true,
"temporary": true,
"includeInSnippet": true,
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"name": "name",
"description": "description",
"creationDate": 7,
"_version": 1,
"key": "key",
"maintainer": {
"kind": "member",
"_member": {
"firstName": "Ariel",
"lastName": "Flores",
"role": "admin",
"_links": {
"self": {
"href": "/api/v2/members/569f183514f4432160000007",
"type": "application/json"
}
},
"_id": "569f183514f4432160000007",
"email": "ariel@acme.com"
},
"_team": {
"_links": {
"key": {
"href": "href",
"type": "type"
}
},
"name": "QA Team",
"customRoleKeys": [
"access-to-test-projects"
],
"key": "team-key-123abc"
},
"key": "key"
},
"tags": [
"tags",
"tags"
]
},
{
"archived": true,
"temporary": true,
"includeInSnippet": true,
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"name": "name",
"description": "description",
"creationDate": 7,
"_version": 1,
"key": "key",
"maintainer": {
"kind": "member",
"_member": {
"firstName": "Ariel",
"lastName": "Flores",
"role": "admin",
"_links": {
"self": {
"href": "/api/v2/members/569f183514f4432160000007",
"type": "application/json"
}
},
"_id": "569f183514f4432160000007",
"email": "ariel@acme.com"
},
"_team": {
"_links": {
"key": {
"href": "href",
"type": "type"
}
},
"name": "QA Team",
"customRoleKeys": [
"access-to-test-projects"
],
"key": "team-key-123abc"
},
"key": "key"
},
"tags": [
"tags",
"tags"
]
}
]
},
"aiConfigs": {
"totalCount": 3,
"items": [
{
"createdAt": 2,
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"name": "name",
"description": "description",
"version": 1,
"key": "key",
"flagKey": "flagKey",
"tags": [
"tags",
"tags"
],
"updatedAt": 6
},
{
"createdAt": 2,
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"name": "name",
"description": "description",
"version": 1,
"key": "key",
"flagKey": "flagKey",
"tags": [
"tags",
"tags"
],
"updatedAt": 6
}
]
},
"metrics": {
"totalCount": 3,
"items": [
{
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"kind": "kind",
"description": "description",
"creationDate": 9,
"isActive": true,
"lastSeen": 3,
"eventKey": "eventKey",
"_versionId": "_versionId",
"isNumeric": true,
"name": "name",
"lastModified": 6,
"_id": "_id",
"category": "category",
"key": "key"
},
{
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"kind": "kind",
"description": "description",
"creationDate": 9,
"isActive": true,
"lastSeen": 3,
"eventKey": "eventKey",
"_versionId": "_versionId",
"isNumeric": true,
"name": "name",
"lastModified": 6,
"_id": "_id",
"category": "category",
"key": "key"
}
]
},
"segments": {
"totalCount": 6,
"items": [
{
"generation": 6,
"lastModifiedDate": 9,
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"description": "description",
"creationDate": 5,
"version": 9,
"environmentKey": "environmentKey",
"tags": [
"tags",
"tags"
],
"environmentId": "environmentId",
"deleted": true,
"name": "name",
"unbounded": true,
"key": "key"
},
{
"generation": 6,
"lastModifiedDate": 9,
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"description": "description",
"creationDate": 5,
"version": 9,
"environmentKey": "environmentKey",
"tags": [
"tags",
"tags"
],
"environmentId": "environmentId",
"deleted": true,
"name": "name",
"unbounded": true,
"key": "key"
}
]
}
}
},
"resourceSummary": {
"flagCount": 7,
"metricCount": 1,
"totalCount": 6,
"segmentCount": 1,
"aiConfigCount": 1
},
"version": 0,
"tags": [
"tags",
"tags"
],
"accountId": "accountId",
"archivedAt": 5,
"deletedAt": 5,
"deleted": false,
"name": "name",
"segmentsSummary": {
"linkedSegments": {
"totalCount": 3,
"items": [
{
"environmentId": "environmentId",
"name": "name",
"links": {
"self": {
"href": "href",
"type": "type"
}
},
"key": "key"
},
{
"environmentId": "environmentId",
"name": "name",
"links": {
"self": {
"href": "href",
"type": "type"
}
},
"key": "key"
}
]
},
"count": 9
},
"aiConfigsExpanded": {
"totalCount": 6,
"items": [
{
"createdAt": 2,
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"name": "name",
"description": "description",
"version": 1,
"key": "key",
"flagKey": "flagKey",
"tags": [
"tags",
"tags"
],
"updatedAt": 6
},
{
"createdAt": 2,
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"name": "name",
"description": "description",
"version": 1,
"key": "key",
"flagKey": "flagKey",
"tags": [
"tags",
"tags"
],
"updatedAt": 6
}
]
},
"segmentsExpanded": {
"totalCount": 8,
"items": [
{
"generation": 6,
"lastModifiedDate": 9,
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"description": "description",
"creationDate": 5,
"version": 9,
"environmentKey": "environmentKey",
"tags": [
"tags",
"tags"
],
"environmentId": "environmentId",
"deleted": true,
"name": "name",
"unbounded": true,
"key": "key"
},
{
"generation": 6,
"lastModifiedDate": 9,
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"description": "description",
"creationDate": 5,
"version": 9,
"environmentKey": "environmentKey",
"tags": [
"tags",
"tags"
],
"environmentId": "environmentId",
"deleted": true,
"name": "name",
"unbounded": true,
"key": "key"
}
]
},
"projectId": "projectId",
"flagsExpanded": {
"totalCount": 4,
"items": [
{
"archived": true,
"temporary": true,
"includeInSnippet": true,
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"name": "name",
"description": "description",
"creationDate": 7,
"_version": 1,
"key": "key",
"maintainer": {
"kind": "member",
"_member": {
"firstName": "Ariel",
"lastName": "Flores",
"role": "admin",
"_links": {
"self": {
"href": "/api/v2/members/569f183514f4432160000007",
"type": "application/json"
}
},
"_id": "569f183514f4432160000007",
"email": "ariel@acme.com"
},
"_team": {
"_links": {
"key": {
"href": "href",
"type": "type"
}
},
"name": "QA Team",
"customRoleKeys": [
"access-to-test-projects"
],
"key": "team-key-123abc"
},
"key": "key"
},
"tags": [
"tags",
"tags"
]
},
{
"archived": true,
"temporary": true,
"includeInSnippet": true,
"_links": {
"parent": {
"href": "href",
"type": "type"
},
"self": {
"href": "href",
"type": "type"
}
},
"name": "name",
"description": "description",
"creationDate": 7,
"_version": 1,
"key": "key",
"maintainer": {
"kind": "member",
"_member": {
"firstName": "Ariel",
"lastName": "Flores",
"role": "admin",
"_links": {
"self": {
"href": "/api/v2/members/569f183514f4432160000007",
"type": "application/json"
}
},
"_id": "569f183514f4432160000007",
"email": "ariel@acme.com"
},
"_team": {
"_links": {
"key": {
"href": "href",
"type": "type"
}
},
"name": "QA Team",
"customRoleKeys": [
"access-to-test-projects"
],
"key": "team-key-123abc"
},
"key": "key"
},
"tags": [
"tags",
"tags"
]
}
]
}
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}{
"code": "code",
"message": "message"
}